예제 #1
0
 public function ApTrabalho($Cod)
 {
     $this->Cod = $Cod;
     $update = new Update();
     $Dados = ["status" => "A"];
     $update->ExeUpdate('trabalhos', $Dados, "where codigo = :c", "c={$this->Cod}");
     if ($update->getResult()) {
         echo "<script>alert('Trabalho Aprovado Com Sucesso!');</script>";
         echo "<script>window.location.assign('painel/submetidos.php')</script>";
     }
 }
 public function ModelUpdate($id, array $dados)
 {
     $this->instituicao = (int) $id;
     $this->data = $dados;
     $update = new Update();
     $update->Updater(self::Entity, $this->data, 'where instituicao_id = :id', "id={$this->instituicao}");
     if ($update->getResult()) {
         $this->result = true;
     } else {
         $this->result = false;
     }
 }
예제 #3
0
 private function Update()
 {
     $Update = new Update();
     $Update->ExeUpdate(self::entidade, $this->dados, "WHERE id = :id", "id={$this->id}");
     if ($Update->getResult()) {
         $this->error = ["A Pessoa <b>{$this->dados['nome']}</b> foi atualizada com sucesso!", WS_ACCEPT];
         $this->result = true;
     } else {
         $this->error = ["Não foi possivel atualizar", WS_ERROR];
         $this->result = false;
     }
 }
예제 #4
0
 public function ModelUpdate($id, array $dados)
 {
     $this->motorista = (int) $id;
     $this->data = $dados;
     $this->data['motorista_nome_url'] = Asserts::CheckName($this->data['motorista_nome']);
     $update = new Update();
     $update->Updater(self::Entity, $this->data, 'where motorista_id = :id', "id={$this->motorista}");
     if ($update->getResult()) {
         $this->result = true;
     } else {
         $this->result = false;
     }
 }
예제 #5
0
 public function ModelUpdate($id, array $dados)
 {
     $this->rota = (int) $id;
     $this->data = $dados;
     $dataRota = array('rota_instituicoes' => json_encode($this->data['escolas']), 'tb_veiculos_veiculo_id' => (int) $this->data['rota_veiculo'], 'rota_inicio' => date('Y-m-d', strtotime(str_replace(array('/', '_', ' '), '-', $this->data['inicio']))), 'rota_fim' => date('Y-m-d', strtotime(str_replace(array('/', '_', ' '), '-', $this->data['fim']))), 'rota_saida' => (int) $this->data['rota_inicio'], 'rota_chegada' => (int) $this->data['rota_fim'], 'rota_observacoes' => $this->data['observacoes']);
     $update = new Update();
     $update->Updater(self::Entity, $dataRota, 'where rota_id = :id', "id={$this->rota}");
     if ($update->getResult()) {
         $this->result = true;
     } else {
         $this->result = false;
     }
 }
예제 #6
0
 public function ModelUpdate($id, array $dados)
 {
     $this->aluno = (int) $id;
     $this->data = $dados;
     $this->data['aluno_nome_url'] = Asserts::CheckName($this->data['aluno_nome']);
     $this->data['aluno_nascimento'] = date('Y-m-d', strtotime(str_replace(array('/', '_'), '-', $this->data['aluno_nascimento'])));
     $update = new Update();
     $update->Updater(self::Entity, $this->data, 'where aluno_id = :id', "id={$this->aluno}");
     if ($update->getResult()) {
         $this->result = true;
     } else {
         $this->result = false;
     }
 }
예제 #7
0
 public function ModelUpdate($idveiculo, array $dados)
 {
     $this->veiculo = $idveiculo;
     $this->data = $dados;
     $read = new Read();
     $read->Reader(self::Entity, 'where veiculo_id = :id', "id={$this->veiculo}");
     if ($read->getResult()) {
         $poltronas = (int) $read->getResult()[0]['veiculo_poltronas'];
         $vagas = (int) $read->getResult()[0]['veiculo_vagas'];
         $diffPoltronas = $this->data['veiculo_poltronas'] - $poltronas;
         if ($this->data['veiculo_poltronas'] > $vagas && $diffPoltronas < $vagas) {
             $this->data['veiculo_vagas'] = $vagas + $diffPoltronas;
         } else {
             $this->data['veiculo_poltronas'] = $poltronas;
         }
         $update = new Update();
         $update->Updater(self::Entity, $this->data, 'where veiculo_id = :id', "id={$this->veiculo}");
         if ($update->getResult()) {
             $this->result = true;
         } else {
             $this->result = false;
         }
     }
 }
<!DOCTYPE html>
<html lang="pt-br">
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <?php 
require './_app/Config.inc.php';
$Dados = ['agent_name' => 'FireFox', 'agent_views' => '120'];
$update = new Update();
$update->ExeUpdate('ws_siteviews_agent', $Dados, "where agent_id = :id", 'id=5');
if ($update->getResult()) {
    echo "{$update->getRowCount()} dado(s) atualizados com sucesso!<hr>";
}
$update->setPlaces('id=6');
$update->setPlaces('id=7');
$update->setPlaces('id=8');
//        var_dump($update);
?>
    </body>
</html>
예제 #9
0
 public function UpdateLogradouro($id, array $dados)
 {
     $this->data = $dados;
     $update = new Update();
     $update->Updater(self::Logradouro, $this->data, 'where logradouro_id = :id', "id={$id}");
     if ($update->getResult()) {
         $this->result = true;
     } else {
         $this->result = false;
     }
 }
예제 #10
0
 private function Update()
 {
     $Update = new Update();
     if (isset($this->Data['user_password'])) {
         $this->Data['user_password'] = crypt(sha1($this->Data['user_email'] . $this->Data['user_password']), sha1($this->Data['user_email']));
     }
     $Update->ExeUpdate(DB_USERS, $this->Data, "WHERE user_id = :id", "id={$this->User}");
     if ($Update->getResult()) {
         $this->Error = ["O usuário <b>{$this->Data['user_name']}</b> foi atualizado com sucesso!", TW_ACCEPT];
         $this->Result = true;
     }
 }
예제 #11
0
 private function Update()
 {
     $Update = new Update();
     if (isset($this->Data['user_password'])) {
         $this->Data['user_password'] = md5($this->Data['user_password']);
     }
     $Update->ExeUpdate(self::Entity, $this->Data, "WHERE user_id = :id", "id={$this->User}");
     if ($Update->getResult()) {
         $this->Error = ["O usuário <b>{$this->Data['user_name']}</b> foi atualizado com sucesso!", WS_ACCEPT];
         $this->Result = true;
     }
 }
예제 #12
0
파일: index.php 프로젝트: claytongf/patr
        $createRecover->ExeCreate(DB_PASSWORD_RECOVER, $sendEmail->getCode());
        $log->RecordLog("Login: Recuperação de senha: " . $datalogin['email'], "Sucesso: Email enviado");
    } else {
        $log->RecordLog("Login: Recuperação de senha: " . $datalogin['email'], "Erro: email não enviado");
        WSErro($sendEmail->getError()[0], $sendEmail->getError()[1]);
    }
} elseif (!empty($dataLogin['AtualizaSenha'])) {
    if ($dataLogin['pass'] == $dataLogin['confirmpass']) {
        $Dados = ['ativo' => 0, 'usado' => 1];
        $updateCode = new Update();
        $updateCode->ExeUpdate(DB_PASSWORD_RECOVER, $Dados, "WHERE pass_code = :code", "code={$lembrarSenha}");
        $readUser = new Read();
        $readUser->ExeRead(DB_USERS, "WHERE user_id = :id", "id={$readCode->getResult()[0]['user_id']}");
        $updateUser['user_password'] = crypt(sha1($readUser->getResult()[0]['user_email'] . $dataLogin['pass']), sha1($readUser->getResult()[0]['user_email']));
        $updateCode->ExeUpdate(DB_USERS, $updateUser, "WHERE user_email = :email", "email={$readUser->getResult()[0]['user_email']}");
        if ($updateCode->getResult()) {
            $log->RecordLog("Login: Atualização de senha: " . $readUser->getResult()[0]['user_email'], "Sucesso: senha atualizada");
            WSErro("Senha atualizada com sucesso. Clique em Voltar e tente logar.", TW_ACCEPT);
        }
    } else {
        $log->RecordLog("Login: Atualização de senha: " . $readUser->getResult()[0]['user_email'], "Erro: senha e confirmação não conferem");
        WSErro("A senha e sua confirmação precisam ser iguais.", TW_ERROR);
    }
}
if (!empty($get)) {
    if ($get == 'restrito') {
        WSErro('<b>Erro:</b> Acesso negado. Favor efetue login para acessar o painel!', TW_ALERT);
    } elseif ($get == 'logoff') {
        WSErro('<b>Sucesso ao deslogar:</b> Sua sessão foi finalizada. Volte sempre!', TW_ACCEPT);
    } elseif ($get == 'emailEnviado') {
        WSErro('<b>Um e-mail foi enviado.</b> Verifique sua caixa de e-mail e siga as instruções de como recuperar sua senha!', TW_ACCEPT);
예제 #13
0
 private function Update()
 {
     $Update = new Update();
     $Update->ExeUpdate(self::Entity, $this->Data, "WHERE id = :id", "id={$this->AudioclipId}");
     if ($Update->getResult()) {
         $this->Result = $Update->getResult();
         $this->Error = ["<b>Sucesso:</b> A {$this->Data['url']} foi atualizada no sistema!", WS_ACCEPT];
     }
 }
예제 #14
0
 /**
  * Atualiza a conta
  */
 public static function UpdateAccount(array $Dados, $id)
 {
     $up = new Update();
     $up->ExeUpdate('accounts', $Dados, 'WHERE id = :id', "id={$id}");
     $Result = $up->getResult();
     if ($Result) {
         return "Conta Atualizado!";
     } else {
         return false;
     }
 }
 private function Update()
 {
     $update = new Update();
     $update->ExeUpdate(self::Entity, $this->Data, "where category_id = :catid", "catid={$this->CatId}");
     if ($update->getResult()) {
         $this->Result = TRUE;
         $this->Error = ["<b>Sucesso:</b> A categoria {$this->Data['category_title']} foi atualizada no sistema", WS_ACCEPT];
     }
 }