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";
}
$companyID = mysql_result($result,0,"companyID");
$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");
if ($all == "") {
$clickall = "Click here to view all records, processed and unprocessed.
\n";
}
if ($markProcessed) {
$sql = "update CompReg set cardNumber='', processed='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 == "") {
$sql = $sql + " and processed=''";
}
if ($regID > 0) {
$sql = $sql + " and regID=$regID";
}
$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 | Seminar | Location/Date | ";
if ($all != "") { $results = $results + "Processed | "; }
$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");
$seminar = mysql_result($result,$i,"seminar");
$locationDate = mysql_result($result,$i,"locationDate");
$processed = mysql_result($result,$i,"processed");
$results = $results + "| $regID | $firstName | $lastName | $seminar | $locationDate | ";
if ($all != "") { $results = $results + "$processed | "; }
$results = $results + "
\n";
$i++;
}
$results = $results + "
\n";
}
}
$template = File("regtemp.html");
$i=0;
while ($i