function AJsubmitDeleteRequest() { global $mode; $mode = 'AJviewRequests'; $requestid = getContinuationVar('requestid', 0); $fromtimetable = getContinuationVar('fromtimetable', 0); $request = getRequestInfo($requestid); deleteRequest($request); if ($fromtimetable) { $cdata = getContinuationVar('ttdata'); $cont = addContinuationsEntry('showTimeTable', $cdata); print "window.location.href='" . BASEURL . SCRIPT . "?continuation={$cont}';"; return; } viewRequests(); }
function submitDeleteRequest() { $requestid = getContinuationVar('requestid', 0); $request = getRequestInfo($requestid); if ($request['forimaging']) { $reservation = $request['reservations'][0]; } else { foreach ($request["reservations"] as $res) { if ($res["forcheckout"]) { $reservation = $res; break; } } } deleteRequest($request); if (datetimeToUnix($request["start"]) > time()) { print "<H2>Delete Reservation</H2>"; print "The reservation for <b>" . $reservation["prettyimage"]; print "</b> starting " . prettyDatetime($request["start"]); print " has been deleted.<br>\n"; } else { print "<H2>End Reservation</H2>"; print "The reservation for <b>" . $reservation["prettyimage"]; print "</b> starting "; if (datetimeToUnix($request["start"]) < datetimeToUnix($request["daterequested"])) { print prettyDatetime($request["daterequested"]); } else { print prettyDatetime($request["start"]); } print " has been released.<br>\n"; } }
} } } if (isset($_GET['del'])) { $id = abs((int) $_GET['id']); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "DELETE"); switch ($_GET['del']) { case 'country': $errMsg = deleteRequest("country/{$id}/"); break; case 'city': $errMsg = deleteRequest("city/{$id}/"); break; case 'language': $idCity = abs((int) $_GET['id_city']); $errMsg = deleteRequest("city/{$idCity}/language/{$id}/"); break; } } elseif (isset($_GET['edit']) && isset($_GET['id'])) { $id = abs((int) $_GET['id']); if ($id) { switch ($_GET['edit']) { case 'country': /* ќтправка данных методом GET дл¤ получени¤ одной страны */ $result = getRequest("country/{$id}/"); if ($result->Status) { $errMsg = 'failed to get country'; } else { $countryName = $result->Name; } break;
$query = "DELETE FROM `complaint` WHERE `complaint_id` = {$ignore_id}"; $result = mysql_query($query); } function deleteRequest($text_id) { global $delete_text; $query = "DELETE FROM `request` WHERE `complaint_id` = {$text_id}"; $result = mysql_query($query); } //=================================== Основной код $formatter = new Formatter(); if (isset($_GET["ignore_id"])) { deleteComplaint(intval($_GET["ignore_id"])); } if (isset($_GET["delete_id"])) { deleteRequest(intval($_GET["delete_id"])); } $complaint_result = loadComplaints(); $complaint_type = array("сообщение", "текст", "отрывок", "комментарий"); function additionalPageHeader() { ?> <link rel="stylesheet" type="text/css" href="/styles/admin_complaint.css"> <?php } $title = "Список жалоб и запросов"; include '../header.php'; ?> <h1>Жалобы пользователей</h1> <table id="complaint_table"> <tr>
function XMLRPCendRequest($requestid) { global $user; $requestid = processInputData($requestid, ARG_NUMERIC); $userRequests = getUserRequests('all', $user['id']); $found = 0; foreach ($userRequests as $req) { if ($req['id'] == $requestid) { $request = getRequestInfo($requestid); $found = 1; break; } } if (!$found) { return array('status' => 'error', 'errorcode' => 1, 'errormsg' => 'unknown requestid'); } deleteRequest($request); return array('status' => 'success'); }
<?php include '../../settings.php'; include '../../inc/login_functions.php'; include 'functions.php'; if (isset($_POST['request'])) { $request = trim(htmlentities($_POST['request'], ENT_QUOTES, "UTF-8")); $request = $mysqli->real_escape_string($request); $result = deleteRequest($mysqli, $request); if ($result == true) { echo "true"; } else { echo "false"; } }