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/public_html/archive/demo/eventreg_su.php
<?php
session_start();
include("_functions.php");
dbconnect();
if (isset($_GET["submit"])) 

if (!isset($_GET["id"])) $_GET["id"] = quickSQL("SELECT MAX(event_id) FROM tbl_event WHERE event_type='su'");

if (isset($_GET["rid"])) {
	$employee_type = quickSQL("SELECT emp_type_id FROM tbl_employees WHERE username='".$_SESSION["auth_user"]."'");
	$event_emponly = quickSQL("SELECT event_emponly FROM tbl_event WHERE event_id=".$_GET["id"]);
	if (($employee_type > 3) && ($event_emponly != 3)) {
		header("Location: eventreg_su.php?id=".$_GET["id"]."&er=".base64_encode("Sorry, but this event is open to Vocollect employees only."));
	} else {
		$onlist = quickSQL("SELECT COUNT(registrant) FROM tbl_event_su_att WHERE registrant='".$_SESSION["auth_user"]."' AND esu_id=".$_GET["rid"]);
		if ($onlist > 0) header("Location: eventreg_su.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_event_su_att (esu_id,attendee,registrant,att_time) VALUES (".$_GET["rid"].",'".get_user($_SESSION["auth_user"],"fullname2")."','".$_SESSION["auth_user"]."',".time().")");
			header("Location: eventreg_su.php?id=".$_GET["id"]."&ty=".base64_encode("You have been added to the requested course attendees list."));
		}
	}
}

if (isset($_GET["del"])) {
	quickUPDATE("DELETE FROM tbl_event_su_att WHERE suatt_id=".$_GET["del"]." AND registrant='".$_SESSION["auth_user"]."'");
}

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

if ($event_word == 1) {
	$word = "class";
	$maxnum = "Seats";
} else if ($event_word == 2) {
	$word = "event";
	$maxnum = "Max.";
}
	

$sql = "SELECT * FROM tbl_event_su WHERE event_id=".$event_id." AND esu_end > ".time()." ORDER BY esu_start ASC, esu_title ASC";
$res = mysql_query($sql);
//$bd = mysql_fetch_array($result);

$page_title = $event_title;
$GLOBALS["ext_page"] = $page_title;  // SET FAUX PAGE NAME
$_GET["p"] = $event_parent;			 // 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 ".$word."?\");\n";
echo "  if (input_box==true) {\n";
echo "    self.location=\"eventreg_su.php?id=".$_GET["id"]."&rid=\"+id;\n";
echo "  }\n";
echo "}\n";
echo "function confirm_unregister(id) {\n";
echo "  input_box=confirm(\"Are you sure you want to cancel your registration for this ".$word."?\");\n";
echo "  if (input_box==true) {\n";
echo "    self.location=\"eventreg_su.php?id=".$_GET["id"]."&del=\"+id;\n";
echo "  }\n";
echo "}\n";
echo "-->\n";
echo "</script>\n";
	
	
	echo "<div class=\"headline\">".$page_title."</div>\n";
	echo "<div class=\"pagebody\">\n";
	
	$logged = is_logged();
	//if (authorize($event_owner)) echo "<P><table><tr><td><img src=\"gui/edit.gif\" border=0></td><td><a href=\"event_new_su.php?id=".$_GET["id"]."\">Edit ".$word." dates</a></td><td>| <a href=\"event_new.php?type=su&id=".$_GET["id"]."\">Edit ".$word." info</a></td></tr></table>";

	
	echo "<P>";
	echo format_body($event_desc,0);
	
	if (($event_active == 1) && (zero($event_deadline) || (time() < $event_deadline))) {
	
		echo "<br><br><ul>\n";
		if (!zero($event_deadline)) echo "<li>Registration deadline for this ".$word." is <b>".date("l, F j, Y",$event_deadline)."</b>\n";
		if (!$logged) {
			echo "<li> <b><span style=\"color:#DD0000\">You must be logged in to sign-up for this ".$word.". Use the form at the top right of this page to login.</span></b>\n";
		} else {
			//echo "<li> The ".($word=="event"?"events":"classes")." in which you are registered for are listed in <b style=\"background:#D5EFFF;\">bold font with light blue background</b>.\n";
			if (($event_emponly == 1) || ($event_emponly == 3)) echo "<li> If you wish to <b style=\"color:#DD0000;\">REMOVE</b> yourself from ".($word=="event"?"an event":"a class").", simply click on the <b style=\"text-decoration:underline;color:#DD0000;\">Remove</b> link.\n";
			else echo "<li> If you wish to <b style=\"color:#DD0000;\">REMOVE</b> an attendee from ".($word=="event"?"an event":"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 style=\"border:solid 1px #999999;\">\n";
		echo "<tr class=\"header\"><td>Day, Date</td><td>Time</td><td>".ucfirst($word)." <span style=\"font-size:10px;\">(Click Title for Description)</span></td><td>Location</td><td align=\"center\">".ucfirst($maxnum)."</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 ($event_emponly != 2) $suatt_id = quickSQL("SELECT suatt_id FROM tbl_event_su_att WHERE esu_id=".$k["esu_id"]." AND registrant='".$_SESSION["auth_user"]."'");
			else $suatt_id = quickSQL("SELECT COUNT(suatt_id) FROM tbl_event_su_att WHERE esu_id=".$k["esu_id"]." AND registrant='".$_SESSION["auth_user"]."'");
			if ($logged && !zero($suatt_id) ? $bold=TRUE : $bold=FALSE);
			echo "<tr bgcolor=\"".($bold?"#D5EFFF":($i%2==0?"#F0F0F0":"#FFFFFF"))."\"".($bold?" style=\"font-weight:bold\"":"").">\n";
			echo "<td>".date("D, m/d",$k["esu_start"])."</td>\n";
			echo "<td>".date("h:i a",$k["esu_start"])." - ".date("h:i a",$k["esu_end"])."</td>\n";
			echo "<td><a href=\"javascript:ToggleRow('desc".$k["esu_id"]."')\">".$k["esu_title"]."</a></td>\n";
			echo "<td>".$k["esu_location"]."</td>\n";
			$seats = $k["esu_size"];
			$seats_taken = quickSQL("SELECT COUNT(suatt_id) FROM tbl_event_su_att WHERE esu_id=".$k["esu_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 if (!$bold && (($event_emponly == 1) || ($event_emponly == 3)))  echo "<td align=\"center\"><a href=\"javascript:confirm_register(".$k["esu_id"].")\">Register</a></td>\n";
				else if ($bold && (($event_emponly == 1) || ($event_emponly == 3))) echo "<td align=\"center\"><a href=\"javascript:confirm_unregister(".$suatt_id.")\" style=\"color:#DD0000;\">Remove</a></td>\n";
				else if (($event_emponly == 2) || ($event_emponly == 4)) echo "<td align=\"center\"><a href=\"#\" onClick=\"openWindow('/eventreg_confirm.php?id=".$k["esu_id"]."&t=su','','resizable=yes,width=350,height=235')\">Register</a></td>\n";
				
				echo "<td align=\"center\"><a href=\"#\" onClick=\"openWindow('eventreg_su_list.php?sid=".$k["esu_id"]."','','scrollbars=yes,resizable=yes,width=350,height=400')\">View List</a></td>\n";
			}
			echo "</tr>\n";
			echo "<tbody id=\"desc".$k["esu_id"]."\" style=\"display:none\">\n";
				echo "<tr bgcolor=\"".($bold?"#D5EFFF":($i%2==0?"#F0F0F0":"#FFFFFF"))."\">\n";
				echo "<td colspan=8><span style=\"font-size:10px\">".(zero($k["esu_desc"])?"No Description":format_body($k["esu_desc"],0))."</span></td>\n";
				echo "</tr>\n";
			echo "</tbody>\n";
		}
		echo "</table></center>\n";
		
	} else if ($event_active == 0) {		
		echo "<br><br><br><ul><li> <b><span style=\"color:#DD0000\">Sorry, but the owner of this ".$word." is not accepting registrations at this time.</span></b>\n";
	} else {
		echo "<br><br><br><ul><li> <b><span style=\"color:#DD0000\">Sorry, but the deadline for ".$word." registrations was ".date("l, F j, Y",$event_deadline)."</span></b>\n";
	}
	
	if (authorize($event_owner)) echo "<P><table><tr><td><img src=\"gui/edit.gif\" border=0></td><td><a href=\"event_new_su.php?id=".$_GET["id"]."\">Edit ".$word." dates</a></td><td>| <a href=\"event_new.php?type=su&id=".$_GET["id"]."\">Edit header information</a></td><td>| <a href=\"/eventadmin_su.php?id=".$_GET["id"]."\" target=\"blank\">Manage Attendees</a></td></tr></table>";

	echo "</div>\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=".$event_owner."\">".$event_owner."</a></div>Content Owner: <a href=\"/profile.php?u=".$event_owner."\">".$event_owner."</a></div>\n";


include("_pageend.php");

?>