} if ($attackData->newAttackData()) { $res["result"] = true; $res["reason"] = "Attack Sended!"; } else { $res["result"] = false; $res["reason"] = "Failed Add Attack Data!"; } } else { $res["result"] = false; $res["reason"] = "Wrang Target or Wrang Attack Module!"; } } //check client status if ($data['op'] === 'checkOnline') { if ($pmd->getPmdByID($data['pmd_id'])) { if (strtotime("now") - strtotime($pmd->uptime) < 10) { $res["result"] = true; $res["reason"] = "online"; } else { $res["result"] = true; $res["reason"] = "outline"; } } } if ($data['op'] === 'attackData') { $datas = $attackData->getDatasByPmdID($data['pmd_id']); if (count($datas) > 0) { $res["result"] = true; $res["reason"] = $datas; }
<?php include "./include/head.php"; ?> <!-- the head end --> <?php require_once "bin/Path.php"; require_once PHP_BASE_DIR . "/db/MySQL.php"; require_once PHP_BASE_DIR . "/entity/Module.php"; require_once PHP_BASE_DIR . "/entity/Project.php"; require_once PHP_BASE_DIR . "/entity/ProjectModuleData.php"; $pmd_id = $_GET['pmd_id']; $pmd_id = $pmd_id ? (int) htmlspecialchars($pmd_id, ENT_QUOTES, 'UTF-8') : 0; $db = new MySQL($log); if ($pmd_id > 0 && ($mysqli = $db->openDB())) { $pmdData = new ProjectModuleData($mysqli, $log); if (!$pmdData->getPmdByID($pmd_id)) { echo "<script>alert('未找到记录!');history.back();</script>"; } $u_id = $pmdData->getUidOfPmdId($pmd_id); if ((int) $user_info['id'] !== (int) $u_id) { echo "<script>alert('您无权操作!');history.back();</script>"; } } else { echo "<script>alert('数据错误!');history.back();</script>"; } ?> <!-- main begin --> <div class="container"> <!--the row jumb begin--> <div class="row jumb">