Ejemplo n.º 1
0
 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;
     }
 }
Ejemplo n.º 2
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;
     }
 }
Ejemplo n.º 3
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;
     }
 }
Ejemplo n.º 4
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;
     }
 }
Ejemplo n.º 5
0
 public function setVaga($veiculo)
 {
     $read = new Read();
     $read->Reader(self::Entity, 'where veiculo_id = :id', "id={$veiculo}");
     if ($read->getResult()) {
         $vagas = (int) $read->getResult()[0]['veiculo_vagas'];
         if (0 < $vagas) {
             $update = new Update();
             $update->Updater('tb_veiculos', array('veiculo_vagas' => $vagas - 1), 'where veiculo_id = :id', "id={$veiculo}");
             return true;
         } else {
             return false;
         }
     }
 }
Ejemplo n.º 6
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;
     }
 }