public static function getType($name) { $query = "select type from structured_field_value_label where label='{$name}'"; $result = mysql_query($query) or die(sqlError(__FILE__, __LINE__, $query)); $row = mysql_fetch_row($result); return $row[0]; }
public static function initAssets($unitId, $id) { $query = "select label from structured_field_asset_label where unit_id={$unitId}"; $result = mysql_query($query) or die(sqlError(__FILE__, __LINE__, $query)); while ($row = mysql_fetch_row($result)) { $query = "INSERT INTO structured_field_asset (structured_field_id, label) VALUES ({$id}, '" . $row[0] . "')"; $result2 = mysql_query($query) or die(sqlError(__FILE__, __LINE__, $query)); } }
public static function getSettings() { $query = "select * from settings"; $result = mysql_query($query) or die(sqlError(__FILE__, __LINE__, $query)); $i = 0; while ($row = mysql_fetch_row($result)) { $setting[$i++] = $row; } return $setting; }
public static function getStructure() { $query = "SHOW COLUMNS FROM structured_field_value_label"; $result = mysql_query($query) or die(sqlError(__FILE__, __LINE__, $query)); while ($row = mysql_fetch_row($result)) { $columnNames[] = $row[0]; } // we remove the last element (rank) and the 2 first elements (id, unitId) return array_slice($columnNames, 2, sizeOf($columnNames) - 3); }
function ScheduleEventGet($EventID) { $schedList = array(); global $EventSchedulesTable; $result = $db->query("select RoomID,\n StartTime\n from {$EventSchedulesTable}\n where EventID = {$EventID}\n order by RoomID, StartTime\n ") or die("Unable to get schedule information for event: " . sqlError()); while ($row = $result->fetch(PDO::FETCH_ASSOC)) { $schedList[TimeToStr($row['StartTime'])] = getRoomName(isset($row['RoomID']) ? $row['RoomID'] : "No Room"); } return $schedList; }
function getPasswordForUser($user) { connect(); $query = "select * from user where username='******'"; $query = stripslashes($query); $result = mysql_query($query) or die(sqlError(__FILE__, __LINE__, $query)); if (!empty($result)) { $userrow = mysql_fetch_row($result); return $userrow[2]; } return ""; }
public static function setViewUrl($name, $url) { $query = "select * from view_url where name='{$name}'"; $result = mysql_query($query) or die(sqlError(__FILE__, __LINE__, $query)); if ($row = mysql_fetch_row($result)) { $query = "UPDATE view_url SET url='{$url}' WHERE name='{$name}';"; $result = mysql_query($query) or die(sqlError(__FILE__, __LINE__, $query)); } else { $query = "INSERT INTO view_url (name, url) VALUES ('{$name}', '{$url}')"; $result = mysql_query($query) or die(sqlError(__FILE__, __LINE__, $query)); } return $row; }
function selectRoom($SchedID) { //----------------------------------------------------------------------------- // Retrieve a list of all avaliable rooms //----------------------------------------------------------------------------- $roomList = getRoomList(); global $ScheduleTable; global $EventID; //----------------------------------------------------------------------------- // Check to see if scheduled event has room assigned //----------------------------------------------------------------------------- $roomKey = substr($SchedID, 0, 3) . '%'; $result = $db->query("select RoomID\n from {$ScheduleTable}\n where SchedID like '{$roomKey}'\n and EventID = {$EventID}\n ") or die("Unable to get room ID: " . sqlError()); $row = $result->fetch(PDO::FETCH_ASSOC); if (!empty($row)) { $roomIDList = explode(',', $row['RoomID']); } else { $roomIDList = array(0); } //----------------------------------------------------------------------------- // Set Row background Color //----------------------------------------------------------------------------- $hour = substr($SchedID, 1, 2); if ($hour % 2 == 0) { $bgcolor = "#6699FF"; } else { $bgcolor = "#D9D9FF"; } //----------------------------------------------------------------------------- // Print the selection Drop-Down //----------------------------------------------------------------------------- $fieldName = 'Room_' . substr($SchedID, 0, 3) . '[]'; print "<td bgcolor=\"{$bgcolor}\" align=\"center\">"; print "<select multiple size=\"4\" name=\"{$fieldName}\">"; foreach ($roomList as $roomNum => $roomName) { if (in_array($roomNum, $roomIDList)) { print "<option selected value=\"{$roomNum}\">{$roomName}</option>"; } } foreach ($roomList as $roomNum => $roomName) { if (!in_array($roomNum, $roomIDList)) { print "<option value=\"{$roomNum}\">{$roomName}</option>"; } } print "</select>"; print "</td>"; }
<input type=hidden name=ChurchID <?php print "value={$ChurchID}"; ?> > <table border=1 width=100%> <tr> <td colspan=4 bgcolor=#000000 align=center><font color=#FFFF00>History</font></td> </tr> <tr> <td bgcolor=#000000><font color=#FFFF00>Date</font></td> <td bgcolor=#000000><font color=#FFFF00>Type</font></td> <td bgcolor=#000000><font color=#FFFF00>Amount</font></td> <td bgcolor=#000000><font color=#FFFF00>Annotation</font></td> </tr> <?php $result = $db->query("select date_format(Date,'%m-%d-%y') as Date,\n Amount,\n Annotation\n from {$MoneyTable}\n where ChurchID={$ChurchID}\n ") or die("Unable to get accounting history: " . sqlError()); while ($row = $result->fetch(PDO::FETCH_ASSOC)) { $Date = $row['Date']; $Amount = $row['Amount']; $Annotation = $row['Annotation']; if ($Amount < 0) { $Type = "Credit"; $Amount *= -1; } else { if ($Amount > 0) { $Type = "Refund"; } else { $Type = "--"; } } print "<tr>";
<?php //---------------------------------------------------------------------------- // This software is licensed under the MIT license. Use as you wish but give // and take credit where due. // // Author: Paul Lemmons //---------------------------------------------------------------------------- include 'include/RegFunctions.php'; if ($Admin != 'Y') { header("refresh: 0; URL=Admin.php"); die; // JudgeID, JudgingCatagory, substr(StartTime,1,1) Day, substr(StartTime,2) StartTime, StopTime } $filename = "JudgesPreferences-" . date("m-d-Y") . ".csv"; header("Content-disposition: attachment; filename={$filename}"); header("Content-type: application/octet-stream"); $fp = fopen('php://output', 'w'); $results = $db->query("select e.JudgeID,\n e.JudgingCatagory,\n Case\n when substring(s.StartTime,1,1) = '1' then 'Sunday'\n when substring(s.StartTime,1,1) = '2' then 'Monday'\n when substring(s.StartTime,1,1) = '3' then 'Tuesday'\n when substring(s.StartTime,1,1) = '4' then 'Wednesday'\n when substring(s.StartTime,1,1) = '5' then 'Thursday'\n when substring(s.StartTime,1,1) = '6' then 'Friday'\n when substring(s.StartTime,1,1) = '7' then 'Saturday'\n else 'Unknown'\n End\n Day,\n maketime(substring(s.StartTime,2,2),substring(s.StartTime,4,2),'00') EventStartTime,\n maketime(substring(s.EndTime,2,2) ,substring(s.EndTime,4,2) ,'00') EventStopTime\n from {$JudgeEventsTable} e,\n {$JudgeTimesTable} t,\n {$EventScheduleTable} s\n where t.JudgeID = e.JudgeID\n and s.SchedID = t.SchedID\n order by JudgeID") or die("Unable to get Judge Preference list:" . sqlError()); $rowCount = 0; while ($row = $results->fetch(PDO::FETCH_ASSOC)) { if ($rowCount++ == 0) { foreach ($row as $key => $value) { $heading[] = $key; } fputcsv($fp, $heading); } fputcsv($fp, $row); } fclose($fp);
</font> </span> </td> <td align="left" bgcolor="#000000"> <span style="background-color: #000000"> <font color="#FFFF00"> Event Name </font> </span> </td> </tr> <?php $ChurchTeams = $db->query("SELECT E.EventName,\n E.EventID,\n E.MaxSize,\n E.MinSize,\n T.TeamID\n FROM {$EventsTable} E,\n {$TeamsTable} T\n WHERE E.EventID = T.EventID\n AND T.ChurchID = {$ChurchID}") or die("Unable to retrieve Team List:" . sqlError()); while ($row = $ChurchTeams->fetch(PDO::FETCH_ASSOC)) { $cntResult = $db->query("select count(*) as count\n from {$TeamMembersTable}\n where TeamID = " . $row['TeamID']) or die("Can not determine team count:" . sqlError()); $cntRow = $cntResult->fetch(PDO::FETCH_ASSOC); $numMembers = $cntRow['count']; ?> <tr> <td width="70" align="center">[<a href="AdminTeamEvents.php?Action=View<?php print "&TeamID=" . $row['TeamID'] . "&EventID=" . $row['EventID']; ?> ">View</a>]</td> <td width="70" align="center">[<a href="AdminTeamEvents.php?Action=Update<?php print "&TeamID=" . $row['TeamID'] . "&EventID=" . $row['EventID']; ?> ">Update</a>]</td> <td width="70" align="center"> [<a href="DelTeam.php?<?php print "&TeamID=" . $row['TeamID']; ?>
$Email = "None"; } if ($ErrorMsg == "") { ereg_replace("'", "''", $FirstName); ereg_replace("'", "''", $LastName); ereg_replace("'", "''", $Address); ereg_replace("'", "''", $City); ereg_replace("'", "''", $Zip); ereg_replace("'", "''", $Phone); ereg_replace("'", "''", $Email); if ($mode == 'update') { $sql = "update {$JudgesTable}\n set FirstName = '{$FirstName}',\n LastName = '{$LastName}',\n Address = '{$Address}',\n City = '{$City}',\n State = '{$State}',\n Zip = '{$Zip}',\n Email = '{$Email}',\n Phone = '{$Phone}'\n where JudgeId = {$JudgeID}\n and ChurchId = {$ChurchID}"; } else { $sql = "insert into {$JudgesTable}\n (FirstName ,\n LastName ,\n Address ,\n City ,\n State ,\n Zip ,\n Email ,\n Phone ,\n ChurchID)\n values ('{$FirstName}',\n '{$LastName}' ,\n '{$Address}' ,\n '{$City}' ,\n '{$State}' ,\n '{$Zip}' ,\n '{$Email}' ,\n '{$Phone}' ,\n {$ChurchID})"; } $results = $db->query($sql) or die("Unable to process update: " . sqlError()); if ($mode != 'update') { $JudgeID = $db->lastInsertId(); } ?> <body style="background-color: rgb(217, 217, 255);"> <?php if ($mode == 'update') { ?> <h1 align=center> Judge <br>"<?php print $LastName . ", " . $FirstName; ?> "<br>Updated! </h1> <?php
} ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en"> <head> <title> Seniors </title> </head> <body bgcolor="White"> <h1 align="center">All Seniors</h1> <hr> <?php $results = $db->query("select p.ParticipantID,\n p.FirstName,\n p.LastName,\n p.Email,\n p.Phone,\n p.Grade,\n p.Comments,\n p.Address,\n p.City,\n p.State,\n p.Zip,\n c.ChurchName\n from {$ParticipantsTable} p,\n {$ChurchesTable} c\n where p.ChurchID = c.ChurchID\n and p.Grade = 12\n order by LastName,\n FirstName") or die("Not found:" . sqlError()); $first = 1; ?> <table border="1" width="100%"> <?php while ($row = $results->fetch(PDO::FETCH_ASSOC)) { $ParticipantID = $row['ParticipantID']; $eventTypeCount = EventCounts($ParticipantID); $eventCount = $eventTypeCount['Team'] + $eventTypeCount['Solo']; if ($eventCount > 0) { $Name = $row['LastName'] . ", " . $row['FirstName']; $Email = $row['Email']; $Phone = $row['Phone']; $Grade = $row['Grade']; $Comment = $row['Comments']; $Address = $row['Address'];
//---------------------------------------------------------------------------- include 'include/RegFunctions.php'; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Language" content="en-us"> <title>Assign Individual Events</title> </head> <body style="background-color: rgb(217, 217, 255);"> <h1 align="center">Assign Individual Events</h1> <?php $results = $db->query("select FirstName,\n LastName,\n ParticipantID,\n Grade\n from {$ParticipantsTable}\n where ChurchID = {$ChurchID}\n order by LastName\n ") or die("Can not get Participant List:" . sqlError()); $count = 0; ?> <table border="1" width="100%"> <tr> <td width="70" align=center bgcolor="#000000"><font color="#FFFF00">Team</font></td> <td width="70" align=center bgcolor="#000000"><font color="#FFFF00">Individual</font></td> <td width="70" align=center bgcolor="#000000"><font color="#FFFF00">Grade</font></td> <td width="70" align=center bgcolor="#000000"><font color="#FFFF00">ID Number</font></td> <td align="left" bgcolor="#000000"><font color="#FFFF00">Participant</font></td> </tr> <?php while ($row = $results->fetch(PDO::FETCH_ASSOC)) { $ParticipantID = $row['ParticipantID']; $EventCounts = EventCounts($ParticipantID); $TeamEvents = $EventCounts['Team'];
print $EventName; ?> </b></TD> <TD width="25%" bgcolor="#C0C0C0"><b><?php print $PatricipantName; ?> </b></TD> <TD width="15%" bgcolor="#C0C0C0"><b><?php print $Award; ?> </b></TD> <tr> <?php if ($TeamEvent) { $memberList = $db->query("select concat(p.FirstName,' ',p.LastName) MemberName,\n IFNULL(m.Award,'Not Assigned') Award\n from {$ParticipantsTable} p,\n {$TeamMembersTable} m\n where m.TeamID = {$ParticipantID}\n and p.ParticipantID = m.ParticipantID\n order by p.LastName\n ") or die("Unable to get event Team Member list:" . sqlError()); while ($row = $memberList->fetch(PDO::FETCH_ASSOC)) { $MemberName = $row['MemberName']; ?> <tr> <td></td> <td><?php print $MemberName; ?> </td> <?php if ($IndividualAwards) { $Award = $row['Award']; ?> <td><?php print $Award;
?> </td> </tr> <tr> <td width="12%">Church</td> <td width="85%" colspan="5"> <?php if ($mode == 'view') { $ChurchName = ChurchName($row['ChurchID']); print $ChurchName; } else { ?> <select size="1" name="ChurchID"> <option value="0">Select Church</option> <?php $results = $db->query("select ChurchName,\n ChurchID\n from {$ChurchesTable}\n order by ChurchName\n ") or die("Not found:" . sqlError()); while ($row = $results->fetch(PDO::FETCH_ASSOC)) { $selected = $NewChurchID == $row['ChurchID'] ? "selected" : ""; print "<option value=\"" . $row['ChurchID'] . "\" " . $selected . ">" . $row['ChurchName'] . "</option>"; } ?> </select> <?php } ?> </td> </tr> <tr> <td width="12%">Status</td> <?php if ($mode == 'view') {
function PrintRoster($ChurchID, $ChurchName) { global $EventScheduleTable; global $EventsTable; global $JudgeAssignmentsTable; global $RoomsTable; global $JudgesTable; global $allTimes; global $allRooms; global $pageBreak; global $db; $result = $db->query("select count(distinct a.JudgeID,\n j.FirstName,\n j.LastName) count\n from {$JudgeAssignmentsTable} a,\n {$JudgesTable} j\n where a.JudgeID = j.JudgeID\n and a.ChurchID = {$ChurchID}\n ") or die("Unable to obtain Judge List:" . sqlError()); $row = $result->fetch(PDO::FETCH_ASSOC); $numRows = $row['count']; ?> <h1 align="center" <?php print $pageBreak; $pageBreak = "style=\"page-break-before:always;\""; ?> ="<?php print $pageBreak; $pageBreak = "style=\"page-break-before:always;\""; ?> "> <?php print $ChurchName; ?> </h1> <hr /> <?php if ($numRows > 0) { $result = $db->query("select distinct\n a.JudgeID,\n j.FirstName,\n j.LastName\n from {$JudgeAssignmentsTable} a,\n {$JudgesTable} j\n where a.JudgeID = j.JudgeID\n and a.ChurchID = {$ChurchID}\n order by j.LastName\n ") or die("Unable to obtain Judge List:" . sqlError()); ?> <table border="1" width="100%"> <tr> </tr> <?php while ($row = $result->fetch(PDO::FETCH_ASSOC)) { $FirstName = $row['FirstName']; $LastName = $row['LastName']; $JudgeID = $row['JudgeID']; ?> <tr> <td width="10%" bgcolor="#CCCCCC" colspan="4"><?php print "{$LastName}, {$FirstName}"; ?> </td> </tr> <?php $details = $db->query("SELECT r.RoomName,\n s.StartTime,\n e.EventName\n FROM {$JudgeAssignmentsTable} a,\n {$RoomsTable} r,\n {$EventScheduleTable} s,\n {$EventsTable} e\n Where a.JudgeID = {$JudgeID}\n and a.RoomID = r.RoomID\n and s.SchedID = a.SchedID\n and s.RoomID = a.RoomID\n and e.EventID = s.EventID\n order by s.StartTime\n ") or die("Unable to obtain Judging Details:" . sqlError()); while ($judgeDtails = $details->fetch(PDO::FETCH_ASSOC)) { $RoomName = $judgeDtails['RoomName']; $SchedTime = TimeToStr($judgeDtails['StartTime']); $EventName = $judgeDtails['EventName']; ?> <tr> <td width="10%"> </td> <td><?php print $SchedTime; ?> </td> <td><?php print $RoomName; ?> </td> <td><?php print $EventName; ?> </td> </tr> <?php } } ?> </table> <?php } else { ?> <p align="center"><i>No Judges Assigned</i></p> <?php } }
} ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Language" content="en-us"> <title>Maintain Participants</title> </head> <body style="background-color: rgb(217, 217, 255);"> <h1 align="center">Participant Maintenance </h1> <form method="post" action=Participants.php> <?php $results = $db->query("select FirstName,\n LastName,\n ParticipantID\n from {$ParticipantsTable}\n where ChurchID = '{$ChurchID}'\n order by LastName,\n FirstName") or die("Participant Not found:" . sqlError()); $count = 0; ?> <table border="1" width="100%"> <tr> <td width="70" align="center" bgcolor="#000000" colspan=3> <span style="background-color: #000000"> <font color="#FFFF00"> Action </font> </span> </td> <td width="100" align="center" bgcolor="#000000"> <span style="background-color: #000000"> <font color="#FFFF00"> ID Number
<?php //---------------------------------------------------------------------------- // This software is licensed under the MIT license. Use as you wish but give // and take credit where due. // // Author: Paul Lemmons //---------------------------------------------------------------------------- include 'include/RegFunctions.php'; if ($Admin != 'Y') { header("refresh: 0; URL=Admin.php"); die; // JudgeID,FirstName, LastName, Address, City, State, Zip, Phone, ChurchID, Gender, MaxEvents, Comments, Email } $filename = "AllJudges-" . date("m-d-Y") . ".csv"; header("Content-disposition: attachment; filename={$filename}"); header("Content-type: application/octet-stream"); $fp = fopen('php://output', 'w'); $results = $db->query("select JudgeID,\n FirstName,\n LastName,\n Address,\n City,\n State,\n Zip,\n Phone,\n ChurchID,\n Email\n from {$JudgesTable}\n order by JudgeID") or die("Unable to get Judge list:" . sqlError()); $rowCount = 0; while ($row = $results->fetch(PDO::FETCH_ASSOC)) { if ($rowCount++ == 0) { foreach ($row as $key => $value) { $heading[] = $key; } fputcsv($fp, $heading); } fputcsv($fp, $row); } fclose($fp);
?> <?php include 'include/RegFunctions.php'; $message = ''; if (isset($_POST['verify'])) { $results = $db->query("select verificationCode\n from {$UsersTable}\n where Userid = '{$Userid}'\n ") or die("Unable to obtain verification code!" . sqlError()); $row = $results->fetch(PDO::FETCH_ASSOC); if ($row['verificationCode'] == $_POST['code']) { $address = $_SESSION['newemail']; $_SESSION['newemail'] = undef; if ($db->query("update {$UsersTable} set email='{$address}' where Userid='{$Userid}'")) { $message = "Email address updated"; $db->query("update {$UsersTable} set verificationCode=null where Userid='{$Userid}'"); } else { $message = "Unable to update email address: " . sqlError(); } } else { $message = "Sorry, that is not the code I am expecting"; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en"> <head> <title>Change Password</title> <h1 align=center>Change Password</h1> </head> <body style="background-color: rgb(217, 217, 255);"> <form method="post" id="main" name="main"> <center>
function slotsFilledInRoom($RoomName, $StartTime) { global $RoomsTable, $RegistrationTable, $EventScheduleTable; global $db; $result = $db->query("select count(*) as Count\n from {$EventScheduleTable} s,\n {$RoomsTable} r,\n {$RegistrationTable} p\n Where r.RoomName like '{$RoomName}%'\n and s.StartTime = '{$StartTime}'\n and s.SchedID = p.SchedID\n and s.RoomID = r.RoomID") or die("Unable to get slot usage for Room:{$RoomName} at start time {$StartTime}:" . sqlError()); $row = $result->fetch(PDO::FETCH_ASSOC); return $row['Count']; }
if ($team['IndividualAwards'] == 'Y') { if (isset($teamAwards[$team['EventName']][$team['Award']])) { $teamAwards[$team['EventName']][$team['Award']]++; } else { $teamAwards[$team['EventName']][$team['Award']] = 1; } $memberQry = $db->query("select m.Award,\n count(*) as Count\n from {$TeamMembersTable} m,\n {$TeamsTable} t\n where t.TeamID=m.TeamID\n and t.TeamID=" . $team['TeamID'] . "\n group by m.Award") or die("Unable to get team member count:" . sqlError()); while ($members = $memberQry->fetch(PDO::FETCH_ASSOC)) { if (isset($teamAwards[$team['EventName']][$members['Award']])) { $teamAwards[$team['EventName']][$members['Award']] += $members['Count']; } else { $teamAwards[$team['EventName']][$members['Award']] = $members['Count']; } } } else { $memberQry = $db->query("select count(*) as Count\n from {$TeamMembersTable} m,\n {$TeamsTable} t\n where t.TeamID=m.TeamID\n and t.TeamID=" . $team['TeamID']) or die("Unable to get team member count:" . sqlError()); $members = $memberQry->fetch(PDO::FETCH_ASSOC); if (isset($teamAwards[$team['EventName']][$team['Award']])) { $teamAwards[$team['EventName']][$team['Award']] += $members['Count']; } else { $teamAwards[$team['EventName']][$team['Award']] = $members['Count']; } } } //print "<pre>";print_r($teamAwards); print "</pre>"; ?> <table border="1" width="100%" id="table1"> <tr> <td bgcolor="#000000"><font color="#FFFF00">Event Name</font></td> <td bgcolor="#000000"><font color="#FFFF00">Gold</font></td> <td bgcolor="#000000"><font color="#FFFF00">Silver</font></td>
function getListedEquipment($itemID, $type) { $allItemsOK = 1; $query = ""; switch ($_GET['type']) { case "Kit": $query = $query . "SELECT * FROM equipments WHERE kitid = '" . $itemID . "' AND status<>-1"; break; case "Equipment": $query = $query . "SELECT * FROM equipments WHERE equipmentid = '" . $itemID . "' AND status<>-1"; break; } $r = mysql_query($query); if (mysql_errno() != 0) { sqlError(mysql_errno(), mysql_error()); } $i = 0; $includedEquipment = ""; $inputHTML = '<div id="input-wrapper">'; // open 1 $equipmentHTML = '<div id="equipment-wrapper">'; // open 1 while ($result = mysql_fetch_assoc($r)) { $equipmentID = $result['equipmentid']; $model = $result['model']; $notes = $result['notes']; if ($i % 4 == 0) { $inputHTML = $inputHTML . "<div class='holder'>"; // open 2 $equipmentHTML = $equipmentHTML . "<div class='holder'>"; //open 2 } $includedEquipment[$i] = $equipmentID; switch ($_GET['type']) { case "Kit": $inputHTML = $inputHTML . '<input id="input_' . $equipmentID . '" class="equipment-input" type="text" onchange="validateEqID(this)"/>'; $equipmentHTML = $equipmentHTML . '<div id="' . $equipmentID . '" class="equipment-wrapper'; if ($result['condID'] == 5) { //broken item $equipmentHTML .= ' not-scanned broken-notify">'; } else { if ($result['condID'] == 6) { //missing item $equipmentHTML .= ' missing-notify">'; } else { // valid item $equipmentHTML .= ' not-scanned">'; } } break; case "Equipment": $inputHTML = $inputHTML . '<input id="input_' . $equipmentID . '" class="equipment-input readonly" readonly="readonly" type="text" value="' . $equipmentID . '"/>'; $equipmentHTML = $equipmentHTML . '<div id="' . $equipmentID . '" class="equipment-wrapper scanned" >'; break; } $equipmentHTML .= '<div class="equipment" style="width:100%">'; $equipmentHTML = $equipmentHTML . '<div><p class="details-title" style="width:40%">Equipment ID:</p><p class="details-content" style="width:60%">' . $equipmentID . '</p><div class="clear"></div></div>'; $equipmentHTML = $equipmentHTML . '<div><p class="details-title">Model:</p><p class="details-content">' . $model . '</p><div class="clear"></div></div>'; if ($result['condID'] == 5) { // item is damaged $equipmentHTML = $equipmentHTML . '<div class="status"><p class="details-title">Status:</p><p class="details-content" style="color:white">Damaged</p><div class="clear"></div></div>'; $equipmentHTML = $equipmentHTML . '</div></div>'; } else { if ($result['condID'] == 6) { // item is missing $equipmentHTML = $equipmentHTML . '<div class="status"><p class="details-title">Status:</p><p class="details-content" style="color:white">Missing</p><div class="clear"></div></div>'; $equipmentHTML = $equipmentHTML . '</div></div>'; } else { // item is good $equipmentHTML = $equipmentHTML . '<div class="status"><p class="details-title">Status:</p><p class="details-content" style="color:white">Good</p><div class="clear"></div></div>'; $equipmentHTML = $equipmentHTML . '</div></div>'; } } $i++; if ($i % 4 == 0) { $inputHTML = $inputHTML . "<div class='clear'></div></div>"; $equipmentHTML = $equipmentHTML . "<div class='clear'></div></div>"; } } // end while if ($i % 4 != 0) { $inputHTML = $inputHTML . "<div class='clear'></div></div>"; $equipmentHTML = $equipmentHTML . "<div class='clear'></div></div>"; } $inputHTML = $inputHTML . "<div class='clear'></div></div>"; $equipmentHTML = $equipmentHTML . "<div class='clear'></div></div>"; $html = "" . $inputHTML . "" . $equipmentHTML; switch ($_GET['type']) { case "Kit": $query = "SELECT loan_length FROM kits WHERE kitid = '" . $itemID . "'"; break; case "Equipment": $query = "SELECT loan_lengthEQ FROM equipments WHERE equipmentid = '" . $itemID . "'"; break; } $result = mysql_query($query); if (mysql_errno() != 0) { sqlError(mysql_errno(), mysql_error()); } $res = mysql_fetch_assoc($result); $loan_length; switch ($_GET['type']) { case "Kit": $loan_length = $res['loan_length']; break; case "Equipment": $loan_length = $res['loan_lengthEQ']; break; } $response['status'] = 0; $response['loan_length'] = $loan_length; $response['all_items_ok'] = $allItemsOK; $response['htmlData'] = $html; $response['equipmentIDS'] = $includedEquipment; echo json_encode($response); exit(0); }
} $sql = "select distinct\n s.SchedID,\n s.StartTime,\n (e.MaxWebSlots * e.MaxRooms) MaxWebSlots,\n IF (RoomName REGEXP '-[a-z]\$',\n SUBSTR(RoomName,1,LENGTH(RoomName)-2),\n RoomName)\n as RoomName\n from {$EventScheduleTable} s,\n {$EventsTable} e,\n {$RoomsTable} r\n where s.EventID = {$EventID}\n and e.EventID = s.EventID\n and s.RoomID = r.RoomID\n order by StartTime\n "; //print "<pre>$sql</$pre>"; $SchedResult = $db->query($sql) or die("Unable to Get available scheduled slots for event:" . sqlError()); while ($SchedRow = $SchedResult->fetch(PDO::FETCH_ASSOC)) { if ($SchedRow['MaxWebSlots'] - slotsFilledInRoom($SchedRow['RoomName'], $SchedRow['StartTime']) > 0 or $selected > 0 and $SchedID == $SchedRow['SchedID']) { $sel = ($selected > 0 and $SchedID == $SchedRow['SchedID']) ? "selected" : ""; print "<option value=\"" . $SchedRow['SchedID'] . "\" {$sel}>" . TimeToStr($SchedRow['StartTime']) . "</option>\n"; } } ?> </select> <?php } } else { $cntResult = $db->query("select count(*) count\n from {$RegistrationTable}\n where EventID = {$EventID}\n ") or die("Unable to get event registration count:" . sqlError()); $cntRow = $cntResult->fetch(PDO::FETCH_ASSOC); $regCount = $cntRow['count']; if ($selected == 0 and $regCount >= $MaxWebSlots) { print "<center>Full</center>"; } else { print "<center><input type=\"checkbox\" name=\"s{$EventID}\" value=\"ON\""; print $selected > 0 ? " checked" : ""; print "></center>"; } } ?> </td> <td> <?php print $selected == 1 ? '<b>' : '';
private static function releaseCurrentField($name) { $query = "UPDATE static_asset SET current='0' WHERE current='1' AND name='{$name}';"; $result = mysql_query($query) or die(sqlError(__FILE__, __LINE__, $query)); }
<table border="1" width="100%"> <?php //-------------------------------------------------------------------- // No loop through the events reporting on the details //-------------------------------------------------------------------- while ($row = $results->fetch(PDO::FETCH_ASSOC)) { $EventID = $row['EventID']; $EventName = $row['EventName']; $ConvEvent = $row['ConvEvent']; $EventType = $row['EventType']; if ($EventType == 'Team') { $sql = "SELECT count(*) as count\n FROM {$RegistrationTable} r,\n {$EventsTable} e\n WHERE r.EventID = {$EventID}\n AND r.EventID = e.EventID\n AND e.TeamEvent = 'Y'\n "; } else { $sql = "SELECT count(*) as count\n FROM {$RegistrationTable} r,\n {$EventsTable} e\n WHERE r.EventID = {$EventID}\n AND r.EventID = e.EventID\n AND e.TeamEvent = 'N'\n "; } $cntResult = $db->query($sql) or die("Unable to get Registration count for event:" . sqlError()); $cntRow = $cntResult->fetch(PDO::FETCH_ASSOC); $numEvents = $cntRow['count']; if ($prevTime != $ConvEvent) { ?> <tr> <td bgcolor="#C0C0C0" colspan=3><b><?php print $ConvEvent; ?> </b></td> </tr> <?php $prevTime = $ConvEvent; } ?> <tr>
$email .= " </p>\n"; $email .= " </body>\n"; $email .= "</html>\n"; $from = 'MIME-Version: 1.0' . "\r\n"; $from .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $from .= "From: registration@ltcsw.org\r\n"; if ($db->query("update {$UsersTable} set Password='******' where Userid='{$Userid}'")) { if (mail($address, $subject, $email, $from)) { header("refresh: 5; URL=login.php"); print "<html>\n <body style=\"background-color: rgb(217, 217, 255);\">\n <center>\n Please check your email for your new password<br>\n (Page will refresh in 5 seconds)\n </center>\n </body>\n </html>"; die; } else { $message = "Unable to send email. That stinks because I know your new password and you do not. You need to contact support"; } } else { $message = "Unable to set your new password: "******"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en"> <head> <title>Forgot Password</title> <h1 align=center>Forgot Password</h1> </head> <body style="background-color: rgb(217, 217, 255);"> <form method="post" id="main" name="main"> <center> <table border="0" width="550px">
<?php //---------------------------------------------------------------------------- // This software is licensed under the MIT license. Use as you wish but give // and take credit where due. // // Author: Paul Lemmons //---------------------------------------------------------------------------- ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en"> <?php include 'include/RegFunctions.php'; if (isset($_POST['Confirm'])) { $db->query("delete from {$EventCoordTable} where CoordID=" . $_REQUEST['CoordID']) or die("Unable to delete Coordinator record: " . sqlError()); $db->query("update {$EventsTable} set CoordID=NULL where CoordID=" . $_REQUEST['CoordID']) or die("Unable to delete registration record: " . sqlError()); WriteToLog("Coordinator " . $_REQUEST['CoordID'] . " was deleted"); ?> <head> <title> Coordinator Deleted </title> </head> <body style="background-color: rgb(217, 217, 255);"> <h1 align=center> Coordinator <?php print $_REQUEST['CoordName']; ?> Deleted! </h1> <?php
// // Author: Paul Lemmons //---------------------------------------------------------------------------- ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en"> <?php include 'include/RegFunctions.php'; if (isset($_POST['Confirm'])) { $ParticipantID = $_REQUEST['ParticipantID']; $db->query("delete from {$ParticipantsTable} where ParticipantID={$ParticipantID}") or die("Unable to delete participant record: " . sqlError()); $db->query("delete from {$TeamMembersTable} where ParticipantID={$ParticipantID}") or die("Unable to delete team membership record: " . sqlError()); $RegList = $db->query("select r.EventID\n from {$RegistrationTable} r,\n {$EventsTable} e\n where r.EventID = e.EventID\n and r.ParticipantID = {$ParticipantID}\n and e.TeamEvent = 'N'\n ") or die("Unable to get Registration List" . sqlError()); while ($Row = $RegList->fetch(PDO::FETCH_ASSOC)) { $EventID = $Row['EventID']; $db->query("delete\n from {$RegistrationTable}\n where ParticipantID = {$ParticipantID}\n and EventID = {$EventID}\n ") or die("Unable to delete registration record: " . sqlError()); } ?> <head> <title> Participant Deleted </title> </head> <body style="background-color: rgb(217, 217, 255);"> <h1 align=center> Participant: <?php print $_REQUEST['Name']; ?> Deleted! </h1> <?php
} ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Language" content="en-us"> <title>Maintain Users</title> </head> <body style="background-color: rgb(217, 217, 255);"> <h1 align="center">User Maintenance </h1> <form method="post" action=Users.php> <?php $results = $db->query("select u.Userid,\n c.ChurchName,\n u.Name,\n u.Email,\n u.Admin,\n u.Status,\n u.Password,\n u.lastLogin\n from {$UsersTable} u,\n {$ChurchesTable} c\n where c.ChurchID=u.ChurchID\n Order by " . $sort . " " . $order) or die("Unable to get user list:" . sqlError()); if ($order == "asc") { $order = "desc"; } else { $order = "asc"; } ?> <table border="1" width="100%"> <tr> <td width="70" align="center" bgcolor="#000000"> <font color="#FFFF00">View</font> </td> <td width="70" align="center" bgcolor="#000000"> <font color="#FFFF00">Update</font> </td> <td width="70" align="center" bgcolor="#000000">