Exemplo n.º 1
0
<?php

if ($pageid == "warnuser") {
    $user = mysql_fetch_assoc(getUserByID($_GET['user_id']));
    echo "\r\n\r\n\t\t<center><h3>Warn " . $user['name'] . "</h3></center>\r\n\r\n\t\t<form action=\"./index.php?pageid=submitwarning\" method=\"POST\">\r\n\t\t<input type=\"hidden\" name=\"user_id\" value=\"" . $_GET['user_id'] . "\">\r\n\t\t\t<table class=\"warning\">\r\n\t\t\t\r\n\t\t\t\t<tr>\r\n\t\t\t\t\r\n\t\t\t\t\t<td colspan=2 class=\"centeredcellbold\">Warn Reason</td>\r\n\t\t\t\t\t\r\n\t\t\t\t</tr>\r\n\t\t\t\t\r\n\t\t\t\t<tr>\r\n\t\t\t\t\r\n\t\t\t\t\t<td colspan=2 class=\"centeredcellbold\"><textarea cols=\"55\" rows=\"7\" name=\"reason\"></textarea></td>\r\n\t\t\t\t\r\n\t\t\t\t</tr>\r\n\t\t\t\t\r\n\t\t\t\t<tr>\r\n\t\t\t\t\r\n\t\t\t\t\t<td class=\"centeredcell\"><select name=\"type\"><option value=\"1\">Active</option><option value=\"2\">Notification</option><option value=\"3\">Inactive</option></select></td>\r\n\t\t\t\t\t<td class=\"centeredcell\"><input type=\"submit\" value=\"Warn\"></textarea></td>\r\n\t\t\t\t\r\n\t\t\t\t</tr>\r\n\t\t\t\r\n\t\t\t</table>\r\n\t\t\r\n\t\t</form>\r\n\r\n\t";
} else {
    if ($pageid == "submitwarning") {
        warnUser($_POST['user_id'], $_POST['reason'], $_POST['type']);
        $user = mysql_fetch_assoc(getUserByID($_POST['user_id']));
        echo "<center><h3>" . $user['name'] . " Warned</h3><a href=\"./index.php?pageid=edituser&user="******"\">View User</a></center>";
    } else {
        if ($pageid == "viewwarnings") {
            if (getSessionVariable('user_level') < getConfigVar("admin_rank") && getSessionVariable('user_id') != $_GET['user_id']) {
                echo "<center><h3><font color=\"#FF0000\">Error: You are not authorized to view other user's warnings.</font></h3></center>";
            } else {
                $warnings = getWarningsForUser($_GET['user_id']);
                $user = mysql_fetch_assoc(getUserByID($_GET['user_id']));
                $options = "";
                while ($row = mysql_fetch_assoc($warnings)) {
                    $options = $options . "<option value=\"" . $row['warn_id'] . "\">" . $row['time'] . " - " . getWarningType($row['type']) . "</option>";
                }
                echo "<center><h3>View Warnings For " . $user['name'] . "</h3>";
                if ($options != "") {
                    echo "<form action=\"index.php\" method=\"GET\">\r\n\t\t\t<input type=\"hidden\" name=\"pageid\" value=\"editwarning\">\r\n\t\t\t<select name=\"warn_id\">" . $options . "</select><input type=\"submit\" value=\"View\"></form></center>";
                } else {
                    echo "<h4>User has no warnings.</h4>";
                }
            }
        } else {
            if ($pageid == "editwarning" || $pageid == "savewarning") {
                $message = "";
Exemplo n.º 2
0
?>
</td>

		</tr>

		<tr>

			<td class="centeredcellbold">User Level</td>
			<td class="centeredcell"><?php 
echo $user['user_level'];
?>
</td>

			<td class="centeredcellbold">Warnings</td>
			<td class="centeredcell"><?php 
echo "" . mysql_num_rows(getActiveWarningsForUser($user['user_id'])) . "(" . mysql_num_rows(getWarningsForUser($user['user_id'])) . ")";
?>
			</td>

		</tr>

		<tr>

			<td colspan=4 class="centeredcellbold">Admin Notes</td>

		</tr>

		<tr>

			<td colspan=4 class="centeredcell"><textarea cols=60 rows=8 disabled>
				
			<td class=\"centeredcellbold\">New Password</td>
			<td class=\"centeredcellbold\">Confirm Password</td>
	
		</tr>
	
		<tr>
		
			<form action=\"./index.php?pageid=savepassword\" method=\"POST\"><td class=\"centeredcellbold\"><input type=\"submit\" value=\"Save Password\"></td>
			<td class=\"centeredcell\"><input type=\"password\" name=\"curpass\"></td>
			<td class=\"centeredcell\"><input type=\"password\" name=\"newpass\"></th>
			<td class=\"centeredcell\"><input type=\"password\" name=\"confpass\"></td></form>
	
		</tr>
	
		<tr>
			
			<form action=\"./index.php?pageid=saveemail\" method=\"POST\">
			<td colspan=1 class=\"centeredcellbold\">Email</th><td colspan=3 class=\"centeredcell\"><input type=\"text\" name=\"email\" size=30 value=\"".$user['email']."\"><input type=\"submit\" value=\"Save Email\"></td></form>
				
		</tr>

		<tr>
		
			<td colspan=1 class=\"centeredcellbold\">Warnings</th>
			<td class=\"centeredcellbold\" colspan=3><a href=\"./index.php?pageid=viewmywarnings\">".mysql_num_rows(getActiveWarningsForUser($user['user_id']))."(".mysql_num_rows(getWarningsForUser($user['user_id'])).")</a></td>
		
		</tr>
			
	</table>";
		
?>
*/
$reservation = mysql_fetch_assoc(getReservationByID($resid));
$user = mysql_fetch_assoc(getUserByID($reservation['user_id']));
$equipment = mysql_fetch_assoc(getEquipmentByID($reservation['equip_id']));
if ($reservation['mod_status'] == RES_STATUS_CONFIRMED) {
    $status = "<font color=\"#005500\">Current Status: Confirmed</font>";
} else {
    if ($reservation['mod_status'] == RES_STATUS_CHECKED_OUT) {
        $status = "<font color=\"#005500\">Current Status: Checked-Out</font>";
    } else {
        if ($reservation['mod_status'] == RES_STATUS_CHECKED_IN) {
            $status = "<font color=\"#005500\">Current Status: Checked-In</font>";
        } else {
            if ($reservation['mod_status'] == RES_STATUS_PENDING) {
                $status = "Current Status: Pending";
            } else {
                $status = "<font color=\"#FF0000\">Current Status: Denied</font>";
            }
        }
    }
}
$checkin = "";
/*
 If the logged in user is an admin, display the "check-in button"
*/
if (issetSessionVariable('user_level') && getSessionVariable('user_level') >= RES_USERLEVEL_ADMIN) {
    $checkin = "<tr><form action=\"./index.php?pageid=viewreservation\" method=\"POST\"><th colspan=4><input type=\"hidden\" value=\"" . $resid . "\" name=\"resid\"><input type=\"submit\" value=\"Checkin\"></th></form></tr>";
}
$page = "";
$page = $page . "\r\n\t<center><h3>Reseravation Info</h3></center>\r\n\t<form action=\"./index.php?pageid=editreservation\" method=\"POST\">\r\n\t<input type=\"hidden\" name=\"resid\" value=\"" . $resid . "\">\r\n\t<table class=\"editreservation\">\r\n\t\t<tr>\r\n\t\t\t\r\n\t\t\t<td colspan=4 class=\"header\">User Information</td>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t\r\n\t\t\t<td class=\"centeredcellbold\">Name</th>\r\n\t\t\t<td class=\"centeredcell\"><a href=\"./index.php?pageid=edituser&user="******"\">" . $user['name'] . "</a></td>\r\n\t\t\t<td class=\"centeredcellbold\">Warnings</th>\r\n\t\t\t<td class=\"centeredcell\"><a href=\"./index.php?pageid=viewwarnings&user_id=" . $user['user_id'] . "\">" . mysql_num_rows(getActiveWarningsForUser($user['user_id'])) . "(" . mysql_num_rows(getWarningsForUser($user['user_id'])) . ")</a></td>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t\r\n\t\t\t<td colspan=4 class=\"header\">Equipment Information</td>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t\r\n\t\t\t<td colspan=2 class=\"centeredcellbold\">Name</td>\r\n\t\t\t<td colspan=2 class=\"centeredcell\">" . $equipment['name'] . "</td>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t\r\n\t\t\t<td colspan=4 class=\"header\">Reservation Information</td>\r\n\t\t\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\r\n\t\t\t<td class=\"centeredcellbold\">Start Date</td>\r\n\t\t\t<td class=\"centeredcell\"><script language=\"JavaScript\" id=\"jscal1x\">\r\n\t\t\t\t\t\tvar cal1x = new CalendarPopup(\"testdiv1\");\r\n\t\t\t\t\t</script>\r\n\t\t\t\t\t<input type=\"text\" name=\"startdate\" size=\"20\" id=\"startdate\" value=\"" . $reservation['start_date'] . "\" onClick=\"cal1x.select(document.forms[0].startdate,'anchor1x','yyyy-MM-dd'); return false;\"><a style=\"visibility:hidden;\" name=\"anchor1x\" id=\"anchor1x\">a</a></th>\r\n\t\t\t<td class=\"centeredcellbold\">End Date</td>\r\n\t\t\t<td class=\"centeredcell\"><script language=\"JavaScript\" id=\"jscal1x\">\r\n\t\t\t\t\t\tvar cal1x = new CalendarPopup(\"testdiv1\");\r\n\t\t\t\t\t</script>\r\n\t\t\t\t\t<input type=\"text\" name=\"enddate\" size=\"20\" id=\"enddate\" value=\"" . $reservation['end_date'] . "\" onClick=\"cal1x.select(document.forms[0].enddate,'anchor2x','yyyy-MM-dd'); return false;\"><a style=\"visibility:hidden;\" name=\"anchor2x\" id=\"anchor2x\">a</a></th>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td colspan=4 class=\"centeredcellbold\">" . $status . "</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t\r\n\t\t\t<td colspan=4 class=\"centeredcellbold\">User Comment</td>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t\r\n\t\t\t<td colspan=4 class=\"centeredcell\">&nbsp;" . $reservation['user_comment'] . "</td>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t\r\n\t\t\t<td colspan=4 class=\"centeredcellbold\">Admin Comment</th>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\r\n\t\t\t<td colspan=4 class=\"centeredcell\">&nbsp;" . $reservation['admin_comment'] . "</td>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td class=\"centeredcell\" colspan=4><input type=\"submit\" value=\"Save\"></td>\r\n\t\t</tr>\r\n\t\r\n\t</table></form>\r\n<DIV ID=\"testdiv1\" STYLE=\"position:absolute;visibility:hidden;background-color:white;\"></DIV>\r\n";
echo $page;
<?php

$userid = getSessionVariable('user_id');
$warnings = getWarningsForUser($userid);
$user = mysql_fetch_assoc(getUserByID($userid));
$options = "";
$types = array(RES_WARNING_ACTIVE => "Active", RES_WARNING_NOTE => "Note", RES_WARNING_INACTIVE => "Inactive");
while ($row = mysql_fetch_assoc($warnings)) {
    $options = $options . "<option value=\"" . $row['warn_id'] . "\">" . $row['time'] . " - " . $types[$row['type']] . "</option>";
}
echo "<center><h3>View Warnings For " . $user['name'] . "</h3>";
if ($options != "") {
    echo "<form action=\"index.php\" method=\"GET\">\r\n\t\t<input type=\"hidden\" name=\"pageid\" value=\"viewmywarning\">\r\n\t\t<select name=\"warn_id\">" . $options . "</select><input type=\"submit\" value=\"View\"></form>";
} else {
    echo "<h4>You don't have any warnings. :)</h4>";
}
if ($pageid == "viewmywarning") {
    $warning = mysql_fetch_assoc(getWarningByID($_GET['warn_id']));
    echo "<table class=\"warning\">\r\n\t\t\t<tr>\r\n\t\t\t\r\n\t\t\t\t<td colspan=2 class=\"centeredcellbold\">Warning Reason</td>\r\n\t\t\t\r\n\t\t\t</tr>\r\n\t\t\t\r\n\t\t\t<tr>\r\n\t\t\t\r\n\t\t\t\t<td colspan=2 class=\"centeredcell\"><textarea cols=\"55\" rows=\"7\" readonly>" . $warning['reason'] . "</textarea></td>\r\n\t\t\t\r\n\t\t\t</tr>\r\n\t\t\t\r\n\t\t\t<tr>\r\n\t\t\t\r\n\t\t\t\t<td class=\"centeredcellbold\">Type: " . getWarningType($warning['type']) . "</td>\r\n\t\t\t\t<td class=\"centeredcellbold\">Time: " . $warning['time'] . "</td>\r\n\t\t\t\r\n\t\t\t</tr>\r\n\t\t\r\n\t\t</table>";
}
echo "</center>";
            if ($newpass == $confpass) {
                changeUserPassword(getSessionVariable('user_id'), $newpass);
                $user = mysql_fetch_assoc(getUserByID(getSessionVariable('user_id')));
                $message = "<font color=\"#005500\"><b>Password Updated!</b></font><br><br>";
            } else {
                $message = "<font color=\"#FF0000\"><b>Error: The New Passwords Don't Match</b></font><br><br>";
            }
        } else {
            $message = "<font color=\"#FF0000\"><b>Error: Current Password Incorrect</b></font><br><br>";
        }
    } else {
        $message = "<font color=\"#005500\"><b>Error: A Required Field Was Left Blank</b></font><br><br>";
    }
} else {
    if ($pageid == "saveemail") {
        $email = $_POST['email'];
        if ($email != "") {
            changeUserEmail(getSessionVariable('user_id'), $email);
            $user = mysql_fetch_assoc(getUserByID(getSessionVariable('user_id')));
            $message = "<font color=\"#005500\"><b>Email Updated!</b></font><br><br>";
        } else {
            $message = "<font color=\"#FF0000\"><b>Error: Email Field Was Left Blank</b></font><br><br>";
        }
    }
}
$passwordRows = "";
if (!getConfigVar("use_ldap")) {
    $passwordRows = "<tr>\r\n\t\t\r\n\t\t\t<td class=\"centeredcellbold\">Change Password</td>\r\n\t\t\t<td class=\"centeredcellbold\">Current Password</td>\r\n\t\t\t<td class=\"centeredcellbold\">New Password</td>\r\n\t\t\t<td class=\"centeredcellbold\">Confirm Password</td>\r\n\t\r\n\t\t</tr>\r\n\t\r\n\t\t<tr>\r\n\t\t\r\n\t\t\t<form action=\"./index.php?pageid=savepassword\" method=\"POST\"><td class=\"centeredcellbold\"><input type=\"submit\" value=\"Save Password\"></td>\r\n\t\t\t<td class=\"centeredcell\"><input type=\"password\" name=\"curpass\"></td>\r\n\t\t\t<td class=\"centeredcell\"><input type=\"password\" name=\"newpass\"></th>\r\n\t\t\t<td class=\"centeredcell\"><input type=\"password\" name=\"confpass\"></td></form>\r\n\t\r\n\t\t</tr>";
}
echo "\r\n\t<center><h3>My Account</h3>" . $message . "</center>\r\n\t\r\n\t<table class=\"myaccount\">\r\n\t\r\n\t\t<tr>\r\n\t\t\r\n\t\t\t<td colspan=4 class=\"header\">Edit User Information</td>\r\n\t\t\r\n\t\t</tr>\r\n\t\t\r\n\t\t<tr>\r\n\r\n\t\t\t<td class=\"centeredcellbold\">Username</td>\r\n\t\t\t<td colspan=3 class=\"centeredcell\">" . $user['username'] . "</td>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\r\n\t\t<tr>\r\n\r\n\t\t\t<td class=\"centeredcellbold\">Name</th>\r\n\t\t\t<td colspan=3 class=\"centeredcell\">" . $user['name'] . "</td>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\r\n\t\t" . $passwordRows . "\r\n\t\r\n\t\t<tr>\r\n\t\t\t\r\n\t\t\t<form action=\"./index.php?pageid=saveemail\" method=\"POST\">\r\n\t\t\t<td colspan=1 class=\"centeredcellbold\">Email</th><td colspan=3 class=\"centeredcell\"><input type=\"text\" name=\"email\" size=30 value=\"" . $user['email'] . "\"><input type=\"submit\" value=\"Save Email\"></td></form>\r\n\t\t\t\t\r\n\t\t</tr>\r\n\r\n\t\t<tr>\r\n\t\t\r\n\t\t\t<td colspan=1 class=\"centeredcellbold\">Warnings</th>\r\n\t\t\t<td class=\"centeredcellbold\" colspan=3><a href=\"./index.php?pageid=viewmywarnings\">" . mysql_num_rows(getActiveWarningsForUser($user['user_id'])) . "(" . mysql_num_rows(getWarningsForUser($user['user_id'])) . ")</a></td>\r\n\t\t\r\n\t\t</tr>\r\n\t\t\t\r\n\t</table>";
			</tr>

			<tr>

				<td colspan=1 class="centeredcellbold">Email</th>
				<td colspan=3 class="centeredcell"><?php echo $user['email']; ?></td>

			</tr>

			<tr>

				<td class="centeredcellbold">User Level</td>
				<td class="centeredcell"><?php echo $user['user_level']; ?></td>

				<td class="centeredcellbold">Warnings</td>
				<td class="centeredcell"><?php echo "".mysql_num_rows(getActiveWarningsForUser($user['user_id']))."(".mysql_num_rows(getWarningsForUser($user['user_id'])).")"; ?></td>

			</tr>

			<tr>

				<td colspan=4 class="centeredcellbold">Admin Notes</td>

			</tr>

			<tr>

				<td colspan=4 class="centeredcell"><textarea cols=60 rows=8 disabled><?php echo $user['notes']; ?></textarea></td>

			</tr>
$page = $page . "
	<center><h3>Reseravation Info</h3></center>
	<form action=\"./index.php?pageid=editreservation\" method=\"POST\">
	<input type=\"hidden\" name=\"resid\" value=\"".$resid."\">
	<table class=\"editreservation\">
		<tr>
			
			<td colspan=4 class=\"header\">User Information</td>
			
		</tr>
		<tr>
			
			<td class=\"centeredcellbold\">Name</th>
			<td class=\"centeredcell\"><a href=\"./index.php?pageid=edituser&user="******"\">".$user['name']."</a></td>
			<td class=\"centeredcellbold\">Warnings</th>
			<td class=\"centeredcell\"><a href=\"./index.php?pageid=viewwarnings&user_id=".$user['user_id']."\">".mysql_num_rows(getActiveWarningsForUser($user['user_id']))."(".mysql_num_rows(getWarningsForUser($user['user_id'])).")</a></td>
			
		</tr>
		<tr>
			
			<td colspan=4 class=\"header\">Equipment Information</td>
			
		</tr>
		<tr>
			
			<td colspan=2 class=\"centeredcellbold\">Name</td>
			<td colspan=2 class=\"centeredcell\">".$equipment['name']."</td>
			
		</tr>
		<tr>
			
Exemplo n.º 9
0
        } else {
            if ($pageid == "adminsavenotes") {
                changeUserNotes($userid, $_POST['notes']);
                $message = "User Saved!<br><br>";
            }
        }
    }
}
if ($pageid == "edituser" || $pageid == "adminsavepassword" || $pageid == "adminsaveemail" || $pageid == "adminsavelevel") {
    $sel = "";
} else {
    $sel = " SELECTED";
}
while ($row = mysql_fetch_assoc($result)) {
    if (isset($userid) && $row['user_id'] == $userid) {
        $sel = " SELECTED";
    }
    $users = $users . "<option value=\"" . $row['user_id'] . "\"{$sel}>" . $row['name'] . "</option>";
    $sel = "";
}
if ($pageid == "edituser" || $pageid == "adminsavepassword" || $pageid == "adminsaveemail" || $pageid == "adminsavenotes" || $pageid == "adminsavelevel") {
    echo "<center><h3>Manage Users</h3></center>\r\n<center><form action=\"index.php\" method=\"GET\"><input type=\"hidden\" name=\"pageid\" value=\"edituser\"><select name=\"user\">\r\n" . $users . "\r\n</select><input type=\"submit\" value=\"Edit\"></form>" . $message . "</center>";
    $user = mysql_fetch_assoc(getUserByID($userid));
    $passwordRows = "";
    if (!getConfigVar("use_ldap")) {
        $passwordRows = "<tr>\r\n\t\t\r\n\t\t\t<td class=\"centeredcellbold\">Change Password</td>\r\n\t\t\t<td class=\"centeredcellbold\">New Password</td>\r\n\t\t\t<td class=\"centeredcellbold\">Confirm Password</td>\r\n\t\t\t<td class=\"centeredcellbold\">--</td>\r\n\t\r\n\t\t</tr>\r\n\t\r\n\t\t<tr>\r\n\t\t\r\n\t\t\t<form action=\"./index.php?pageid=adminsavepassword\" method=\"POST\"><td class=\"centeredcellbold\">--</td>\r\n\t\t\t<td class=\"centeredcell\"><input type=\"hidden\" name=\"userid\" value=\"" . $user['user_id'] . "\"><input type=\"password\" name=\"newpass\"></td>\r\n\t\t\t<td class=\"centeredcell\"><input type=\"password\" name=\"confpass\"></th>\r\n\t\t\t<td class=\"centeredcell\"><input type=\"submit\" value=\"Save Password\"></td></form>\r\n\t\r\n\t\t</tr>";
    }
    echo "<table class=\"userinfo\">\r\n\t\r\n\t\t<tr>\r\n\t\t\r\n\t\t\t<td colspan=4 class=\"header\">User Information</td>\r\n\t\t\r\n\t\t</tr>\r\n\t\r\n\t\t<tr>\r\n\r\n\t\t\t<td class=\"centeredcellbold\">ID Number</th>\r\n\t\t\t<td colspan=3 class=\"centeredcell\">" . $user['username'] . "</td>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\r\n\t\t<tr>\r\n\r\n\t\t\t<td class=\"centeredcellbold\">Name</td>\r\n\t\t\t<td colspan=3 class=\"centeredcell\">" . $user['name'] . "</td>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\r\n\t\t" . $passwordRows . "\r\n\t\r\n\t\t<tr>\r\n\t\t\t\r\n\t\t\t<td colspan=1 class=\"centeredcellbold\">Email</td>\r\n\t\t\t<form action=\"./index.php?pageid=adminsaveemail\" method=\"POST\"><td colspan=3 class=\"centeredcell\"><input type=\"hidden\" name=\"userid\" value=\"" . $user['user_id'] . "\"><input type=\"text\" name=\"email\" size=30 value=\"" . $user['email'] . "\"><input type=\"submit\" value=\"Save Email\"></td></form>\r\n\t\t\t\t\r\n\t\t</tr>\r\n\t\r\n\t\t<tr>\r\n\t\t\t\r\n\t\t\t<td colspan=1 class=\"centeredcellbold\">Userlevel</td>\r\n\t\t\t<form action=\"./index.php?pageid=adminsavelevel\" method=\"POST\"><td colspan=3 class=\"centeredcell\">\r\n\t\t\t<input type=\"hidden\" name=\"userid\" value=\"" . $user['user_id'] . "\">" . getUserLevelDropDownSelected("level", $user['user_level']) . "<input type=\"submit\" value=\"Save Level\"></td>\r\n\t\t\t</form>\r\n\t\t\t\t\r\n\t\t</tr>\r\n\r\n\t\t<tr>\r\n\t\t\r\n\t\t\t<td colspan=1 class=\"centeredcellbold\">Warnings</td>\r\n\t\t\t<td class=\"centeredcell\" colspan=2><a href=\"./index.php?pageid=viewwarnings&user_id=" . $user['user_id'] . "\">" . mysql_num_rows(getActiveWarningsForUser($user['user_id'])) . "(" . mysql_num_rows(getWarningsForUser($user['user_id'])) . ")</a></td>\r\n\t\t\t<td class=\"centeredcell\" colspan=1><a href=\"./index.php?pageid=warnuser&user_id=" . $user['user_id'] . "\">Warn User</a></td>\r\n\t\t\r\n\t\t</tr>\r\n\t\t\r\n\t\t<tr>\r\n\t\t\r\n\t\t\t<td colspan=4 class=\"centeredcellbold\">User Notes</th>\r\n\t\t\r\n\t\t</tr>\r\n\t\t\r\n\t\t<tr>\r\n\t\t\r\n\t\t\t<td colspan=4 class=\"centeredcellbold\"><br><form action=\"./index.php?pageid=adminsavenotes\" method=\"POST\"><input type=\"hidden\" name=\"userid\" value=\"" . $user['user_id'] . "\"><textarea cols=60 rows=8 name=\"notes\">" . $user['notes'] . "</textarea><br><input type=\"submit\" value=\"Save Notes\"</form></th>\r\n\t\t\r\n\t\t</tr>\r\n\t\t\t\r\n\t</table>";
} else {
    echo "<center><h3>Manage Users</h3></center>\r\n\t<center><form action=\"index.php\" method=\"GET\"><input type=\"hidden\" name=\"pageid\" value=\"edituser\"><select name=\"user\" size=10>\r\n\t" . $users . "\r\n\t</select><br><input type=\"button\" value=\"Create User\" onClick=\"window.location = './index.php?pageid=newuser'\"><input type=\"submit\" value=\"Edit\"></form></center>";
}
    }
    $checkin = "";
    $userinfo = "\r\n\t\t<tr>\r\n\t\t\t\r\n\t\t\t<td class=\"centeredcellbold\">Name</th>\r\n\t\t\t<td class=\"centeredcell\">" . $user['name'] . "</td>\r\n\t\t\t<td class=\"centeredcellbold\">Warnings</th>\r\n\t\t\t<td class=\"centeredcell\">" . mysql_num_rows(getActiveWarningsForUser($user['user_id'])) . "(" . mysql_num_rows(getWarningsForUser($user['user_id'])) . ")</td>\r\n\t\t\t\r\n\t\t</tr>";
    $checkinCell = "&nbsp;-&nbsp;";
    if ($reservation['mod_status'] == RES_STATUS_CONFIRMED) {
        $checkinCell = "<input type=\"hidden\" value=\"checkout\" name=\"action\">\r\n\t\t\t\t<input type=\"hidden\" value=\"" . $resid . "\" name=\"resid\">\r\n\t\t\t\t<input type=\"submit\" value=\"Check Out\">";
    } else {
        if ($reservation['mod_status'] == RES_STATUS_CHECKED_OUT) {
            $checkinCell = "<input type=\"hidden\" value=\"checkin\" name=\"action\">\r\n\t\t\t\t<input type=\"hidden\" value=\"" . $resid . "\" name=\"resid\">\r\n\t\t\t\t<input type=\"submit\" value=\"Check In\">";
        }
    }
    /*
     If the logged in user is an admin, display the "check-in button"
    */
    if (issetSessionVariable('user_level') && getSessionVariable('user_level') >= RES_USERLEVEL_ADMIN) {
        $userinfo = "<tr>\r\n\t\t\t\r\n\t\t\t<td class=\"centeredcellbold\">Name</th>\r\n\t\t\t<td class=\"centeredcell\"><a href=\"./index.php?pageid=edituser&user="******"\">" . $user['name'] . "</a></td>\r\n\t\t\t<td class=\"centeredcellbold\">Warnings</th>\r\n\t\t\t<td class=\"centeredcell\"><a href=\"./index.php?pageid=viewwarnings&user_id=" . $user['user_id'] . "\">" . mysql_num_rows(getActiveWarningsForUser($user['user_id'])) . "(" . mysql_num_rows(getWarningsForUser($user['user_id'])) . ")</a></td>\r\n\t\t\t\r\n\t\t</tr>";
        $checkin = "<tr>\r\n\t\t\t\t\t\r\n\t\t\t\t\t<form action=\"./index.php?pageid=viewreservation\" method=\"POST\">\r\n\t\t\t\t\t<td class=\"centeredcellbold\">\r\n\t\t\t\t\t" . $checkinCell . "\r\n\t\t\t\t\t</td>\r\n\t\t\t\t\t</form>\r\n\t\t\t\t\t<form action=\"./index.php?pageid=viewreservation\" method=\"POST\" onSubmit=\"return confirm('Are you sure you want to delete this reservation?')\">\r\n\t\t\t\t\t<td class=\"centeredcellbold\">\r\n\t\t\t\t\t\t<input type=\"hidden\" value=\"delete\" name=\"action\">\r\n\t\t\t\t\t\t<input type=\"hidden\" value=\"" . $resid . "\" name=\"resid\">\r\n\t\t\t\t\t\t<input type=\"submit\" value=\"Delete\">\r\n\t\t\t\t\t</td>\r\n\t\t\t\t\t</form>\r\n\t\t\t\t\t<form action=\"./index.php?pageid=viewreservation\" method=\"POST\">\r\n\t\t\t\t\t<td class=\"centeredcellbold\">\r\n\t\t\t\t\t\t<input type=\"hidden\" value=\"update\" name=\"action\">\r\n\t\t\t\t\t\t<input type=\"hidden\" value=\"" . $resid . "\" name=\"resid\">\r\n\t\t\t\t\t\t<select name=\"status\">\r\n\t\t\t\t\t\t\t<option value=1>Approve</option>\r\n\t\t\t\t\t\t\t<option value=2>Deny</option>\r\n\t\t\t\t\t\t</select>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t\t<td class=\"centeredcellbold\">\r\n\t\t\t\t\t\t<input type=\"hidden\" value=\"update\" name=\"action\">\r\n\t\t\t\t\t\t<input type=\"hidden\" value=\"" . $resid . "\" name=\"resid\">\r\n\t\t\t\t\t\t<input type=\"submit\" value=\"Update\">\r\n\t\t\t\t\t</td>\r\n\t\t\t\t\t</form>\r\n\t\t\t\t\t\r\n\t\t\t\t</tr>";
    } else {
        if (issetSessionVariable('user_level') && getSessionVariable('user_level') == RES_USERLEVEL_LEADER) {
            if ($checkinCell == "&nbsp;-&nbsp;") {
                $checkinCell = "No Available Action (Reservation Pending, Denied, or Checked-in)";
            }
            $checkin = "<tr><form action=\"./index.php?pageid=viewreservation\" method=\"POST\"><td class=\"centeredcellbold\" colspan=4>" . $checkinCell . "</td></form></tr>";
        }
    }
    $page = $page . "\r\n\t<center><h3>Reseravation Info</h3></center>\r\n\t<table class=\"viewreservation\">\r\n\t\t<tr>\r\n\t\t\t\r\n\t\t\t<td colspan=4 class=\"header\">User Information</td>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\t" . $userinfo . "\r\n\t\t<tr>\r\n\t\t\t\r\n\t\t\t<td colspan=4 class=\"header\">Equipment Information</td>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t\r\n\t\t\t<td colspan=2 class=\"centeredcellbold\">Name</th>\r\n\t\t\t<td colspan=2 class=\"centeredcell\"><a href=\"./index.php?pageid=moreinfo&equipid=" . $equipment['equip_id'] . "\">" . $equipment['name'] . "</a></td>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t\r\n\t\t\t<td colspan=4 class=\"header\">Reservation Information</td>\r\n\t\t\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\r\n\t\t\t<td class=\"centeredcellbold\">Start Date</td>\r\n\t\t\t<td class=\"centeredcell\">" . $reservation['start_date'] . "</td>\r\n\t\t\t<td class=\"centeredcellbold\">End Date</td>\r\n\t\t\t<td class=\"centeredcell\">" . $reservation['end_date'] . "</td>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td colspan=4 class=\"centeredcellbold\">" . $status . "</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t\r\n\t\t\t<td colspan=4 class=\"centeredcellbold\">User Comment</td>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t\r\n\t\t\t<td colspan=4 class=\"topaligncell\">&nbsp;" . $reservation['user_comment'] . "</td>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t\r\n\t\t\t<td colspan=4 class=\"centeredcellbold\">Admin Comment</td>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t\r\n\t\t\t<td colspan=4 class=\"topaligncell\">&nbsp;" . $reservation['admin_comment'] . "</td>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\t" . $checkin . "\r\n\t\r\n\t</table>\r\n\r\n";
} else {
    if (isset($_POST['action']) && $_POST['action'] == "delete") {
        $page = $page . "<br><h3>Reservation Deleted</h3>";
    }
}