include_once $toRoot . "beans/Log.class.php";
 include_once $toRoot . "beans/Pessoa.class.php";
 include_once $toRoot . "beans/Tecnico.class.php";
 include_once $toRoot . "beans/Telefone.class.php";
 include_once $toRoot . "dao/DAOEmail.class.php";
 include_once $toRoot . "dao/DAOLog.class.php";
 include_once $toRoot . "dao/DAOPessoa.class.php";
 include_once $toRoot . "dao/DAOTecnico.class.php";
 include_once $toRoot . "dao/DAOTelefone.class.php";
 $conexao = new ConectarMySql($toRoot);
 $log = new Log(3, NULL, NULL);
 $daoLog = new DAOLog($log, $conexao);
 if ($cbSel == "novo") {
     $pessoa = new Pessoa($tfNom, $tfCPF, $tfRG);
     $daoPessoa = new DAOPessoa($pessoa, $conexao);
     $daoPessoa->cadastrar();
     $pessoa = $daoPessoa->getAtual();
     $log->alvCodigo = 3;
     $log->descricao = $tfNom . " cadastrado!";
     $daoLog->setLog($log);
     $daoLog->cadastrar();
     if (strlen($tfEmlURL) > 0) {
         $email = new Email($pessoa->codigo, $tfEmlURL, $tfEmlNot);
         $daoEmail = new DAOEmail($email, $conexao);
         $daoEmail->cadastrar();
         $log->alvCodigo = 4;
         $log->descricao = $tfEmlURL . " cadastrado!";
         $daoLog->setLog($log);
         $daoLog->cadastrar();
     }
     if (strlen($tfFonNum) > 0) {
Example #2
0
         break;
     case "contato":
         $classe = "B";
         $slBancRef = antiSQL(isset($_POST["slBancRef"]) ? $_POST["slBancRef"] : NULL);
         break;
 }
 $pesCod = NULL;
 if ($tfNome != NULL || $tfCPF != NULL) {
     if (strlen($tfCPF) == 0) {
         $tfCPF = NULL;
     }
     include_once "../../dao/DAOPessoa.class.php";
     $dao = new DAOPessoa($tfNome, $tfCPF, $classe, "../../", $conexao);
     include_once "../../dao/DAOLog.class.php";
     $log = new DAOLog($_SESSION["pessoa"], 3, $_SESSION["nivel"], $_SESSION["codigo"], 5, "nome=\\'" . $tfNome . "\\'", "../../", $conexao);
     if (!$dao->cadastrar() || !$log->cadastrar()) {
         $comitar = false;
     }
     if ($tfCPF == NULL) {
         $tfCPF = "%";
     }
     $linha = mysqli_fetch_array($dao->pesquisar($tfNome . ":" . $tfCPF . ":" . $classe));
     $pesCod = $linha["pes_codigo"];
 } else {
     $comitar = false;
 }
 for ($x = 1; $x < $tfFoneCont + 1; $x++) {
     eval("\$tfPesFone[{$x}] = isset(\$_POST[\"tfPesFone{$x}\"]) ? \$_POST[\"tfPesFone{$x}\"] : NULL;");
     if ($tfPesFone[$x] != NULL && preg_match("/^[0-9]{2,2}-[0-9]{4,4}-[0-9]{4,4}\$/", $tfPesFone[$x])) {
         include_once "../../dao/DAOTelefone.class.php";
         $dao = new DAOTelefone($pesCod, $tfPesFone[$x], "../../", $conexao);
 $sAdmissao = substr($campo[4], 0, 4) . "/" . substr($campo[4], 4, 2) . "/" . substr($campo[4], 6, 2);
 $sCargo = $campo[5];
 $sVinculo = $campo[6];
 $sConsignavel = $campo[7];
 $dao = new DAOPessoa($pNome, $pCPF, "S", "../", $conexao);
 $linha = mysqli_fetch_array($dao->pesquisar($pNome . ":" . $pCPF . ":S"));
 $existe = $linha["pes_codigo"];
 if (strlen($existe) > 0) {
     $log = new DAOLog($_SESSION["pessoa"], 4, $_SESSION["nivel"], $_SESSION["codigo"], 5, "nome=\\'" . $pNome . "\\'", "../", $conexao);
     if (!$dao->alterar($existe)) {
         $comitar = false;
         //echo($campo[1]);
     }
 } else {
     $log = new DAOLog($_SESSION["pessoa"], 3, $_SESSION["nivel"], $_SESSION["codigo"], 5, "nome=\\'" . $pNome . "\\'", "../", $conexao);
     if (!$dao->cadastrar()) {
         $comitar = false;
         //echo($campo[1]);
     }
     $linha = mysqli_fetch_array($dao->pesquisar($pNome . ":" . $pCPF . ":S"));
     $pesCod = $linha["pes_codigo"];
 }
 if (strlen($existe) > 0) {
     $dao = new DAOServidor($pEmpresa, $existe, $sMatricula, $sAdmissao, $sCargo, $sVinculo, $sConsignavel, 0, $sConsignavel, "../", $conexao);
     $log = new DAOLog($_SESSION["pessoa"], 4, $_SESSION["nivel"], $_SESSION["codigo"], 10, "matricula=\\'" . $sMatricula . "\\'", "../", $conexao);
     if (!$dao->alterar($existe)) {
         $comitar = false;
         //echo($campo[3]);
     }
 } else {
     $dao = new DAOServidor($pEmpresa, $pesCod, $sMatricula, $sAdmissao, $sCargo, $sVinculo, $sConsignavel, 0, $sConsignavel, "../", $conexao);