Exemple #1
0
<?php

require_once 'includes/phpvortex/DB_MySQL.class.php';
require_once 'includes/conn.php';
require_once 'includes/helper.php';
$db = new DB_MySQL($db_conn);
$db->Connect();
$db->Query("SET NAMES 'utf8'");
$db->Query("SET CHARACTER SET utf8");
session_start();
if (empty($_SESSION['user']) || empty($_SESSION['ip']) || $_SESSION['ip'] != $_SERVER['REMOTE_ADDR'] || $_SESSION['user']['usu_nivel'] > 1) {
    header("Location: index.php");
    exit;
}
header('Content-type: text/html; charset=utf-8');
//barra do governo full - largura 100%
#require_once ('http://www.saopaulo.sp.gov.br/barrasp/barrasp_full.htm');
require_once "includes/cabecalho.php";
?>
<body>
    <script type="text/javascript">
$(document).ready(function(){
    $('table#resultado tbody tr:odd').css('background','#C3DAE2');

    $('table#resultado tbody tr').hover(
    function(){
        $(this).addClass('destaque');
    },
    function(){
        $(this).removeClass('destaque');
    }
Exemple #2
0
        die("Error : " . $archive->errorInfo(true));
    } else {
        //exclue o arquivo .zip enviado via upload
        $fileDbf = $uploaddir . $listFiles[0]['stored_filename'];
        echo "<b>ARQUIVO =" . $listFiles[0]['filename'] . "</b>";
        unlink($uploaddir . $filename);
    }
} elseif (strtoupper($ext[1]) == "DBF") {
    $fileDbf = $uploaddir . $filename;
}
ob_flush();
flush();
$arrCampoData = array("DT_NOTIFIC", "DT_NASC", "DT_DIAG", "EVO_DT");
$db = new DB_MySQL($db_conn);
$db->Connect();
$db->Query("SET NAMES 'utf8'");
$db->Query("SET CHARACTER SET utf8");
$db->Query("truncate table {$tabelaNome}");
$dbf = new dbf_class($fileDbf);
$num_rec = $dbf->dbf_num_rec;
$num_field = $dbf->dbf_num_field;
#$num_rec =5620;
$qtdeErr = 0;
$field_names = $dbf->dbf_names;
foreach ($field_names as $indice => $campo) {
    $campos .= $campo['name'] . ',';
}
$campos = substr($campos, 0, strlen($campos) - 1);
for ($i = 0; $i < $num_rec; $i++) {
    $row = $dbf->getRowAssoc($i);
    foreach ($field_names as $ind => $campo) {
<?php

require_once 'includes/phpvortex/DB_MySQL.class.php';
require_once 'includes/conn.php';
require_once 'includes/helper.php';
$db = new DB_MySQL($db_conn);
$db->Connect();
$db->Query("SET NAMES 'utf8'");
$db->Query("SET CHARACTER SET utf8");
session_start();
if (empty($_SESSION['user']) || empty($_SESSION['ip']) || $_SESSION['ip'] != $_SERVER['REMOTE_ADDR']) {
    header("Location: index.php");
    exit;
}
function str2query($str)
{
    $tr = array('A' => 'H?A+H?', 'B' => '[BP]+', 'C' => '[CKS]+', 'D' => 'D+', 'E' => 'H?[EIY]+H?', 'F' => 'F+', 'G' => '[JG]+U?', 'H' => '[HR]*', 'I' => 'H?[EIY]+H?', 'J' => '[JG]+U?', 'K' => '[CKQ]+', 'L' => 'L+', 'M' => '[MN]+', 'N' => '[MN]+', 'O' => 'H?[OU]+H?', 'P' => '[BP]+', 'Q' => '[CKQ]+', 'R' => '[HR]+', 'S' => '[CSZ]+', 'T' => 'T+', 'U' => 'H?[OU]+H?', 'V' => '[WVU]+', 'W' => '[WVU]+', 'X' => '[CSX]+H?', 'Y' => 'H?[EIY]+H?', 'Z' => '[CSZ]+', ' ' => '.*');
    $ret = '';
    $tmp = strtoupper(strtr($str, "áàãâäÁÀÃÂÄéèêëÉÈÊËíìîïÍÌÎÏóòõôöÓÒÕÔÖúùûüÚÙÛÜçÇñÑýÿÝ", "AAAAAAAAAAEEEEEEEEIIIIIIIIOOOOOOOOOOUUUUUUUUCCNNYYY"));
    for ($i = 0; $i < strlen($tmp); $i++) {
        if (!empty($tr[$tmp[$i]])) {
            $ret .= $tr[$tmp[$i]];
        }
    }
    return '"^' . $ret . ' | ' . $ret . ' | ' . $ret . '$|^' . $ret . '$"';
}
$dataBr = "d/m/Y";
header('Content-type: text/html; charset=utf-8');
//barra do governo full - largura 100%
#require_once ('http://www.saopaulo.sp.gov.br/barrasp/barrasp_full.htm');
require_once "includes/cabecalho.php";
<?php

require_once 'includes/phpvortex/DB_MySQL.class.php';
require_once 'includes/conn.php';
require_once 'includes/helper.php';
$db = new DB_MySQL($db_conn);
$db->Connect();
$db->Query("SET NAMES 'utf8'");
$db->Query("SET CHARACTER SET utf8");
session_start();
if (empty($_SESSION['user']) || empty($_SESSION['ip']) || $_SESSION['ip'] != $_SERVER['REMOTE_ADDR'] || $_SESSION['user']['usu_nivel'] > 1) {
    header("Location: index.php");
    exit;
}
function GeraSenha()
{
    $charsenha = "ABCDEFGHJKLMNPRSTUVWXYZ23456789";
    $novasenha = '';
    for ($i = 0; $i < 8; $i++) {
        $novasenha .= $charsenha[rand(0, strlen($charsenha) - 1)];
    }
    return $novasenha;
}
function EnviaEmail($email, $login, $senha)
{
    $mail_body = <<<EOF
Seu cadastro no SNAIDS:
Usuário: {$login}
Senha: {$senha}

TERMO DE RESPONSABILIDADE
Exemple #5
0
<?php

require_once 'includes/phpvortex/DB_MySQL.class.php';
require_once 'includes/conn.php';
$db = new DB_MySQL($db_conn);
$db->Connect();
$db->Query("SET NAMES 'utf8'");
$db->Query("SET CHARACTER SET utf8");
session_start();
if (isset($_REQUEST['logout'])) {
    if (!empty($_SESSION['user'])) {
        $db->Query("INSERT INTO tb_log (ev_id, usu_id) VALUES (2, {$_SESSION['user']['usu_id']})");
    }
    $_SESSION['user'] = array();
}
if (isset($_REQUEST['user'])) {
    $rs = $db->Query("SELECT * FROM tb_usuario WHERE usu_login = '******'user']) . "' AND usu_password = '******'password']) . "' AND usu_ativo = 1");
    if ($rs->RowCount() == 1) {
        $_SESSION['user'] = $rs->Row();
        $_SESSION['ip'] = $_SERVER['REMOTE_ADDR'];
        $db->Query("UPDATE tb_usuario SET dt_ult_login = CURRENT_TIMESTAMP WHERE usu_id = {$_SESSION['user']['usu_id']}");
        $db->Query("INSERT INTO tb_log (ev_id, usu_id) VALUES (1, {$_SESSION['user']['usu_id']})");
        header("Location:consulta.php");
        exit;
    } else {
        $erro = "Usu&aacute;rio ou Senha Inv&aacute;lidos";
    }
}
//barra do governo full - largura 100%
#require_once ('http://www.saopaulo.sp.gov.br/barrasp/barrasp_full.htm');
require_once "includes/cabecalho.php";
Exemple #6
0
<?php

require_once 'includes/phpvortex/DB_MySQL.class.php';
require_once 'includes/conn.php';
require_once 'includes/helper.php';
$db = new DB_MySQL($db_conn);
$db->Connect();
$db->Query("SET NAMES 'utf8'");
$db->Query("SET CHARACTER SET utf8");
session_start();
if (empty($_SESSION['user']) || empty($_SESSION['ip']) || $_SESSION['ip'] != $_SERVER['REMOTE_ADDR']) {
    header("Location: index.php");
    exit;
}
header('Content-type: text/html; charset=utf-8');
//barra do governo full - largura 100%
#require_once ('http://www.saopaulo.sp.gov.br/barrasp/barrasp_full.htm');
require_once "includes/cabecalho.php";
?>
<body>
<?php 
$idCurrent = "Trocar senha";
require 'includes/menu.php';
?>
<div class="container">
  <div class="content">
    <img src="img/logo_snaids.gif"/><br/><br/>
<?php 
$ok = false;
if (!empty($_REQUEST['senha'])) {
    if ($_REQUEST['nova1'] == '') {
Exemple #7
0
<?php

require_once 'includes/phpvortex/DB_MySQL.class.php';
require_once 'includes/conn.php';
$db = new DB_MySQL($db_conn);
$db->Connect();
$db->Query("SET NAMES 'latin1'");
$db->Query("SET CHARACTER SET latin1");
setlocale(LC_ALL, "pt_BR", "pt_BR.iso-8859-1", "pt_BR.utf-8", "portuguese");
session_start();
if (empty($_SESSION['user']) || empty($_SESSION['ip']) || $_SESSION['ip'] != $_SERVER['REMOTE_ADDR'] || $_SESSION['user']['usu_nivel'] > 1) {
    header("Location: index.php");
    exit;
}
header("Content-type: text/comma-separated-values; charset=windows-1252");
header("Content-Disposition: attachment; filename=relatorio.csv");
$filtro = '';
if (!empty($_REQUEST['ev'])) {
    $filtro .= (empty($filtro) ? '' : ' AND ') . "ev_id = '" . $db->AddSlashes($_REQUEST['ev']) . "'";
}
if (!empty($_REQUEST['usu'])) {
    $filtro .= (empty($filtro) ? '' : ' AND ') . "usu_id = '" . $db->AddSlashes($_REQUEST['usu']) . "'";
}
if (!empty($_REQUEST['nd']) && !empty($_REQUEST['nm']) && !empty($_REQUEST['na'])) {
    if (is_numeric($_REQUEST['na'])) {
        $d = intval($_REQUEST['nd'], 10);
        $m = intval($_REQUEST['nm'], 10);
        $a = intval($_REQUEST['na'], 10);
        if ($a < 100) {
            $a += 1900;
        }
Exemple #8
0
?>
<div class="container">
  <div class="content">
      
        <img src="img/logo_snaids.gif"/><br/><br/>
        <div id="admin">
        <p><a href="usuarios.php">Cadastro de usu&aacute;rios</a></p>
        <p><a href="logs.php">Relat&oacute;rios</a></p>
        <p><a href="base.php">Atualiza&ccedil;&atilde;o das bases de dados</a></p>
      </div>
      <br />
<?php 
if (!empty($_REQUEST['desativar'])) {
    $db = new DB_MySQL($db_conn);
    $db->Connect();
    $db->Query("UPDATE tb_usuario SET usu_ativo = 0 WHERE DATEDIFF(NOW(), dt_ult_login) > '" . $db->AddSlashes($_REQUEST['desativar']) . "'");
    ?>
        <p>Usuários desativados</p>
<?php 
} else {
    ?>
	<form action="admin.php" method="post">
    	<label for="desativar">Desativar usu&aacute;rios que n&atilde;o acessam o sistema por mais de </label>
    	<input type="text" name="desativar" value="365" size="3" /> dias <input type="submit" value="Desativar" />
    </form>
<?php 
}
?>
  </div>
    <?php 
require 'includes/rodape.php';
Exemple #9
0
<?php

require_once 'includes/phpvortex/DB_MySQL.class.php';
require_once 'includes/conn.php';
require_once 'includes/helper.php';
$db = new DB_MySQL($db_conn);
$db->Connect();
$db->Query("SET NAMES 'utf8'");
$db->Query("SET CHARACTER SET utf8");
session_start();
if (empty($_SESSION['user']) || empty($_SESSION['ip']) || $_SESSION['ip'] != $_SERVER['REMOTE_ADDR']) {
    header("Location: index.php");
    exit;
}
if (strtolower($_REQUEST['b']) == 'n') {
    $rs = $db->Query("SELECT * FROM ((((tb_net LEFT JOIN tb_municnet USING (id_municip)) LEFT JOIN tb_regionet ON (tb_regionet.id_regiona = tb_net.id_regiona)) LEFT JOIN tb_unidade USING (id_unidade)) LEFT JOIN tb_ocupanet USING (id_ocupa_n)) WHERE id = '" . $db->AddSlashes($_REQUEST['n']) . "'");
    $log = "Base: SINAN NET\n";
} else {
    $rs = $db->Query("SELECT * FROM (((tb_windows LEFT JOIN tb_municipi USING (id_municip)) LEFT JOIN tb_unidade USING (id_unidade)) LEFT JOIN tb_ocupacao USING (id_ocupaca)) WHERE id = '" . $db->AddSlashes($_REQUEST['n']) . "'");
    $log = "Base: SINAN Windows\n";
}
$row = $rs->Row();
$log .= "Número da Notificação: {$row['nu_notific']}\nNome: {$row['nm_pacient']}\n";
$db->Query("INSERT INTO tb_log (ev_id, usu_id, log_det) VALUES (4, {$_SESSION['user']['usu_id']}, '" . $db->AddSlashes($log) . "')");
$dataBr = "d/m/Y";
//barra do governo full - largura 100%
header('Content-type: text/html; charset=utf-8');
#require_once ('http://www.saopaulo.sp.gov.br/barrasp/barrasp_full.htm');
require_once "includes/cabecalho.php";
?>
<body>