Exemple #1
0
include_once '../../head.php';
$remessa = new Remessa();
$DAO = new RemessaDAO();
$remessa->setId(limpaTexto($_GET['lista']));
if (!in_array(235, listarAcesso())) {
    echo '<script language= "JavaScript">location.href="' . EXTERNAL_ROOT_PORTAL . '/modulos.php";</script>';
}
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'editar') {
    $msg_erro = NULL;
    $msg_sucesso = NULL;
    $file = $_FILES['file'];
    $remessa->setFile($file['name']);
    $remessa->setTitulo($_POST['titulo']);
    $remessa->setIdArquivo($_POST['id']);
    if ($file['error'] == UPLOAD_ERR_NO_FILE) {
        $res = $DAO->Listar("SELECT * FROM " . MYSQL_BASE_REMESSA_ARQUIVOS . " WHERE id = " . $remessa->getIdArquivo());
        foreach ($res as $item) {
            $remessa->setFile($item['file']);
        }
        $num = 1;
    } else {
        $res = $DAO->Listar("SELECT * FROM " . MYSQL_BASE_REMESSA_ARQUIVOS . " WHERE file = '" . $file['name'] . "' AND excluido IS NULL");
        $num = $res->rowCount();
    }
    if ($num > 0) {
        $uploadDir = '../../arquivos/remessa/';
        $name = $file['name'];
        $uploadFile = $uploadDir . $name;
        if (move_uploaded_file($file['tmp_name'], $uploadFile) || $file['error'] == 4) {
            if ($remessa->getTitulo() == NULL) {
                $msg_erro = utf8_encode("É necessário conter um titulo");
Exemple #2
0
include_once '../../includes.sys/metodos.php';
include_once '../DAO/RemessaDAO.php';
include_once '../Remessa.class.php';
if (!empty($_GET['arquivo'])) {
    $nome_arquivo = $_GET['arquivo'];
    //file location
    // 	    header("Content-type: application/vnd.ms-excel");
    header("Content-type: application/force-download");
    header('Content-Disposition: attachment; filename="' . basename($nome_arquivo) . '"');
    readfile('../../arquivos/remessa/' . $nome_arquivo);
    //  ../../arquivos/remessa
    header("Pragma: no-cache");
} else {
    $lista = $_GET['lista'];
    $remessa = new Remessa();
    $DAO = new RemessaDAO();
    $res = $DAO->Listar("SELECT * FROM " . MYSQL_BASE_REMESSA_ARQUIVOS . " WHERE id_remessa_lista =" . $lista);
    foreach ($res as $item) {
        $remessa->setFile($item['file']);
        $nome_arquivo = $remessa->getFile();
        //file location
        // 	    header("Content-type: application/vnd.ms-excel");
        header("Content-type: application/force-download");
        header('Content-Disposition: attachment; filename="' . basename($nome_arquivo) . '"');
        readfile('../../arquivos/' . $nome_arquivo);
        header("Pragma: no-cache");
    }
}
?>

Exemple #3
0
					<li>Listagem de Documentos</li>
				</ul>
			</div>
			
			<div class="row-fluid">
				<div class="box span12">
					<div class="box-header well">
						<h2><i class="icon-list-alt"></i> Listagem de Projetos em Desenvolvimento - Obra</h2>
						<div class="box-icon">
						</div>
					</div>
					<div class="box-content">
						
						  <ul class="nav">
						  	<?php 
$resultado = $DAO->Listar("SELECT DISTINCT o.id, o.codigo, o.nome, COUNT(o.id) as contador FROM " . MYSQL_BASE_PROJETO_OBRA . " o, " . MYSQL_BASE_PROJETO_DESENVOLVIMENTO . " pd \r\n\t\t\t\t\t\t  \t\t\t\tWHERE o.id = pd.id_obra AND pd.dat_excluido IS NULL GROUP BY o.codigo ASC");
foreach ($resultado as $item) {
    echo '<li>
											<a href="' . EXTERNAL_ROOT_PORTAL . '/remessa/list_desenvolvimento/obra_fase.php?obra=' . $item['id'] . '">
												<i class="icon-folder-close"></i>
											<span class="hidden-tablet" style="font-size: 16px; color:#000080;"><b>' . $item['codigo'] . ' - ' . $item['nome'] . ' (' . $item['contador'] . ')</b></span>
											</a></li>';
}
?>
						  </ul>   
					</div>
				</div>
			</div>
					
					<!-- content ends -->
			</div><!--/#content.span10-->
Exemple #4
0
 function listarEmpresas($id = null)
 {
     $DAO = new RemessaDAO();
     $empresas = $DAO->Listar("SELECT * FROM " . MYSQL_BASE_EMPRESAS . " WHERE id IN (8, 9, 10)");
     foreach ($empresas as $empresa) {
         if ($id == $empresa['id']) {
             echo '<option selected="selected" value="' . $empresa['id'] . '">' . $empresa['nome'] . '</option>';
         } else {
             echo '<option value="' . $empresa['id'] . '">' . $empresa['nome'] . '</option>';
         }
     }
 }
Exemple #5
0
												<span>
													<input type="radio" name="status" id="optionsRadios2" value="R" style="opacity: 0;">
												</span>
											</div>
											Reprovado
										</label>
									</div>
								</div>
							
								<div class="control-group">
									<label class="control-label" for="selectError1">Obra</label>
									<div class="controls">
										<select id="selectError1" data-rel="chosen" name="obra">
											<option value="0">Selecione ...</option>
											<?php 
$result = $DAO->Listar("SELECT * FROM " . MYSQL_BASE_PROJETO_OBRA . " WHERE status = 'S'");
foreach ($result as $item) {
    echo '<option value="' . $item['codigo'] . '">' . $item['codigo'] . ' - ' . $item['nome'] . "</option>";
}
?>
										</select>
									</div>
								</div>
								
								<div class="control-group">
									<label class="control-label" for="selectError2">Fase do Projeto</label>
									<div class="controls">
										<select id="selectError2" data-rel="chosen" name="fase">
											<option value="0">Selecione ...</option>
											<?php 
$result = $DAO->Listar("SELECT * FROM " . MYSQL_BASE_FASE_PROJETOS . " WHERE ativo = 'S'");
Exemple #6
0
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../Remessa.class.php';
include_once '../DAO/RemessaDAO.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
if (!in_array(165, listarAcesso())) {
    echo '<script language= "JavaScript">location.href="index.php";</script>';
}
$id = limpaTexto($_GET['id']);
$remessa = new Remessa();
$DAO = new RemessaDAO();
$sql_lista = $DAO->Listar("SELECT A.id, A.criado, B.nome, C.nome_completo, A.id_empresa, C.id AS id_usuario\r\n\t\t\t\t\t\t\tFROM " . MYSQL_BASE_REMESSA_LISTAS . " A \r\n\t\t\t\t\t\t\t\tINNER JOIN " . MYSQL_BASE_EMPRESAS . " B ON A.id_empresa = B.id \r\n\t\t\t\t\t\t\t\tINNER JOIN " . MYSQL_BASE_PESSOAS . " C ON A.id_usuario = C.id\r\n\t\t\t\t\t\t\tWHERE A.id =" . $id);
foreach ($sql_lista as $item) {
    $remessa->setId($item['id']);
    $remessa->setCriado($item['criado']);
    $remessa->setEmpresa($item['nome']);
    $remessa->setIdEmpresa($item['id_empresa']);
    $remessa->setIdUsuario($item['id_usuario']);
    $remessa->setNome($item['nome_completo']);
}
$resultado = $DAO->Listar("SELECT \tA.id_remessa_lista, \r\n\t\t\t\t\t\t\t\t\tSUBSTRING(A.file,4,35) AS cod_doc, \r\n\t\t\t\t\t\t\t\t\tB.nome_completo, \r\n\t\t\t\t\t\t\t\t\tC.nome AS obra, \r\n\t\t\t\t\t\t\t\t\tA.titulo, \r\n\t\t\t\t\t\t\t\t\tD.nome AS disciplina, \r\n\t\t\t\t\t\t\t\t\tSUBSTRING(A.file,37,2) AS revisao \r\n\t\t\t\t\t\t\tFROM " . MYSQL_BASE_REMESSA_ARQUIVOS . " A \r\n\t\t\t\t\t\t\t\tINNER JOIN " . MYSQL_BASE_PESSOAS . " B ON B.id = A.id_usuario \r\n\t\t\t\t\t\t\t\tINNER JOIN " . MYSQL_BASE_PROJETO_OBRA . " C ON C.codigo = SUBSTRING(A.file,16,3) \r\n\t\t\t\t\t\t\t\tINNER JOIN " . MYSQL_BASE_DISCIPLINAS . " D ON D.codigo = SUBSTRING(A.file,26,3) \r\n\t\t\t\t\t\t\tWHERE excluido IS NULL \r\n\t\t\t\t\t\t\tAND A.id_remessa_lista =" . $id);
?>

<style>
	table {
/* 		border-spacing: 0px; */
/* 		border-collapse: collapse; */
		width: 800px;
	}
Exemple #7
0
								  <th style="display: none;" width="10%"nowrap>DATA PARA ORDENAR</th>
								  <th>PI</th>
								  <th>Assunto</th>
								  <th>Obra</th>
								  <th>Fase do Projeto</th>
								  <th>Disciplina</th>
								  <th>Data da PI</th>
								  <th>Empresa</th>
								  <th>Cont&eacute;m Anexo?</th>
								  <th>Status da An&aacute;lise</th>
								  <th width="25%">A&ccedil;&atilde;o</th>
							  </tr>
						  </thead>   
						  <tbody>
							<?php 
$result = $DAO->Listar($query);
$count = 1;
foreach ($result as $item) {
    $tem_anexo = "N&atilde;o";
    if (!empty($item['file'])) {
        $tem_anexo = "Sim";
    }
    switch ($item['status']) {
        case 'A':
            $status = 'Aprovado';
            break;
        case 'AC':
            $status = 'Aprovado com coment&aacute;rio';
            break;
        case 'R':
            $status = 'Reprovado';
Exemple #8
0
            <div class="row-fluid">
                <div class="box span12">
                    <div class="box-header well">
                        <h2><i class="icon-list-alt"></i> Listagem de Projetos em Desenvolvimento - Fase do Projeto</h2>
                        <div class="box-icon">
                        </div>
                    </div>
                    <div class="box-content">

                        <style>
                            ul{list-style-type: none;}
                        </style>

                        <ul class="nav">
                            <?php 
$resultado = $DAO->Listar("SELECT DISTINCT o.id, o.codigo, o.nome, COUNT(o.id) as contador FROM " . MYSQL_BASE_PROJETO_OBRA . " o, " . MYSQL_BASE_PROJETO_DESENVOLVIMENTO . " pd WHERE\n\t\t\t\t\t\t\t\t\t o.id = pd.id_obra AND pd.dat_excluido IS NULL AND o.id=" . limpaTexto($_GET['obra']) . " GROUP BY o.codigo ASC");
foreach ($resultado as $item) {
    echo '<li>
											<a href="' . EXTERNAL_ROOT_PORTAL . '/remessa/list_desenvolvimento/index.php">
												<i class="icon-folder-open"></i>
											<span class="hidden-tablet" style="font-size: 16px; color:#000080;"><b>' . $item['codigo'] . ' - ' . $item['nome'] . ' (' . $item['contador'] . ')</b></span>
											</a></li>';
}
echo '<ul>';
$resultado = $DAO->Listar("SELECT DISTINCT fp.id, fp.codigo, fp.nome, COUNT(fp.id) as contador FROM " . MYSQL_BASE_FASE_PROJETOS . " fp, " . MYSQL_BASE_PROJETO_DESENVOLVIMENTO . " pd WHERE\n\t\t\t                                            fp.id = pd.id_fase AND pd.dat_excluido IS NULL AND pd.id_obra=" . $_GET['obra'] . " GROUP BY fp.codigo ASC;");
foreach ($resultado as $item) {
    echo '<li>
											<a href="' . EXTERNAL_ROOT_PORTAL . '/remessa/list_desenvolvimento/obra_disciplina.php?obra=' . limpaTexto($_GET['obra']) . '&fase=' . $item['id'] . '">
												<i class="icon-folder-close"></i>
											<span class="hidden-tablet" style="font-size: 16px; color:#000080;"><b>' . $item['codigo'] . ' - ' . $item['nome'] . ' (' . $item['contador'] . ')</b></span>
											</a></li>';
Exemple #9
0
									<label class="control-label"><b>Arquivo CSV</b></label>
									<div class="controls">
									  <input type="file" name="files">
									  <p class="help-block"><a href="modelo.csv" target="_blank">Baixar Arquivo modelo</a></p>
									</div>
								</div>
								
								<?php 
if ($remessa->getId() != 0) {
    ?>
								<div class="control-group">
									<label class="control-label"><b>Arquivo Sem Titulo</b></label>
									<div class="controls">
									  <ul>
									  	<?php 
    $resultado = $DAO->Listar("SELECT * FROM " . MYSQL_BASE_REMESSA_ARQUIVOS . " WHERE excluido IS NULL AND titulo IS NULL AND id_remessa_lista = " . $remessa->getId());
    foreach ($resultado as $item) {
        echo '<li>' . $item['file'] . '</li>';
    }
    ?>
									  </ul>
									</div>
								</div>
								<?php 
}
?>
								
								<div class="form-actions">
									<input type="hidden" name="cmd" value="inserir">
									<button type="submit" class="btn btn-primary">Enviar</button>
									<button type="reset" class="btn" onclick="history.go(-1)">Cancelar</button>
Exemple #10
0
            <div class="row-fluid">
                <div class="box span12">
                    <div class="box-header well">
                        <h2><i class="icon-list-alt"></i> Listagem de Projetos em Desenvolvimento - Lista de Arquivos</h2>
                        <div class="box-icon">
                        </div>
                    </div>
                    <div class="box-content">

                        <style>
                            ul{list-style-type: none;}
                        </style>

                        <ul class="nav">
                            <?php 
$resultado = $DAO->Listar("SELECT DISTINCT o.id, o.codigo, o.nome, COUNT(o.id) as contador FROM " . MYSQL_BASE_PROJETO_OBRA . " o, " . MYSQL_BASE_PROJETO_DESENVOLVIMENTO . " pd WHERE\r\n\t\t\t\t\t\t\t\t\to.id = pd.id_obra AND pd.dat_excluido IS NULL AND o.id=" . limpaTexto($_GET['obra']) . " GROUP BY o.codigo ASC");
foreach ($resultado as $item) {
    echo '<li>
											<a href="' . EXTERNAL_ROOT_PORTAL . '/remessa/list_desenvolvimento/obra.php">
												<i class="icon-folder-open"></i>
											<span class="hidden-tablet" style="font-size: 16px; color:#000080;"><b>' . $item['codigo'] . ' - ' . $item['nome'] . ' (' . $item['contador'] . ')</b></span>
											</a></li>';
}
echo '<ul>';
$resultado = $DAO->Listar("SELECT DISTINCT fp.id, fp.codigo, fp.nome, COUNT(fp.id) as contador FROM " . MYSQL_BASE_FASE_PROJETOS . " fp, " . MYSQL_BASE_PROJETO_DESENVOLVIMENTO . " pd WHERE\r\n\t\t\t                                            fp.id = pd.id_fase AND pd.dat_excluido IS NULL AND pd.id_obra=" . $_GET['obra'] . " AND pd.id_fase=" . limpaTexto($_GET['fase']) . " GROUP BY fp.codigo ASC;");
foreach ($resultado as $item) {
    echo '<li>
											<a href="' . EXTERNAL_ROOT_PORTAL . '/remessa/list_desenvolvimento/obra_fase.php?obra=' . limpaTexto($_GET['obra']) . '">
												<i class="icon-folder-open"></i>
											<span class="hidden-tablet" style="font-size: 16px; color:#000080;"><b>' . $item['codigo'] . ' - ' . $item['nome'] . ' (' . $item['contador'] . ')</b></span>
											</a></li>';
Exemple #11
0
     $msg_codigo_erro .= "<li>A disciplina não existe</li>";
 }
 if ($remessa->getTipoDocumento() == 0) {
     $msg_codigo_erro .= "<li>O tipo de documento não existe</li>";
 }
 $msg_codigo_erro .= "</ul>";
 if ($remessa->getCodigoProjeto() > 0 && $remessa->getNucleo() > 0 && $remessa->getContrato() > 0 && $remessa->getObra() > 0 && $remessa->getTrecho() > 0 && $remessa->getFaseProjeto() > 0 && $remessa->getDisciplina() > 0 && $remessa->getTipoDocumento() > 0) {
     //Fazer o Upload do arquivo
     $validado = mysql_query("SELECT id FROM " . MYSQL_BASE_REMESSA_ARQUIVOS . " WHERE file = '" . $remessa->getFile() . "' AND excluido IS NULL");
     $cheklist = mysql_query("SELECT id FROM " . MYSQL_BASE_CHECK_LISTS . " WHERE nome_arquivo = '" . $remessa->getFile() . "' AND ativo = 'S'");
     $num = mysql_num_rows($validado);
     $num2 = mysql_num_rows($cheklist);
     if ($num == 0 && $num2 == 0) {
         $nome_versao = substr($explode[0], 0, -2);
         $superior = mysql_query("SELECT * FROM " . MYSQL_BASE_REMESSA_ARQUIVOS . " WHERE file LIKE '" . $nome_versao . "%' AND revisao > '" . $remessa->getRevisao() . "' ORDER BY revisao DESC LIMIT 1");
         $superior_chk = $DAO->Listar("SELECT * FROM " . MYSQL_BASE_CHECK_LISTS . " WHERE id IN (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tSELECT id FROM " . MYSQL_BASE_CHECK_LISTS . " WHERE nome_arquivo LIKE '" . $nome_versao . "%' AND ativo = 'S'\r\n\t\t\t\t\t\t\t\t\t\t\t\t) AND nome_arquivo > '" . $remessa->getFile() . "'");
         $num_chk_superior = $superior_chk->rowCount();
         $num_superior = mysql_num_rows($superior);
         if ($num_chk_superior > 0 || $num_superior > 0) {
             $validador = 1;
             $erros += 1;
             if ($num_chk_superior == 0 && $num_superior > 0) {
                 foreach ($superior as $row) {
                     $versao = $row['revisao'];
                 }
             } elseif ($num_chk_superior > 0 && $num_superior == 0) {
                 foreach ($superior_chk as $row) {
                     $ex = explode(".", $row['nome_arquivo']);
                     $versao_ck[] = substr($ex[0], 33, 35);
                 }
                 rsort($versao_ck);
Exemple #12
0
 //Fazer o Upload do arquivo
 $validado = mysql_query("SELECT id FROM " . MYSQL_BASE_REMESSA_ARQUIVOS . " WHERE file LIKE '%" . $nome_arquivo_35 . "%' AND excluido IS NULL");
 $cheklist = mysql_query("SELECT id FROM " . MYSQL_BASE_CHECK_LISTS . " WHERE nome_arquivo LIKE '" . $nome_arquivo_35 . "%' AND ativo = 'S'");
 $num = mysql_num_rows($validado);
 $num2 = mysql_num_rows($cheklist);
 if ($num == 0 && $num2 == 0) {
     $nome_versao = substr($nome_arquivo_35, 0, -2);
     if (is_numeric($remessa->getRevisao())) {
         $sql_regexp = '0-9';
     } else {
         $sql_regexp = 'A-Z';
     }
     //se existe um arquivo com o mesmo nome e com uma vers�o superior
     $superior = mysql_query("SELECT * FROM " . MYSQL_BASE_REMESSA_ARQUIVOS . " \r\n\t\t\t\t\t\t\t\t\t\t\tWHERE file LIKE '" . $nome_versao . "%' \r\n\t\t\t\t\t\t\t\t\t\t\tAND revisao > '" . $remessa->getRevisao() . "' \r\n\t\t\t\t\t\t\t\t\t\t\tAND excluido IS NULL \r\n\t\t\t\t\t\t\t\t\t\t\tORDER BY revisao DESC LIMIT 1");
     //verifica no check_lits se existe uma versao superior
     $superior_chk = $DAO->Listar("SELECT * FROM " . MYSQL_BASE_CHECK_LISTS . " \r\n\t\t\t\t\t\t\t\t\t\t\t  WHERE id IN (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tSELECT id FROM " . MYSQL_BASE_CHECK_LISTS . " \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE nome_arquivo LIKE '" . $nome_versao . "%' \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND ativo = 'S' \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND revisao REGEXP '[" . $sql_regexp . "]'\r\n\t\t\t\t\t\t\t\t\t\t\t) AND revisao > '" . $remessa->getRevisao() . "'");
     $num_chk_superior = $superior_chk->rowCount();
     $num_superior = mysql_num_rows($superior);
     $sql_versao = mysql_query("SELECT \r\n\t\t\t\t\t\t\t\t\t\t\t\t* \r\n\t\t\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\t\t" . MYSQL_BASE_REMESSA_ARQUIVOS . " \r\n\t\t\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\t\t\texcluido IS NULL AND \r\n\t\t\t\t\t\t\t\t\t\t\t\tfile LIKE '%" . $nome_versao . "%' \r\n\t\t\t\t\t\t\t\t\t\t\tORDER BY id DESC \r\n\t\t\t\t\t\t\t\t\t\t\tLIMIT 1");
     $proxima_revisao = "";
     $num_rem = mysql_num_rows($sql_versao);
     if ($num_rem > 0) {
         while ($row_revisao = mysql_fetch_array($sql_versao)) {
             $proxima_revisao = $row_revisao['revisao'];
         }
         if (is_numeric($remessa->getRevisao())) {
             if (is_numeric($proxima_revisao)) {
                 ++$proxima_revisao;
             } else {
                 $proxima_revisao = '00';
             }
Exemple #13
0
        echo '		<a data-rel="tooltip" title="Download" class="btn btn-inverse" href="index.php?cmd=compact&id=' . $item['id'] . '">';
        echo '			<i class="icon-download-alt icon-white"></i>';
        echo '		</a>';
    }
    echo '	</td>';
    echo '</tr>';
}
?>
						  </tbody>
					  </table>
					  
					  <!-- PAGINACAO -->
					  <div class="pagination pagination-centered">
						  <ul>
							<?php 
$stmt = $DAO->Listar($query . $order_by);
$total_registros = $stmt->rowCount();
$pags = ceil($total_registros / $qnt);
// Número máximos de botões de paginação
$max_links = 3;
$get = "";
//Montando os gets para paginacao
if (!empty($_POST['q'])) {
    $keys = array_keys($_POST);
    foreach ($keys as $value) {
        if ($value != 'p') {
            $get .= '&' . $value . '=' . $_POST[$value];
        }
    }
}
//Montando os gets para paginacao