sql_where(array("objEid*" => "objid", "objPending" => 0, "objCreator" => $_auth["useid"], "objDeleted" => 1, "objDeletedBy" => $_auth["useid"], "objDeleteDate<!" => "DATE_SUB( NOW(), INTERVAL 30 DAY )")); $result = sql_rowset("objects, objExtData"); $showForm = sql_num_rows($result) > 0 && !isset($_POST["submit"]); if ($showForm) { ?> <form action="<?php echo url("."); ?> " method="post"> <div> Select deleted submissions you want to purge forever: </div> <?php } include_once INCLUDES . "submission.php"; while ($objData = sql_next($result)) { if (isset($_POST["delete" . $objData["objid"]])) { eraseSubmission($objData["objid"], false, false); notice("Purged: " . $objData["objTitle"]); continue; } if ($showForm) { ?> <div class="sep"> <input type="checkbox" class="checkbox" name="delete<?php echo $objData["objid"]; ?> " /> <a target="_blank" href="<?php echo url("view/" . $objData["objid"]);
} ?> <button type="submit" class="submit button" style="vertical-align: middle;">Delete</button> </form> </div> <div class="sep"> <div class="f_left mar_left"> <form action="<?php echo url("."); ?> " method="get"> <select class="smalltext" name="filterOut" onchange="this.form.submit()"> <option>*</option> <?php $result = sql_query("SELECT `useUsername`, COUNT(*) AS `count` FROM `pms`,`users` " . dbWhere(array("pmsPmUser*" => "useid", "pmsCreatorDelete" => '0', "pmsCreator" => $_auth["useid"])) . getTwitWhere("pmsPmUser") . "GROUP BY `pmsPmUser` ORDER BY `useUsername`"); while ($rowData = sql_next($result)) { echo '<option '; if (isset($_GET["filterOut"]) && $_GET["filterOut"] == $rowData["useUsername"]) { echo 'selected="selected" '; } echo 'value="' . $rowData["useUsername"] . '">' . $rowData["useUsername"] . " (" . fuzzy_number($rowData["count"]) . ")</option>"; } sql_free($result); ?> </select> </form> </div> <?php navControls($sentOffset, $_pm_per_page, $totalCount, "", "", "", "", "sentOffset"); ?> </div>
echo formatText("Sorry, the Helpdesk is currently in development. If you have a request, please send it to [c=1]."); return; } if (isset($_POST["summary"])) { sql_values(array("hlpSummary" => $_POST["summary"], "hlpCategory" => $_POST["category"], "hlpSubmitDate!" => "NOW()", "hlpSubmitter" => $_auth["useid"], "hlpReferenceType" => $_POST["referenceType"], "hlpReferenceId" => $_POST["referenceID"], "hlpOwner" => getRequestRefOwner($_POST["referenceType"], $_POST["referenceID"]))); $helpdeskItem = sql_insert("helpdesk"); addRequestDetail($helpdeskItem, "publicDetail", "publicFile", "all"); addRequestDetail($helpdeskItem, "privateDetail", "privateFile", "submitter"); redirect(url("helpdesk")); } $requestCat = strtolower($_cmd[2]); $requestRef = strtolower($_cmd[3]); $requestRefId = intval($_cmd[4]); $cats = array(); $catsResult = sql_rowset("helpdeskCats"); while ($catsData = sql_next($catsResult)) { $cats[$catsData["hdcid"]] = array("name" => $catsData["hdcName"], "type" => $catsData["hdcType"]); } sql_free($catsResult); ?> <div class="header"> Add a Request </div> <form action="<?php echo url("."); ?> " enctype="multipart/form-data" method="post"> <div class="container2 mar_bottom"> <table cellspacing="15" cellpadding="0" border="0"> <tr> <td valign="bottom" width="50%">
<td><b>W/M Total time</b></td> <td><b>W/M %</b></td> </tr> <?php $prfResult = sql_query("SELECT SUM(`prfTime`) FROM `profiler`"); $totalTime = sql_result($prfResult); if ($totalTime == 0) { $totalTime = 1; } $prfResult = sql_query("SELECT SUM(`prfWMTime`) FROM `profiler`"); $totalTimeWM = sql_result($prfResult); if ($totalTimeWM == 0) { $totalTimeWM = 1; } $prfResult = sql_query("SELECT * FROM `profiler` ORDER BY `prfTime` DESC"); while ($prfData = sql_next($prfResult)) { if ($prfData["prfCount"] == 0) { $prfData["prfCount"] = 1; } if ($prfData["prfWMCount"] == 0) { $prfData["prfWMCount"] = 1; } if (strpos($prfData["prfPage"], "(bot)") !== false) { $prfData["prfPage"] = '<span class="error">' . $prfData["prfPage"] . '</span>'; } ?> <tr> <td>/<?php echo $prfData["prfPage"]; ?> </td>
function putTagList($title, $order) { ?> <div style="margin-left : 2em;"> <?php echo $title; ?> : </div> <ul style="margin : 0.3em 1.2em; padding : 0; padding-left : 2em;"> <?php sql_order($order); sql_where(array("hftCount>" => 0)); $tagResult = sql_rowset("helpdeskFAQTags"); while ($tagData = sql_next($tagResult)) { $url = url("helpdesk/faq/tag", array("tag" => $tagData["hftName"])); ?> <li><a href="<?php echo $url; ?> "><?php echo $tagData["hftName"]; ?> </a> (<?php echo $tagData["hftCount"]; ?> )</li><?php } sql_free($tagResult); ?> </ul> <?php }
<div class="subheader"> All articles tagged with '<?php echo $tagName; ?> ' </div> </div> <ul> <?php sql_where(array("hftName" => $tagName, "hfmTag*" => "hftid", "hfmArticle*" => "hfqid", "hfqCategory*" => "hfcid")); $result = sql_rowset("helpdeskFAQ, helpdeskFAQCats, helpdeskFAQTagMap, helpdeskFAQTags"); if (sql_num_rows($result) == 0) { ?> --<?php } else { while ($data = sql_next($result)) { $url = url("helpdesk/faq/" . $data["hfcIdent"] . "/" . $data["hfqIdent"]); $title = htmlspecialchars(preg_replace('/^.*\\|/', "", $data["hfqTitle"])); ?> <li><a href="<?php echo $url; ?> "><?php echo $title; ?> </a></li><?php } } sql_free($result); ?> </ul>
function putRequestData($hlpData, $showDetails = false) { global $_auth; ?> <div class="container2 mar_bottom"> <div style="margin-left : 20px;"> <div style="margin-left : -20px; margin-top : 0.4em; float : left;"> <?php echo getIMG(url() . "images/emoticons/star.png"); ?> </div> <?php if ($hlpData["hlpReferenceType"] == "submission") { ?> <div style="float : right; margin-left : 1em; margin-bottom : 0.5em;"> <?php echo getObjectThumb($hlpData["hlpReferenceId"], 100, false); ?> </div> <?php } if ($hlpData["hlpReferenceType"] == "extras") { ?> <div style="float : right; margin-left : 1em; margin-bottom : 0.5em;"> <?php echo getObjectThumb($hlpData["hlpReferenceId"], 100, true); ?> </div> <?php } ?> <div class="header" style="padding : 0; padding-bottom : 0.3em;"> <a href="<?php echo url("helpdesk/details/" . $hlpData["hlpid"]); ?> "> <?php echo getRequestCategoryText($hlpData["hlpCategory"]); ?> </a> </div> <?php $ref = getRequestRefText($hlpData["hlpReferenceType"], $hlpData["hlpReferenceId"]); if ($ref != "--") { ?> <div> <b>In reference to</b>: <?php echo $ref; ?> </div> <?php } ?> <div> <b>Status</b>: <?php echo getRequestStatusText($hlpData["hlpStatus"]); ?> </div> <div> <b>Urgency</b>: <?php echo getRequestUrgencyText($hlpData["hlpUrgency"]); ?> </div> <?php $hasOwner = $hlpData["hlpOwner"] > 0; $isStaff = atLeastModerator(); $isSubmitter = isLoggedIn() && $_auth["useid"] == $hlpData["hlpSubmitter"]; $isOwner = isLoggedIn() && $_auth["useid"] == $hlpData["hlpOwner"]; if ($isOwner && $hlpData["hlpStatus"] == "wait-assign") { ?> <div class="mar_top"> <span class="error">Summary will be available after the request is assigned.</span> </div> <?php } else { ?> <div class="mar_top"> <?php echo formatText($hlpData["hlpSummary"], true, true); ?> </div> <?php } $allowedPrivacy = "'all'"; if ($isStaff) { $allowedPrivacy .= ",'private','submitter','owner'"; } else { if ($isSubmitter) { $allowedPrivacy .= ",'submitter'"; } if ($isOwner) { $allowedPrivacy .= ",'owner'"; } } if ($showDetails) { ?> <div style="clear : both;"></div> <?php sql_order("hddSubmitDate"); sql_where(array("hddItem" => $hlpData["hlpid"], "|1" => "`hddPrivacy` IN(" . $allowedPrivacy . ")")); $hddResult = sql_rowset("helpdeskDetails"); while ($hddData = sql_next($hddResult)) { putRequestDetail($hlpData, $hddData); } sql_free($hddResult); $doSubmitDetail = false; $detailPrivacy = "?"; if (isset($_POST["submitPrivate"])) { $doSubmitDetail = true; $detailPrivacy = "private"; } if (isset($_POST["submitSubmitter"])) { $doSubmitDetail = true; $detailPrivacy = "submitter"; } if (isset($_POST["submitOwner"])) { $doSubmitDetail = true; $detailPrivacy = "owner"; } if (isset($_POST["submitAll"])) { $doSubmitDetail = true; $detailPrivacy = "all"; } if ($doSubmitDetail) { addRequestDetail($hlpData["hlpid"], "detailText", "detailFile", $detailPrivacy); redirect(url(".")); } if ($hlpData["hlpStatus"] == "completed") { ?> <span class="error"><b>COMPLETED</b></span>. This request's status is 'completed', no further details are accepted. <?php } else { ?> <div class="container2 mar_bottom"> <div class="header" style="padding-left : 0; padding-top : 0;"> Submit new detail </div> <form action="<?php echo url("."); ?> " enctype="multipart/form-data" method="post"> <div class="mar_bottom"> <textarea name="detailText" rows="9" style="width : 95%;"></textarea> </div> <div class="mar_bottom" style="padding-right : 10%"> (optionally) <b>Upload a file</b>: </div> <div class="mar_bottom"> <input name="detailFile" type="file" size="30" /> </div> <?php if ($isSubmitter && !$hasOwner) { // A simple submit button. ?> <div class="mar_top"> <input type="submit" name="submitSubmitter" value="<?php echo _SUBMIT; ?> " /> </div> <?php } else { ?> <div class="mar_top"> Who should be able to read this detail: </div> <?php if ($hasOwner) { ?> <div class="mar_top"> <button name="submitAll"> <?php echo getRequestPrivacyText("all", $hlpData); ?> </button> </div> <?php if (!$isSubmitter) { ?> <div class="mar_top"> <button name="submitOwner"> <?php echo getRequestPrivacyText("owner", $hlpData); ?> </button> </div> <?php } } ?> <div class="mar_top"> <button name="submitSubmitter"> <?php echo getRequestPrivacyText("submitter", $hlpData); ?> </button> </div> <?php if ($isStaff) { // Only staff can submit staff-only details :3 ?> <div class="mar_top"> <button name="submitPrivate"> <?php echo getRequestPrivacyText("private", $hlpData); ?> </button> </div> <?php } ?> <div class="mar_top"> * <b>Submitter</b> — The user that made the request. <?php if ($hasOwner) { ?> <br /> * <b>Owner</b> — The user that owns the object questioned by the request. <?php } ?> </div> <?php } ?> </form> </div> <?php } } else { sql_where(array("hddItem" => $hlpData["hlpid"], "|1" => "`hddPrivacy` IN(" . $allowedPrivacy . ")")); $detailCount = sql_count("helpdeskDetails"); ?> <div style="text-align : left; margin-top : 0.6em;"> <a href="<?php echo url("helpdesk/details/" . $hlpData["hlpid"]); ?> "> View Request Details</a> (<?php echo $detailCount; ?> ) </div> <div style="clear : both;"></div> <?php } ?> </div> </div> <?php }
function sql_row($table, $fields = "*") { global $_SQLWhere; if ($_SQLWhere === false) { fatal_error("WHERE is required"); } sql_offset(0); sql_limit(1); $result = sql_rowset($table, $fields); $data = sql_next($result); sql_free($result); return $data; }
echo htmlspecialchars($editArticleIdent); ?> " /> <div class="mar_top"> <textarea name="article" cols="70" rows="15"><?php echo htmlspecialchars($editArticleText); ?> </textarea> </div> <div class="mar_top"> Category: <select name="category"> <?php sql_order("hfcName"); $editCatResult = sql_rowset("helpdeskFAQCats"); while ($editCatData = sql_next($editCatResult)) { ?> <option<?php echo $editCatData["hfcid"] == $editCategory ? ' selected="selected"' : ''; ?> value="<?php echo $editCatData["hfcid"]; ?> "><?php echo htmlspecialchars(preg_replace('/^.*\\|/', "", $editCatData["hfcName"])); ?> </option><?php } sql_free($editCatResult); ?> </select>
$totalCount = sql_result($accResult); $accResult = sql_query("SELECT * FROM `access` ORDER BY `accCount` DESC LIMIT 30"); while ($accData = sql_next($accResult)) { ?> <tr> <td><?php echo getDotDecIp($accData["accIp"]); ?> </td> <td align="center"><?php echo $accData["accCount"]; ?> </td> <td><?php sql_where(array("useid*" => "useEid", "useLastIp" => $accData["accIp"])); $useResult = sql_rowset("users, useExtData", "useUsername"); while ($useData = sql_next($useResult)) { echo $useData["useUsername"] . " "; } sql_free($useResult); ?> </td> </tr> <?php } sql_free($accResult); ?> </table> </div>