-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·259 lines (251 loc) · 13.1 KB
/
index.php
File metadata and controls
executable file
·259 lines (251 loc) · 13.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
<?php
require_once("assets/Lock.php");
require_once("assets/Scroll.php");
require_once("includes/State.php");
require_once("session.inc");
include("includes/lock.inc");
/**
* Main page
*/
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<?php include("includes/header.inc");?>
</head>
<body>
<div class="container-fluid">
<div id="head">
<div id="div-logo">
<a href="index.php"><img src="icons/epfl-logo.png" alt="Logo EPFL" id="logo"/></a>
</div>
<div id="div-path">
<p>Accueil</p>
<p><a href="logout.php">Logout</a></p>
</div>
</div>
<div class="title <?php if(TEST_MODE) echo "test";?>">
<h1 class="text-center p-1">Interface de facturation</h1>
<h6 class="text-center">Welcome <i><?= USER ?></i></h6>
</div>
<div class="scroll-message">
<?php
$inter = " - ";
$msg = "";
foreach(Csv::extract(DATA.Scroll::NAME) as $line) {
if($line[0] > 0) {
$msg .= $line[1];
$msg .= $inter;
}
}
if(!empty($msg)) {
?>
<div data-text="<?= $msg ?>"><span><?= $msg ?></span></div>
<?php
}
?>
</div>
<?php include("includes/message.inc");
if(!empty($lockUser)) { ?>
<div class="text-center"><?= $dlTxt ?></div>
<?php }
?>
<div id="index-canevas">
<?php
if(IS_SUPER) {
// Only supervisor can upload/download config files
?>
<div class="index-primary">
<h3>Supervision</h3>
<div class="tiles">
<div type="button" id="download-config" class="tile center-two">
<p>Download CONFIG <br /> files</p>
<svg class="icon feather icon-tile" aria-hidden="true">
<use xlink:href="#download-cloud"></use>
</svg>
</div>
<label class="tile center-two">
<form action="controller/uploadConfig.php" method="post" id="form-config" enctype="multipart/form-data" >
<input type="file" name="zip_file" id="zip-config" accept=".zip">
</form>
<p>Upload CONFIG <br > files</p>
<svg class="icon feather icon-tile" aria-hidden="true">
<use xlink:href="#upload-cloud"></use>
</svg>
</label>
<div type="button" id="manage-message" class="tile center-two" data-toggle="modal" data-target="#scroll-modal">
<p>Manage Scroll <br /> Message</p>
<svg class="icon feather icon-tile" aria-hidden="true">
<use xlink:href="#message-square"></use>
</svg>
</div>
</div>
</div>
<div class="modal fade" id="scroll-modal" tabindex="-1" role="dialog" aria-labelledby="scroll-modal-title" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" id="scroll-modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="scroll-modal-title">Gestion des messages défilants</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<?php
$i = 0;
$lines = Csv::extract(DATA.Scroll::NAME);
if(count($lines) > 0) {
echo "<table>";
echo '<tr><th class="th-modal">Afficher</th><th class="th-modal"></th class="th-modal"><th>Supprimer</th>';
foreach($lines as $line) {
echo "<tr>";
echo '<td class="td-modal"><input type="checkbox" id="dis-'.$i.'" ';
if($line[0] > 0) {
echo 'checked';
}
echo ' ></td><td class="td-modal input-modal"><input type="text" maxlength="200" id="msg-'.$i.'" value="'.$line[1].'" /></td>';
echo '<td class="td-modal"><input type="checkbox" id="del-'.$i.'"></td>';
echo "</tr>";
$i++;
}
echo "</table>";
}
echo "<table>";
echo "<tr>";
echo '<td class="td-modal td-new">Ajouter un nouveau message : </td>';
echo '<td class="td-modal input-modal"><input type="text" maxlength="200" id="msg-new" placeholder="maximum 200 caractères" /></td>';
echo "</tr>";
echo "</table>";
echo '<input type="hidden" id="msg-num" value="'.$i.'"/>';
?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Fermer</button>
<button type="button" class="btn btn-primary" id="modal-save">Enregistrer</button>
</div>
</div>
</div>
</div>
<?php
}
if(DATA_GEST) {
?>
<div class="index-primary">
<h3>Gestion</h3>
<?php
if(!empty(DATA_GEST['facturation'])) {
?>
<div class="index-secondary">
<h5>Facturation</h5>
<div class="tiles">
<?php
foreach(DATA_GEST['facturation'] as $plateforme => $name) {
?>
<div class="facturation tile center-two">
<input type="hidden" id="plate-fact" value="<?= $plateforme ?>" />
<p class="num-tile"><?= $plateforme ?></p><p class="nom-tile"><?= $name ?></p>
<svg class="icon feather icon-tile" aria-hidden="true">
<use xlink:href="#dollar-sign"></use>
</svg>
</div>
<?php }
?>
</div>
</div>
<?php
}
if(!empty(DATA_GEST['tarifs'])) {
?>
<div class="index-secondary">
<h5>Tarifs</h5>
<div class="tiles">
<?php
foreach(DATA_GEST['tarifs'] as $plateforme => $name) {
$available = false;
if(file_exists(DATA.$plateforme)) {
$available = true;
$state = new State(DATA.$plateforme);
if(empty($state->getLast())) {
$available = false;
}
}
if($available) {
?>
<div class="tarifs tile center-two">
<input type="hidden" id="plate-tarifs" value="<?= $plateforme ?>" />
<p class="num-tile"><?= $plateforme ?></p><p class="nom-tile"><?= $name ?></p>
<svg class="icon feather icon-tile" aria-hidden="true">
<use xlink:href="#settings"></use>
</svg>
</div>
<?php }
else {
?>
<div class="desactived-tile center-two">
<p class="num-tile"><?= $plateforme ?></p><p class="nom-tile"><?= $name ?></p>
<svg class="icon feather icon-tile" aria-hidden="true">
</svg>
</div>
<?php
}
}
?>
</div>
</div>
<?php
}
if(!empty(DATA_GEST['reporting'])) {
?>
<div class="index-secondary">
<h5>Reporting</h5>
<div class="tiles">
<?php
foreach(DATA_GEST['reporting'] as $plateforme => $name) {
?>
<div class="reporting tile center-two">
<input type="hidden" id="plate-report" value="<?= $plateforme ?>" />
<p class="num-tile"><?= $plateforme ?></p><p class="nom-tile"><?= $name ?></p>
<svg class="icon feather icon-tile" aria-hidden="true">
<use xlink:href="#book"></use>
</svg>
</div>
<?php }
?>
</div>
</div>
<?php
}
?>
</div>
<?php
}
?>
<div class="index-primary">
<h3>Outils</h3>
<div class="tiles">
<label class="tile center-one">
<form action="controller/viewTicket.php" method="post" id="form-view" enctype="multipart/form-data" >
<input type="file" name="zip_file" id="zip-view" accept=".zip">
</form>
<p>Visionner Tickets</p>
<svg class="icon feather icon-tile" aria-hidden="true">
<use xlink:href="#eye"></use>
</svg>
</label>
<label class="simulation tile center-one">
<form action="controller/uploadPrepa.php" method="post" class="form-simu" enctype="multipart/form-data" >
<input type="hidden" name="type" id="type" value="SIMU">
<input id="SIMU" type="file" name="SIMU" <?= $disabled ?> class="zip-simu lockable" accept=".zip">
</form>
<p>Simulation</p>
<svg class="icon icon-tile" aria-hidden="true">
<use xlink:href="#activity"></use>
</svg>
</label>
</div>
</div>
</div>
<?php include("includes/footer.inc");?>
<script src="js/index.js"></script>
</body>
</html>