include "../admin/connect.phtml";
if (!$sid) {
$results = $results + "
Sorry - required parameters not passed.\n";
}
$sql = "select * from Sid where sid='$sid'";
$result = mysql($database, $sql);
$num = mysql_numrows($result);
if ($num == 0) {
$results = $results + "
Sorry - invalid sid.\n";
echo "$results";
exit;
}
$companyID = mysql_result($result,0,"companyID");
$sql = "select companyID from CompanyDeluxe where companyID=$companyID";
$result = mysql($database, $sql);
$num = mysql_numrows($result);
if ($num == 0) {
$results = $results + "
You must be a Seminar Deluxe member to use the online registration feature. To order your deluxe seminar listing(s) so that you can receive online orders, please click here.\n";
echo $results;
exit;
}
$sql = "select * from Company where companyID=$companyID";
$result = mysql($database, $sql);
$num = mysql_numrows($result);
if ($num == 0) {
$results = $results + "
Sorry - invalid companyID.\n";
}
$company = mysql_result($result,0,"company");
/* all=1 means unprocessed only */
/* all=2 means processed and unprocessed */
if ($all != "1") {
$clickall1 = "Click here to view all unprocessed records.
\n";
}
if ($all != "2") {
$clickall2 = "Click here to view all records, processed and unprocessed.
\n";
}
if ($markProcessed) {
$sql = "update CompReg set cardNumber='', compProcessed='Y' where regID=$regID";
$result = mysql($database, $sql);
$regID=0;
$search="Y";
}
if ($regID > 0 || $search != "" || $all != "") {
$sql = "select * from CompReg where companyID=$companyID";
if ($all != "2") {
$sql = $sql + " and compProcessed=''";
}
if ($regID > 0) {
$sql = $sql + " and regID=$regID";
}
/* echo "$sql
\n"; */
$result = mysql($database, $sql);
$num = mysql_numrows($result);
if ($num == 0) {
if ($regID) {
$results = "
Sorry - registrant number $regID not found.\n";
}
elseif ($search != "" || $all != "") {
$results = "
Sorry - no orders found.\n";
}
}
elseif ($num == 1) {
$results = "\n";
$lresult = mysql_Listfields($database,"CompReg");
$lnum = mysql_NumFields($lresult);
$i=0;
while ($i < $lnum) {
$Fname = mysql_FieldName($lresult,$i);
$results = $results + "| $Fname | ";
$Fval = mysql_result($result,0,"$Fname");
$results = $results + "$Fval |
\n";
$i++;
}
$results = $results + "
\n";
$results = $results + "\n";
}
else {
$results = $results + "\n";
$results = $results + "| Reg\# | First Name | Last Name | Organization | Seminar | Location/Date | ";
$results = $results + "
\n";
$i=0;
while ($i < $num) {
$regID = sprintf("%06d", mysql_result($result,$i,"regID"));
$firstName = mysql_result($result,$i,"firstName");
$lastName = mysql_result($result,$i,"lastName");
$organization = mysql_result($result,$i,"organization");
$seminar = mysql_result($result,$i,"seminar");
$locationDate = mysql_result($result,$i,"locationDate");
$results = $results + "| $regID | $firstName | $lastName | $organization | $seminar | $locationDate | ";
$results = $results + "
\n";
$i++;
}
$results = $results + "
\n";
}
}
$template = File("regtemp.html");
$i=0;
while ($i