Example #1
0
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/PendenciaDAO.php';
include_once '../../cadastros/Usuario.class.php';
include_once '../Pendencia.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
$usuario = new Usuario();
$pendencia = new Pendencia();
$DAO = new PendenciaDAO();
//Verifica se a opcao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'inserir') {
    $pendencia->setUsuario(userId());
    $pendencia->setDocumentoPendente($_POST['documento']);
    $pendencia->setIdPessoa($_POST['responsavel']);
    $pendencia->setDescricao($_POST['descricao']);
    $pendencia->setConcluido('N');
    $pendencia->setDataLimite($_POST['dataPrazo']);
    $pessoa = $_POST['responsavel'];
    //Verifica se todos os campos foram digitados
    if ($pendencia->getDocumentoPendente() != NULL && $pendencia->getDescricao() != NULL && $pendencia->getDataLimite() != NULL) {
        $retorno = $DAO->Gravar($pendencia);
        // 		die(print_r($retorno));
        if ($retorno == true) {
            $retorno = $DAO->Listar("SELECT cod_documento FROM " . MYSQL_BASE_DOCUMENTOS . " WHERE id=" . $pendencia->getDocumentoPendente());
            foreach ($retorno as $item) {
                $cod_documento = $item['cod_documento'];
            }
            //---------Envio de e-mail-Inicio-----------------
Example #2
0
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/PendenciaDAO.php';
include_once '../Pendencia.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
$pendencia = new Pendencia();
$DAO = new PendenciaDAO();
//Verifica se a opcao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'finalizar') {
    $pendencia->setDocumentoCorrigido($_POST['documento']);
    $pendencia->setId(limpaTexto($_POST['id']));
    if ($pendencia->getDocumentoCorrigido() != NULL) {
        $retorno = $DAO->Atualizar($pendencia);
        if ($retorno == true) {
            echo '<script language= "JavaScript">alert("Registro alterado com sucesso");</script>';
            echo '<script language= "JavaScript">location.href="index.php";</script>';
        }
    } else {
        echo '<script language= "JavaScript">alert("Escolha o documento");</script>';
    }
} else {
    $pendencia->setId(limpaTexto($_GET['id']));
    $resultado = $DAO->Listar("SELECT * FROM " . MYSQL_BASE_PENDENCIA . " WHERE concluido='N' AND id=" . $pendencia->getId());
    foreach ($resultado as $item) {
        $pendencia->setUsuario($item['id_documento_pendente']);
        $pendencia->setDescricao($item['descricao']);
        $pendencia->setDocumentoPendente($item['id_documento_pendente']);
    }
Example #3
0
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/PendenciaDAO.php';
include_once '../Pendencia.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
$pendencia = new Pendencia();
$DAO = new PendenciaDAO();
//Verifica se a opcao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'inserir') {
    $pendencia->setDocumentoPendente($_POST['documento']);
    $pendencia->setDescricao($_POST['descricao']);
    $pendencia->setConcluido('N');
    $pendencia->setUsuario(userId());
    $pendencia->setDataLimite($_POST['dataPrazo']);
    $pendencia->setResponsavel(limpaTexto($_POST['responsavel']));
    $pendencia->setEmailResponsavel(limpaTexto($_POST['email']));
    //Verifica se todos os campos foram digitados
    if ($pendencia->getDocumentoPendente() != NULL && $pendencia->getDescricao() != NULL && $pendencia->getDataLimite() != NULL && $pendencia->getResponsavel() != NULL && $pendencia->getEmailResponsavel() != NULL) {
        $retorno = $DAO->Gravar($pendencia);
        if ($retorno == true) {
            echo '<script language= "JavaScript">alert("Registro cadastrado com sucesso");</script>';
            echo '<script language= "JavaScript">location.href="new.php";</script>';
        }
    } else {
        echo '<script language= "JavaScript">alert("Preencha todos os campos");</script>';
    }
}
?>