/** * Handle the event. * * @param OrderWasCanceled $event * @return void */ public function handle(OrderWasCanceled $event) { $admins = getAdmins(); $data = ['username' => $event->order->user->username, 'id' => $event->order->id]; foreach ($admins as $admin) { Mail::queue('emails.admin.canceled', $data, function ($message) use($event, $admin) { $message->to($admin->email, $admin->getName())->subject('Order canceled'); }); } }
/** * Handle the event. * * @param OrderWasPlaced $event * @return void */ public function handle(OrderWasPlaced $event) { $admins = getAdmins(); $data = ['amount' => $event->order->getAmount(), 'username' => $event->user->username]; foreach ($admins as $admin) { Mail::queue('emails.admin.placed', $data, function ($message) use($admin) { $message->to($admin->email, $admin->getName())->subject('Order was placed'); }); } }
/** * Handle the event. * * @param OrderWasDelivered $event * @return void */ public function handle(OrderWasDelivered $event) { $admins = getAdmins(); $data = ['amount' => $event->order->getAmount(), 'username' => $event->order->user->username, 'date' => getCarbonDate(Carbon::now())]; foreach ($admins as $admin) { Mail::queue('emails.admin.delivered', $data, function ($message) use($admin) { $message->to($admin->email, $admin->getName())->subject('Order was delivered'); }); } }
if ($equipment['max_length'] < $length) { $message = "<font color=\"#FF0000\"><b>Error: Cannot reserve this equipment for that long.</b></font><br><br>"; } else { if (isDateRangeBlackedOut($startdate, $enddate)) { $message = "<font color=\"#FF0000\"><b>Error: Date Range Blacked-Out.</b></font><br><br>"; } else { if ($equipment['checkoutfrom'] != -1) { $message = "<font color=\"#FF0000\"><b>Error: You must check this out from it's assigned user.</b></font><br><br>"; } else { createReservation($userid, $equipid, $startdate, $length, $usercomment, "", 0); $message = "<font color=\"#005500\"><b>Successfully created new reservation!</b></font><br><br>"; } } } } } } $equipment = mysql_fetch_assoc(getEquipmentByID($equipid)); $length = ""; for ($i = 1; $i <= $equipment["max_length"]; $i++) { $length = $length . "<option value=\"" . $i . "\">" . $i . "</option>"; } echo "\r\n\t\t<center><h3>Make Reservation</h3>" . $message . "</center>\r\n\t\t\r\n\t\t<script type=\"text/javascript\">\r\n\t\t\tfunction checkDate(){\r\n\r\n\t\t\t\tif(document.reservation.startdate.value == \"" . getCurrentMySQLDate() . "\"){\r\n\r\n\t\t\t\t\treturn confirm(\"Reservations placed on the same day as they are created cannot be guaranteed to be ready for their start date. By continuing you are acknowledging that. Would you like to continue?\");\r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t</script>\r\n\r\n\t\t<form name=\"reservation\" action=\"./index.php?pageid=finishres\" method=\"POST\" onsubmit=\"return checkDate();\">\r\n\t\t\r\n\t\t<table class=\"reservation\">\r\n\t\t\r\n\t\t\t<tr>\r\n\t\t\t\r\n\t\t\t\t<td colspan=4 class=\"header\">Reserve the " . $equipment["name"] . "<input type=\"hidden\" name=\"equip_id\" value=\"" . $equipid . "\"></td>\r\n\t\t\t\r\n\t\t\t</tr>\r\n\t\t\r\n\t\t\t<tr>\r\n\t\t\t\r\n\t\t\t\t<td class=\"centeredcellbold\">Date (YYYY-MM-DD)</td>\r\n\t\t\t\t<td class=\"centeredcell\"><script language=\"JavaScript\" id=\"jscal1x\">\r\n\tvar cal1x = new CalendarPopup(\"testdiv1\");\r\n\t</script><input type=\"text\" name=\"startdate\" id=\"startdate\" onClick=\"cal1x.select(document.forms[0].startdate,'anchor1x','yyyy-MM-dd'); return false;\"><a style=\"visibility:hidden;\" name=\"anchor1x\" id=\"anchor1x\">a</a></td>\r\n\t\t\t\t<td class=\"centeredcellbold\">Length</td>\r\n\t\t\t\t<td class=\"centeredcell\"><select name=\"length\">" . $length . "</select></td>\r\n\t\t\r\n\t\t\t</tr>\r\n\t\t\r\n\t\t\t<!--<tr>\r\n\t\t\t\t\r\n\t\t\t\t<td colspan=4 class=\"centeredcellbold\">Pickup Time: \r\n\t\t\t\t\t<select name=\"pickup\">\r\n\t\t\t\t\t\t<option value=\"10am-12pm (Monday/Friday)\">10am-12pm (Monday/Friday)</option>\r\n\t\t\t\t\t\t<option value=\"9am-12pm (Tuesday)\">9am-12pm (Tuesday)</option>\r\n\t\t\t\t\t\t<option value-\"9-10 (Wednesday/Thursday)\">9-10 (Wednesday/Thursday)</option>\r\n\t\t\t\t\t\t<option value=\"2pm-4pm (Wednesday)\">2pm-4pm (Wednesday)</option>\r\n\t\t\t\t\t\t<option value=\"12pm-2pm (Thursday)\">12pm-2pm (Thursday)</option>\r\n\t\t\t\t\t</select>\r\n\t\t\t\t</td>\r\n\t\t\t\t\t\r\n\t\t\t</tr>-->\r\n\r\n\t\t\t<tr>\r\n\t\t\t\r\n\t\t\t\t<td colspan=1 class=\"centeredcellbold\">User Comment</th>\r\n\t\t\t\t<td class=\"centeredcell\" colspan=3><textarea rows=5 cols=45 name=\"usercomment\"></textarea></td>\r\n\t\t\t\r\n\t\t\t</tr>\r\n\t\t\t\t\r\n\t\t\t\t<tr>\r\n\t\t\t\t\r\n\t\t\t\t\t<td colspan=4 class=\"centeredcell\"><input type=\"submit\" value=\"Reserve\"></td>\r\n\t\t\r\n\t\t\t\t</tr>\r\n\t\t\t\t\r\n\t\t\t</table>\r\n\t\t\t</form></div><DIV ID=\"testdiv1\" STYLE=\"position:absolute;visibility:hidden;background-color:white;\"></DIV>\r\n\t"; } else { echo "<center><h3><font color=\"#FF0000\">Error: You have recieved 3 or more warnings.</font></h3>To reserve equipment please contact an admin: <br><br>"; $admins = getAdmins(); while ($row = mysql_fetch_assoc($admins)) { echo $row['name'] . " -- " . $row['email'] . "<br>"; } echo "</center>"; }
$pageTitle = "Twitter"; date_default_timezone_set('UTC'); include_once 'includes/session.php'; // TODO, verify what happens if we post over the tweet length limit // TODO, verify what happens if our tweet exceeds length limit yet contains a URL that will be shortened // TODO, verify CURL doesn’t have issues (apparently it will) // are we logged in? no → leave if (!login_check()) { header("Location: /"); exit; } else { $me = $_SESSION['u']; } // are we admin? no → leave if (in_array($me, getAdmins())) { } else { header("Location: /"); exit; } include_once 'includes/functions_events.php'; include_once 'includes/functions_cast.php'; include_once 'includes/functions_twitter.php'; $action = "Failure"; $body = ""; $style = " panel-success"; $nextGameEvent = getNextEvent(false, 3600); $nextCastEvent = getNextEvent(true, 3600); $latestCast = getLatestCast(); $recentTweets = getRecentTweets(); // are we supplying tweet, message via POST? → send tweet
function getAdminNames() { $users = getPlayerSummary(implode(',', getAdmins())); asort($users); return $users; }
function showPollAdmin() { if (in_array($_SESSION['u'], getAdmins())) { global $database; $uid = array_key_exists('u', $_SESSION) ? $_SESSION['u'] : False; $poll = array(); if (isset($_GET['poll'])) { if (is_numeric($_GET['poll'])) { $stmt = $database->prepare("select date_format(expireDate, '%Y-%m-%d') as expireDate, date_format(publishDate, '%Y-%m-%d') as publishDate, title, description, url, type, multipleChoice, id from poll where id = :pollid"); $stmt->execute(array('pollid' => $_GET['poll'])); $poll = $stmt->fetchAll(PDO::FETCH_ASSOC); //echo $_GET['poll'] . ": ". print_r($poll); if (count($poll) > 0) { $poll = $poll[0]; } else { //We're trying to edit a post that doesn't exist, but lets just let the player make a new one. unset($_GET['poll']); echo "<p class=\"text-warning\">Warning: The specified poll does not exist.</p>"; } $stmt->closeCursor(); } else { //We're trying to edit a post that doesn't exist, but lets just let the player make a new one. unset($_GET['poll']); echo "<p class=\"text-warning\">Warning: Invalid poll id.</p>"; } } ?> </div> </article> <article class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title"><?php echo count($poll) > 0 ? "Poll Details" : "New Poll"; ?> </h3> </div> <div class="panel-body"> <form class="form-horizontal" method = 'post' action = 'poll-admin.php<?php echo isset($_GET['poll']) ? "?poll=" . $_GET['poll'] : ""; ?> '> <div class="form-group"> <label class="col-lg-2 control-label" for="poll_title">Title</label> <div class="col-lg-10"> <input class="form-control" id="poll_title" name="poll_title" type="text" placeholder="The title of the poll" value='<?php echo isset($poll['title']) ? $poll['title'] : ""; ?> '/> </div> </div> <div class="form-group"> <label class="col-lg-2 control-label" for="poll_description">Description</label> <div class="col-lg-10"> <textarea class="form-control" rows="3" id="poll_description" name="poll_description" placeholder="Poll description"><?php echo isset($poll['description']) ? $poll['description'] : ""; ?> </textarea> </div> </div> <div class="form-group"> <label class="col-lg-2 control-label" for="poll_url">URL</label> <div class="col-lg-10"> <input class="form-control" type="text" id="poll_url" name="poll_url" placeholder="Optional supporting URL for the poll." value = "<?php echo isset($poll['url']) ? $poll['url'] : ""; ?> " /> </div> </div> <div class="form-group"> <label class="col-lg-2 control-label" for="poll_type">Type</label> <div class="col-lg-10"> <select class="form-control" id="poll_type" name="poll_type"> <option value="decision" <?php echo isset($poll['type']) and $poll['type'] == 'decision' ? "selected = 'selected'" : ""; ?> >Decision</option> <option value="event" <?php echo isset($poll['type']) and $poll['type'] == 'event' ? "selected = 'selected'" : ""; ?> >Event</option> <option value="research" <?php echo isset($poll['type']) and $poll['type'] == 'research' ? "selected = 'selected'" : ""; ?> >Research</option> </select> </div> </div> <div class="form-group"> <label class="col-lg-2 control-label" for="poll_multipleChoice">Multiple Choice</label> <div class="col-lg-10"> <input id="poll_multipleChoice" name="poll_multipleChoice" type="checkbox" <?php if (isset($poll['multipleChoice'])) { echo $poll['multipleChoice'] != 0 ? "checked = 'checked'" : ""; } ?> /> </div> </div> <div class="form-group"> <label class="col-lg-2 control-label" for="poll_publishDate">Publish Date</label> <div class="col-lg-10"> <input class="form-control" id="poll_publishDate" name="poll_publishDate" type="text" placeholder="2013-11-03" value = '<?php echo isset($poll['publishDate']) ? $poll['publishDate'] : ""; ?> '/> </div> </div> <div class="form-group"> <label class="col-lg-2 control-label" for="poll_expireDate">Expire Date</label> <div class="col-lg-10"> <input class="form-control" id="poll_expireDate" name="poll_expireDate" type="text" placeholder="2013-11-29" value = '<?php echo isset($poll['expireDate']) ? $poll['expireDate'] : ""; ?> '/> </div> </div> <?php echo isset($poll['id']) ? "<input type=\"hidden\" name=\"poll_id\" id=\"poll_id\" value=\"" . $poll['id'] . "\" />" : ""; ?> <h3>Poll Options</h3> <?php $stmt = $database->prepare("select id, name, description, url from poll_option where pollID = :pollid"); $stmt->execute(array('pollid' => isset($poll['id']) ? $poll['id'] : "")); $options = $stmt->fetchAll(PDO::FETCH_ASSOC); $stmt->closeCursor(); for ($i = 0; $i <= 8; $i++) { $o = array(); if ($i < count($options)) { $o = $options[$i]; } ?> <hr /> <div class="form-group"> <label class="col-lg-2 control-label" for="option_name_<?php echo $i; ?> ">Option Name</label> <div class="col-lg-10"> <input class="form-control" id="option_name_<?php echo $i; ?> " name="option_name[<?php echo $i; ?> ]" type="text" placeholder="A name for this option" value="<?php echo isset($o['name']) ? $o['name'] : ""; ?> " /> </div> </div> <div class="form-group"> <label class="col-lg-2 control-label" for="option_description_<?php echo $i; ?> ">Option Description</label> <div class="col-lg-10"> <textarea class="form-control" rows="3" id="option_description_<?php echo $i; ?> " name="option_description[<?php echo $i; ?> ]" placeholder="A brief description for this option."><?php echo isset($o['description']) ? $o['description'] : ""; ?> </textarea> </div> </div> <div class="form-group"> <label class="col-lg-2 control-label" for="option_url_<?php echo $i; ?> ">Option URL</label> <div class="col-lg-10"> <input class="form-control" type="text" id="option_url_<?php echo $i; ?> " name="option_url[<?php echo $i; ?> ]" placeholder="An optional supporting URL." value="<?php echo isset($o['url']) ? $o['url'] : ""; ?> " /> </div> </div> <input type="hidden" id="option_pollID_<?php echo $i; ?> " name="option_pollID[<?php echo $i; ?> ]" value="<?php echo isset($poll['id']) ? $poll['id'] : ""; ?> "/> <div class="form-group"> <label class="col-lg-2 control-label" for="option_delete_<?php echo $i; ?> ">Delete Option</label> <div class="col-lg-10"> <input type="checkbox" id="option_delete<?php echo $i; ?> " name="option_delete[<?php echo $i; ?> ]" /> </div> </div> <?php echo "<input type=\"hidden\" name=\"option_id[" . $i . "]\" id=\"option_id[" . $i . "]\" value=\"" . (isset($o['id']) ? $o['id'] : -1) . "\" />"; } ?> <!-- this is needed so that we can be confident that the array exists even if nothing is being deleted --> <input type="hidden" name="option_delete[-1]" id="delete_option_placeholder" /> <input class="btn btn-success col-xs-offset-2" type="submit" value="Save" /> </form> <?php } else { echo "<p class=\"text-error\">You don't belong here.</p>"; } }
} $result['filters_block'] = $twig->render('filters_block.twig', $c); $result['success'] = true; unset($result['msg']); break; case 'getTicketInfo': require_once "../vendor/autoload.php"; // Twig инициализация Twig_Autoloader::register(); $loader = new Twig_Loader_Filesystem("../templates/helpdesk"); // Twig папка с шаблонами $twig = new Twig_Environment($loader, array("cache" => "")); // Twig no cache $id = $_POST['ticket_id']; $AREAS = getAreas(); $ADMINS = getAdmins(); $query_info = "SELECT\r\n `id`,\r\n `title`,\r\n `creator`,\r\n `contractor`,\r\n `performers`,\r\n `area`,\r\n `description`,\r\n DATE_FORMAT(`created`, '%d.%m.%Y') as `created`,\r\n DATE_FORMAT(`changed`, '%d.%m.%Y') as `changed`,\r\n DATE_FORMAT(`deadline`,'%d.%m.%Y') as `deadline`,\r\n `type`,\r\n `status`,\r\n `parent`,\r\n `tags`,\r\n `comments`,\r\n `category`,\r\n `access`\r\n FROM helpdesk WHERE `id`={$id}"; if ($query_info_res = $db->query($query_info)) { $info_data = $db->fetch_assoc($query_info_res); $info_data['statuses'] = getTicketsStatuses(); $info_data['types'] = getTicketsTypes(); $info_data['categories'] = getTicketsCategories(); $info_data['admins'] = $ADMINS; $info_data['comments'] = getTicketComments($id); $info_data['areas'] = $AREAS; $result['ticket_info'] = $twig->render('ticket_info.twig', $info_data); unset($result['msg']); } break; case "saveNewComment": $ticket_id = check_string($_REQUEST['ticket_id'], 'digits');
function otherBooking($msg, $name, $email) { $msg2 = "A booking was made with the reason being stated as 'Other'. The booking was made by:"; $msg2 .= "\nName: {$name}"; $msg2 .= "\nEmail: {$email}"; $msg = $msg2 . "\n\n" . $msg; $admins = getAdmins(); foreach ($admins as $adminEmail) { sendEmail($adminEmail, "Other Booking", $msg); } }
if (checkRequest('ticket')) { header("Location: {$url}?ticket={$_REQUEST['ticket']}"); } elseif (checkRequest('list')) { header("Location: {$url}?list"); } else { header("Location: {$url}"); } } if ($c = isKnownUser($_SESSION['username'], $_SESSION['userpass'])) { $uid = $c["uid"]; $users = getUsers(); $c['MONTHS_G'] = $MONTHS_G; $c['usercomp'] = $_SESSION['usercomp']; $c['useros'] = $_SESSION['useros']; $c['dir'] = 'helpdesk'; $c['admins'] = getAdmins(); $c['users'] = $users; $c['statuses'] = getTicketsStatuses(); $c['msg'] = $_SESSION['msg']; unset($_SESSION['msg']); $c['msg_type'] = $_SESSION['msg_type']; unset($_SESSION['msg_type']); $c["is_boss"] = in_array($users[$uid]['post_id'], [1, 5, 9, 37, 68, 21, 60, 25, 51, 29, 35, 57, 59, 40, 46]); if (isset($_REQUEST['list']) or isset($_REQUEST['dept_list'])) { $c['section'] = checkRequest('list') !== false ? 'list' : (checkRequest('dept_list') !== false ? 'dept_list' : ""); $section = 'list'; $c["pagename"] = "Мои заявки :: Задачник IT"; $c['access_level'] = $ACCESS_LEVEL; $creator = $c["uid"]; if ($c["is_boss"]) { $dept_users = getUsersListByDept($users[$uid]['dept_id']);
session_start(); if ($c = isAuthorized()) { $TITLE['helpdesk/reports'] = "Отчёты"; $users = getUsers(); $permissions = getPermissions($c["uid"], $users); if ($permissions["bills"] == 'deny') { unset($TITLE["bills"]); } if ($permissions["users"] == 'deny') { unset($TITLE["users"]); } $c['sections'] = $TITLE; $c['dir'] = "helpdesk/reports"; $c['admin_fio'] = $c["lastname"] . " " . $c["firstname"]; $c['notify'] = getBurnedCounts($c["uid"]); $admins = getAdmins(true); $performer = isset($_REQUEST["performer"]) ? check_string($_REQUEST["performer"], "digits") : null; $p = isset($performer) ? array($admins[$performer]['uid'] => $admins[$performer]) : $admins; // print_r($p); $month = (int) (isset($_REQUEST["m"]) ? check_string($_REQUEST["m"], "digits") : date("m")); $year = isset($_REQUEST["y"]) ? check_string($_REQUEST["y"], "digits") : date("Y"); $days = date("t", strtotime("{$year}-{$month}-1")); if ($month > 0) { $dates = "{$year}-{$month}-1,{$year}-{$month}-{$days} 23:59:59"; } else { $dates = "{$year}-1-1,{$year}-12-31 23:59:59"; } $c["performer"] = $performer; $c["MONTHS"] = $MONTHS; $c["MONTHS"][0] = "весь год"; $c["month"] = $month;
$steam_sign_in_url = SteamSignIn::genUrl(); $logIn = <<<AUTHBUTTON <li class="steamLogin"><a href="{$steam_sign_in_url}"><img src="/images/sits_large_noborder.png" alt="Log into Steam" /></a></li> AUTHBUTTON; } } else { if (isset($_SESSION['a']) and $_SESSION['a'] != "") { $logIn = <<<SHOWAVATAR <li class="steamLogin navbar-avatar"><a href="/logout"><img width="32" height="32" id="steamAvatar" alt="Your Steam avatar" src="{$_SESSION['a']}" /></a></li> SHOWAVATAR; } else { $logIn = <<<SHOWAVATAR <li class="steamLogin navbar-avatar"><a href="/logout"><img width="32" height="32" id="steamAvatar" alt="Default Steam avatar" src="/avatars/default.png" /></a></li> SHOWAVATAR; } if (in_array($_SESSION['u'], getAdmins())) { $weareadmin = true; } } } // send only after any cookie tweaks header("Cache-Control: public, max-age=60"); ?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <meta charset="UTF-8" /> <title>SteamLUG <?php echo $pageTitle; ?> </title>