-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathavailCheck.php
More file actions
41 lines (37 loc) · 827 Bytes
/
availCheck.php
File metadata and controls
41 lines (37 loc) · 827 Bytes
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
<?php
$i=0;
session_start();
$q="update availability set";
for($i=0;$i<167;$i++)
{
$q=$q." d".(($i/24)-($i%24)/24 )."h".($i%24)."=";
if($_POST['d'.(($i/24)-($i%24)/24 ).'h'.($i%24)]==1)
{
echo "<br />d". (($i/24)-($i%24)/24)."h".$i%24 ." SET";
$var=1;
}
else
{
echo "<br />d". (($i/24)-($i%24)/24)."h".$i%24 ." NOT SET";
$var=0;
}
$q=$q.$var." ,";
}
$q=$q."d".(($i/24)-($i%24)/24 )."h".($i%24)."=";
if($_POST['d'.(($i/24)-($i%24)/24 ).'h'.($i%24)]==1)
{
echo "<br />d". (($i/24)-($i%24)/24)."h".$i%24 ." SET";
$var=1;
}
else
{
echo "<br />d". (($i/24)-($i%24)/24)."h".$i%24 ." NOT SET";
$var=0;
}
$q=$q.$var." where eid='".$_SESSION['eid']."';";
echo "<br />Query : ".$q;
$con=mysql_connect("localhost","root","");
mysql_select_db("firefighting");
mysql_query($q);
mysql_close($con);
?>