-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathops_reg_attendee_summary.php
186 lines (150 loc) · 6.06 KB
/
ops_reg_attendee_summary.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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<?php require_once('access_and_open.php'); require_once('secure.php'); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Op Session Attendee Summary</title>
</head>
<body>
<h3>Op Session Attendee Summary</h3>
<a href="index.php">Back to main page</a>
<p>
<?php
// -------------------------------------------------------------------------
// Part of EventTools, a package for managing convention information
//
// By Bob Jacobsen, jacobsen@mac.com, Copyright 2010, 2011, 2012, 2013
// -------------------------------------------------------------------------
include_once('mysql2i.class.php'); // migration step
//
// PHP to summarize the Operating Session requests
//
// -------------------------------------------------------------------------
// Configure:
$min_status = 40; // min status included; 40 is "under construction", 60 is "approved"
$update_quantity = FALSE; // TRUE to update quantity, FALSE to leave unchanged
// -------------------------------------------------------------------------
// Code starts here
require('access_and_open.php');
require_once('utilities.php');
require_once('options_utilities.php');
global $stats;
parse_str($_SERVER["QUERY_STRING"], $args);
// are we changing an option to start?
if (array_key_exists("id", $args) AND array_key_exists("option", $args) AND array_key_exists("curvalue", $args)) {
// here to do an update
$id = $args["id"];
$option = $args["option"];
$curvalue = $args["curvalue"];
$newvalue = ($curvalue == "Y") ? "" : "Y";
$email = $args["email"];
$j = $args["j"];
echo "updated ".$email." option ".$j." to ".($newvalue == "Y" ? "Y" : "N")."<br>";
$update_query = "UPDATE ".$event_tools_db_prefix."eventtools_customer_option_values SET customer_option_value_value='".$newvalue."' WHERE customers_id='".$id."' AND customer_option_id='".$option."';";
//echo $update_query;
mysql_query($update_query);
}
// is this only for a specific session?
$where = "";
if (array_key_exists("session", $args)) {
$where = " WHERE ops_id = \"".$args["session"]."\"";
}
if (array_key_exists("q", $args)) {
$where = " WHERE opsreq_opt".$args["q"]." = \"Y\"";
}
require_once('parsers.php');
// get the list of extras
$queryExtras="
SELECT *
FROM (
".$event_tools_db_prefix."eventtools_customer_options
)
".$where." ORDER BY customer_option_order
;
";
//echo $queryExtras;
$resultExtras=mysql_query($queryExtras);
$numExtras= mysql_numrows($resultExtras);
// create table
echo '<table border="1">';
echo '<tr>';
echo '<th><a href="?order=cfirstname">First</a></th>';
echo '<th><a href="?order=clastname">Last</a></th>';
echo '<th><a href="?order=email">Email</a></th>';
echo '<th><a href="?order=telephone">Telephone</a></th>';
echo '<th><a href="?order=cellphone">Cell Phone</a></th>';
global $event_tools_emergency_contact_info;
if ($event_tools_emergency_contact_info ) {
echo '<th><a href="?order=cellphone">Emergency<br>Contact</a></th>';
echo '<th><a href="?order=cellphone">Emergency<br>Phone</a></th>';
}
echo '<th><a href="?order=create">Created Date</a></th>';
echo '<th><a href="?order=update">Updated Date</a></th>';
echo '<th><a href="?order=category">Attendee<br/>Category</a></th>';
// add columns for extras
$i = 0;
while ($i < $numExtras) {
echo '<th><a href="?order=value'.$i.'">'.mysql_result($resultExtras,$i,"customer_option_short_name").'</a></th>';
$i++;
}
// end of header
echo '</tr>';
// create a query that includes the extras
if ( array_key_exists("order", $args) AND strlen($args["order"])>5 AND substr($args["order"],0,5) == "value") $order = urldecode($args["order"]).' DESC, customers_updated_date ';
else $order = parse_order();
if ($order == NULL) $order = "customers_lastname";
$query=options_select_statement(); // create default select statement
$query=$query."
".$where." ORDER BY ".$order."
;
";
// echo $query;
$resultReqs=mysql_query($query);
$numReqs= mysql_numrows($resultReqs);
// for each line
$i = 0;
while ($i < $numReqs) {
echo '<tr>';
echo '<td>'.mysql_result($resultReqs,$i,"customers_firstname").'</td>';
echo '<td>'.mysql_result($resultReqs,$i,"customers_lastname").'</td>';
echo '<td>'.mysql_result($resultReqs,$i,"opsreq_person_email").'</td>';
echo '<td>'.mysql_result($resultReqs,$i,"customers_telephone").'</td>';
echo '<td>'.mysql_result($resultReqs,$i,"customers_cellphone").'</td>';
if ($event_tools_emergency_contact_info ) {
echo '<td>'.mysql_result($resultReqs,$i,"customers_x2011_emerg_contact_name").'</td>';
echo '<td>'.mysql_result($resultReqs,$i,"customers_x2011_emerg_contact_phone").'</td>';
}
echo '<td>';
if (("".mysql_result($resultReqs,$i,"customers_create_date")) != "")
echo mysql_result($resultReqs,$i,"customers_create_date");
echo '</td>';
echo '<td>';
if (("".mysql_result($resultReqs,$i,"customers_updated_date")) != "0000-00-00 00:00:00")
echo mysql_result($resultReqs,$i,"customers_updated_date");
echo '</td>';
echo '<td align="center">'.mysql_result($resultReqs,$i,"opsreq_priority").'</td>';
// add options
$j = 0;
while ($j < $numExtras) {
echo '<td align="center">';
// enclose in a link to an edit page
echo '<a href="';
echo '?id='.mysql_result($resultReqs,$i,"customers_id");
echo '&option='.mysql_result($resultReqs,$i,"id".$j);
echo '&curvalue='.mysql_result($resultReqs,$i,"value".$j);
echo '&email='.mysql_result($resultReqs,$i,"opsreq_person_email");
echo '&j='.$j;
echo '">';
echo ' ';
echo mysql_result($resultReqs,$i,"value".$j);
echo ' ';
echo '</a>';
echo '</td>';
$j++;
}
echo '</tr>';
$i++;
}
echo '</table>';
echo '</body></html>';