$interval = date_diff($create, $end1); $days = (int) $interval->format("%a"); $end = strtotime($end); $sql = $dbh->query("UPDATE `amx_amxadmins` SET `expired` = '{$end}' WHERE `steamid` = '" . $row['steamid'] . "'"); if (!$sql) { die("Произошла ошибка, обновите страницу и попробуйте обратиться к администратору."); } } //Удаляем всю инфу о бане (bid прописывается в password) if ($type == 5) { $sql = $dbh->query("DELETE FROM `amx_bans` WHERE `bid` = '" . $row['pasword'] . "'"); $sql = $dbh->query("DELETE FROM `amx_bans_edit` WHERE `bid` = '" . $row['pasword'] . "'"); $sql = $dbh->query("DELETE FROM `amx_bans_log` WHERE `bid` = '" . $row['pasword'] . "'"); } //Посылаем amx_reloadadmins спасибо xPaw //Пока заглушка на unban чтобы не было ошибки if ($type != 5) { $sql_server = $dbh->query("SELECT `address` FROM `amx_serverinfo` WHERE `id` = '{$server_id}'"); if ($sql_server && ($row_server = $sql_server->fetch())) { $row_server = $sql_server->fetch(); $address = explode(":", $row_server['address']); $Query = new SourceQuery(); $Query->Connect($address[0], $address[1], $address[1], SourceQuery::GOLDSOURCE); $Query->SetRconPassword($rcon); $Query->Rcon($cmd); $Query->Disconnect(); } } $f = @fopen("order.txt", "a+") or die("error"); fputs($f, "order_num :{$inv_id};Summ :{$out_summ};Date :{$date}\n"); fclose($f);
<?php require __DIR__ . '/SourceQuery/SourceQuery.class.php'; // For the sake of this example Header('Content-Type: text/plain'); Header('X-Content-Type-Options: nosniff'); // Edit this -> define('SQ_SERVER_ADDR', 'localhost'); define('SQ_SERVER_PORT', 27015); define('SQ_TIMEOUT', 1); define('SQ_ENGINE', SourceQuery::SOURCE); // Edit this <- $Query = new SourceQuery(); try { $Query->Connect(SQ_SERVER_ADDR, SQ_SERVER_PORT, SQ_TIMEOUT, SQ_ENGINE); $Query->SetRconPassword('my_awesome_password'); var_dump($Query->Rcon('say hello')); } catch (Exception $e) { echo $e->getMessage(); } $Query->Disconnect();
<?php // create a database connection, using the constants from config/db.php (which we loaded in index.php) $db_connection = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME); // change character set to utf8 and check it if (!$db_connection->set_charset("utf8")) { $db_connection->errors[] = $db_connection->error; } if (isset($_POST['kick'])) { $Query = new SourceQuery(); try { $Query->Connect(SQ_SERVER_ADDR, SQ_SERVER_PORT, SQ_TIMEOUT, SQ_ENGINE); $Query->SetRconPassword(SQ_SERVER_PASSWORD); var_dump($Query->Rcon('say hello')); } catch (Exception $e) { echo $e->getMessage(); } $Query->Disconnect(); } if (isset($_GET["IP"])) { require __DIR__ . '/SourceQuery/SourceQuery.class.php'; define('SQ_TIMEOUT', 1); define('SQ_ENGINE', SourceQuery::SOURCE); $serverIp = $_GET["IP"]; $serverPort = $_GET["Port"]; $Timer = MicroTime(true); $Query = new SourceQuery(); $Info = array(); $Rules = array(); $Players = array(); try {