function process_editsponsor_form($smarty) { global $Link; global $SPONSOR; $errors = array(); $sname = format_doublequotes($_POST['sponsorname']); $surl = $_POST['sponsorurl']; $sabout = format_paragraph(format_doublequotes($_POST['sponsorabout'])); $sponsorNameInsertSQL = 'UPDATE ' . SPONSORS . ' SET sponsorName="' . $sname . '", sponsorURL="' . $surl . '", sponsorAbout="' . $sabout . '"'; if ($_FILES['logo']['size'] > 0 && ($_FILES['logo']['type'] == 'image/jpeg' || $_FILES['logo']['type'] == 'image/gif')) { $sponsorNameInsertSQL .= get_logo_sql_info(); } $sponsorNameInsertSQL .= ' WHERE sponsorID=' . $SPONSOR; $sponsorNameInsertResult = mysql_query($sponsorNameInsertSQL, $Link) or die("sp_clubs (Line " . __LINE__ . "): " . mysql_errno() . ": " . mysql_error()); return $errors; }
function process_addannouncement_form($smarty) { global $userID; global $Link; $errors = array(); $atitle = format_doublequotes($_POST['announcementtitle']); $abody = format_paragraph(format_doublequotes($_POST['announcementbody'])); $abegin = mktime(0, 0, 0, $_POST['bMonth'], $_POST['bDay'], $_POST['bYear'], -1); $aend = mktime(23, 59, 59, $_POST['eMonth'], $_POST['eDay'], $_POST['eYear'], -1); $announceColumns = '`announceTitle`,`announcement`,`announceBeginDate`,`announceEndDate`,`userID`'; $announceInsertSQL = 'INSERT INTO ' . ANNOUNCEMENTS . ' (' . $announceColumns . ') VALUES ("' . $atitle . '","' . $abody . '","' . $abegin . '","' . $aend . '","' . $userID . '")'; $announceInsertResult = mysql_query($announceInsertSQL, $Link) or die("sp_clubs (Line " . __LINE__ . "): " . mysql_errno() . ": " . mysql_error()); return $errors; }
function process_addnewaward_form($smarty) { global $Link; global $SEASON; $errors = array(); $award = format_doublequotes($_POST['award']); $recipient = format_doublequotes($_POST['recipient']); $seasonID = $_POST['season']; $priority = $_POST['priority']; $about = format_paragraph(format_doublequotes($_POST['about'])); $awardInsert = 'INSERT INTO ' . AWARDS . ' (`seasonID`, `award`, `recipient`, `priority`, `about`'; if ($_FILES['image']['size'] > 0 && ($_FILES['image']['type'] == 'image/jpeg' || $_FILES['image']['type'] == 'image/gif')) { $awardInsert .= ', `image`, `imageWidth`, `imageHeight`'; } $awardInsert .= ') VALUES (' . $seasonID . ', "' . $award . '", "' . $recipient . '", "' . $priority . '", "' . $about . '"'; if ($_FILES['image']['size'] > 0 && ($_FILES['image']['type'] == 'image/jpeg' || $_FILES['image']['type'] == 'image/gif')) { $awardInsert .= get_image_sql_info(); } $awardInsert .= ')'; $awardResult = mysql_query($awardInsert, $Link) or die("sp_clubs (Line " . __LINE__ . "): " . mysql_errno() . ": " . mysql_error()); return $errors; }
function process_addnewsponsor_form($smarty) { global $Link; $errors = array(); $sname = format_doublequotes($_POST['sponsorname']); $surl = $_POST['sponsorurl']; $sabout = format_paragraph(format_doublequotes($_POST['sponsorabout'])); $sponsorNameInsertSQL = 'INSERT INTO ' . SPONSORS . ' (`sponsorName`, `sponsorURL`, `sponsorAbout`'; if ($_FILES['logo']['size'] > 0 && ($_FILES['logo']['type'] == 'image/jpeg' || $_FILES['logo']['type'] == 'image/gif')) { $sponsorNameInsertSQL .= ', `sponsorLogo`, `sponsorLogoWidth`, `sponsorLogoHeight`'; } $sponsorNameInsertSQL .= ') VALUES ("' . $sname . '", "' . $surl . '", "' . $sabout . '"'; if ($_FILES['logo']['size'] > 0 && ($_FILES['logo']['type'] == 'image/jpeg' || $_FILES['logo']['type'] == 'image/gif')) { $sponsorNameInsertSQL .= get_logo_sql_info(); } $sponsorNameInsertSQL .= ')'; $sponsorNameInsertResult = mysql_query($sponsorNameInsertSQL, $Link) or die("sp_clubs (Line " . __LINE__ . "): " . mysql_errno() . ": " . mysql_error()); return $errors; }
function process_editaward_form($smarty) { global $Link; global $AWARD; $errors = array(); $award = format_doublequotes($_POST['awardName']); $recipient = format_doublequotes($_POST['recipient']); $seasonID = $_POST['season']; $priority = $_POST['priority']; $about = format_paragraph(format_doublequotes($_POST['about'])); $awardNameUpdate = 'UPDATE ' . AWARDS . ' SET award="' . $award . '", recipient="' . $recipient . '", about="' . $about . '", priority="' . $priority . '", seasonID=' . $seasonID . ''; if ($_FILES['image']['size'] > 0 && ($_FILES['image']['type'] == 'image/jpeg' || $_FILES['image']['type'] == 'image/gif')) { $awardNameUpdate .= get_image_sql_info(); } $awardNameUpdate .= ' WHERE awardID=' . $AWARD; $awardNameResult = mysql_query($awardNameUpdate, $Link) or die("sp_clubs (Line " . __LINE__ . "): " . mysql_errno() . ": " . mysql_error()); return $errors; }