public function ExeDelete($CategoryId)
 {
     $this->CatId = (int) $CategoryId;
     $read = new Read();
     $read->ExeRead(self::Entity, "where category_id = :delid", "delid={$this->CatId}");
     if (!$read->getResult()) {
         $this->Result = FALSE;
         $this->Error = ['Ops, você tentou remover uma categoria que não existe no sistema!', WS_INFOR];
     } else {
         extract($read->getResult()[0]);
         if (!$category_parent && !$this->checkCats()) {
             $this->Result = FALSE;
             $this->Error = ["a sessão<b> {$category_title}</b> possui categorias cadastradas. Para deletar, antes altere ou remova as categorias filhas!", WS_ALERT];
         } elseif ($category_parent && !$this->checkPosts()) {
             $this->Result = FALSE;
             $this->Error = ["a categoria<b> {$category_title}</b> possui artigos cadastrados. Para deletar, antes altere ou remova todos os posts desta categoria!", WS_ALERT];
         } else {
             $delete = new Delete();
             $delete->ExeDelete(self::Entity, "where category_id = :deletaid", "deletaid={$this->CatId}");
             $tipo = empty($category_parent) ? 'sessão' : 'categoria';
             $this->Result = TRUE;
             $this->Error = ["a {$tipo}<b> {$category_title}</b> foi removida com sucesso do sistema!", WS_ACCEPT];
         }
     }
 }
Esempio n. 2
0
function usrdel($no, $pwd, $onlyimgdel)
{
    global $path, $pwdc, $onlyimgdel;
    require_once CORE_DIR . "/admin/delete.php";
    $del = new Delete();
    $del->userDel($no, $pwd, $onlyimgdel);
}
Esempio n. 3
0
function delete_post($resno, $pwd, $imgonly = 0, $automatic = 0, $children = 1, $die = 1)
{
    require_once CORE_DIR . "/log/log.php";
    require_once CORE_DIR . "/admin/delete.php";
    $remove = new Delete();
    $remove->targeted($resno, $pwd, $imgonly = 0, $automatic = 0, $children = 1, $die = 1);
}
Esempio n. 4
0
 /**
  * DELETE
  * @param $task
  * @param $arguments
  * @param $conditions
  * @return bool|mysqli_result
  */
 public function delete($task, $arguments, $conditions)
 {
     //TODO: delete
     $delete = new Delete();
     return $delete->run($task, $arguments, $conditions);
     /*        $query = "delete from $table where $condition";
               return $this->query($query);*/
 }
Esempio n. 5
0
 public function testDelete()
 {
     $delete = new Delete('foo');
     $delete->whereEquals('id', 1);
     list($sql, $params) = $delete->toQuery();
     $this->assertEqualsSql('DELETE FROM foo WHERE id = ?', $sql);
     $this->assertEquals(array(1), $params);
 }
Esempio n. 6
0
 public static function UserOnline()
 {
     $now = Date('Y-m-d H:i:s');
     $deleteUserOnline = new Delete();
     $deleteUserOnline->ExeDelete('ws_siteviews_online', "WHERE online_endview < :now", "now={$now}");
     $readUserOnline = new Read();
     $readUserOnline->ExeRead('ws_siteviews_online');
     return $readUserOnline->getRowCount();
 }
 public function delete(PostInterface $postObject)
 {
     $action = new Delete($postObject);
     $action->where(array('id=?' => $postObject->getId()));
     $sql = new Sql($this->Adapter);
     $stmt = $sql->prepareStatementForSqlObject($action);
     $result = $stmt->execute();
     return (bool) $result->getAffectedRows();
 }
 public function DeleteLogradouro($id)
 {
     $delete = new Delete();
     $delete->Deleter(self::Logradouro, 'where logradouro_id = :id', "id={$id}");
     if ($delete->getResult()) {
         $this->result = true;
     } else {
         $this->result = false;
     }
 }
 /**
  * Choose which type of deletion needs to be accomplished and route through
  * the correct method of Delete.
  */
 private function deletion_routing($data)
 {
     $delete_content = new Delete();
     if ($data['type'] == 'all') {
         $return = $delete_content->delete_all_test_data();
     } else {
         $return = $delete_content->delete_objects($data);
     }
     $clean = $this->reporting->create_report($return);
     echo $clean;
 }
Esempio n. 10
0
 public function unlink($contactId, $addressId)
 {
     $adapter = $this->getDbAdapter();
     $statement = $adapter->createStatement();
     $where = new Where();
     $where->equalTo('contact_id', $contactId)->equalTo('address_id', $addressId);
     $delete = new Delete();
     $delete->from('contact_addresses')->where($where);
     $delete->prepareStatement($adapter, $statement);
     $result = $statement->execute();
     return $result;
 }
Esempio n. 11
0
 /**
  * <b>Deleta Informação Nutricional:</b> Informe o ID da Informação Nutricional a ser removida para que esse método realize uma
  * checagem excluindo todos os dados nessesários e removendo o visitante do banco!
  * @param INT $NutriId = Id da Informação Nutricional
  * @param INT $userId = id do usuário que irá deletar o registro
  */
 public function ExeDelete($NutriId, $userId)
 {
     $this->NutriId = (int) $NutriId;
     $this->UserId = $userId;
     $ReadCat = new Read();
     $ReadCat->ExeRead(DB_NUTRICAO, "WHERE nutri_id = :nutri", "nutri={$this->NutriId}");
     if (!$ReadCat->getResult()) {
         $this->Error = ["O Informação Nutricional que você tentou deletar não existe no sistema!", TW_ERROR];
         $this->Result = false;
     } else {
         $deleta = new Delete();
         $deleta->ExeDelete(DB_NUTRICAO, "WHERE nutri_id = :nutri", "nutri={$this->NutriId}");
         $this->Error = ["A Informação Nutricional foi removida com sucesso do sistema!", TW_ACCEPT];
         $this->Result = true;
     }
 }
Esempio n. 12
0
 /**
  * <b>Deleta Produto:</b> Informe o ID do Produto a ser removida para que esse método realize uma
  * checagem excluindo todos os dados nessesários e removendo o visitante do banco!
  * @param INT $ProdId = Id do Produto
  * @param INT $userId = id do usuário que irá deletar o registro
  */
 public function ExeDelete($ProdId, $userId)
 {
     $this->ProdId = (int) $ProdId;
     $this->UserId = $userId;
     $ReadCat = new Read();
     $ReadCat->ExeRead(DB_PRODUTOS, "WHERE prod_id = :prod", "prod={$this->ProdId}");
     if (!$ReadCat->getResult()) {
         $this->Error = ["O Produto que você tentou deletar não existe no sistema!", TW_ERROR];
         $this->Result = false;
     } else {
         $deleta = new Delete();
         $deleta->ExeDelete(DB_PRODUTOS, "WHERE prod_id = :prod", "prod={$this->ProdId}");
         $this->Error = ["O Produto foi removido com sucesso do sistema!", TW_ACCEPT];
         $this->Result = true;
     }
 }
Esempio n. 13
0
 /**
  * <b>Deleta membro:</b> Informe o ID do membro a ser removido para que esse método realize uma
  * checagem excluindo todos os dados necessários e removendo o membro do banco!
  * @param INT $Membro = id do membro da família
  * @param INT $userId = id do usuário que está deletando o registro
  */
 public function ExeDelete($Membro, $userId)
 {
     $this->UserId = $userId;
     $this->Membro = $Membro;
     $ReadFam = new Read();
     $ReadFam->ExeRead(DB_FAMILIA_COMPOSICAO, "WHERE id = :membro", "membro={$this->Membro}");
     if (!$ReadFam->getResult()) {
         $this->Error = ["O Membro da família que você tentou deletar não existe no sistema!", TW_ERROR];
         $this->Result = false;
     } else {
         $deleta = new Delete();
         $deleta->ExeDelete(DB_FAMILIA_COMPOSICAO, "WHERE id = :membro", "membro={$this->Membro}");
         $this->Error = ["O Membro da família foi removido com sucesso do sistema!", TW_ACCEPT];
         $this->Result = true;
     }
 }
Esempio n. 14
0
 /**
  * <b>Deleta Curso:</b> Informe o ID do curso a ser removido para que esse método realize uma
  * checagem excluindo todos os dados nessesários e removendo-o do banco!
  * @param INT $CursoId Id do curso
  * @param INT $userId = id do usuário que irá deletar o registro
  */
 public function ExeDelete($CursoId, $userId)
 {
     $this->CursoId = (int) $CursoId;
     $this->UserId = $userId;
     $ReadCurso = new Read();
     $ReadCurso->ExeRead(DB_CURSOS, "WHERE curso_id = :curso", "curso={$this->CursoId}");
     if (!$ReadCurso->getResult()) {
         $this->Error = ["O Curso que você tentou deletar não existe no sistema!", TW_ERROR];
         $this->Result = false;
     } else {
         $deleta = new Delete();
         $deleta->ExeDelete(DB_CURSOS, "WHERE curso_id = :curso", "curso={$this->CursoId}");
         $this->Error = ["O Curso foi removido com sucesso do sistema!", TW_ACCEPT];
         $this->Result = true;
     }
 }
Esempio n. 15
0
 /**
  * <b>Deleta Alimento:</b> Informe o ID do Alimento a ser removido para que esse método realize uma
  * checagem excluindo todos os dados nessesários e removendo o visitante do banco!
  * @param INT $AlimentoId = Id da Alimento
  * @param INT $userId = id do usuário que irá deletar o registro
  */
 public function ExeDelete($AlimentoId, $userId)
 {
     $this->AlimentoId = (int) $AlimentoId;
     $this->UserId = $userId;
     $ReadCat = new Read();
     $ReadCat->ExeRead(DB_NUTRICAO_CARDAPIO, "WHERE id = :id", "id={$this->AlimentoId}");
     if (!$ReadCat->getResult()) {
         $this->Error = ["O Alimento que você tentou deletar não existe no sistema!", TW_ERROR];
         $this->Result = false;
     } else {
         $deleta = new Delete();
         $deleta->ExeDelete(DB_NUTRICAO_CARDAPIO, "WHERE id = :id", "id={$this->AlimentoId}");
         $this->Error = ["O Alimento foi removido com sucesso do sistema!", TW_ACCEPT];
         $this->Result = true;
     }
 }
Esempio n. 16
0
 /**
  * <b>Deleto Grupo:</b> Informe o ID do grupo a ser removida para que esse método realize uma
  * checagem excluindo todos os dados nessesários e removendo-a do banco!
  * @param INT $GrupoId Id do grupo
  * @param INT $userId = id do usuário que irá deletar o registro
  */
 public function ExeDelete($GrupoId, $userId)
 {
     $this->GrupoId = (int) $GrupoId;
     $this->UserId = $userId;
     $ReadGrupo = new Read();
     $ReadGrupo->ExeRead(DB_PSICO_GRUPOS, "WHERE grupo_id = :grupo", "grupo={$this->GrupoId}");
     if (!$ReadGrupo->getResult()) {
         $this->Error = ["O grupo que você tentou deletar não existe no sistema!", TW_ERROR];
         $this->Result = false;
     } else {
         $deleta = new Delete();
         $deleta->ExeDelete(DB_PSICO_GRUPOS, "WHERE grupo_id = :grupo", "grupo={$this->GrupoId}");
         $this->Error = ["A Grupo foi removida com sucesso do sistema!", TW_ACCEPT];
         $this->Result = true;
     }
 }
Esempio n. 17
0
 /**
  * <b>Deleta Categoria:</b> Informe o ID da Categoria a ser removida para que esse método realize uma
  * checagem excluindo todos os dados nessesários e removendo o visitante do banco!
  * @param INT $CatId = Id da Categoria
  * @param INT $userId = id do usuário que irá deletar o registro
  */
 public function ExeDelete($CatId, $userId)
 {
     $this->CatId = (int) $CatId;
     $this->UserId = $userId;
     $ReadCat = new Read();
     $ReadCat->ExeRead(DB_NUTRICAO_CATEGORIAS, "WHERE cat_id = :cat", "cat={$this->CatId}");
     if (!$ReadCat->getResult()) {
         $this->Error = ["O Categoria que você tentou deletar não existe no sistema!", TW_ERROR];
         $this->Result = false;
     } else {
         $deleta = new Delete();
         $deleta->ExeDelete(DB_NUTRICAO_CATEGORIAS, "WHERE cat_id = :cat", "cat={$this->CatId}");
         $this->Error = ["A Categoria foi removida com sucesso do sistema!", TW_ACCEPT];
         $this->Result = true;
     }
 }
Esempio n. 18
0
    /**
     * @covers Zend\Db\Sql\Delete::getSqlString
     */
    public function testGetSqlString()
    {
        $this->delete->from('foo')
            ->where('x = y');
        $this->assertEquals('DELETE FROM "foo" WHERE x = y', $this->delete->getSqlString());

    }
Esempio n. 19
0
 /**
  * <b>Deleta categoria:</b> Informe o ID de uma categoria para remove-la do sistema. Esse método verifica
  * o tipo de categoria e se é permitido excluir de acordo com os registros do sistema!
  * @param INT $BandId = Id da categoria
  */
 public function ExeDelete($BandId)
 {
     $this->BandId = (int) $BandId;
     $name = "NOME DA BANDA";
     $read = new Read();
     $read->ExeRead(self::Entity, "WHERE id = :delid", "delid={$this->BandId}");
     if (!$read->getResult()) {
         $this->Result = false;
         $this->Error = ['Você tentou remover uma banda que não existe no sistema!', WS_INFOR];
     } else {
         extract($read->getResult()[0]);
         $delete = new Delete();
         $delete->ExeDelete(self::Entity, "WHERE id = :bandid", "bandid={$this->BandId}");
         $this->Result = true;
         $this->Error = ["A banda <b>{$name}</b> foi removida com sucesso do sistema!", WS_ACCEPT];
     }
 }
Esempio n. 20
0
 /**
  * <b>Deleta Visitantes:</b> Informe o ID do Visitante a ser removido para que esse método realize uma
  * checagem excluindo todos os dados nessesários e removendo o visitante do banco!
  * @param INT $VisitanteId = Id do Visitante
  * @param INT $userId = id do usuário que irá deletar o registro
  */
 public function ExeDelete($VisitanteId, $userId)
 {
     $this->VisitanteId = (int) $VisitanteId;
     $this->UserId = $userId;
     $ReadFam = new Read();
     $ReadFam->ExeRead(DB_VISITANTES, "WHERE visitante_id = :edu", "edu={$this->VisitanteId}");
     if (!$ReadFam->getResult()) {
         $this->Error = ["O Visitante que você tentou deletar não existe no sistema!", TW_ERROR];
         $this->Result = false;
     } else {
         $this->checkCover();
         $deleta = new Delete();
         $deleta->ExeDelete(DB_VISITANTES, "WHERE visitante_id = :edu", "edu={$this->VisitanteId}");
         $this->Error = ["O Visitante foi removido com sucesso do sistema!", TW_ACCEPT];
         $this->Result = true;
     }
 }
Esempio n. 21
0
 public function __construct($node, $parent)
 {
     parent::__construct($node, $parent);
     self::$possible_attributes = array_merge(parent::$possible_attributes, self::$possible_attributes);
     self::$required_attributes = array_merge(parent::$required_attributes, self::$required_attributes);
     self::$possible_children = array_merge(parent::$possible_children, self::$possible_children);
     self::$required_children = array_merge(parent::$required_children, self::$required_children);
 }
Esempio n. 22
0
File: bans.php Progetto: Bossgod/3ch
 function postOptions($no, $ip, $expires, $banType, $perma, $pubreason, $staffnote, $custmess, $showbanmess, $afterban)
 {
     global $mysql;
     //This will do the POST processing and pass it to applyBan
     $str = "+" . $expires . " day";
     $expires = strtotime($str, time());
     if ($banType) {
         if ($banType == 'warn') {
             $banType = 1;
         } elseif ($banType == 'thisboard') {
             $banType = 2;
         } elseif ($banType == 'global') {
             //bantype is global
             $banType = 3;
         } else {
             $banType = 4;
         }
     }
     if ($showbanmess) {
         if ($custmess == '') {
             $custmess = "(USER WAS BANNED FOR THIS POST)";
         } else {
             $custmess = "(" . $custmess . ")";
         }
     } else {
         $custmess = 0;
     }
     if ($afterban !== 'none') {
         require_once CORE_DIR . '/admin/delete.php';
         $del = new Delete();
         if ($afterban == 'delpost') {
             $del->targeted($no, $pwd, $imgonly = 0, $automatic = 1, $children = 1, $die = 1);
         }
         if ($afterban == 'delallbyip') {
             $del->targeted($no, $pwd, $imgonly = 0, $automatic = 1, $children = 1, $die = 1, $allbyip = 1, $ip);
         }
         if ($afterban == 'delimgonly') {
             $del->targeted($no, $pwd, $imgonly = 1, $automatic = 1, $children = 0, $die = 1);
         }
     }
     $mysql->query("INSERT INTO " . SQLBANLOG . " (ip, active, placedon, expires, board, type, reason, staffnotes) \n\t\tVALUES ('" . $mysql->escape_string($ip) . "', \n\t\t'1', \n\t\tUNIX_TIMESTAMP(),\n\t\t'" . $mysql->escape_string($expires) . "',\n\t\t'" . BOARD_DIR . "', \n\t\t'" . $mysql->escape_string($banType) . "', \n\t\t'" . $mysql->escape_string($pubreason) . "', \n\t\t'" . $mysql->escape_string($staffnote) . "' )");
     if ($custmess) {
         $mysql->query("UPDATE " . SQLLOG . " SET com = CONCAT(com, '<br><b><font color=\"FF101A\">" . $mysql->escape_string($custmess) . "</font></b>') where no='" . $no . "'");
     }
 }
 public function excluir($produtoId = null)
 {
     try {
         $delete = new Delete();
         $delete->ExeDelete('produtos', "WHERE id = :id", "id={$produtoId}");
         if (is_null($produtoId)) {
             throw new Exception('Digite um id para o produto', E_USER_ERROR);
         } else {
             if ($delete->getRowCount() < 1) {
                 throw new Exception('Não existe um produto com esse ID!', E_USER_ERROR);
             } else {
                 JBErro('<p>Produto deletado com Sucesso!</p>', JB_ACCEPT);
             }
         }
     } catch (Exception $e) {
         JBErro("<b>Erro ao Deletar:</b> {$e->getMessage()}", $e->getCode());
     }
 }
Esempio n. 24
0
 public function submit($data)
 {
     $file_name = $this->maphper[$data["id"]]->file_name;
     if (parent::submit($data)) {
         //var_dump($file_name); exit;
         unlink($this->file_path . $file_name);
         return true;
     } else {
         return false;
     }
 }
 public static function DeleteWidgetConfig()
 {
     $response = new simpleResponse();
     //  include './inc/incWebServiceSessionValidation.php';
     try {
         $parameters = Delete::collectParameters();
         $result = da_widget_config::DeleteWidgetConfig($parameters->widget_config_id);
         $response->status = "OK";
         $response->message = "";
         $response->data = $result;
     } catch (Exception $ex) {
         $response->status = "EXCEPTION";
         $response->message = $ex->getMessage();
         $response->data = $result;
     }
     return $response;
 }
Esempio n. 26
0
 /**
  * <b>Deleta Família:</b> Informe o ID da família a ser removida para que esse método realize uma
  * checagem excluindo todos os dados necessários e removendo a família do banco!
  * @param INT $FamiliaId = Id da família!
  * @param INT $userId = id do usuário que irá deletar o registro
  */
 public function ExeDelete($FamiliaId, $userId)
 {
     $this->FamiliaId = (int) $FamiliaId;
     $this->UserId = $userId;
     $ReadFam = new Read();
     $ReadFam->ExeRead(DB_FAMILIA, "WHERE familia_id = :familia", "familia={$this->FamiliaId}");
     if (!$ReadFam->getResult()) {
         $this->Error = ["A família que você tentou deletar não existe no sistema!", TW_ERROR];
         $this->Result = false;
     } else {
         $deleta = new Delete();
         $deleta->ExeDelete(DB_FAMILIA, "WHERE familia_id = :familia", "familia={$this->FamiliaId}");
         $deleta->ExeDelete(DB_FAMILIA_PAI_SITUACAO, "WHERE familia_id = :familia", "familia={$this->FamiliaId}");
         $deleta->ExeDelete(DB_FAMILIA_MAE_SITUACAO, "WHERE familia_id = :familia", "familia={$this->FamiliaId}");
         $deleta->ExeDelete(DB_FAMILIA_RESPONSAVEL, "WHERE familia_id = :familia", "familia={$this->FamiliaId}");
         $deleta->ExeDelete(DB_FAMILIA_RESP_SITUACAO, "WHERE familia_id = :familia", "familia={$this->FamiliaId}");
         $this->checkCover();
         $deleta->ExeDelete(DB_EDUCANDOS, "WHERE educando_familia_id = :familia", "familia={$this->FamiliaId}");
         $deleta->ExeDelete(DB_FAMILIA_COMPOSICAO, "WHERE familia_id = :familia", "familia={$this->FamiliaId}");
         $this->Error = ["A Família foi removida com sucesso do sistema!", TW_ACCEPT];
         $this->Result = true;
     }
 }
Esempio n. 27
0
 private function checkOcorrencia()
 {
     $read = new Read();
     $read->FullRead("SELECT id FROM " . DB_EDUCANDOS_OCORRENCIAS . " WHERE educando_id = :id", "id={$this->EducandoId}");
     if ($read->getResult()) {
         $delete = new Delete();
         $delete->ExeDelete(DB_EDUCANDOS_OCORRENCIAS, "WHERE educando_id = :id", "id={$this->EducandoId}");
     }
 }
Esempio n. 28
0
             //$PageDataDisplay;
             $tablename = "sections";
             $dsiSections = new Display($tablename);
             $PageDataDisplay = $dsiSections->getAllData();
         } catch (Exception $exc) {
             echo $exc->getMessage();
         }
         include 'veiws/addNewPage.php';
     }
 }
 // Delete:
 if (isset($_GET['action']) and $_GET['action'] == "delete") {
     try {
         $tablename = "pages";
         $id = $_GET['id'];
         $deSec = new Delete($tablename);
         $deSec->deletRecordByID($id);
     } catch (Exception $exc) {
         echo $exc->getMessage();
     }
 }
 //edit
 if (isset($_GET['action']) and $_GET['action'] == "edit") {
     $id = $_GET['id'];
     $tablename = "pages";
     $displaypagedata = new Display($tablename);
     $pagedata = $displaypagedata->getRecordByID($id);
     $tablename = "sections";
     $dsiSections = new Display($tablename);
     $PageDataDisplay = $dsiSections->getAllData();
     include 'veiws/editPage.php';
Esempio n. 29
0
 /**
  * @group pull-request-1813
  * @covers Zend\Db\Sql\Delete::where
  */
 public function testDeleteWhereCombination()
 {
     $this->delete->where(array('one' => 1, 'two' => 2));
     $this->assertCount(2, $this->delete->getRawState('where'));
 }
Esempio n. 30
0
File: opt.php Progetto: Torredo/glzn
include "models/function.php";
$param = "opt";
if (isset($_POST["go"])) {
    if ($_POST["go"] == "save") {
        array_pop($_POST);
        DB::insert(DB::insertSql($param, $_POST), $_POST);
        header("Location: " . $param . ".php");
    } else {
        $id = array_pop($_POST);
        DB::update(DB::updateSql($param, $_POST), $_POST, $id);
        header("Location: " . $param . ".php");
    }
}
if (isset($_GET["delete"])) {
    Delete::del($_GET["title"], $_GET["delete"]);
    header("Location: " . $param . ".php");
}
$records = DB::select($param);
require_once 'view/tpl_top.php';
?>
<div class="app app-header-fixed">
    <?php 
include "view/tpl_popup_opt.php";
include "view/header.php";
$active_b = "class=\"active\"";
include "view/nav.php";
?>
	<!-- content -->
	<div id="content" class="app-content" role="main">
		<div class="app-content-body ">