// 			$erro = true;
 // 		} else $erro = false;
 $erro = false;
 if (!$erro) {
     if ($row['loc_id'] != $_POST['estoque_local'] || $row['eqp_equip_inst'] != $_POST['estoque_equip_unidade'] || $row['eqp_equip_inv'] != $_POST['estoque_equip_tag']) {
         $updHist = true;
     } else {
         $updHist = false;
     }
     $valor = str_replace(",", ".", $_POST['estoque_value']);
     if (empty($_POST['estoque_tag'])) {
         $estoque_tag = 'null';
     } else {
         $estoque_tag = $_POST['estoque_tag'];
     }
     $query = "UPDATE estoque SET estoq_tipo = " . $_POST['estoque_tipo'] . " , estoq_desc = '" . noHtml($_POST['estoque_desc']) . "', " . "estoq_sn = '" . noHtml($_POST['estoque_sn']) . "', estoq_local = " . $_POST['estoque_local'] . ", " . "estoq_tag_inst = " . $_POST['estoque_unidade'] . ", estoq_tag_inv = " . $estoque_tag . ", " . "estoq_partnumber = '" . noHtml($_POST['estoque_partnumber']) . "',  estoq_vendor = '" . $_POST['estoque_vendor'] . "', " . "estoq_nf = '" . noHtml($_POST['estoque_nf']) . "', estoq_value = '" . noHtml($valor) . "',  " . "estoq_data_compra = '" . FDate(noHtml($_POST['estoque_date_buy'])) . "', estoq_warranty = '" . $_POST['estoque_warranty'] . "',  " . "estoq_ccusto = '" . $_POST['estoque_ccusto'] . "', estoq_situac = '" . $_POST['estoque_situac'] . "',  " . "estoq_comentario = '" . noHtml($_POST['estoque_comentario']) . "' " . "WHERE estoq_cod=" . $_POST['cod'] . "";
     //print $query; exit;
     $resultadoUpd = mysql_query($query) or die(TRANS('ERR_EDIT') . '<BR>' . $query);
     if ($resultadoUpd == 0) {
         $aviso = TRANS('ERR_EDIT');
     } else {
         $aviso = TRANS('OK_EDIT');
         $texto = TRANS('WARE_COD') . $row['estoq_cod'] . TRANS('CHANGED');
         geraLog(LOG_PATH . 'invmon.txt', date('d-m-Y H:i:s'), $_SESSION['s_usuario'], $_SERVER['PHP_SELF'], $texto);
     }
     if (isset($_POST['estoque_equip_unidade']) && isset($_POST['estoque_equip_tag'])) {
         $sqlChecaEquip = "SELECT * FROM equipXpieces WHERE eqp_piece_id = " . $_POST['cod'] . " ";
         //".$row['estoq_cod']."
         $execChecaEquip = mysql_query($sqlChecaEquip) or die(TRANS('ERR_EDIT') . '<br>' . $sqlChecaEquip);
         $achou = mysql_num_rows($execChecaEquip);
         if ($achou) {
     }
 }
 /* ----------------- FIM ALTERACAO ----------------- */
 //$data = date("Y-m-d H:i:s");
 $i = 0;
 if (!isset($_POST['replicar'])) {
     $replicate = 0;
 } else {
     $replicate = $_POST['replicar'];
 }
 $date_schedule = date("Y-m-d H:i:s");
 while ($i <= $replicate) {
     $operator = $_SESSION['s_uid'];
     if (isset($_POST['chk_squedule']) && $_POST['chk_squedule'] != "") {
         $schedule = 1;
         $date_schedule = FDate($_POST['date_schedule']);
         $oStatus = $row_config['conf_schedule_status'];
         $first_queued = false;
     } else {
         $schedule = 0;
         $date_schedule = date("Y-m-d H:i:s");
         if (isset($_POST['foward']) && $_POST['foward'] != -1) {
             $oStatus = $row_config['conf_foward_when_open'];
             $operator = $_POST['foward'];
         } else {
             $oStatus = 1;
         }
         //Aguardando atendimento
         $first_queued = true;
         //date("Y-m-d H:i:s");
     }
Example #3
0
 function pega_dados_del()
 {
     $db = new Database($this->Owner, true);
     if (!$db->link) {
         return;
     }
     $sql = 'SELECT * FROM Vw_Del_Contas_Pagar';
     $filtro = $this->del_filtro->sql();
     $extra = ' Inativo = 0 ';
     $where = $filtro ? ' AND ' . $extra : ' WHERE ' . $extra;
     if (!$db->multi_query($sql . $filtro . $where)) {
         return;
     }
     $this->del_grid->store->clear();
     while ($line = $db->line()) {
         $row = $this->del_grid->store->append();
         $this->del_grid->store->set($row, 0, $line['Id'], 1, $line['CodConta'], 2, $line['Filial'], 3, $line['Fornecedor'], 4, $line['NumDoc'], 5, $line['Parcela'], 6, PointToComma($line['ValorDoc']), 7, FDate($line['Vencimento']), 8, FDate($line['Cancelado']));
     }
     $this->del_grid->first_line();
     return true;
 }
Example #4
0
 function pega_dados()
 {
     $db = new Database($this, true);
     if (!$db->link) {
         return;
     }
     /*
      * Dados
      */
     if (!$db->multi_query(' SELECT * FROM Vw_Usuarios WHERE Id = ' . $this->CodUsuario)) {
         return;
     }
     if (!($line = $db->line())) {
         return;
     }
     $this->filial->combobox->set_active_iter($this->filial->it[$line['CodFilial']]);
     $this->perfil->combobox->set_active_iter($this->perfil->it[$line['CodPerfil']]);
     $this->usuario->set_text($line['Usuario']);
     $this->nome->set_text($line['Nome']);
     $this->ativo->set_active($line['Ativo']);
     $this->endereco->set_text($line['Endereco']);
     $this->bairro->set_text($line['Bairro']);
     $this->cep->set_text($line['CEP']);
     $this->cidade->set_text($line['Cidade']);
     $this->estado->combobox->set_active_iter($this->estado->it[$line['CodEstado']]);
     $this->cpf->set_text($line['CPF']);
     $this->rg->set_text($line['RG']);
     $this->sexo->combobox->set_active_iter($this->sexo->it[$line['CodSexo']]);
     $this->est_civil->combobox->set_active_iter($this->est_civil->it[$line['CodEstCivil']]);
     $this->dependentes->set_text($line['Dependentes']);
     $this->filhos->set_text($line['Filhos']);
     $this->depto->combobox->set_active_iter($this->depto->it[$line['CodDepto']]);
     $this->cargo->combobox->set_active_iter($this->cargo->it[$line['CodCargo']]);
     $this->cracha->set_text($line['Cracha']);
     $this->email->set_text($line['Email']);
     $this->tel->set_text($line['Tel']);
     $this->cel->set_text($line['Cel']);
     $this->data_nasc->set_text(FDate($line['Nascimento']));
     $this->data_adm->set_text(FDate($line['Admissao']));
     $this->data_homo->set_text(FDate($line['Homologacao']));
     $this->data_resc->set_text(FDate($line['Rescisao']));
     return true;
 }
     //NOVO STATUS
     if ($rowChkDate['oco_real_open_date'] != "") {
         $realOpenDate = $rowChkDate['oco_real_open_date'];
     } else {
         $realOpenDate = $_POST['data_abertura'];
     }
     $data_agendamento = FDate($_POST['data_abertura']);
     $agendado = $rowChkDate['oco_scheduled'];
 }
 $erro = false;
 if (!$erro) {
     $sqlPost = "select o.*, u.* from ocorrencias as o, usuarios as u where o.operador = u.user_id and numero=" . $_POST['numero'] . "";
     $resultadoPost = mysql_query($sqlPost);
     $row = mysql_fetch_array($resultadoPost);
     //CONTROLE PARA GARANTIR QUE NÃO EXISTA DATA DE ABERTURA ZERADA
     if (FDate($data_agendamento) == '0000-00-00 00:00:00') {
         if ($row['data_abertura'] != '0000-00-00 00:00:00' && !empty($row['data_abertura'])) {
             $data_agendamento = $row['data_abertura'];
         } else {
             if ($row['oco_real_open_date'] != '0000-00-00 00:00:00' && !empty($row['oco_real_open_date'])) {
                 $data_agendamento = $row['oco_real_open_date'];
             } else {
                 if ($row['data_atendimento'] != '0000-00-00 00:00:00' && !empty($row['data_atendimento'])) {
                     $data_agendamento = $row['data_atendimento'];
                 }
             }
         }
     }
     /* ----------------- INICIO ALTERACAO ----------------- */
     $gravaImg = false;
     $qryConf = "SELECT * FROM config";
Example #6
0
function FDateTime($date)
{
    $fdate = FDate($date);
    $ftime = substr($date, 11);
    if (!strcmp($ftime, '00:00:00')) {
        $ftime = '';
    }
    return $fdate . ' ' . $ftime;
}