-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprogram.php
executable file
·124 lines (121 loc) · 3.27 KB
/
program.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
<!--
/*
Copyright (C) 2015 Baskın Burak Şenbaşlar
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 3
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-->
<!doctype html>
<html>
<head>
<meta charset="utf8"/>
<title>Kampüs Gelişim Günleri 2015</title>
<link rel="stylesheet" href="inc/bootstrap/css/bootstrap.min.css">
<script src="inc/jquery.js"></script>
<script src="inc/bootstrap/js/bootstrap.min.js"></script>
<script>
$(document).ready(function(){
window.setTimeout('location.reload()',10000);
});
</script>
<!--<meta name="viewport" content="width=device-width"-->
</head>
<body>
<?php
function generateprogram($gun)
{
include "db.php";
$res=$conn->query("SELECT * FROM oturumlar WHERE zaman LIKE '$gun%'",PDO::FETCH_ASSOC);
$oturumlar=array();
$butunZamanlar=array();
$butunSalonlar=array();
foreach($res as $ins)
{
$zaman=explode("_",$ins['zaman']);
$zaman=$zaman[1]."-".$zaman[2];
$ins['zaman']=$zaman;
array_push($oturumlar,$ins);
array_push($butunZamanlar,$ins['zaman']);
array_push($butunSalonlar,$ins['salon']);
}
$butunZamanlar=array_keys(array_flip($butunZamanlar));
$butunSalonlar=array_keys(array_flip($butunSalonlar));
sort($butunZamanlar);
sort($butunSalonlar);
?>
<div><h1 class="text-center">Kampüs Gelişim Günleri 2015 <?php echo $gun; ?> Mart Programı</h1></div>
<div class=""><table class="table" style="width:80%;margin:0 auto;position:relative;top:50px;font-size:17px">
<?php
echo "<tr>";
echo "<th>#</th>";
for($i=0;$i<count($butunSalonlar);$i++)
{
if($butunSalonlar[$i]=='KK')
echo "<th>Kemal Kurdaş Salonu</th>";
else
echo "<th>".$butunSalonlar[$i]." Salonu</th>";
}
for($i=0;$i<count($butunZamanlar);$i++)
{
echo "<tr>";
echo "<td>".$butunZamanlar[$i]."</td>";
for($j=0;$j<count($butunSalonlar);$j++)
{
echo "<td>";
for($k=0;$k<count($oturumlar);$k++)
{
if($oturumlar[$k]['salon']==$butunSalonlar[$j] && $oturumlar[$k]['zaman']==$butunZamanlar[$i])
{
echo "<span style=\"font-weight:bold\">".$oturumlar[$k]['oturum_isim']."</span> / ".$oturumlar[$k]['veren_isim'];
break;
}
}
echo "</td>";
}
echo "</tr>";
}
?>
</table></div>
<?php
}
?>
<?php
if(isset($_GET['gun']) && !empty($_GET['gun']))
{
switch($_GET['gun'])
{
case '2':
case '3':
case '4':
generateprogram($_GET['gun']);
break;
default:
echo "bad boy.that is what you are.";
die();
}
}
else
{
?>
<form action="program.php" method="get">
<select type="text" name="gun">
<option value="2">2 Mart</option>
<option value="3">3 Mart</option>
<option value="4">4 Mart</option>
</select>
<input type="submit" value="Ayarla"/>
</form>
<?php
}
?>
</body>
</html>