public function removeFromServer($server, $gameserver = null)
 {
     if ($this->isBaseTemplate()) {
         $shell = $server->createShell($this->getData("infoxmlar", "RootUser") == "True" ? true : false);
         $remoteFolder = $this->getStaticFolder($shell);
         $shell->executeInHome("rm -R " . $remoteFolder['directory']);
         $cond = array();
         $cond['serverID'] = $server->getData("id");
         $cond['userID'] = 0;
         $cond['templateID'] = $this->getData("id");
         Database::deleteRow("physicalserver_templates", $cond);
     } else {
         $remoteFolder = $this->getGameserverFolder($shell, $server, $gameserver->getUser(), $gameserver);
         $shell->executeInHome("rm -R " . $remoteFolder['directory']);
         $cond = array();
         $cond['id'] = $gameserver->getData("id");
         Database::deleteRow("gameserver", $cond);
     }
     /* $shell = $server->CreateShell($this->GetData("infoxmlar", "RootUser") == "True" ? true : false);
               $remoteFolder = $this->GetRemoteFolder($shell, $server);
               $shell->executeInHome("rm -R " . $remoteFolder['toMoveDir']);
     
               $cond = array();
               $cond['serverID'] = $server->GetData("id");
               $cond['userID'] = 0;
               $cond['templateID'] = $this->GetData("id");
               Database::DeleteRow("physicalserver_templates", $cond); */
 }
<?php

require_once 'Database.php';
$id = $_GET['id'];
$db = new Database();
// se a variável tiver ID, delete!
if (isset($id)) {
    $db->deleteRow("DELETE FROM admin WHERE id={$id}");
}
// redirecione para a lista de cadastros
header('Location: ../cadastros.php');
<?php

require_once 'Database.php';
$id = $_GET['id'];
$db = new Database();
// se a variável tiver ID, delete!
if (isset($id)) {
    $db->deleteRow("DELETE FROM colchoes WHERE id={$id}");
}
// redirecione para a lista de cadastros
header('Location: ../colchoes.php');
Example #4
0
    /* IF - OK - Send create */
    $userCreated = $DB->insertData("users", $newUser);
    if ($userCreated) {
        $spawnSuccess = true;
        $spawnSuccessText = "User <strong>" . $newUser['login'] . "</strong> has been created successfully.";
    } else {
        $spawnError = true;
        $spawnErrorText = "Unable to comply. User <strong>" . $newUser['login'] . "</strong> was NOT created.";
    }
    $loadFormUsers = "users.default.tpl";
} elseif (isset($_GET['deleteID']) and $_GET['deleteID'] != "" and $_GET['deleteID'] > 0) {
    $rowDeleted = false;
    if ($_GET['deleteID'] != $_SESSION['id']) {
        /* IF checks passed - Delete user entry */
        $deleteRowId = $DB->escapeData($_GET['deleteID']);
        $rowDeleted = $DB->deleteRow("users", $deleteRowId);
    }
    if ($rowDeleted) {
        $spawnWarning = true;
        $spawnWarningText = "User has been deleted successfully";
    } else {
        $spawnError = true;
        $spawnErrorText = "Unsuccessful. Cannot delete such user.";
    }
    $loadFormUsers = "users.default.tpl";
} elseif (isset($_GET['uid']) or isset($_GET['modifyID'])) {
    if (isset($_GET['modifyID'])) {
        $userID = $_GET['modifyID'];
        $modifyUser = true;
    } elseif (isset($_GET['uid'])) {
        $userID = $_GET['uid'];
 /**
  * 
  * Deletes the server on the running server
  * 
  */
 public function delete()
 {
     if (!$this->statusWaitedFree()) {
         return false;
     }
     echo "<br />Deletion state: " . $this->getData("status") . " (" . GAMESERVER_STATUS_RUNNING . ")";
     if ($this->isRunningOnServer()) {
         echo "<br />Runs - shutting down";
         $this->stop(true);
         $this->updateStatus(GAMESERVER_STATUS_UNINSTALLING);
         Core::addTask(TASK_GAMESERVER_UNINSTALL, $this->getData("id"));
     } else {
         if ($this->getData("status") == GAMESERVER_STATUS_UNINSTALLING) {
             echo "<br />Uninstalling";
             // Server Files
             $shell = $this->getShell();
             $directory = $this->_getGameserverDirectory()["directory"];
             $shell->executeInHome("rm -R {$directory}");
             // Database
             Database::deleteRow("gameserver", array("id" => $this->getData("id")));
         } else {
             echo "<br />Else last";
             $this->updateStatus(GAMESERVER_STATUS_UNINSTALLING);
             Core::addTask(TASK_GAMESERVER_UNINSTALL, $this->getData("id"));
         }
     }
     return true;
 }