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
<?php 
//connect to db (keep this info on top.)
$x_db_host1="xxxxx"; // Host name
$x_db_username1="xxxxx"; // Mysql username
$x_db_password1="xxxxxx"; // Mysql password
$x_db_name1="xxxxx"; // Database name
// Connect to server and select databse.
mysql_connect("$x_db_host1", "$x_db_username1", "$x_db_password1")or die("cannot connect to database");
mysql_select_db("$x_db_name1") or die("cannot select DB");


ob_start(); 
$x_station = mysql_real_escape_string($_REQUEST['station']);

include('incl/session.php3'); 
if($session->logged_in){ } else { header("Location: index.php"); }
include('incl/vars.php3');
include('incl/header.php3'); 
include('incl/menu.php3');


$sql="SELECT * FROM delegates WHERE CheckedIn = 0 AND DStation = $x_station";
$result=mysql_query($sql) or die ('Error: '.mysql_error ());

// Count table rows
$count=mysql_num_rows($result);
?>


<div class="content">
<div class="in author">
<h2>Conference Check-in</h2>
<p>Please see Brad for assistance.<em></em></p>
</div>

<div class="line"></div>
<div class="check_main"></div>

<div class="in forms">
<form name="form1" method="post" action="<?php print htmlentites($_SERVER['PHP_SELF']); ?>">
<table width="600" border="0" cellspacing="1" cellpadding="0">
<tr style="background-color:#d9d8d8; font-size:14px;">
<td align="center"><strong>ID</strong></td>
<td align="center"><strong>Name</strong></td>
<td align="center"><strong>Saturday</strong></td>
<td align="center"><strong>Dinner</strong></td>
<td align="center"><strong>Sunday</strong></td>
<td align="center"><strong>Special Req</strong></td>
<td align="center"><strong>Check In?</strong></td>
</tr>

<?php
while($rows=mysql_fetch_array($result)){
?>
<tr>
<td align="center"><? echo $rows['DID']; ?></td> 
<td align="center"><? echo $rows['DFName']; ?> <? echo $rows['DLName']; ?></td>
<td align="center">   

<?php 

if($rows['DConfSat']==0){ ?>
<select name="Sat[]" id="Sat"><option selected="selected" value="0">YES</option><option value="1">NO</option></select>

<?PHP } else { ?>
<select name="Sat[]" id="Sat[]"><option selected="selected" value="1">NO</option><option value="0">YES</option></select>
<?PHP } ?>
</td>


<td align="center"> 
<?php 

if($rows['DConfdinner'] == 0) { ?>
<select name="<?php print $rows['DConfdinner']; ?>" id="DiSat">
<option selected="selected" value="0">YES</option><option value="1">NO</option>
</select>

<?php } else { ?>

<select name="<?php print $rows['DConfdinner']; ?>" id="DiSat">
<option selected="selected" value="1">NO</option><option value="0">YES</option></select>
<?php } ?>

</td>
<td align="center">  
<?php 

if($rows['DConfSun']==0) { ?>
<select name="<?php print $rows['DConfSun']; ?>" id="Sun"><
option selected="selected" value="0">YES</option><option value="1">NO</option></select>

<?php } else{ ?>

<select name="<?php print $rows['DConfSun']; ?> " id="Sun"><option selected="selected" value="1">NO</option>
<option value="0">YES</option></select>

<?php } ?>
</td>
<td align="center"> 

<?php 
if($rows['DSpecRe']==0){echo "NO"; }
    else { echo "YES"; }
 ?> 
</td>
<td align="center"> 

<input name="checkin[]" type="checkbox" id="checkin" value="1" /></td>
</tr>
<?php
}
?>
<tr>
<td colspan="4" align="center"><input type="submit" name="submit" value="Submit"></td>
</tr>
</table>

</form>
</div>
<div class="in"></div>
</div>
<?php
// BEGIN FORM PROCESSING!


// Check if button name "Submit" is active, do this


if($_POST['submit'])
{

for($i=0;$i<$count;$i++){
// SQl Query
$sql1="UPDATE delegates SET Dconfdinner='$DiSat[$i]', DConfSat='$Sat[$i]' DConfSun='$Sun[$i]' CheckedIn='checkin[$i]' WHERE DID='$DID[$i]'";


$result1=mysql_query($sql1)or die ('Error: '.mysql_error ());
}
}
if($result1){
header("location: checkin.php&msg=1");
}

mysql_close();
include('incl/footer.php3'); 
ob_flush(); 



?>