Пример #1
0
$_GET['pesquisa'] = htmlspecialchars($_GET['pesquisa'], ENT_QUOTES);
$where = "`" . $_GET['campo'] . "` LIKE '" . $_GET['pesquisa'] . "%'";
if ($_GET[pg] != '') {
    $limit = ($_GET[pg] - 1) * PG_MAX;
} else {
    $limit = 0;
    $_GET[pg] = 1;
}
$href = 'href=';
$onclick = 'onclick=';
if (checknivel('Dentista') || checknivel('Funcionario')) {
    $href = '';
    $onclick = '';
}
$sql = "SELECT * FROM `fornecedores` WHERE " . $where . " ORDER BY `nomefantasia` ASC";
$pacientes = new TFornecedores();
$lista = $pacientes->ListFornecedores($sql . ' LIMIT ' . $limit . ', ' . PG_MAX);
$total_regs = $pacientes->ListFornecedores($sql);
$par = "F0F0F0";
$impar = "F8F8F8";
for ($i = 0; $i < count($lista); $i++) {
    if ($i % 2 == 0) {
        $odev = $par;
    } else {
        $odev = $impar;
    }
    ?>
    <tr bgcolor="#<?php 
    echo $odev;
    ?>
" onmouseout="style.background='#<?php 
Пример #2
0
 * Arcos - MG - CEP 35588-000
 *
 *
 */
include "../lib/config.inc.php";
include "../lib/func.inc.php";
include "../lib/classes.inc.php";
require_once '../lang/' . $idioma . '.php';
header("Content-type: text/html; charset=ISO-8859-1", true);
if (!checklog()) {
    die($frase_log);
}
if ($_GET['codigo'] != '' && !verifica_nivel('fornecedores', 'E') || $_GET['codigo'] == '' && !verifica_nivel('fornecedores', 'I')) {
    $disable = 'disabled';
}
$fornecedor = new TFornecedores();
if (isset($_POST[Salvar])) {
    $obrigatorios[1] = 'nomefantasia';
    $i = $j = 0;
    foreach ($_POST as $post => $valor) {
        $i++;
        if (array_search($post, $obrigatorios) && $valor == "") {
            $j++;
            $r[$j] = '<font color="#FF0000">';
        }
    }
    if ($j == 0) {
        if ($_GET[acao] == "editar") {
            $fornecedor->LoadFornecedores($_GET[codigo]);
            $strScrp = "Ajax('fornecedores/gerenciar', 'conteudo', '');";
        }