HEX
Server: Apache
System: Linux www3.pit.tblive.com 5.14.0-687.38.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 12 17:19:12 EDT 2026 x86_64
User: awaldron (1020)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/awaldron/www/archive/demo/coursereg.php
<?php
session_start();
include("_functions.php");
dbconnect();
if (isset($_GET["submit"])) 

if (!isset($_GET["id"])) $_GET["id"] = quickSQL("SELECT MAX(set_id) FROM tbl_course_sets");

if (isset($_GET["rid"])) {
	$onlist = quickSQL("SELECT COUNT(username) FROM tbl_course_att WHERE username='".$_SESSION["auth_user"]."' AND sched_id=".$_GET["rid"]);
	if ($onlist > 0) header("Location: coursereg.php?id=".$_GET["id"]."&er=".base64_encode("Your request could not be completed because you are already registered for this course."));
	else {
		quickUPDATE("INSERT INTO tbl_course_att (sched_id,attendee,username) VALUES (".$_GET["rid"].",'".get_user($_SESSION["auth_user"],"fullname2")."','".$_SESSION["auth_user"]."')");
		header("Location: coursereg.php?id=".$_GET["id"]."&ty=".base64_encode("You have been added to the requested course attendees list."));
	}
}

	$s = "SELECT * FROM tbl_course_sets WHERE set_id=".$_GET["id"];
	$r = mysql_query($s);
	extract(mysql_fetch_array($r));

	$sql = "SELECT * FROM tbl_courses, tbl_course_sched WHERE tbl_courses.course_id=tbl_course_sched.course_id AND tbl_course_sched.end > ".time()." AND tbl_courses.set_id=".$_GET["id"]." ORDER BY tbl_course_sched.start ASC, tbl_courses.course_name ASC";
	$res = mysql_query($sql);
	//$bd = mysql_fetch_array($result);

$page_title = $set_name;
$GLOBALS["ext_page"] = $page_title;  // SET FAUX PAGE NAME
$_GET["p"] = $parent_id;			 // SET FAUX PARENT ID

$lnav_mods = get_layout($_GET["p"],1);
$rnav_mods = get_layout($_GET["p"],3);

include("_pagestart.php");
echo "<script language=\"JavaScript\" type=\"text/javascript\">\n";
echo "<!--\n";
echo "function confirm_register(id) {\n";
echo "  input_box=confirm(\"Are you sure you want to register for this course?\");\n";
echo "  if (input_box==true) {\n";
echo "    self.location=\"coursereg.php?id=".$_GET["id"]."&rid=\"+id;\n";
echo "  }\n";
echo "}\n";
echo "-->\n";
echo "</script>\n";
	
	echo "<div class=\"headline\">".$page_title."</div>\n";
	
		$logged = is_logged();
		
		echo "<P>";
		echo format_body($set_body,0);
		echo "<ul>\n";
		if (!$logged) {
			echo "<li> <b><span style=\"color:#DD0000\">You must be logged in to sign-up for this event. Use the form at the top left of this page to login.</span></b>\n";
		} else {
			echo "<li> The courses in which you are registered for are listed in <b style=\"color:#009900;\">green bold type font</b>.\n";
			echo "<li> If you wish to <b style=\"color:#DD0000;\">REMOVE</b> yourself from a class, you can do so in the <a href=\"#\">View List</a> popup window.\n";
		}
		echo "</ul>\n";
		
		if (isset($_GET["er"])) echo "<br><br>".error(base64_decode($_GET["er"]));
		else if (isset($_GET["ty"])) echo "<br><br>".thankyou(base64_decode($_GET["ty"]));
		
		echo "<br><br><center><table width=96% border=0 cellspacing=0 cellpadding=4>\n";
		echo "<tr class=\"header\"><td>Day, Date</td><td>Time</td><td>Class</td><td>Location</td><td align=\"center\">Seats</td><td align=\"center\">Open</td>".($logged?"<td align=\"center\">Register</td><td align=\"center\">Attendees</td>":"")."</tr>\n";
		for ($i=0; $i < mysql_num_rows($res); $i++) {
			$k = mysql_fetch_array($res);
			if (($logged && (quickSQL("SELECT COUNT(sched_id) FROM tbl_course_att WHERE sched_id=".$k["sched_id"]." AND username='".$_SESSION["auth_user"]."'")))?$bold=TRUE:$bold=FALSE);
			echo "<tr".($i%2==0?" bgcolor=\"#F0F0F0\"":" bgcolor=\"#FFFFFF\"").($bold?" style=\"color:#009900;font-weight:bold\"":"").">\n";
			echo "<td>".date("D, n/j",$k["start"])."</td>\n";
			echo "<td>".date("g:i a",$k["start"])." - ".date("g:i a",$k["end"])."</td>\n";
			echo "<td>".$k["course_name"]."</td>\n";
			echo "<td>".(!zero($k["cust_location"])?$k["cust_location"]:$k["course_location"])."</td>\n";
			$seats = (!zero($k["cust_seats"])?$k["cust_seats"]:$k["course_size"]);
			$seats_taken = quickSQL("SELECT COUNT(sched_id) FROM tbl_course_att WHERE sched_id=".$k["sched_id"]);
			echo "<td align=\"center\">".$seats."</td>\n";
			echo "<td align=\"center\">".($seats-$seats_taken)."</td>\n";
			if ($logged) {
				if (($seats-$seats_taken)<=0) echo "<td align=\"center\"><b style=\"color:#DD0000\">Full</b></td>\n";
				else echo "<td align=\"center\"><a href=\"javascript:confirm_register(".$k["sched_id"].")\">Register</a></td>\n";
				//else echo "<td align=\"center\"><a href=\"#\" onClick=\"openWindow('/quick_change.php?a=coursereg&sid=".$k["sched_id"]."','','resizable=yes,width=350,height=235')\">Register</a></td>\n";
				echo "<td align=\"center\"><a href=\"#\" onClick=\"openWindow('coursereg_list.php?id=".$_GET["id"]."&sid=".$k["sched_id"]."','','scrollbars=yes,resizable=yes,width=350,height=400')\">View List</a></td>\n";
			}
			echo "</tr>\n";
		}
		echo "</table></center>\n";
	
	echo "<br><br><br><br><div class=\"pagefoot\" style=\"border-width:1px 0px 0px 0px;\"><div style=\"float:right\">Last Updated: ".date("F j, Y")." by <a href=\"/profile.php?u=awaldron\">awaldron</a></div></div>\n";


include("_pageend.php");

?>