-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcekilis.php
executable file
·138 lines (134 loc) · 4.46 KB
/
cekilis.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
<?php
/*
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.
*/
session_start();
//if(@$_SESSION['auth']!='kapi' && @$_SESSION['auth']!='admin')die();
?>
<!doctype html>
<html>
<head>
<meta charset="utf8"/>
<title>Kampüs Gelişim Günleri 2015</title>
<style>
body
{
background-color:white;
background-image:url(img/agac.png);
background-size:60%;
background-repeat:no-repeat;
background-position:right 50px;
}
</style>
</head>
<body>
<h1 style="color:black;font-family:Helvetica,sans-serif;margin:20px">Kampüs Gelişim Günleri 2015</h1>
<?php
if(isset($_GET['salon']))
{
switch($_GET['salon'])
{
case 'A':
case 'B':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'KK':
processHall($_GET['salon']);
break;
default:
echo "are you trying to fuck me?";
break;
}
}
else
{
?>
<form action="cekilis.php" method="get">
<div style="width:600px;position:relative;top:150px">
<select style="display:block;margin:0 auto;-moz-appearance: none;border:none;color:black;font-weight:bold;height:auto;width:400px;text-align:center;font-size:30px;padding:20px;margin-bottom:5px" name="salon">
<option value="KK">Kemal Kurdaş Salonu</option>
<option value="A">A Salonu</option>
<option value="B">B Salonu</option>
<option value="D">D Salonu</option>
<option value="E">E Salonu</option>
<option value="F">F Salonu</option>
<option value="G">G Salonu</option>
<option value="H">H Salonu</option>
</select>
<select style="display:block;margin:0 auto;-moz-appearance: none;border:none;color:black;font-weight:bold;height:auto;width:400px;text-align:center;font-size:30px;padding:20px;margin-bottom:5px" name="gun">
<option value="2">2 Mart</option>
<option value="3">3 Mart</option>
<option value="4">4 Mart</option>
</select>
<input style="border-radius:5px;width:300px;height:50px;background-color:rgba(12,34,56,0.5);border:none;color:white;font-weight:bold;display:block;margin:0 auto;" type="submit" value="Ayarla"/></div>
</form>
<?php
}
?>
<?php
function processHall($salon)
{
include "db.php";
if((string)(int)$_GET['gun'] != $_GET['gun'])die();
$gun=$_GET['gun']."_";
$res=$conn->query("SELECT * FROM oturumlar WHERE salon='$salon' AND zaman LIKE '$gun%'",PDO::FETCH_ASSOC);
//echo $res->rowCount();
?>
<form action="cekilis.php?salon=<?php echo $salon; ?>&gun=<?php echo (int)$gun; ?>" method="post">
<div style="width:900px">
<select style="overflow:scroll;display:block;margin:0 auto;-moz-appearance: none;border:none;background:transparent;color:black;font-weight:bold;height:auto;width:900px;text-align:center;font-size:18px;padding:20px" name="oturumid">
<?php
foreach($res as $ins)
{
$zmn=explode('_',$ins['zaman']);
echo "<option id=\"".$ins['id']."\" value=\"".$ins['id']."\">";
echo $zmn[1]."-".$zmn[2]." ".$ins['oturum_isim']." / ".$ins['veren_isim'];
echo "</option>";
}
?>
</select>
<input type="submit" name="submit" value="rastgeleeee"/>
</form>
<div style="position:relative;top:100px;margin:30px">
<p style="color:black;font-size:30px">
<?php
if(isset($_POST['submit']) && $_POST['submit']=="rastgeleeee")
{
include "db.php";
$res=$conn->query("select distinct katilimci_oturum.katilimciid,katilimcilar.isim from katilimci_oturum, katilimcilar where katilimci_oturum.oturumid=".(int)$_POST['oturumid']." and katilimci_oturum.katilimciid=katilimcilar.id ORDER BY RAND()",PDO::FETCH_ASSOC);
echo "<table>";
foreach($res as $ins)
{
echo "<tr><td>".$ins['katilimciid']."</td><td>".$ins['isim']."</td></tr>\n";
}
echo "</table>";
}
?>
<?php
}
?>
</p>
</div>
<script src="inc/jquery.js"></script>
<script>
$(document).ready(function(){
$("#<?php echo $_POST['oturumid']; ?>").attr("selected","selected");
$("#asdqwe").focus();
});
</script>
</body>
</html>