} if (!isset($_POST["nickname"])) { die("nickname is not set!"); } if (!isset($_POST["reason"])) { die("reason is not set!"); } if (!isset($_POST["length"])) { die("length is not set!"); } if (!isset($_POST["report_ids"])) { die("report_ids is not set!"); } include_once dirname(__FILE__) . "/../../scripts-generic/getPDO.php"; include_once dirname(__FILE__) . "/../../scripts-generic/PDOQuery.php"; include_once dirname(__FILE__) . "/../../scripts-generic/checkAdmin.php"; session_start(); if (!checkAdminBySession()) { die("You are not admin!"); } $pdo = getPDOConnection(); $query = "INSERT INTO `soe-csgo`.`sb_bans` (\n `type`,\n `steam`,\n `ip`,\n `name`,\n `reason`,\n `length`,\n `admin_id`,\n `admin_ip`,\n `create_time`)\n VALUES (\n '0',\n :steamid,\n :ip,\n :nickname,\n :reason,\n :length,\n :admin_id,\n '88.86.107.243',\n UNIX_TIMESTAMP(NOW()))"; //echo $query; $reason = $_POST['reason'] . " | http://ezpz.cz/page/report-system?report_ids=" . $_POST["report_ids"]; $parameters = array(":steamid" => $_POST['steamid'], ":ip" => $_POST['ip'], ":nickname" => $_POST['nickname'], ":reason" => $reason, ":length" => intval($_POST['length']), ":admin_id" => intval($_SESSION['ezpz_sb_admin_id'])); // http://ezpz.cz/ext/phpbb/pages/styles/pbtech/template/report-g/report_actions/addban_report.php?steamid=1:0012646&ip=88.45.21.47&nickname=test&reason=test&length=50 if (PDOExecParametrizedQuery($pdo, $query, $parameters, __FILE__, __LINE__)) { echo json_encode(array('success' => true, 'ban_id' => $pdo->lastInsertId())); } else { echo json_encode(array('success' => false)); }
<?php if (!isset($_POST["report_id"])) { die("report_id is not set!"); } include_once dirname(__FILE__) . "/../../scripts-generic/getPDO.php"; include_once dirname(__FILE__) . "/../../scripts-generic/PDOQuery.php"; include_once dirname(__FILE__) . "/../../scripts-generic/checkAdmin.php"; session_start(); $report_id = intval($_POST["report_id"]); if (checkAdminForReportByReportId($report_id) || checkMainAdmin()) { $pdo = getPDOConnection(); $query = "UPDATE `ezpz-report-g`.`report_report` SET status_id = 5, time_finish = TIMESTAMP(NOW()) WHERE id = :id"; header('Content-Type: application/json'); if (PDOExecParametrizedQuery($pdo, $query, array("id" => $report_id), __FILE__, __LINE__)) { echo json_encode(array('success' => true)); } else { echo json_encode(array('success' => false)); } }