-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·168 lines (113 loc) · 5.24 KB
/
index.php
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
<?php
// Includes
include_once "include/cookies_check.php" ;
include_once "include/functions.php" ;
include_once "include/tp_select.php" ;
// Connexion BDD
include_once "config/piwake_conf.php" ;
$bdd = new PDO("mysql:host=localhost;dbname=PIWAKE;charset=utf8", $usernameDB, $passwordDB);
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<title>PiWake</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/style.css">
<link href='http://fonts.googleapis.com/css?family=Roboto:400,200,100' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Roboto+Condensed:300' rel='stylesheet' type='text/css'>
</head>
<body>
<div id="wrapp">
<div id="head">
<a href="index.php" title="" alt"Rafraichir">
<h1>PiWake <span class="trucUseless">3<span id="petiteVersion">.3</span></span></h1>
<?php switch($filiere) {
case "SRC":
echo '<h2><span class="trucUseless">S</span>imple <span class="trucUseless">R</span>apide <span class="trucUseless">C</span>onnecté</h2>' ;
break ;
case "MMI":
echo '<h2><span class="trucUseless">M</span>oderne <span class="trucUseless">M</span>ignon <span class="trucUseless">I</span>npépendant</h2>' ;
break ;
case "PUB_1":
echo '<h2><span class="trucUseless">P</span> <span class="trucUseless">U</span> <span class="trucUseless">B</span></h2>' ;
break ;
case "PUB_2":
echo '<h2><span class="trucUseless">P</span> <span class="trucUseless">U</span> <span class="trucUseless">B</span></h2>' ;
break ;
} ?>
</a>
<div id="formulaire">
<form action="index.php" method="post">
<select id="selectFiliere" name="filiere" onchange="this.form.submit()">
<option <?php if($filiere=="SRC"){echo "selected" ;}?> value="SRC">SRC</option>
<option <?php if($filiere=="MMI"){echo "selected" ;}?> value="MMI">MMI</option>
</select>
<select id="selectVue" name="vue" onchange="this.form.submit()">
<option <?php if($vue==1){echo "selected" ;}?> value="1">Selon</option>
<option <?php if($vue==0){echo "selected" ;}?> value="0">Tout</option>
</select>
<?php //if($filiere == "SRC" || $filiere == "MMI") { ?>
<select id="selectTP" name="tp" onchange="this.form.submit()">
<option <?php if($tp==1){echo "selected" ;}?> value="1">TP1</option>
<option <?php if($tp==2){echo "selected" ;}?> value="2">TP2</option>
<option <?php if($tp==3){echo "selected" ;}?> value="3">TP3</option>
</select>
<select id="selectTD" name="td" onchange="this.form.submit()" >
<option <?php if($td==1){echo "selected" ;}?> value="1">TD1</option>
<option <?php if($td==2){echo "selected" ;}?> value="2">TD2</option>
</select>
<? //} ?>
<select id="selectSemaine" name="semaine" onchange="this.form.submit()" >
<?php
$intervale_start= (int)date('W') ;
$intervale_end=26;
for(;$intervale_start <= $intervale_end;$intervale_start++) {
?>
<option <?php if($semaine==$intervale_start){echo "selected" ;}?> value="<?php echo $intervale_start ?>"><?php echo "Semaine " . $intervale_start ?></option>
<?php } ?>
</select>
</form>
</div> <!-- Fin du formulaire -->
</div> <!-- Fin du Head -->
<?php if ($vue != 1) { ?> <p style="color:grey;font-style:italic;text-align:center;margin:-10px 0 20px 0;">Cette vue de 'tous les cours' est encore expérimentale. Utilisez la en connaissance de cause.</p><?php } ?>
<div id="tableau">
<table>
<thead>
<tr>
<td class="jourTop">Jour</td>
<?php
for ($heureDuJour=9;$heureDuJour<20;$heureDuJour++)
{
echo "<td class=\"Heure\">" . $heureDuJour. "h</td>" ;
echo "<td class=\"demiHeure\"></td>" ;
}
?>
</tr>
</thead>
<tbody>
<?php
$requeteMois = $bdd->query("SELECT DISTINCT nomJour, jour, mois FROM EDT_SRC WHERE semaine=" . $semaine . " ORDER BY jour") ;
$nomMois = array("Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre");
while ($lines = $requeteMois->fetch()) {
echo '<tr>' ;
if ($vue==1)
drawTimeTableSelective($lines['nomJour'], $lines['jour'], $nomMois[--$lines['mois']], $tp_code, $td_code, $semaine,$bdd, $filiere) ;
else
drawTimeTableGlobal($lines['nomJour'], $lines['jour'], $nomMois[--$lines['mois']], $semaine,$bdd, $filiere) ;
echo "</tr>" ;
}
?>
</tbody>
</table>
<div id="footer">
<a href="https://github.com/sd65/PiWake" title="Le site du projet">All rights reserved · <img src="picture/cat.png" width="24px" height="24px" alt="Calendar Mew"/> · Explore on GitHub</a>
</div>
</div> <!-- Fin du Tableau -->
</div> <!-- Fin du Wrapp -->
</body>
<script src="script/jquery.js" type="text/javascript"></script>
<script src="script/script.js" type="text/javascript"></script>
<script src="script/konami.js" type="text/javascript"></script>
</html>
<?php $bdd=null ?>