Commit 037959d6 authored by Erwan Normand's avatar Erwan Normand
Browse files

Download the merged file

parent 6646caf0
...@@ -105,14 +105,14 @@ ...@@ -105,14 +105,14 @@
<h3>Merge levels</h3> <h3>Merge levels</h3>
<div class="row"> <div class="row">
<div class="col-md-6 col-md-offset-3"> <div class="col-md-6 col-md-offset-3">
<form class="form-horizontal" action="upload.php" method="POST"> <form class="form-horizontal" action="merge.php" method="POST">
<fieldset> <fieldset>
<div class="form-group"> <div class="form-group">
<label for="td" class="col-lg-2 control-label">Which level group ?</label> <label for="td" class="col-lg-2 control-label">Which level group ?</label>
<div class="col-lg-10"> <div class="col-lg-10">
<select class="form-control" name="td" id="td"> <select class="form-control" name="td" id="td">
<option>TD 1 (13h15-16h15)</option> <option>1</option>
<option>TD 2 (16h30-19h30)</option> <option>2</option>
</select> </select>
</div> </div>
</div> </div>
...@@ -6,19 +6,25 @@ ini_set('display_errors', 1); ...@@ -6,19 +6,25 @@ ini_set('display_errors', 1);
require_once 'model/Data.class.php'; require_once 'model/Data.class.php';
require_once 'model/Tabs.class.php'; require_once 'model/Tabs.class.php';
$td = $_GET['td']; $td = $_POST['td'];
$levels = Data::loadXML($td); //$levels = Data::loadXML($td);
$finalTabs = new Tabs();
$final = new Tabs(); foreach($levels as $level) {
$final->fillBlank(); $currentTab = new Tabs();
$finalTabs->setTab($currentTab->getTab(), $level['x'], $level['y']);
foreach($levels as $level){
$myContent = new Tabs();
$final->setTab($myContent->getTab(), $level['x'], $level['y']);
} }
echo $final->toString(); $finalFile = simplexml_load_file('data/level_layout.vvvvvv');
$finalFile->Data->contents = $finalTabs->toString();
header('Content-type: text/xml');
header('Content-Disposition: attachment; filename=VVVVVV_level_merged.vvvvvvv');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment