Пример #1
0
include_once '../DAO/ProjetoDAO.php';
include_once '../CheckList.class.php';
include_once '../../mensagem/Mensagem.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
if (!in_array(11, listarAcesso())) {
    echo '<script language= "JavaScript">location.href="index.php";</script>';
}
$checkList = new CheckList();
$DAO_CK = new CheckListDAO();
$DAOMsg = new MensagemDAO();
$mensagem = new Mensagem();
//Verifica se a acao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'inserir') {
    connectSQL();
    $checkList->setRemessaLista($_POST['lista']);
    $checkList->setRemessaArquivo($_POST['id_arquivo']);
    if ($_POST['item1'] == '' || $_POST['item2'] == '' || $_POST['item5'] == '' || $_POST['item6'] == '' || $_POST['item7'] == '' || $_POST['item8'] == '' || $_POST['item9'] == '' || $_POST['item10'] == '' || $_POST['item11'] == '' || $_POST['item12'] == '' || $_POST['item13'] == '' || $_POST['item14'] == '' || $_POST['item17'] == '') {
        $msg = utf8_encode("Selecione um item.");
        echo '<script language= "JavaScript">alert("' . $msg . '");</script>';
        echo '<script language= "JavaScript">location.href="new.php?id=' . $checkList->getRemessaLista() . '";</script>';
    } else {
        if ($checkList->getRemessaArquivo() != '') {
            $resultado = $DAO_CK->Listar("SELECT nome FROM " . MYSQL_BASE_OBRAS . " WHERE id=" . $_POST['obra']);
            foreach ($resultado as $item) {
                $obra = $item['nome'];
            }
            $sql_lista = $DAO_CK->Listar("SELECT * \r\n\t\t\t\t\t\t\t\t\t\t  FROM " . MYSQL_BASE_REMESSA_LISTAS . " \r\n\t\t\t\t\t\t\t\t\t\t  WHERE id = " . $checkList->getRemessaLista());
            foreach ($sql_lista as $item) {
                $lista_empresa = $item['id_empresa'];
            }
Пример #2
0
include_once '../CheckList.class.php';
include_once '../../mensagem/Mensagem.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
if (!in_array(11, listarAcesso())) {
    echo '<script language= "JavaScript">location.href="index.php";</script>';
}
$checkList = new CheckList();
$DAO = new CheckListDAO();
$DAOMsg = new MensagemDAO();
$mensagem = new Mensagem();
//Verifica se a acao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'inserir') {
    $check = $_POST['check'];
    connectSQL();
    $checkList->setRemessaLista($_POST['lista']);
    if ($_FILES['anexo']['error'] != 4) {
        $uploadDir = '../../arquivos/';
        $name = sha1(date("d-m-Y H:i:s"));
        $uploadFile = $uploadDir . $name;
        $extension = pathinfo($_FILES['anexo']['name'], PATHINFO_EXTENSION);
        $uploadFile = $uploadFile . '.' . $extension;
        //Fazer o Upload do arquivo
        if (move_uploaded_file($_FILES['anexo']['tmp_name'], $uploadFile)) {
            $checkList->setFile($name . '.' . $extension);
        } else {
            echo '<script language= "JavaScript">alert("Erro ao anexo o Arquivo");</script>';
            echo '<script language= "JavaScript">location.href="verificador_varios.php";</script>';
        }
    } else {
        $checkList->setFile('');