Beispiel #1
0
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/MedicaoDAO.php';
include_once '../Medicao.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
$medicao = new Medicao();
$DAO = new MedicaoDao();
$medicao->setId(limpaTexto($_GET['id']));
$sql = $DAO->Listar("SELECT DATE_FORMAT(ref_inicio, '%M de %Y') as referencia, numero FROM " . MYSQL_BASE_MEDICAO . " WHERE id = " . $medicao->getId());
$data = "";
foreach ($sql as $row) {
    $medicao->setNumeroMedicao($row['numero']);
    $data = $row['referencia'];
}
$resultado = $DAO->Listar("SELECT \r\n\t\t\t\t\t\t\t\tP.nome_completo,\r\n\t\t\t\t\t\t\t    CI.nome,\r\n\t\t\t\t\t\t\t    MIP.quantidade,\r\n\t\t\t\t\t\t\t    CI.grupo,\r\n\t\t\t\t\t\t\t    E.nome as empresa\r\n\t\t\t\t\t\t\tFROM\r\n\t\t\t\t\t\t\t\t" . MYSQL_BASE_MEDICAO_ITEM_PESSOA . " MIP\r\n\t\t\t\t\t\t\t    INNER JOIN " . MYSQL_BASE_PESSOAS . " P ON P.id = MIP.id_pessoa\r\n\t\t\t\t\t\t\t    INNER JOIN " . MYSQL_BASE_CONTRATO_ITEM . " CI ON CI.id = MIP.id_medicao_item\r\n\t\t\t\t\t\t\t    INNER JOIN " . MYSQL_BASE_EMPRESAS . " E ON E.id = MIP.id_empresa\r\n\t\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\t\tMIP.id_medicao = " . $medicao->getId() . " AND\r\n\t\t\t\t\t\t\t    MIP.dat_excluido = '0000-00-00 00:00:00'\r\n\t\t\t\t\t\t\tORDER BY P.nome_completo, CI.grupo ASC");
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Cons&oacute;rcio Troncal Bel&eacute;m - Relat&oacute;rio de Pessoal</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-15" />

<script type="text/javascript">

</script>

<style>
table {
Beispiel #2
0
<?php

include_once '../../includes.sys/ini.php';
include_once INTERNAL_ROOT_PORTAL . '/includes.sys/metodos.php';
include_once INTERNAL_ROOT_PORTAL . '/medicao/DAO/MedicaoDAO.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
$medicao = new Medicao();
$DAO = new MedicaoDao();
if (!in_array(38, listarAcesso())) {
    echo '<script language= "JavaScript">location.href="../../modulos.php";</script>';
}
if (!empty($_GET['cmd']) && $_GET['cmd'] == 'del') {
    $id = ValidateInteger(INPUT_GET, 'id');
    $retorno = $DAO->Deletar($id);
    if ($retorno == 1) {
        echo '<script language= "JavaScript">alert("Caixa removido com sucesso");</script>';
        echo '<script language= "JavaScript">location.href="index.php";</script>';
    } else {
        print_r($retorno);
    }
}
if (!empty($_GET['cmd']) && $_GET['cmd'] == 'reabrir') {
    $id = ValidateInteger(INPUT_GET, 'id');
    $retorno = $DAO->Reabrir($id);
    if ($retorno == 1) {
        echo '<script language= "JavaScript">alert("Medição reaberta com sucesso");</script>';
        echo '<script language= "JavaScript">location.href="index.php";</script>';
    } else {
        print_r($retorno);
    }
Beispiel #3
0
 function listarAnexo($medicao)
 {
     $DAO = new MedicaoDao();
     $medicao = new Medicao();
     $resultado = $DAO->Listar();
     foreach ($resultado as $item) {
     }
 }
Beispiel #4
0
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/MedicaoDAO.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
$medicao = new Medicao();
$DAO = new MedicaoDao();
if (!empty($_GET['cmd']) && $_GET['cmd'] == 'del') {
    $id = ValidateInteger(INPUT_GET, 'id');
    $retorno = $DAO->Deletar($id);
    if ($retorno == 1) {
        echo '<script language= "JavaScript">alert("Caixa removido com sucesso");</script>';
        echo '<script language= "JavaScript">location.href="index.php";</script>';
    } else {
        print_r($retorno);
    }
}
if (!empty($_GET['cmd']) && $_GET['cmd'] == 'atualizar') {
    $id = limpaTexto($_GET['id']);
    connectSQL();
    $query = mysql_query("SELECT id FROM " . MYSQL_BASE_MEDICAO . " WHERE dat_atualizado IS NULL AND id <" . $id);
    if (mysql_num_rows($query) == 0) {
        $medicao->AtualizarAcumuladoAnterioG1($id);
        $medicao->AtualizarAcumuladoAnterioG2($id);
        $medicao->AtualizarMedidoMesRemuneracao($id);
        $medicao->AtualizarMedidoMesReembolso($id);
        mysql_query("UPDATE " . MYSQL_BASE_MEDICAO . " SET dat_atualizado = NOW() WHERE id =" . $id);
        $msg = utf8_encode("Medição atualizada com sucesso.");
        echo '<script language= "JavaScript">alert("' . $msg . '");</script>';
Beispiel #5
0
 function ComprovanteRemuneracao($file, $empresa, $medicao_id, $tipo)
 {
     $DAO = new MedicaoDao();
     $medicao = new Medicao();
     $request = $DAO->Listar("SELECT * FROM " . MYSQL_BASE_MEDICAO . " WHERE id = " . $medicao_id);
     $name = NULL;
     $name_old = NULL;
     foreach ($request as $item) {
         if ($empresa == 1 && $tipo == 1) {
             $name = $item['comp_cmat_clt'];
         }
         if ($empresa == 1 && $tipo == 2) {
             $name = $item['comp_cmat_pj'];
         }
         if ($empresa == 3 && $tipo == 1) {
             $name = $item['comp_vetec_clt'];
         }
         if ($empresa == 3 && $tipo == 2) {
             $name = $item['comp_vetec_pj'];
         }
         $name_old = $name;
     }
     if ($file['error'] != UPLOAD_ERR_NO_FILE) {
         $uploadDir = '../../arquivos/medicao/remuneracao/';
         $name = sha1(date("d-m-Y H:i:s") . $empresa . $tipo);
         $uploadFile = $uploadDir . $name;
         $extension = pathinfo($file['name'], PATHINFO_EXTENSION);
         $uploadFile = $uploadFile . '.' . $extension;
         if (!empty($file['name'])) {
             $name = $name . '.' . $extension;
         } else {
             $name = NULL;
         }
         if (move_uploaded_file($file['tmp_name'], $uploadFile)) {
             if (!empty($name_old)) {
                 unlink("../../arquivos/remessa/" . $name_old);
             }
         }
     }
     return $name;
 }