index.php 7.43 KB
Newer Older
Erwan Normand's avatar
Erwan Normand committed
1 2 3 4
<?php
	include 'model/Data.class.php';
?>

Orbmancer's avatar
Orbmancer committed
5 6
<!doctype html>
<html class="no-js" lang="">
Orbmancer's avatar
Orbmancer committed
7 8 9 10 11 12
<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title></title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
Orbmancer's avatar
Orbmancer committed
13

Orbmancer's avatar
Orbmancer committed
14 15
    <link rel="apple-touch-icon" href="apple-touch-icon.png">
    <!-- Place favicon.ico in the root directory -->
Orbmancer's avatar
Orbmancer committed
16

Orbmancer's avatar
Orbmancer committed
17 18 19
    <link rel="stylesheet" href="css/normalize.css">
    <link rel="stylesheet" href="css/main.css">
    <link rel="stylesheet" href="css/bootstrap.min.css">
Orbmancer's avatar
Orbmancer committed
20

Orbmancer's avatar
Orbmancer committed
21 22 23 24 25 26
    <script src="js/vendor/modernizr-2.8.3.min.js"></script>
</head>
<body>
<!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
Orbmancer's avatar
Orbmancer committed
27

Orbmancer's avatar
Orbmancer committed
28 29
<!-- Add your site or application content here -->
<div class="container-fluid text-center">
Erwan Normand's avatar
Erwan Normand committed
30
    <h1>VVVVVV Level Merger</h1>
Orbmancer's avatar
Orbmancer committed
31

32
    <p>By <a href="https://twitter.com/Orbmancer" target="_blank" title="See my twitter">Damien Bry</a> & Erwan Normand</p>
Erwan Normand's avatar
Erwan Normand committed
33 34
	
	<br/>
35 36 37 38

    <p class="text-danger">You must upload a file <strong>ONLY</strong> built on one level like (1,1) or (3,2).</p>
    <p>The merger automatically recognise where you built that level.</p>

Erwan Normand's avatar
Erwan Normand committed
39 40 41
	<br/>

	<h3>Upload a level</h3>
Orbmancer's avatar
Orbmancer committed
42 43
    <div class="row">
        <div class="col-md-6 col-md-offset-3">
Erwan Normand's avatar
Erwan Normand committed
44
            <form class="form-horizontal" action="upload.php" method="POST">
Orbmancer's avatar
Orbmancer committed
45 46 47 48
                <fieldset>
                    <div class="form-group">
                        <label for="inputName" class="col-lg-2 control-label">Level name</label>
                        <div class="col-lg-10">
Orbmancer's avatar
Orbmancer committed
49
                            <input type="text" class="form-control" name="name" id="inputName" placeholder="Level Name">
Orbmancer's avatar
Orbmancer committed
50 51 52 53 54
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="textArea" class="col-lg-2 control-label">Level content</label>
                        <div class="col-lg-10">
Orbmancer's avatar
Orbmancer committed
55
                            <textarea class="form-control" name="data" rows="3" id="textArea"></textarea>
56
                            <span class="help-block">The content of your .vvvvvv file</span>
Orbmancer's avatar
Orbmancer committed
57 58 59 60 61 62 63
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">Which level group ?</label>
                        <div class="col-lg-10">
                            <div class="radio">
                                <label>
Orbmancer's avatar
Orbmancer committed
64
                                    <input type="radio" name="td" id="optionsRadios1" value="1" checked="">
Erwan Normand's avatar
Erwan Normand committed
65
                                    TD 1 (13h15-16h15)
Orbmancer's avatar
Orbmancer committed
66 67 68 69
                                </label>
                            </div>
                            <div class="radio">
                                <label>
Orbmancer's avatar
Orbmancer committed
70
                                    <input type="radio" name="td" id="optionsRadios2" value="2">
Erwan Normand's avatar
Erwan Normand committed
71
                                    TD 2 (16h30-19h30)
Orbmancer's avatar
Orbmancer committed
72 73 74 75 76 77 78
                                </label>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">Where to put the level ?</label>
                        <div class="col-lg-5">
Erwan Normand's avatar
Erwan Normand committed
79 80
							<label for="x" class="">X</label>
                            <select class="form-control" name="x" id="x">
Orbmancer's avatar
Orbmancer committed
81 82 83 84 85 86 87 88
                                <option>1</option>
                                <option>2</option>
                                <option>3</option>
                                <option>4</option>
                                <option>5</option>
                            </select>
                        </div>
                        <div class="col-lg-5">
Erwan Normand's avatar
Erwan Normand committed
89 90
							<label for="y" class="">Y</label>
                            <select class="form-control" name="y" id="y">
Orbmancer's avatar
Orbmancer committed
91 92 93 94 95 96 97 98 99 100
                                <option>1</option>
                                <option>2</option>
                                <option>3</option>
                                <option>4</option>
                                <option>5</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-lg-10 col-lg-offset-2">
Orbmancer's avatar
Orbmancer committed
101
                            <button type="submit" class="btn btn-primary">Save the awesome !</button>
Orbmancer's avatar
Orbmancer committed
102 103 104 105 106 107
                        </div>
                    </div>
                </fieldset>
            </form>
        </div>
    </div>
Erwan Normand's avatar
Erwan Normand committed
108 109 110 111
	
	<h3>Merge levels</h3>
	<div class="row">
        <div class="col-md-6 col-md-offset-3">
Erwan Normand's avatar
Erwan Normand committed
112
            <form class="form-horizontal" action="merge.php" method="POST">
Erwan Normand's avatar
Erwan Normand committed
113 114 115 116 117
                <fieldset>
                    <div class="form-group">
                        <label for="td" class="col-lg-2 control-label">Which level group ?</label>
                        <div class="col-lg-10">
                            <select class="form-control" name="td" id="td">
118 119
                                <option value="1">TD 1 (13h15-16h15)</option>
                                <option value="2">TD 2 (16h30-19h30)</option>
Erwan Normand's avatar
Erwan Normand committed
120 121 122 123 124
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-lg-10 col-lg-offset-2">
125
                            <button type="submit" class="btn btn-success">Let the magical merge happen !</button>
Erwan Normand's avatar
Erwan Normand committed
126 127 128 129 130 131 132 133
                        </div>
                    </div>
                </fieldset>
            </form>
        </div>
    </div>
	
	<h3>Uploaded levels</h3>
Orbmancer's avatar
Orbmancer committed
134 135 136 137 138 139 140
    <div class="row">
        <div class="col-md-6 col-md-offset-3">
            <table class="table table-striped table-hover">
                <thead>
                <tr>
                    <th>TD</th>
                    <th>Level name</th>
Erwan Normand's avatar
Erwan Normand committed
141 142
                    <th>X</th>
                    <th>Y</th>
Erwan Normand's avatar
Erwan Normand committed
143
					<th>Actions</th>
Orbmancer's avatar
Orbmancer committed
144 145 146
                </tr>
                </thead>
                <tbody>
Erwan Normand's avatar
Erwan Normand committed
147 148 149 150 151 152 153 154
					<?php
					for ($td = 1; $td <= 2; $td++) { 
						foreach (Data::loadXML($td) as $level) { ?>
						<tr>
							<td><?php echo $td; ?></td>
							<td><?php echo $level['name']; ?></td>
							<td><?php echo $level['x']; ?></td>
							<td><?php echo $level['y']; ?></td>
Erwan Normand's avatar
Erwan Normand committed
155 156 157
							<td>
								<a style="color: red; text-decoration: none;" href="delete.php?name=<?php echo $level['name']; ?>&x=<?php echo $level['x']; ?>&y=<?php echo $level['y']; ?>&td=<?php echo $td; ?>"></a>
							</td>
Erwan Normand's avatar
Erwan Normand committed
158 159 160 161
						</tr>
					<?php } 
					} ?>
				</tbody>
Orbmancer's avatar
Orbmancer committed
162 163 164
            </table>
        </div>
    </div>
Orbmancer's avatar
Orbmancer committed
165
</div>
Orbmancer's avatar
Orbmancer committed
166

Orbmancer's avatar
Orbmancer committed
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
<!-- Script section -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.3.min.js"><\/script>')</script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>

<!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
<script>
    (function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
        function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
        e=o.createElement(i);r=o.getElementsByTagName(i)[0];
        e.src='https://www.google-analytics.com/analytics.js';
        r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
    ga('create','UA-XXXXX-X','auto');ga('send','pageview');
</script>
</body>
183
</html>