function showEventBrief($idEvent, $showRelationship = true) { if (!isUserLoggedIn()) { throw new RuntimeException("You need to be logged in."); } if (!canSeeEvent($_SESSION["userid"], $idEvent)) { throw new RuntimeException("You do not have access to this event."); } $event = getEvent($idEvent); $canEdit = isUserLoggedIn() && $event["owner"] === getUserID(); echo '<div class="event_brief" id="event' . $idEvent . '">'; echo '<div class="name"><a href="view_event.php?id=' . $idEvent . '">'; echo '<h2>' . htmlspecialchars($event["name"]) . '</h2>'; echo '</a></div>'; if ($showRelationship) { if ($canEdit) { echo '<div class="owner"></div>'; } else { if (isUserRegisteredInEvent(getUserID(), $idEvent)) { echo '<div class="registered"></div>'; } else { echo '<div class="not_registered"></div>'; } } } echo '<img src="database/event_image.php?id=' . $idEvent . '" alt="' . htmlspecialchars($event["name"]) . '" width="64" height="64" />'; echo '<div class="description">'; echo '<p class="description">' . htmlspecialchars($event["description"]) . '</p>'; echo '</div>'; echo '<datetime>' . htmlspecialchars($event["date"]) . '</datetime>'; echo '</div>'; }
function getMeeting($u_ID, $year, $level) { $query = mysql_query("select distinct meeting.meeting from content, event, content_user, meeting where content_user.u_ID = '{$u_ID}' and content_user.c_ID = content.c_ID and content.e_ID = event.e_ID and event.m_ID = meeting.m_ID and meeting.year = '{$year}' order by meeting.meeting asc"); while ($ans = mysql_fetch_array($query)) { if ($level > 1) { getEvent($ans['meeting'], $u_ID, $level); } } }
function showResults() { #---------------------------------------------------------------------- global $chosenEventId, $chosenRegionId, $chosenYears, $chosenShow, $chosenSingle, $chosenAverage; #--- Try the cache tryCache('event', $chosenEventId, preg_replace('/ /', '', $chosenRegionId), $chosenYears, preg_replace('/ /', '', $chosenShow), $chosenSingle, $chosenAverage); #------------------------------ # Prepare stuff for the query. #------------------------------ $eventCondition = eventCondition(); $yearCondition = yearCondition(); $regionCondition = regionCondition('result'); $limitCondition = ''; if (preg_match('/^10+/', $chosenShow, $matches)) { $limitNumber = $matches[0]; $limitCondition = 'LIMIT ' . 2 * $limitNumber; } $valueSource = $chosenAverage ? 'average' : 'best'; $valueName = $chosenAverage ? 'Average' : 'Single'; #------------------------------ # Get results from database. #------------------------------ if ($chosenShow == 'By Region') { require 'includes/events_regions.php'; return; } if ($chosenShow == '100 Results' || $chosenShow == '1000 Results') { require 'includes/events_results.php'; } else { require 'includes/events_persons.php'; } #------------------------------ # Show the table. #------------------------------ startTimer(); $event = getEvent($chosenEventId); tableBegin('results', 6); tableCaption(true, spaced(array($event['name'], chosenRegionName(), $chosenYears, $chosenShow))); $headerSources = $chosenAverage ? 'Result Details' : ''; tableHeader(explode('|', "Rank|Person|Result|Citizen of|Competition|{$headerSources}"), array(0 => "class='r'", 2 => "class='R2'", 5 => 'class="f"')); $ctr = 0; foreach ($results as $result) { extract($result); $ctr++; $no = isset($previousValue) && $value == $previousValue ? ' ' : $ctr; if ($limitCondition && $no > $limitNumber) { break; } tableRow(array($no, personLink($personId, $personName), formatValue($value, $event['format']), htmlEntities($countryName), competitionLink($competitionId, $competitionName), formatAverageSources($chosenAverage, $result, $event['format']))); $previousValue = $value; } tableEnd(); stopTimer("printing the table"); }
/** * Created by PhpStorm. * User: andry * Date: 13.01.16 * Time: 16:48 */ function ajax() { switch ($_GET['action']) { case 'getEvent': $arr = getEvent(); echo $arr; break; default: break; } }
function getMeeting($u_ID, $year, $level) { $query = mysql_query("select distinct meeting.meeting from content, event, content_user, meeting where content_user.u_ID = '{$u_ID}' and content_user.c_ID = content.c_ID and content.e_ID = event.e_ID and event.m_ID = meeting.m_ID and meeting.year = '{$year}'"); while ($ans = mysql_fetch_array($query)) { echo "<div style='border:1px solid #000;padding:5px 15px;margin-top:5px'>"; echo "<h3 style='margin:10px'>" . $year . "-第" . $ans['meeting'] . "次校长办公会" . "</h3>"; if ($level > 1) { getEvent($ans['meeting'], $u_ID, $level); } echo "</div>"; } }
public static function find($id) { $event_query = getEvent($id); $event = new Event(); $event->setId($event_query["id"]); $event->setDate($event_query["date"]); $event->setDescription($event_query["description"]); $event->setName($event_query["name"]); $event->setPublic($event_query["public"]); $event->setOwner($event_query["owner"]); $event->setImagePath($event_query["imagePath"]); return $event; }
function getMeeting($u_ID, $year, $level) { $query = mysql_query("select distinct meeting.meeting from content, event, content_user, meeting where content_user.u_ID = '{$u_ID}' and content_user.c_ID = content.c_ID and content.e_ID = event.e_ID and event.m_ID = meeting.m_ID and meeting.year = '{$year}'"); while ($ans = mysql_fetch_array($query)) { echo "<tr>"; echo "<td colspan='11'>"; echo "<h3 style='margin:10px'>" . $year . "-第" . $ans['meeting'] . "次校长办公会" . "</h3>"; if ($level > 1) { getEvent($ans['meeting'], $u_ID, $level); } echo "</td>"; echo "</tr>"; } }
function getMeeting($u_ID, $year, $level) { $query = mysql_query("select distinct meeting.meeting,meeting.m_ID from content, event, content_user, meeting where content_user.u_ID = '{$u_ID}' and content_user.c_ID = content.c_ID and content.e_ID = event.e_ID and event.m_ID = meeting.m_ID and meeting.year = '{$year}' order by meeting.meeting asc"); while ($ans = mysql_fetch_array($query)) { $result = getMeetingCompletion($ans['m_ID']); $mid = $ans['m_ID']; echo "<tr>"; echo "<td><div class='container-fluid'><div class='row'>"; echo "<div class='col-lg-12 lv-meeting' style='background-color:rgb(128,185,188); border-radius:0.5em; padding:5px;'><span style='font-size:1.5em;'>" . $year . "-第" . $ans['meeting'] . "次校长办公会" . "</span><span class='pull-right' style='padding:5px;'>实际完成率:{$result['0']}%; 参考完成率: {$result['1']}%;</span></div>"; getEvent($ans['meeting'], $u_ID, $level); echo "</div></div></td>"; echo "</tr>"; } }
function showEventDetails() { $EventID = $_GET['EventID']; if (!isset($EventID)) { $errorMessage = 'You must provide an EventID to display.'; include '../view/404.php'; } else { $row = getEvent($EventID); if ($row == FALSE) { $errorMessage = 'No event was found.'; include '../view/404.php'; } else { include '../view/eventDetails.php'; } } }
function g_cal_updateEvent($client, $eventEditUrl, $title = '', $desc = '', $where = '', $startDate = '', $endDate = '') { $gdataCal = new Zend_Gdata_Calendar($client); if ($eventOld = $gdataCal->getEvent($eventId)) { echo "Old title: " . $eventOld->title->text . "<br />\n"; $eventOld->title = $gdataCal->newTitle($newTitle); try { $eventOld->save(); } catch (Zend_Gdata_App_Exception $e) { var_dump($e); return null; } $eventNew = getEvent($client, $eventId); echo "New title: " . $eventNew->title->text . "<br />\n"; return $eventNew; } else { return null; } }
<?php session_start(); include_once "database/events.php"; $id = $_GET['id']; $event = getEvent($id); if (isset($_SESSION['username'])) { if ($_SESSION['username'] == 'admin' || $_SESSION['username'] == $event['creator']) { deleteEvent($id, $_SESSION['username']); } } header('Location: ' . './list_events.php');
$out = register($_POST['email'], $_POST['password'], $_POST['nickname']); break; case 'getRowById': $out = getRowById($_POST['table'], $_POST['id']); break; case 'getRowByColumn': $out = getRowByColumn($_POST['table'], $_POST['source_column'], $_POST['value']); break; case 'getColumnByColumn': $out = getColumnByColumn($_POST['table'], $_POST['source_column'], $_POST['value'], $_POST['returned_column']); break; case 'addEvent': $out = addEvent($_POST['id_sport'], $_POST['id_location'], $_POST['date'], $_POST['time'], $_POST['description'], $_POST['id_user']); break; case 'getEvent': $out = getEvent($_POST['id_sport'], $_POST['id_location'], $_POST['date']); break; case 'getHistoryForPlayer': $out = getHistoryForPlayer($_POST['id_user']); break; case 'getUpcomingEvents': $out = getUpcomingEvents($_POST['id_user']); break; case 'getEventBySportName': $out = getEventBySportName($_POST['name_sport'], $_POST['name_location'], $_POST['date']); break; case 'getNewEventsForUser': $out = getNewEventsForUser($_POST['id_user']); break; case 'updateChatForEvent': $out = updateChatForEvent($_POST['id_event'], $_POST['chat']);
$authenticatedMachines = $stmt->fetchAll(); return $authenticatedMachines; } $sanitizer = Sanitizer::getInstance(); $username = $sanitizer->filterString('username'); $password = $sanitizer->filterString('password'); $isStaff = $sanitizer->filterString('fullrequest'); try { Session::checkCredentials($username, $password); $user = User::getUser($username); } catch (\libAllure\UserNotFoundException $e) { apiReturn('reject-authentication', 'User not found'); } catch (\libAllure\IncorrectPasswordException $e) { apiReturn('reject-authentication', 'Password is incorrect'); } $event = getEvent(); $signupStatus = getSignupStatus($user->getId(), $event['id']); switch ($signupStatus) { case 'PAID': $authenticatedMachines = getAuthenticatedMachines($user->getId(), $event['id']); $sql = 'SELECT s.numberMachinesAllowed FROM signups s WHERE s.user = :user AND s.event = :event'; $stmt = DatabaseFactory::getInstance()->prepare($sql); $stmt->bindValue(':user', $user->getId()); $stmt->bindValue(':event', $event['id']); $stmt->execute(); $signup = $stmt->fetchRowNotNull(); if (count($authenticatedMachines) >= $signup['numberMachinesAllowed']) { apiReturn('reject-overuse'); } else { $sql = 'INSERT INTO authenticated_machines (user, event, seat, ip, hostname, mac) VALUES (:user, :event, :seat, :ip, :hostname, :mac)'; $stmt = DatabaseFactory::getInstance()->prepare($sql);
//RESPONSE \"([[:ascii:]]+?)\" \"([[:ascii:]]+?)\" $F = getParameters($front); $D = getParameters($data); $State['IdArray_Token'] = $D[0]; $State['IdArray_base64'] = $D[1]; $State['IdArray'] = unpack("N*", base64_decode($D[1])); $musicDB = new MusicDB(); CheckPlaylist($musicDB); $musicDB->close(); } Send(""); $DataHandled = true; } elseif (strpos($data, "EVENT ") !== false) { // EVENTs are sent by Your linn - those that were subscribed // to. We think the below ones are interesting.... $E = getEvent($data); if (strpos($data, "EVENT " . $SubscribeType['Ds/Product']) !== false) { if (strpos($data, "SourceIndex ") !== false) { $State['SourceIndex'] = $E[SourceIndex]; } if (strpos($data, "ProductModel ") !== false) { $State['ProductModel'] = $E[ProductModel]; } if (strpos($data, "ProductName ") !== false) { $State['ProductName'] = $E[ProductName]; } if (strpos($data, "ProductRoom ") !== false) { $State['ProductRoom'] = $E[ProductRoom]; } if (strpos($data, "ProductType ") !== false) { $State['ProductType'] = $E[ProductType];
require INCLUDES_PATH . "/edit_event_image_action.php"; try { if (!isset($_GET["id"])) { http_response_code(400); showError('Missing event ID.'); } else { if (!isUserLoggedIn()) { http_response_code(403); showError('You need to login to view this event.'); } else { if (!canSeeEvent($_SESSION["userid"], $_GET["id"])) { http_response_code(403); showError('You do not have access to this event.'); } else { $idEvent = $_GET["id"]; $event = getEvent($idEvent); $canEdit = isUserLoggedIn() && $event["owner"] === getUserID(); echo '<div class="event" id="event' . $idEvent . '">'; if ($canEdit) { echo '<a href="delete_event.php?id=' . $idEvent . '&csrf_token=' . rawurlencode($_SESSION['csrf_token']) . '" class="delete" id="delete_event" onclick="return confirm(\'Are you sure you want to delete this event?\');"><div alt="Delete Event"></div></a>'; $public = $event["public"]; if ($public) { echo '<a href="change_event_privacy.php?id=' . $idEvent . '&action=0&csrf_token=' . rawurlencode($_SESSION['csrf_token']) . '" class="change_privacy public" id="change_privacy"><div alt="Change Event Privacy"></div><p class="description">Make me private</p></a>'; } else { echo '<a href="change_event_privacy.php?id=' . $idEvent . '&action=1&csrf_token=' . rawurlencode($_SESSION['csrf_token']) . '" class="change_privacy private" id="change_privacy"><div alt="Change Event Privacy"></div><p class="description">Make me public</p></a>'; } echo '<div class="registration owner"></div>'; echo '<form class="invite_user" action="invite_user.php" method="get">'; echo '<input type="hidden" name="csrf_token" value="' . $_SESSION['csrf_token'] . '" />'; echo '<input type="hidden" name="idEvent" value="' . $idEvent . '" />'; echo '<input type="text" value="" placeholder="Invite user" name="invited_username" required/>';
<?php session_start(); require_once "../../inc/config.php"; require_once ROOT_PATH . "inc/database.php"; include ROOT_PATH . "inc/header.php"; // TODO: clean $_GET["event_id"]; $event = getEvent($_GET["event_id"]); $admin = getUser($_SESSION["user_id"]); if ($_SERVER["REQUEST_METHOD"] == "POST") { // process the event deletion if (password_verify($_POST["admin_password"], $admin["password"])) { deleteEvent($event["event_id"]); $_SESSION["delete"] = true; } else { $_SESSION["incorrect-password"] = true; } header("Location:/admin/events/delete/" . $event["event_id"]); } else { ?> <html> <?php include ROOT_PATH . "inc/head.php"; ?> <body> <div class="wrapper content"> <div class="row"> <nav class="col-20"> <ul class="side-nav"> <li><a href="/admin/users/">User Accounts</a></li> <li class="selected">
<?php require_once 'connect.php'; require_once 'mailer.php'; $post = file_get_contents("php://input"); $postData = json_decode($post, true); $data['result'] = false; $data['postData'] = $postData; if (isset($postData['choice']) && !empty($postData['choice']) && isset($postData['choiceId']) && !empty($postData['choiceId']) && isset($postData['event_date_id']) && !empty($postData['event_date_id']) && isset($postData['event_id']) && !empty($postData['event_id'])) { $choice = $postData['choice']; $choiceId = $postData['choiceId']; $event_date_id = $postData['event_date_id']; if ($choice == 1 || $choice == 2 || $choice == 3) { $event = getEvent($postData['event_id']); if ($event) { $qry = "UPDATE \n\t\t\t\t\t\tdate_userchoice\n\t\t\t\t\tSET\n\t\t\t\t\t\tchoice = '" . mysqli_real_escape_string($connection, $choice) . "'\n\t\t\t\t\tWHERE \n\t\t\t\t\t\tid = '" . mysqli_real_escape_string($connection, $choiceId) . "'\n\t\t\t\t\tAND\n\t\t\t\t\t\tevent_date_id = '" . mysqli_real_escape_string($connection, $event_date_id) . "'"; $result = mysqli_query($connection, $qry); if ($result) { $data['result'] = true; if (allUsersMadeChoice($event['id'])) { $creatorOfEvent = getCreatorOfEvent($event['id']); if ($creatorOfEvent) { $html = ' Hoi ' . $creatorOfEvent['name'] . ',<br> Iedereen heeft een datum gekozen voor je evenement <b>' . $event['name'] . '</b><br> <a href="http://www.tengwerda.nl/prikkr/#/event/overview/' . $event['code'] . '/' . $creatorOfEvent['code'] . '">Bekijk welke geschikte datum(s) er zijn!</a>.<br> '; mailIt($creatorOfEvent['email'], 'De stemmen zijn geteld voor "' . $creatorOfEvent['name'] . '" op Prikkr', $html); } } }
/** * Deletes the event specified by retrieving the atom entry object * and calling Zend_Feed_EntryAtom::delete() method. This is for * example purposes only, as it is inefficient to retrieve the entire * atom entry only for the purposes of deleting it. * * @param Zend_Http_Client $client The authenticated client object * @param string $eventId The event ID string * @return void */ function deleteEventById(Zend_Http_Client $client, $eventId) { $event = getEvent($client, $eventId); $event->delete(); }
/** * Deletes the event specified by retrieving the atom entry object * and calling Zend_Feed_EntryAtom::delete() method. This is for * example purposes only, as it is inefficient to retrieve the entire * atom entry only for the purposes of deleting it. * * @param Zend_Http_Client $client The authenticated client object * @param string $eventId The event ID string * @return void */ function deleteEventById($client, $eventId) { $event = getEvent($client, $eventId); $event->delete(); }
$stmt->execute(); $result = $stmt->get_result(); $results = array(); while ($row = $result->fetch_assoc()) { array_push($results, $row); } $follows = array_reverse($results); for ($i = 0; $i < 5; $i++) { echo '<div class="row">'; echo '<div class="col s6">'; echo '<p class="left-align">'; if (@$goingTo[$i]['userID'] != NULL) { $uID = $goingTo[$i]['userID']; echo '<i class="mdi-hardware-keyboard-tab"></i>   ' . getName($uID) . ' ' . (getName($uID) == "You" ? "are" : "is") . ' going to <a href="event.php?id=' . $goingTo[$i]['eventID'] . '">' . getEvent($goingTo[$i]['eventID'])['name'] . "</a>"; } echo '</p>'; echo '</div>'; echo '<div class="col s6">'; echo '<p class="right-align">'; if (@$follows[$i]['User1'] != NULL) { $row = $follows[$i]; echo getName($row['User1']) . " followed " . getName($row['User2']) . "  \n <i class=\"mdi-social-person-add\"></i></p>"; } echo '</p>'; echo '</div>'; echo '</div>'; } echo '</div> </div>
<?php session_start(); require_once "../../inc/config.php"; require_once ROOT_PATH . "inc/database.php"; include ROOT_PATH . "inc/header.php"; if (empty($_GET["event_id"]) || $_GET["event_id"] < 1 || getEvent($_GET["event_id"]) == false) { header("Location:/admin/events/"); } $event = getEvent(intval($_GET["event_id"])); $users = getEventUsers($event["event_id"]); $admin = getUser($_SESSION["user_id"]); $name = $event["name"]; $desc = preg_replace('/\\<br(\\s*)?\\/?\\>/i', "\n", $event["description"]); $date = $event["event_date"]; $start = $event["start_time"]; $end = $event["end_time"]; $member_price = $event["member_price"]; $nonmember_price = $event["nonmember_price"]; if ($event["max_attendees"] == 0) { $max = ""; } else { $max = $event["max_attendees"]; } if ($_SERVER["REQUEST_METHOD"] == "POST") { // process the event change if (password_verify($_POST["admin-password"], $admin["password"])) { if ($_POST["action"] == "delete") { $registrations = deleteEvent($event["event_id"]); foreach ($registrations as $registration) { // refund the charge
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. */ require_once 'includes/config.php'; $data = array(); $error = false; $title = 'Could Not Find Event'; $id = -1; if (isset($_GET['id'])) { $id = (int) safeString($_GET['id']); $data = getEvent($id); $title = 'Event: ' . ucwords($data[0]['title']); } if ($id == -1 || $id == "") { $error = true; } $smarty->assign('error', $error); $smarty->assign('data', $data[0]); $smarty->assign('user', $session->getUser()); $smarty->assign('title', $title); $smarty->assign('content', $smarty->fetch('events.tpl')); $smarty->display('skeleton.tpl');
<?php define("NO_SESSION_REGENERATION", true); require_once __DIR__ . "/../config.php"; require_once DATABASE_PATH . "/connection.php"; require_once DATABASE_PATH . "/events.php"; require_once INCLUDES_PATH . "/events.php"; require_once INCLUDES_PATH . "/authentication.php"; if (!isset($_GET["id"])) { echo "Missing event ID."; http_response_code(400); } else { if (!isUserLoggedIn()) { echo "You are not logged in."; http_response_code(401); } else { if (!canSeeEvent(getUserID(), $_GET["id"])) { echo "You do not have access to this event."; http_response_code(403); } else { $event = getEvent($_GET["id"]); if ($event && !@is_null($event["imagePath"])) { header('Location: ../' . $event['imagePath']); die; } else { header('Location: ../images/event_default.png'); die; } } } }
function showField($fieldSpec) { #---------------------------------------------------------------------- list($id, $type, $rest) = explode(' ', $fieldSpec, 3); #--------------------- if ($type == 'hidden') { #--------------------- $value = $rest; echo "<input id='{$id}' name='{$id}' type='hidden' value='{$value}' />"; } #--------------------- if ($type == 'text') { #--------------------- list($default, $size, $label) = explode(' ', $rest, 3); $fieldHtml = "<input id='{$id}' name='{$id}' type='text' value='{$default}' size='{$size}' />"; $type = 'standard'; } #--------------------- if ($type == 'readonly') { #--------------------- list($default, $size, $label) = explode(' ', $rest, 3); $fieldHtml = "<input id='{$id}' name='{$id}' type='text' value='{$default}' size='{$size}' readonly='readonly' />"; $type = 'standard'; } #--------------------- if ($type == 'name') { #--------------------- list($size, $label, $default) = explode(' ', $rest, 3); $fieldHtml = "<input id='{$id}' name='{$id}' type='text' value='{$default}' size='{$size}' />"; $fieldHtml .= "<input type='submit' id='search' name='search' value='Search' />"; $type = 'standard'; } #--------------------- if ($type == 'namelist') { #--------------------- global $persons; list($label) = explode(' ', $rest, 1); $fieldHtml = "<select id='{$id}' name='{$id}'>\n"; foreach ($persons as $person) { $personName = $person['name']; $personId = $person['id']; $fieldHtml .= " <option value='{$personId}'>{$personName}</option>\n"; } $fieldHtml .= "</select>"; $fieldHtml .= "<input type='submit' id='confirm' name='confirm' value='Load' />"; $type = 'standard'; } #--------------------- if ($type == 'country') { #--------------------- list($label, $default) = explode(' ', $rest, 2); $fieldHtml = "<select id='{$id}' name='{$id}'>\n"; $countries = dbQuery("SELECT * FROM Countries ORDER BY name"); foreach ($countries as $country) { $countryId = $country['id']; $countryName = $country['name']; if ($countryId == $default) { $fieldHtml .= " <option value=\"{$countryId}\" selected='selected' >{$countryName}</option>\n"; } else { $fieldHtml .= " <option value=\"{$countryId}\">{$countryName}</option>\n"; } } $fieldHtml .= "</select>"; $type = 'standard'; } #--------------------- if ($type == 'gender') { #--------------------- list($default, $label) = explode(' ', $rest, 2); if ($default == 'm') { $fieldHtml = "Male : <input type='radio' id='{$id}' name='{$id}' value='m' checked='checked' /> Female : <input type='radio' id='{$id}' name='{$id}' value='f' />"; } else { if ($default == 'f') { $fieldHtml = "Male : <input type='radio' id='{$id}' name='{$id}' value='m' /> Female : <input type='radio' id='{$id}' name='{$id}' value='f' checked='checked' />"; } else { $fieldHtml = "Male : <input type='radio' id='{$id}' name='{$id}' value='m' /> Female : <input type='radio' id='{$id}' name='{$id}' value='f' />"; } } $type = 'standard'; } #--------------------- if ($type == 'date') { #--------------------- list($defaultDay, $defaultMonth, $defaultYear, $label) = explode(' ', $rest, 4); echo " <tr><td>{$label}</td><td>"; echo numberSelect("{$id}Day", "Day", 1, 31, $defaultDay); echo numberSelect("{$id}Month", "Month", 1, 12, $defaultMonth); echo numberSelect("{$id}Year", "Year", date("Y"), date("Y") - 100, $defaultYear); echo "</td></tr>\n"; } #--------------------- if ($type == 'area') { #--------------------- list($cols, $rows, $label, $default) = explode(' ', $rest, 4); $fieldHtml = "<textarea id='{$id}' name='{$id}' cols='{$cols}' rows='{$rows}'>{$default}</textarea>"; $type = 'standard'; } #--------------------- if ($type == 'standard') { #--------------------- echo " <tr><td width='30%'><label for='{$id}'>{$label}</label></td><td>{$fieldHtml}</td></tr>\n"; } #--------------------- if ($type == 'event') { #--------------------- $eventId = substr($id, 1); $event = getEvent($eventId); $eventName = $event['cellName']; $eventFormat = $event['format']; list($personLimit, $timeLimit, $timeFormat, $default) = explode(' ', $rest, 4); if ($timeLimit) { $timeFormat = $timeFormat == 's' ? 'single' : 'average'; if ($eventFormat == 'multi') { if ($timeLimit > 1) { $timeLimit = "{$timeLimit} cubes"; } else { $timeLimit = "1 cube"; } } else { $timeLimit = formatValue($timeLimit, $eventFormat); } $timeLimit = " ({$timeFormat} limit {$timeLimit})"; } if ($default) { echo "<input id='{$id}' name='{$id}' type='checkbox' value='yes' checked='checked' />"; } else { echo "<input id='{$id}' name='{$id}' type='checkbox' value='yes' />"; } if (count(dbQuery("SELECT * FROM Events WHERE id='{$eventId}' AND rank<990"))) { echo " <label for='{$id}'>{$eventName}{$timeLimit}</label><br />"; } else { echo " <label for='{$id}' style='color:#999'>{$eventName}{$timeLimit}</label><br />"; } } }
<?php set_time_limit(0); error_reporting(E_ALL); session_start(); //sleep(1); // Récupére la date date_default_timezone_set('Europe/Paris'); $sToday = date('d/m/Y'); // Initialise PDO pour les requete sql include './DatabaseConfig.php'; include './php/config.php'; include './php/functions.php'; $sEvent = getEvent(); if ($sEvent == 'RESET') { $oPDO->query('DELETE FROM cooldown WHERE name="EVENT"'); } if ($sEvent == 'STOP') { $oPDO->query('UPDATE quizz SET actual=0, used=1 WHERE actual=1'); $oPDO->query('UPDATE pve SET actual=0, used=1 WHERE actual=1'); $oPDO->query('DELETE FROM cooldown WHERE name="EVENT"'); $oPDO->query('INSERT INTO cooldown SET name="EVENT", status="10", stepNext="pause"'); setEvent(''); } $aCooldown = $oPDO->query('SELECT * FROM cooldown WHERE name="EVENT"')->fetch(PDO::FETCH_ASSOC); if (!$aCooldown) { $oPDO->query('INSERT INTO cooldown SET name="EVENT", status=0, timerNext="' . (microtrue() + COOLDOWN_PVE * 60) . '", stepNext="PVE"'); $aCooldown['name'] = 'EVENT'; $aCooldown['status'] = '0'; $aCooldown['timerNext'] = microtrue() + COOLDOWN_PVE * 60; $aCooldown['stepNext'] = 'PVE';
</div> <!---------- STAR btn-search----------> <div class="col-lg-2"> <button type="button" class="btn btn-primary btn-lg btn-block"><span class="glyphicon glyphicon-search" aria-hidden="true"></span>搜尋</button> </div> </div> </form> </div> </div> </div> <!---------- END 搜詢----------> <!---------- STAR 內容----------> <div class="container"> <?php $cart = json_decode(getEvent()); for ($i = 0; $i < count($cart); $i++) { $place = explode(',', $cart[$i]->place); echo ' <div class="panel panel-default products-panel"> <div class="panel-body products-body"> <div class="row products-row"> <div class="col-lg-4 col-sm-12 products-img"> <img src="' . $cart[$i]->TripImg . '" class="img-responsive"> <div class="products-price"> <small>$</small>' . $cart[$i]->price . ' </div> </div> <div class="col-lg-8 col-sm-12 products-content"> <div class="products-title"> ' . $cart[$i]->Title . ' </div> <div class="hidden-xs">
function valueFormat($eventId) { $event = getEvent($eventId); return $event['format']; }
// Mark event as false positive if (isset($_POST["action"]) and $_POST["action"] == "Mark" and $_POST["event"][0] != "") { $eventFalsePositive = @sanitize_int($_POST["event"][0], $min = '0'); if ($eventFalsePositive) { $falsePositiveResult = falsePositiveEvent($eventFalsePositive, 'fp'); if (!$falsePositiveResult) { print $falsePositiveResult; } } } if (isset($_GET["e"])) { $geteventid = @sanitize_int($_GET["e"], $min = '1'); } else { $geteventid = 1; } $event_detail = getEvent($geteventid); if (!$event_detail) { header("HTTP/1.1 302 Found"); header("Location: events.php"); header("Connection: close"); header("Content-Type: text/html; charset=UTF-8"); exit; } $event_navigation = getEventPag($geteventid); require_once "../header.php"; ?> <div id="page-wrap"> <div id="main-content"> <div id="events_header"> <?php
fputs($amiSocket, "Events: call\r\n\r\n"); // just monitor call data $result = fgets($amiSocket, 4096); echo "! Login action returned with rc={$result}\n"; $event = ''; $stack = 0; $event_started = false; // Keep a loop going to read the socket and parse the resulting commands. while (!feof($amiSocket)) { $buffer = fgets($amiSocket, 4096); // echo("# Read " . strlen($buffer) . " " . $buffer . "\n"); if ($buffer == "\r\n") { // handle partial packets $event_started = false; // parse the event and get the result hashtable $e = getEvent($event); dumpEvent($e); // // Call Event // if ($e['Event'] == 'Dial') { print "! Dial Event src=" . $e['Source'] . " dest=" . $e['Destination'] . "\n"; // // Before we log this Dial event, we create a corresponding object in Calls module. // We'll need this later to record the call when finished, but create it right here // to get the ID // $set_entry_params = array('session' => $soapSessionId, 'module_name' => 'Calls', 'name_value_list' => array(array('name' => 'name', 'value' => '** Automatic record **'), array('name' => 'status', 'value' => 'In Limbo'), array('name' => 'assigned_user_id', 'value' => $userGUID))); $result = $soapClient->call('set_entry', $set_entry_params); $callRecordId = $result['id']; echo "! Successfully created CALL record with id=" . $callRecordId . "\n";
<?php /** * Created by PhpStorm. * User: Jason * Date: 11/13/2015 * Time: 9:08 PM */ require 'db_cn.inc'; require 'db_access.inc'; require 'update_event_ui.inc'; getEvent(); function getEvent() { connect_and_select_db(DB_SERVER, DB_UN, DB_PWD, DB_NAME); $eventCode = $_REQUEST['eventCode']; $sql = "SELECT EventCode, AdEvent.Name, StartDate, EndDate, Description, AdType\n FROM AdEvent\n WHERE EventCode = '" . $eventCode . "'"; $error_message = "Could not successfully run query to get event data ({$sql}) from DB: "; $not_found_message = "Event with Event Code ({$eventCode}) not found in DB"; $row = get_unique_row($sql, $error_message, $not_found_message); $eventCode = $row["EventCode"]; $name = $row["Name"]; $startDate = $row["StartDate"]; $endDate = $row["EndDate"]; $description = $row["Description"]; $adType = $row["AdType"]; ui_show_update_event_form($eventCode, $name, $startDate, $endDate, $description, $adType); }