/** * Fraternity events are displayed with three action buttons: * Updated, Delete, and Show PNMs. * This function is the form handler for all three. * This function is going to add an event for the passed $frat_letters * This function is called from ifcrush_frat with $frat_letters **/ function ifcrush_event_handle_form($frat_letters) { global $debug; if ($debug) { echo "[ifcrush_event_handle_form] {$frat_letters}"; echo "<pre>"; print_r($_POST); echo "</pre>"; } $thisevent = array('eventID' => isset($_POST['eventID']) ? $_POST['eventID'] : "", 'eventDate' => $_POST['eventDate'], 'title' => $_POST['eventTitle'], 'fratID' => $frat_letters); // put the form input into an array switch ($_POST['action']) { case "Update Event": updateEvent($thisevent); break; case "Delete Event": deleteEvent($thisevent); break; case "Add Event": addEvent($thisevent); break; default: echo "[ifcrush_event_handle_form]: bad action"; } }
function content() { $event = NULL; if (isset($_GET['name'])) { $event = new Event($_GET['name']); eventForm($event); } elseif (strcmp($_POST['mode'], "Create New Event") == 0) { if (Player::getSessionPlayer()->isHost()) { if (isset($_POST['insert'])) { insertEvent(); eventList(); } else { eventForm(); } } else { authFailed(); } } elseif (strcmp($_GET['mode'], "create") == 0) { eventForm(); } elseif (isset($_POST['name'])) { $event = new Event($_POST['name']); if (!$event->authCheck($_SESSION['username'])) { authFailed(); } else { if (strcmp($_POST['mode'], "Parse DCI Files") == 0) { dciInput(); } elseif (strcmp($_POST['mode'], "Auto-Input Event Data") == 0) { autoInput(); } elseif (strcmp($_POST['mode'], "Update Registration") == 0) { updateReg(); } elseif (strcmp($_POST['mode'], "Update Match Listing") == 0) { updateMatches(); } elseif (strcmp($_POST['mode'], "Update Medals") == 0) { updateMedals(); } elseif (strcmp($_POST['mode'], "Upload Trophy") == 0) { if (insertTrophy()) { $event->hastrophy = 1; } } elseif (strcmp($_POST['mode'], "Update Event Info") == 0) { $event = updateEvent(); } eventForm($event); } } else { echo "<table style=\"border-width: 0px;\" align=\"center\">"; echo "<tr><td>"; echo "<form action=\"event.php\" method=\"post\">"; echo "<input type=\"submit\" name=\"mode\" value=\"Create New Event\">"; echo "</form></td><td>"; echo "<form action=\"format.php\" method=\"post\">"; echo "<input type=\"submit\" name=\"mode\" value=\"View/Add Formats\">"; echo "</form></td></tr>"; echo "</table><br><br>"; eventList($_POST['series'], $_POST['season']); } }
<?php session_start(); if (!isset($_SESSION['userId'])) { header("Location: ../index.php"); } include_once '../database/connection.php'; include_once '../database/events.php'; include_once '../php/formatting.php'; $eventType = filter_var($_POST['eventType'], FILTER_SANITIZE_SPECIAL_CHARS); $visibility = filter_var($_POST['visibility'], FILTER_SANITIZE_SPECIAL_CHARS); $imageURL = filter_var($_POST['imageURL'], FILTER_SANITIZE_SPECIAL_CHARS); $title = filter_var($_POST['title'], FILTER_SANITIZE_SPECIAL_CHARS); $description = filter_var($_POST['description'], FILTER_SANITIZE_SPECIAL_CHARS); $eventTime = filter_var($_POST['eventTime'], FILTER_SANITIZE_SPECIAL_CHARS); $eventId = filter_var($_POST['eventId'], FILTER_SANITIZE_SPECIAL_CHARS); updateEvent($eventType, $visibility, $imageURL, $title, $description, $eventTime, $eventId); header("Location: ../pages/event_item.php?id=" . $_POST['eventId'] . "#content");
<?php if (!isset($_POST['id'])) { die('No ID'); } if (!isset($_POST['title']) || trim($_POST['title']) == '') { die('Title is Mandatory'); } include_once 'database/connection.php'; include_once 'database/events.php'; include_once 'database/images.php'; try { $id = addImage(); updateEvent($_POST['id'], $_POST['title'], $_POST['introduction'], $_POST['fulltext'], $id, $_POST['event']); } catch (PDOException $e) { die($e->getMessage()); } header('Location: view_event.php?id=' . $_POST['id']);
<?php include 'header.php'; ?> <body> <?php include 'functions.php'; ?> <?php include 'connectdb.php'; ?> <?php //Getting data from the former page via POST method $id = $_POST["id"]; $status = $_POST["status"]; $title = $_POST["title"]; $content = $_POST["content"]; $date = $_POST["datetime"]; $place = $_POST["place"]; //Status of the post translating into a numeric value if ($status == 'Kararlaştırılmış Etkinlik') { $status = 1; updateEvent($id, $status, $title, $content, $date, $place); header("Location: events.php"); } else { $status = 0; updateEventSuggestion($id, $status, $title, $content); header("Location: event-suggestion.php"); } ?> </body> </html>
function schedEvent($postData, $iEventID = '') { global $mail; global $host; global $docroot; // take the input vals, call addEvent, and call addAssign // if we have an event_id, we do an update, else, we just add if ($iEventID) { $iEID = $iEventID; // we update the event, delete the currently assigned emps, and re-add the sub'd ones updateEvent($iEventID, sanitizeInput($postData['dDate']), sanitizeInput($postData['dStartTime']), sanitizeInput($postData['dEndTime']), sanitizeInput($postData['area']), sanitizeInput($postData['tbName'])); // now do the delete delAssign($iEventID); } else { // first add the event and get back the eventID $iEID = addEvent(sanitizeInput($postData['dDate']), sanitizeInput($postData['dStartTime']), sanitizeInput($postData['dEndTime']), sanitizeInput($postData['area']), sanitizeInput($postData['tbName'])); } // now we grab the positions for the area // and iterate through the emp lists, adding the assignments $oPositions = getAreaPos($postData['area']); $oEmps = getMyEmployees($_SESSION['USERID']); // grab data for email // get sender details $oSender = getUserVals($_SESSION['USERID']); // get event details $oEventDetails = getEventDetails($iEID); // set up email basics $mail->From = $oSender->user_email; $mail->FromName = $oSender->user_first . ' ' . $oSender->user_last; // if updated event, change subj line if ($iEventID) { $sSubj = "UPDATED: "; } else { $sSubj = ""; } $sSubj .= 'You have been scheduled for ' . $oEventDetails->event_name; $mail->Subject = $sSubj; // the message // handle updated event if ($iEventID) { $sBody = "The following event has been UPDATED!\n"; } else { $sBody = ""; } $sBody .= "You have been scheduled for the following:\n"; $sBody .= "Event Name: " . $oEventDetails->event_name . "\n"; $sBody .= "Event Date: " . date("l, F jS, Y", strtotime($oEventDetails->event_date)) . "\n"; $sBody .= "From: " . date("g:i a", strtotime($oEventDetails->event_start)) . " To: " . date("g:i a", strtotime($oEventDetails->event_end)) . "\n"; $sBody .= "\nPlease see http://" . $host . $docroot . " for more details.\n"; $sBody .= "Thanks, \n" . $oSender->user_first . " " . $oSender->user_last; // append to mail $mail->Body = $sBody; // iterate list $bAssigned = false; // this flag flips once an assignment is made foreach ($oEmps as $Emp) { if ($_POST['rad' . $Emp->user_id]) { $bAssigned = true; // flip the flag addAssign($Emp->user_id, $_POST['rad' . $Emp->user_id], $iEID); $mail->AddAddress($Emp->user_email, $Emp->user_first . " " . $Emp->user_last); } } // now check for curUser assign if ($_POST['rad' . $_SESSION['USERID']]) { addAssign($_SESSION['USERID'], $_POST['rad' . $_SESSION['USERID']], $iEID); } // send mail if checkbox checked and if >= 1 emp assigned if ($postData['chkMail'] && $bAssigned) { // send the mail if (!$mail->Send()) { accessDenied("There has been an error sending mail!"); } $mail->ClearAddresses(); $mail->ClearAttachments(); } return $iEID; }
function updateWeight($eid, $newWeight) { $CI = get_instance(); /* $data = array('weight' => $newWeight); $CI->db->where('eid', $eid); $CI->db->update('Events', $data);*/ updateEvent($eid, null, null, null, $newWeight); }
<section class="index"> <?php $appID = $_POST['appID']; $title = $_POST['title']; $location = $_POST['location']; $start = $_POST['start_year'] . '-' . $_POST['start_month'] . '-' . $_POST['start_day'] . ' ' . $_POST['start_hour'] . ':' . $_POST['start_min'] . ':00'; $end = $_POST['end_year'] . '-' . $_POST['end_month'] . '-' . $_POST['end_day'] . ' ' . $_POST['end_hour'] . ':' . $_POST['end_min'] . ':00'; $label = $_POST['label']; $secret = $_POST['secret']; //$moment = $_POST['start_hour'] . ':' . $_POST['start_min'] . ':00'; //$date = $_POST['date_year'] . '-' . $_POST['date_month'] . '-' . $_POST['date_day']; updateEvent($appID, $userID, $title, $location, $start, $end, $label, $secret); echo '<p class="succes">Event successfully updated.</p>'; /*if (amIInAnAppointment($moment, $date, $userID)==false && amIInAnAppointment($moment, $date, $userID)==false && $invitee!=0){ postEvent($userID, $title, $location, $start, $end, $invitee, $label); postEvent($invitee, $title, $location, $start, $end, $userID, $label); echo '<p class="succes">Event added to your and your invitees agenda.</p>'; } else if (amIInAnAppointment($moment, $date, $userID)==false && amIInAnAppointment($moment, $date, $userID)==true && $invitee!=0){ postEvent($userID, $title, $location, $start, $end, $invitee, $label); echo '<p class="succes">The event was added to your agenda. But your colleague seems to already be in an appointment. A mail was sent.</p>'; } else if (amIInAnAppointment($moment, $date, $userID)==false && $invitee==0){ postEvent($userID, $title, $location, $start, $end, $invitee, $label); echo '<p class="succes">The event was added to your agenda.</p>'; } else { echo '<p class="succes">The event could not be added, you already have an appointment planned at that time.</p>'; }*/ ?> </section>
} else { echo "Usage: php {$argv[0]} {$argv[1]} <username> <password> <fullTextQuery>\n"; } break; case 'outputCalendarList': if ($argc == 4) { $client = getClientLoginHttpClient($argv[2], $argv[3]); outputCalendarList($client); } else { echo "Usage: php {$argv[0]} {$argv[1]} <username> <password>\n"; } break; case 'updateEvent': if ($argc == 6) { $client = getClientLoginHttpClient($argv[2], $argv[3]); updateEvent($client, $argv[4], $argv[5]); } else { echo "Usage: php {$argv[0]} {$argv[1]} <username> <password> " . "<eventId> <newTitle>\n"; } break; case 'setReminder': if ($argc == 6) { $client = getClientLoginHttpClient($argv[2], $argv[3]); setReminder($client, $argv[4], $argv[5]); } else { echo "Usage: php {$argv[0]} {$argv[1]} <username> <password> " . "<eventId> <minutes>\n"; } break; case 'addExtendedProperty': if ($argc == 7) { $client = getClientLoginHttpClient($argv[2], $argv[3]);
$_POST['error'] = $error; if ($error == "NoError") { updateSection($_POST['nom'], $_POST['couleur'], $_POST['image'], $_POST['desc'], $jeu->idjeux); header('Location : index.php?page=admin'); } else { echo "<div class='error' >" . $error . "</div>"; } } if (isset($_GET['event'])) { $event = recupEvent($_GET['event']); } if (isset($_POST['editerEvent'])) { $error = checkEventEdition($event); $_POST['error'] = $error; if ($error == "NoError") { updateEvent($_POST['nom'], $_POST['type'], $_POST['date'], $_POST['heure'], $_POST['localisation'], $_POST['image'], $_POST['jeux'], $_POST['desc'], $event->idevent); header('Location : index.php?page=admin'); } else { echo "<div class='error' >" . $error . "</div>"; } } /******************************************************/ /* Suppression */ /******************************************************/ if (isset($_GET['supprimer'])) { switch ($_GET['supprimer']) { case 'User': $listeUser = recupListeUser(); break; case 'News': $listeNews = recupListeNews();
out($matches); } else { out(null, 'You must supply a valid start and end date'); } break; case 'add': if (isset($event)) { // The id column is auto-increment, so remove if passed in unset($event['id']); $result = addEvent($event); } out($result); break; case 'update': if (isset($event)) { $result = updateEvent($event); } out($result); break; case 'delete': if (isset($event)) { $result = deleteEvent($event); } if ($result === 1) { // Return the deleted id instead of row count $result = $event['id']; } out($result); break; } } catch (Exception $e) {
function content() { $event = NULL; // Prevent surplufous warnings. TODO: fix the code so we don't try to access these if unset. if (!isset($_GET['action'])) { $_GET['action'] = ''; } if (!isset($_POST['mode'])) { $_POST['mode'] = ''; } if (!isset($_GET['mode'])) { $_GET['mode'] = ''; } if (!isset($_GET['series'])) { $_GET['series'] = ''; } if (!isset($_GET['season'])) { $_GET['season'] = ''; } $player = Player::getSessionPlayer(); if ((isset($_GET['name']) || isset($_POST['name'])) && !mode_is("Create New Event")) { if (isset($_POST['name'])) { $eventname = $_POST['name']; } else { $eventname = $_GET['name']; } $event = new Event($eventname); } // if -- can create new events if (Player::getSessionPlayer()->isSteward()) { if (mode_is("Create New Event")) { if (isset($_POST['insert'])) { $event = insertEvent(); eventForm($event); } else { eventForm(); } return; } elseif (mode_is("Create Next Event")) { $oldevent = new Event($_POST['name']); $newevent = new Event(""); $newevent->season = $oldevent->season; $newevent->number = $oldevent->number + 1; $newevent->format = $oldevent->format; $newevent->start = strftime("%Y-%m-%d %H:00:00", strtotime($oldevent->start) + 86400 * 7); $newevent->kvalue = $oldevent->kvalue; $newevent->finalized = 0; $newevent->player_editdecks = 1; $newevent->player_reportable = $oldevent->player_reportable; $newevent->prereg_allowed = $oldevent->prereg_allowed; $newevent->series = $oldevent->series; $newevent->host = $oldevent->host; $newevent->cohost = $oldevent->cohost; $newevent->mainrounds = $oldevent->mainrounds; $newevent->mainstruct = $oldevent->mainstruct; $newevent->finalrounds = $oldevent->finalrounds; $newevent->finalstruct = $oldevent->finalstruct; $newevent->name = sprintf("%s %d.%02d", $newevent->series, $newevent->season, $newevent->number); eventForm($newevent, true); return; } else { if (!isset($event)) { if (!isset($_POST['series'])) { $_POST['series'] = ''; } if (!isset($_POST['season'])) { $_POST['season'] = ''; } eventList($_POST['series'], $_POST['season']); } } } if ($event && $event->authCheck($player)) { if (strcmp($_GET['action'], "undrop") == 0) { $event->undropPlayer($_GET['player']); } if (mode_is("Start Event")) { $event->active = 1; $event->save(); $entries = $event->getEntries(); Standings::startEvent($entries, $event->name); $event->pairCurrentRound(); } if (mode_is("Recalculate Standings")) { $structure = $event->mainstruct; $event->recalculateScores($structure); Standings::updateStandings($event->name, $event->mainid, 1); } if (mode_is("Reset Event")) { $event->resetEvent(); } if (mode_is("Delete Matches and Re-Pair Round")) { $event->repairRound(); } if (mode_is("Reactivate Event")) { $event->active = 1; $event->player_editdecks = 1; $event->finalized = 0; $event->save(); } if (mode_is("Assign Medals")) { $event->assignMedals(); } if (mode_is("Parse DCI Files")) { dciInput(); } elseif (mode_is("Parse DCIv3 Files")) { dci3Input(); } elseif (mode_is("Auto-Input Event Data")) { autoInput(); } elseif (mode_is("Update Registration")) { updateReg(); } elseif (mode_is("Update Match Listing")) { updateMatches(); } elseif (mode_is("Update Medals")) { updateMedals(); } elseif (mode_is("Update Adjustments")) { updateAdjustments(); } elseif (mode_is("Upload Trophy")) { if (insertTrophy()) { $event->hastrophy = 1; } } elseif (mode_is("Update Event Info")) { $event = updateEvent(); } eventForm($event); } else { authFailed(); } }
public function update() { updateEvent($this->name, $this->description, $this->date, $this->public); }
newCalendar($user2, 'google'); $ds = createDBdate($today['year'], $today['mon'], 6, 14, 0, 0); $de = createDBdate($today['year'], $today['mon'], 6, 16, 0, 0); insertEvent($user2, 'google', 'Autumn', $ds, $de, 1); addMemberToGroup($kkk, $user3); // acceptGroup(1,$user3); rejectGroup($kkk, $user3); newCalendar($user2, 'outlook'); $ds = createDBdate($today['year'], $today['mon'], 6, 16, 0, 0); $de = createDBdate($today['year'], $today['mon'], 6, 18, 0, 0); insertEvent($user2, 'outlook', 'Winter', $ds, $de, 1); insertUser('noEventGuy', 'password', null); addMemberToGroup($kkk, 'noEventGuy'); acceptGroup($kkk, 'noEventGuy'); } updateEvent(5, 'Lunch 3', null, null, null); displayAllEvents($user, 'unsw'); //$results = getEvents($user,'unsw'); $results = getEventsForAMonth($user, 'unsw', 10, 2014); //print_r($results); print "--------------- Calendars of {$user} ---------------\n"; printTable(getCalendars($user)); print_r($results); print "--------------- All groups {$user} belongs to ---------------\n"; printTable(memberOf($user)); foreach (memberOf($user) as $group) { if ($group['name'] == 'KKK') { $kkk = $group['gid']; } } print "---------------------- Members of KKK ---------------\n";
} } if (!empty($_POST) && !empty($push)) { // Affiche les champs à jour avec ce qui a été saisi dans le formulaire. foreach ($push as $cle => $valeur) { $contents['values'][$cle] = $push[$cle]; } foreach ($nameTranslation as $cle => $value) { $contents['values'][$value] = $push[$cle]; } } if (empty($errors)) { $push['id_media_principal'] = $contents['values']['id_media_principal']; $push['max_type'] = count($contents['types']); $push['id'] = $_GET['id']; if (updateEvent($push)) { alert("info", "Votre évènement a bien été modifié."); header('Location: ' . getLink(['events', 'display', $_GET['id']])); exit; } } else { $contents['errors']['general'] = '<p id="mainError">Nous n\'avons pas validé vos changements, il y a au moins une entrée invalide.</p>'; foreach ($errors as $key => $value) { $contents['errors'][$key] = '<p class="formError">' . $value . '</p>'; } } } // /**** préparation de la vue ****/ $title = 'Modifier mon évènement'; $styles = ['form.css', 'accueil.css', 'search.css', 'prettyform.css']; $blocks = ['modify'];
function updateEvents() { foreach (getSpreadsheets() as $spreadsheet) { $events = spreadsheetToArray($spreadsheet); foreach ($events as $event) { // reload locations as we dynamically create them if missing /* $locations = getLocationIDs(); $event['locationid'] = @$locations[$event['venue']]; if($event['locationid'] == '') $event['locationid'] = addLocation($event['venue']); */ updateEvent($event); } } }
case "changeMonth": $cal_obj = new EventCalendar($request_obj); echo $cal_obj->createTable(); break; case "eventDay": switch ($request_obj->action) { case "POST": if ($request_obj->account_priv == "Officer" or $request_obj->account_priv == "Admin") { createNewEvent($request_obj); } $cal_obj = new EventCalendar($request_obj); echo $cal_obj->createTable(); break; case "PUT": if ($request_obj->account_priv == "Officer" or $request_obj->account_priv == "Admin") { updateEvent($request_obj); } $cal_obj = new EventCalendar($request_obj); echo $cal_obj->createTable(); break; case "GET": $event_day = new EventDay($request_obj); $event = getEventInfo($request_obj); $event_day->fillEventInfo($event); echo $event_day->displayEvent(); break; case "DELETE": if ($request_obj->account_priv == "Officer" or $request_obj->account_priv == "Admin") { deleteEvent($request_obj); } $cal_obj = new EventCalendar($request_obj);
if (!isset($_SESSION['authUser'])) { $cancelProcess = true; header("Location: login.php"); } if (isset($_POST['saveevent']) && !$cancelProcess) { $eventname = $_POST['eventname']; $startdate = $_POST['startdate']; $enddate = $_POST['enddate']; $userid = $_SESSION['UserID']; $capacity = $_POST['capacity']; $displaycapacity = $_POST['displaycapacity']; $eventid = $_POST['eventid']; if ($eventid == "") { $task = createEvent($eventname, $startdate, $enddate, $userid, $capacity, $displaycapacity); } else { $task = updateEvent($eventname, $startdate, $enddate, $userid, $capacity, $displaycapacity, $eventid); } if (!$task) { $data = array("success" => false, "message" => "Error!"); } else { $data = array("success" => true, "message" => "Success!", "id" => $task); } echo json_encode($data); } //saveevent if (isset($_POST['deleteEvent']) && !$cancelProcess) { $userid = $_SESSION['UserID']; $eventid = $_POST['eventid']; $task = deleteEvent($userid, $eventid); if (!$task) { $data = array("success" => false, "message" => "Error!");
if (ALLOW_ACCESS_BY == 'login' || ADMIN_CAN_LOGIN_FROM_ADMIN_URL === true && stristr($_SERVER['SCRIPT_NAME'], '/admin')) { if (!User::isLoggedIn()) { echo json_encode(array('success' => false, 'notloggedin' => true, 'error' => 'You are not logged in')); exit; } } } switch ($_GET['action']) { case 'start': getEvents(); break; case 'add': addEvent(); break; case 'update': updateEvent(); break; case 'resize': resizeEvent(); break; case 'del': deleteEvent(); break; case 'get_cal': getCalendar(); break; case 'mail_event': mailEvent(); break; default: break;
public function json_ModifyEvent() { //function updateEvent($eid,$ename,$estart,$eend,$weight){ $data = json_decode(file_get_contents('php://input'), true); if (!(isset($data['id']) && $data['id'] > 0)) { $return['error'] = -3; $return['value'] = "Event id is not set/valid!"; $return['passed'] = $data; } else { $title = null; $start = null; $end = null; $weight = null; $eid = $data['id']; if (isset($data['title'])) { $title = $data['title']; } if (isset($data['start'])) { $start = $data['start']; } if (isset($data['end'])) { $end = $data['end']; } if (isset($data['weight'])) { $weight = $data['weight']; } updateEvent($eid, $title, $start, $end, $weight); //$data['id'], $data['title'], $data['start'], $data['end'], $data['weight']); $return['error'] = 0; } $jsonstring = json_encode($return); echo $jsonstring; }