public function generarPDF()
 {
     $sql = "SELECT codigo,nombre,apellido,cedula,edad,semestre from estudiante";
     $resultado = $this->objCon->Ejecutar($sql);
     if ($resultado && pg_numrows($resultado) > 0) {
         require_once '../Recursos/html2pdf/html2pdf.class.php';
         // Se carga la libreria
         ob_start();
         //Habilita el buffer para la salida de datos
         ob_get_clean();
         //Limpia lo que actualmente tenga el buffer
         //En la variable content entre las etiquetas <page></page> va todo el contenido del pdf en formato html
         $content = "<page>";
         $content .= "<h1>ESTE ES EL REPORTE</h1>";
         $content .= '<link href="../Recursos/css/estilosPDF.css" type="text/css" rel="stylesheet">';
         $content .= "<table border='1'>";
         $content .= "<tr>";
         $content .= "<th>Codigo</th>";
         $content .= "<th>Nombre</th>";
         $content .= "<th>Apellido</th>";
         $content .= "<th>Cedula</th>";
         $content .= "<th>Edad</th>";
         $content .= "<th>Semestre</th>";
         $content .= "</tr>";
         for ($cont = 0; $cont < pg_numrows($resultado); $cont++) {
             $content .= "<tr>";
             $content .= "<td>" . pg_result($resultado, $cont, 0) . "</td>";
             $content .= "<td>" . pg_result($resultado, $cont, 1) . "</td>";
             $content .= "<td>" . pg_result($resultado, $cont, 2) . "</td>";
             $content .= "<td>" . pg_result($resultado, $cont, 3) . "</td>";
             $content .= "<td>" . pg_result($resultado, $cont, 4) . "</td>";
             $content .= "<td>" . pg_result($resultado, $cont, 5) . "</td>";
             $content .= "</tr>";
         }
         $content .= "</table>";
         $content .= "</page>";
     } else {
         $content = "<b>No hay registros en la base de datos</b>";
     }
     $html2pdf = new HTML2PDF('P', 'A4', 'es');
     //formato del pdf (posicion (P=vertical L=horizontal), tamaño del pdf, lenguaje)
     $html2pdf->WriteHTML($content);
     //Lo que tenga content lo pasa a pdf
     ob_end_clean();
     // se limpia nuevamente el buffer
     $html2pdf->Output('exemple.pdf');
     //se genera el pdf, generando por defecto el nombre indicado para guardar
 }
 function construirListado($resultado)
 {
     if ($resultado && pg_num_rows($resultado) > 0) {
         $cadenaHTML = "<table border ='1'>";
         $cadenaHTML .= "<tr>";
         $cadenaHTML .= "<th>Codigo</th>";
         $cadenaHTML .= "<th>Nombre</th>";
         $cadenaHTML .= "<th>Apellido</th>";
         $cadenaHTML .= "<th>Cedula</th>";
         $cadenaHTML .= "<th>Edad</th>";
         $cadenaHTML .= "<th>Semestre</th>";
         $cadenaHTML .= "</tr>";
         for ($cont = 0; $cont < pg_numrows($resultado); $cont++) {
             $cadenaHTML .= "<tr>";
             $cadenaHTML .= "<td>" . pg_result($resultado, $cont, 0) . "</td>";
             $cadenaHTML .= "<td>" . pg_result($resultado, $cont, 1) . "</td>";
             $cadenaHTML .= "<td>" . pg_result($resultado, $cont, 2) . "</td>";
             $cadenaHTML .= "<td>" . pg_result($resultado, $cont, 3) . "</td>";
             $cadenaHTML .= "<td>" . pg_result($resultado, $cont, 4) . "</td>";
             $cadenaHTML .= "<td>" . pg_result($resultado, $cont, 5) . "</td>";
             $cadenaHTML .= "</tr>";
         }
         $cadenaHTML .= "</table>";
     } else {
         $cadenaHTML = "<b>No hay Registros en la Base de datos</b>";
     }
     header('location:../index.php?page=estudiantes&&info_list=' . $cadenaHTML);
 }
 function listadoRegistro($resultado)
 {
     if ($resultado && pg_numrows($resultado) > 0) {
         $cadenaHTML = "<table border='1'>";
         $cadenaHTML .= "<tr>";
         $cadenaHTML .= "<th>Codigo</th>";
         $cadenaHTML .= "<th>Nombre</th>";
         $cadenaHTML .= "<th>Apellido</th>";
         $cadenaHTML .= "<th>Cedula</th>";
         $cadenaHTML .= "<th>Edad</th>";
         $cadenaHTML .= "<th>Semestre</th>";
         $cadenaHTML .= "</tr>";
         for ($cont = 0; $cont < pg_numrows($resultado); $cont++) {
             $cadenaHTML .= "<tr>";
             $cadenaHTML .= "<td>" . pg_result($resultado, $cont, 0) . "</td>";
             $cadenaHTML .= "<td>" . pg_result($resultado, $cont, 1) . "</td>";
             $cadenaHTML .= "<td>" . pg_result($resultado, $cont, 2) . "</td>";
             $cadenaHTML .= "<td>" . pg_result($resultado, $cont, 3) . "</td>";
             $cadenaHTML .= "<td>" . pg_result($resultado, $cont, 4) . "</td>";
             $cadenaHTML .= "<td>" . pg_result($resultado, $cont, 5) . "</td>";
             $cadenaHTML .= "</tr>";
         }
         $cadenaHTML .= "</table>";
     } else {
         $cadenaHTML = "<b>No hay registros en la base de datos</b>";
     }
     header('location:../Index.php?tabla=' . $cadenaHTML);
 }
Ejemplo n.º 4
0
function pg_fetch_all($result)
{
    $o = array();
    for ($i = 0; $i = pg_numrows($result); $i++) {
        $o[$i] = pg_result($result, $i);
    }
    return $o;
}
Ejemplo n.º 5
0
function create_station($stationname)
{
    $sql = "INSERT INTO Stations (name) VALUES('{$stationname}')";
    pg_query($sql);
    $sql = "SELECT id from Stations ORDER by id desc limit 1";
    $res = pg_query($sql);
    return pg_result($res, 0, 0);
}
Ejemplo n.º 6
0
/**
 * used if you need to run a SQL command, like MAX()
 * \todo figure out some way around using this
 */
function command_result($stuff, $number)
{
    if (server_type == "mysql") {
        return mysql_result($stuff, $number);
    } elseif (server_type == "postgresql") {
        return pg_result($stuff, $number);
    }
}
Ejemplo n.º 7
0
 function Header()
 {
     global $conn;
     global $result;
     global $url;
     //Dados da instituição
     $dados = @pg_exec("select nomeinst,ender,munic,uf,telef,email,url,logo from db_config where codigo = " . @$GLOBALS["DB_instit"]);
     $url = @pg_result($dados, 0, "url");
     $this->SetXY(1, 1);
     $this->Image('../imagens/files/' . pg_result($dados, 0, "logo"), 7, 3, 20);
     //$this->Cell(100,32,"",1);
     $nome = pg_result($dados, 0, "nomeinst");
     global $nomeinst;
     $nomeinst = pg_result($dados, 0, "nomeinst");
     if (strlen($nome) > 42) {
         $TamFonteNome = 8;
     } else {
         $TamFonteNome = 9;
     }
     $this->SetFont('Arial', 'BI', $TamFonteNome);
     $this->Text(33, 9, $nome);
     $this->SetFont('Arial', 'I', 8);
     $this->Text(33, 14, trim(pg_result($dados, 0, "ender")));
     $this->Text(33, 18, trim(pg_result($dados, 0, "munic")) . " - " . pg_result($dados, 0, "uf"));
     $this->Text(33, 22, trim(pg_result($dados, 0, "telef")));
     $this->Text(33, 26, trim(pg_result($dados, 0, "email")));
     $this->Text(33, 30, $url);
     //parametros
     //	$this->SetXY(108,3);
     //	$this->SetFillColor(235);
     //	$this->Cell(98,29,"",1,0,0,1);
     //    $this->Line(178,3,178,32);
     //    $this->Line(178,13,206,13);
     //    $this->Line(178,22,206,22);
     //    $this->Text(180,10,date("d-m-Y"));
     //    $this->Text(180,20,date("H:i:s"));
     //    $this->Text(180,30,@$GLOBALS["DB_login"]);
     //    $this->SetFont('Arial','',6);
     //    $this->Text(179,5,"Data:");
     //    $this->Text(179,15,"Hora:");
     //    $this->Text(179,24,"Login:"******"head1"]);
     $this->Text($Espaco, 6, @$GLOBALS["head1"]);
     $this->Text($Espaco, 9, @$GLOBALS["head2"]);
     $this->Text($Espaco, 12, @$GLOBALS["head3"]);
     $this->Text($Espaco, 15, @$GLOBALS["head4"]);
     $this->Text($Espaco, 18, @$GLOBALS["head5"]);
     $this->Text($Espaco, 21, @$GLOBALS["head6"]);
     $this->Text($Espaco, 24, @$GLOBALS["head7"]);
     $this->Text($Espaco, 27, @$GLOBALS["head8"]);
     $this->Text($Espaco, 30, @$GLOBALS["head9"]);
     //$this->Ln(25);
     $this->SetY(35);
 }
Ejemplo n.º 8
0
function enviarpass($correo)
{
    if (!empty($correo)) {
        $resultado = ejecutaConsulta("Select password,idioma from usuario where correo='{$correo}';");
        $pass = pg_result($resultado, 0, 'password') or sysError("activa.php.No tiene pass");
        mandarCorreoPass($correo, $pass);
        return 'true';
    } else {
        return 'false';
    }
}
 function calcula_valores()
 {
     $this->sqlporreceita = "\n\t               select k00_numpre,k00_numpar,k00_receit,k00_dtvenc,k00_dtoper,sum(k00_valor) as k00_valor \n\t               from arrecad \n\t\t\t\t   where k00_numpre = {$this->np} and ( ";
     $or = "";
     echo pg_numrows($this->resultparcelas);
     for ($i = 0; $i < $this->resultparcelas; $i++) {
         $this->sqlporreceita .= $or . " k00_numpar = " . pg_result($this->resultparcelas, $i, "k00_numpar");
         $or = " or ";
     }
     $this->sqlporreceita .= ") group by k00_numpre,k00_numpar,k00_receit,k00_dtvenc,k00_dtoper";
     return true;
 }
Ejemplo n.º 10
0
function db_mensagem($cabecalho, $rodape)
{
    global $DB_mens1, $DB_align1, $DB_mens2, $DB_align2;
    $result = pg_query("select mens,alinhamento from db_confmensagem where (cod = '{$cabecalho}' or cod = '{$rodape}') and instit = " . db_getsession("DB_instit") . " order by cod");
    if (pg_numrows($result) == 0) {
        db_msgbox2("Mensagem não encontrado para: {$cabecalho} {$rodape}");
        //redireciona("index.php");
        exit;
    }
    $DB_mens1 = @pg_result($result, 0, 0);
    $DB_align1 = @pg_result($result, 0, 1);
    $DB_mens2 = @pg_result($result, 1, 0);
    $DB_align2 = @pg_result($result, 1, 1);
}
Ejemplo n.º 11
0
function justdump($tablename)
{
    $res2 = pg_query("SELECT  * FROM {$tablename} ");
    $num2 = pg_numrows($res2);
    $num2f = pg_numfields($res2);
    for ($j = 0; $j < $num2; $j++) {
        $insvals = "";
        for ($z = 0; $z < $num2f; $z++) {
            $insvals .= "'" . pg_result($res2, $j, $z) . "',";
        }
        $insvals = substr($insvals, 0, -1);
        $sql = "INSERT INTO {$tablename} VALUES ({$insvals});";
        echo $sql . "\n";
    }
}
 function Count()
 {
     $_count_command = "SELECT COUNT(*) FROM (" . $this->SelectCommand . ") AS _TMP {where}";
     $_where = "";
     $_filters = $this->Filters;
     for ($i = 0; $i < sizeof($_filters); $i++) {
         $_where .= " and " . $this->GetFilterExpression($_filters[$i]);
     }
     if ($_where != "") {
         $_where = "WHERE " . substr($_where, 5);
     }
     $_count_command = str_replace("{where}", $_where, $_count_command);
     $_result = pg_query($this->_Link, $_count_command);
     return pg_result($_result, 0, 0);
 }
 public function construirOptionsSelect($resultado, $page)
 {
     $cadenaHTML = "";
     if ($resultado && pg_num_rows($resultado) > 0) {
         for ($cont = 0; $cont < pg_num_rows($resultado); $cont++) {
             $variable = $cont == 0 ? "selected='selected'" : "";
             $cadenaHTML .= "<option " . $variable . " value='" . pg_result($resultado, $cont, 0) . "'>";
             $cadenaHTML .= pg_result($resultado, $cont, 1);
             $cadenaHTML .= "</option>";
         }
     } else {
         $cadenaHTML .= "<b>No hay registros en la base de datos</b>";
     }
     header('location: ../index.php?page=' . $page . '&&contenidoSel=' . $cadenaHTML);
 }
Ejemplo n.º 14
0
Archivo: ac.php Proyecto: vrodic/Vlakic
function spittable($query)
{
    $res = pg_query($query);
    $num = pg_num_rows($res);
    $cols = pg_num_fields($res);
    for ($i = 0; $i < $num; $i++) {
        $c = "";
        for ($j = 0; $j < $cols; $j++) {
            $c .= pg_result($res, $i, $j) . "|";
        }
        echo "{$c}\n";
    }
    echo "\n";
    exit;
}
Ejemplo n.º 15
0
function checkID()
{
    $bool;
    $query = "SELECT * FROM student";
    $result = pg_query($query);
    for ($i = 0; $i < pg_num_rows($result); $i++) {
        if ($_POST["id"] == pg_result($result, $i, "id")) {
            $bool = false;
            break;
        } else {
            $bool = true;
        }
    }
    return $bool;
}
Ejemplo n.º 16
0
function autoselect($var, $type, $lang)
{
    global $conn;
    $res2 = pg_exec($conn, "SELECT * FROM contents " . "WHERE id = {$var} AND type = '{$type}' AND language = '{$lang}'");
    if ($res2 && pg_numrows($res2) == 1) {
        $var = pg_result($res2, 0, "content");
    } else {
        $res2 = pg_exec($conn, "SELECT * FROM contents " . "WHERE id = {$var} AND type = '{$type}' LIMIT 1");
        if ($res2 && pg_numrows($res2) == 1) {
            $var = pg_result($res2, 0, "content");
        } else {
            $var = "Not available.";
        }
    }
    return $var;
}
function db_getNomeSecretaria()
{
    $nomeSecretaria = "SECRETARIA DA FAZENDA";
    $sqlparag = " select db02_texto ";
    $sqlparag .= "   from db_documento ";
    $sqlparag .= "        inner join db_docparag  on db03_docum   = db04_docum ";
    $sqlparag .= "        inner join db_tipodoc   on db08_codigo  = db03_tipodoc ";
    $sqlparag .= "        inner join db_paragrafo on db04_idparag = db02_idparag ";
    $sqlparag .= " where db03_tipodoc = 1017 ";
    $sqlparag .= "   and db03_instit = " . db_getsession("DB_instit") . " ";
    $sqlparag .= " order by db04_ordem ";
    $resparag = db_query($sqlparag);
    if (pg_numrows($resparag) > 0) {
        $nomeSecretaria = pg_result($resparag, 0, 'db02_texto');
    }
    return $nomeSecretaria;
}
 function fieldsMemory($rs, $idx, $formata = false, $mostra = false, $lEncode = false)
 {
     $oFields = new _db_fields();
     $numFields = pg_num_fields($rs);
     $iTotalLinhas = pg_num_rows($rs);
     for ($i = 0; $i < $numFields; $i++) {
         $sValor = "";
         $sFieldName = @pg_field_name($rs, $i);
         $sFieldType = @pg_field_type($rs, $i);
         if ($iTotalLinhas > 0) {
             $sValor = trim(@pg_result($rs, $idx, $sFieldName));
         }
         if ($formata) {
             switch ($sFieldType) {
                 case "date":
                     if ($sValor != null) {
                         $sValor = implode('/', array_reverse(explode("-", $sValor)));
                     }
                     break;
                 default:
                     $sValor = stripslashes($sValor);
                     break;
             }
         }
         if ($mostra) {
             echo $sFieldName . " => " . $sValor . " <br>";
         }
         if ($lEncode) {
             switch ($sFieldType) {
                 case "bpchar":
                     $sValor = urlencode($sValor);
                     break;
                 case "varchar":
                     $sValor = urlencode($sValor);
                     break;
                 case "text":
                     $sValor = urlencode($sValor);
                     break;
             }
         }
         $oFields->{$sFieldName} = $sValor;
     }
     return $oFields;
 }
Ejemplo n.º 19
0
function wypisz_tabele($nazwa_tabeli)
{
    $zapytanie = "select * from {$nazwa_tabeli}";
    $wynik_zapytania = pg_exec(polacz(), $zapytanie);
    echo '<table border="1">';
    echo '<tr>';
    for ($i = 0; $i < pg_numfields($wynik_zapytania); $i++) {
        echo '<td>' . pg_field_name($wynik_zapytania, $i) . '</td>';
    }
    echo '</tr>';
    for ($i = 0; $i < pg_numrows($wynik_zapytania); $i++) {
        echo '<tr>';
        for ($j = 0; $j < pg_numfields($wynik_zapytania); $j++) {
            echo '<td>' . pg_result($wynik_zapytania, $i, $j) . '</td>';
        }
        echo '</tr>';
    }
    echo '</table>';
}
Ejemplo n.º 20
0
function wypisz_tabele($wynik_zapytania, $naglowek)
{
    echo '<table border="1">';
    if ($naglowek == true) {
        echo '<tr>';
        for ($i = 0; $i < pg_numfields($wynik_zapytania); $i++) {
            echo '<td>' . pg_field_name($wynik_zapytania, $i) . '</td>';
        }
        echo '</tr>';
    }
    for ($i = 0; $i < pg_numrows($wynik_zapytania); $i++) {
        echo '<tr>';
        for ($j = 0; $j < pg_numfields($wynik_zapytania); $j++) {
            echo '<td>' . pg_result($wynik_zapytania, $i, $j) . '</td>';
        }
        echo '</tr>';
    }
    echo '</table>';
}
Ejemplo n.º 21
0
 public function construirOptionsSelect($resultado, $page)
 {
     $cadenaHTML = "";
     if ($resultado && pg_num_rows($resultado) > 0) {
         for ($cont = 0; $cont < pg_num_rows($resultado); $cont++) {
             $variable = $cont == 0 ? "selected='selected'" : "";
             $cadenaHTML .= "<option " . $variable . " value='" . pg_result($resultado, $cont, 0) . "'>";
             $cadenaHTML .= pg_result($resultado, $cont, 1);
             $cadenaHTML .= "</option>";
         }
     } else {
         $cadenaHTML .= "<b>No hay registros en la base de datos</b>";
     }
     /* Se recuperan las variables que hayan sido diligenciadas del formulario */
     $variablesTemporales = "&&";
     if ($page == "eventos") {
         $variablesTemporales .= "departamento=document.getElementById('selDepartamento').value=" . (isset($_REQUEST['departamento']) ? $_REQUEST['departamento'] : "-1" . ";");
     }
     $cadenaHTML .= $variablesTemporales;
     header('location: ../index.php?page=' . $page . '&&contenidoSel=' . $cadenaHTML);
 }
 function assinatura($codigo, $default = '', $pos_paragrafo = "")
 {
     //#00#//assinatura
     //#10#//Este método é usado gerar a assinatura de acordo com o cadastro de assinaturas
     //#15#//assinatura($codigo,$default)
     //#20#//codigo  : codigo do tipo de assinatura da tabela db_tipodoc
     //#20#//default : string default que será impressa caso o código não seja encontrado
     //#20#//pos_paragrafo : qual será o paragrafo retornado, se retornar somente o primeiro, seria somente o nome da pessoa
     //#20#//, por exemplo  ( nome, carlos).  0 = nome, 1 = cargo , passar este parementro sempre entre aspas simples
     //#20#//na tabela.
     $result = pg_query("select db_paragrafo.*\n      \t        \t      from db_documento\n                      \t\t    inner join db_docparag on db03_docum = db04_docum\n                      \t\t    inner join db_paragrafo on db04_idparag = db02_idparag\n                 \t   \t  where db03_tipodoc = {$codigo} and\n                       \t\t         db03_instit  = " . db_getsession('DB_instit') . "\n                 \t\t  order by db02_descr\n                 \t\t");
     //db_criatabela($result);exit;
     $ass = $default;
     if (pg_numrows($result) > 0) {
         $ass = '';
         $ar = "";
         for ($i = 0; $i < pg_numrows($result); $i++) {
             $db02_texto = pg_result($result, $i, "db02_texto");
             $ass .= $ar . $db02_texto;
             $ar = "\r\n";
         }
         /* paragrafo : qual será o paragrafo retornado, se retornar somente o primeiro, seria somente o nome da pessoa 
          * por exemplo  ( nome, carlos).  0 = nome, 1 = cargo
          * aqui sobrescrevemos as variáveis acima ( codigo pobre )
          */
         if ($pos_paragrafo != "") {
             $ass = '';
             if (pg_numrows($result) > $pos_paragrafo) {
                 $db02_texto = pg_result($result, $pos_paragrafo, "db02_texto");
                 // retorna da posição paragrafo
                 $ass = $db02_texto;
             }
         }
         //------------------------------------------ * -------------------------------------
     }
     return $ass;
 }
Ejemplo n.º 23
0
<h2>Overview</h2>

<table frame=1 border=1>
<tr>
 <td><b>Category</b>
 <td><b>Amount</b>

<?

        $stati=pg_exec($db,"select * from status order by statusid");
        $ln=pg_numrows($stati);
        for($i=0;$i<$ln;$i++){
                $stat=pg_fetch_array($stati,$i);
                $amtr=pg_exec("select count(licenseid) from license where adminid='".$user->getusername()."' and statusid=".$stat["statusid"]);
                $amt=pg_result($amtr,0,0);
                pg_freeresult($amtr);
                print("<tr><td><font color=\"".$stat["colordef"]."\">".($amt>0?"<b>":"").$stat["status"].($amt>0?"</b>":"")."</font><td>");
                print($amt."</tr>\n");
        }

        pg_freeresult($stati);

?>

</table>

<h2>Expirations</h2>

(yet not working)<p>
    } elseif (pg_result($result, 0, "usuarioativo") != 1) {
        $erroscripts = "5";
    } else {
        session_register("DB_login");
        db_fieldsmemory($result, 0, true, true);
        $HTTP_SESSION_VARS["DB_login"] = $cgmlogin;
        $DB_LOGADO = "";
        db_logs("", "", "0", "index.php - Usuário fez login.");
        $sql = "select fc_permissaodbpref({$cgmlogin},0,0)";
        $result = db_query($sql);
        if (pg_numrows($result) == 0) {
            //db_redireciona("index.php?".base64_encode("erroscripts='4'"));
            ?>
<script>parent.location="index.php?".base64_encode("erroscripts='4'";</script><?php 
        }
        $HTTP_SESSION_VARS["DB_acesso"] = pg_result($result, 0, 0);
        $HTTP_SESSION_VARS["hora"] = date("H:i:s");
    }
}
?>
<html>
<head>
<title><?php 
echo $w01_titulo;
?>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/javascript" src="scripts/md5.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/db_script.js"></script>
</script>
<script>
if (!isset($HTTP_POST_VARS["cria_senha"])) {
    $result = @db_query("select senha from db_usuarios where login = '******' and senha != '' ");
    if (@pg_num_rows($result) == 0) {
        msgbox("Login inválido");
        redireciona("digitafornecedor.php");
        exit;
    } else {
        if (Encriptacao::hash($DB_senha) != @pg_result($result, 0, 0)) {
            msgbox("ERRO: Senha Incorreta.");
            redireciona("digitafornecedor.php");
            exit;
        }
    }
}
//reenvio de senha
if (Encriptacao::hash($DB_senha) != @pg_result($result, 1, 0)) {
    $result = @db_query("select login,senha from db_usuarios where trim(login) = '{$cgccpf}' ");
}
if (@pg_num_rows($result) == 0) {
    msgbox("ERRO: REGISTRO NÃO ENCONTRADO.");
    exit;
}
//////////////////////////////////////////////////////////////
db_mensagem("opcoesfornecedor_cab", "opcoesfornecedor_rod");
mens_help();
?>
<html>
<head>
<title>opcoesimovel</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" src="javascript/db_script.js"></script>
Ejemplo n.º 26
0
    $r5 = pg_query($connection, $q5);
    $row5 = pg_num_rows($r5);
    if ($row5 > 0) {
        for ($i5 = 0; $i5 < $row5; $i5++) {
            $checkInfCompl = pg_result($r5, $i5, "id");
            $newInfCompl .= $checkInfCompl . ',';
        }
    }
}
echo "<input type='hidden' value='{$newInfCompl}' id='arrInfCompl'/>";
$q6 = "SELECT * FROM lista_coll_infcom order by definizione asc; ";
$r6 = pg_query($connection, $q6);
$row6 = pg_num_rows($r6);
for ($i6 = 0; $i6 < $row6; $i6++) {
    $id6 = pg_result($r6, $i6, "id");
    $def6 = pg_result($r6, $i6, "definizione");
    echo "<label for='infcom{$id6}' style='display:block;cursor:pointer;margin-bottom:3px; padding-right:3px;'><input type='checkbox' name='infcom' id='infcom{$id6}' value='{$def6}' />{$def6}</label>";
}
?>
</div>

<label>NOTE</label>
<textarea id="mater3_cll_note" class="form"><?php 
echo $note8;
?>
 </textarea>

 <div class="login2" style="margin-top:20px;" id="mater3_collegamenti_salva">Salva modifiche</div>
 <div class="chiudiForm login2">Annulla modifiche</div>
</div>
 function excluir($pc17_codigo = null, $dbwhere = null)
 {
     if ($dbwhere == null || $dbwhere == "") {
         $resaco = $this->sql_record($this->sql_query_file($pc17_codigo));
     } else {
         $resaco = $this->sql_record($this->sql_query_file(null, "*", null, $dbwhere));
     }
     if ($resaco != false || $this->numrows != 0) {
         for ($iresaco = 0; $iresaco < $this->numrows; $iresaco++) {
             $resac = db_query("select nextval('db_acount_id_acount_seq') as acount");
             $acount = pg_result($resac, 0, 0);
             $resac = db_query("insert into db_acountacesso values({$acount}," . db_getsession("DB_acessado") . ")");
             $resac = db_query("insert into db_acountkey values({$acount},6460,'{$pc17_codigo}','E')");
             $resac = db_query("insert into db_acount values({$acount},1061,6453,'','" . AddSlashes(pg_result($resaco, $iresaco, 'pc17_unid')) . "'," . db_getsession('DB_datausu') . "," . db_getsession('DB_id_usuario') . ")");
             $resac = db_query("insert into db_acount values({$acount},1061,6459,'','" . AddSlashes(pg_result($resaco, $iresaco, 'pc17_quant')) . "'," . db_getsession('DB_datausu') . "," . db_getsession('DB_id_usuario') . ")");
             $resac = db_query("insert into db_acount values({$acount},1061,6460,'','" . AddSlashes(pg_result($resaco, $iresaco, 'pc17_codigo')) . "'," . db_getsession('DB_datausu') . "," . db_getsession('DB_id_usuario') . ")");
         }
     }
     $sql = " delete from solicitemunid\n                    where ";
     $sql2 = "";
     if ($dbwhere == null || $dbwhere == "") {
         if ($pc17_codigo != "") {
             if ($sql2 != "") {
                 $sql2 .= " and ";
             }
             $sql2 .= " pc17_codigo = {$pc17_codigo} ";
         }
     } else {
         $sql2 = $dbwhere;
     }
     $result = db_query($sql . $sql2);
     if ($result == false) {
         $this->erro_banco = str_replace("\n", "", @pg_last_error());
         $this->erro_sql = "Unidade/quantidade dos itens nao Excluído. Exclusão Abortada.\\n";
         $this->erro_sql .= "Valores : " . $pc17_codigo;
         $this->erro_msg = "Usuário: \\n\\n " . $this->erro_sql . " \\n\\n";
         $this->erro_msg .= str_replace('"', "", str_replace("'", "", "Administrador: \\n\\n " . $this->erro_banco . " \\n"));
         $this->erro_status = "0";
         $this->numrows_excluir = 0;
         return false;
     } else {
         if (pg_affected_rows($result) == 0) {
             $this->erro_banco = "";
             $this->erro_sql = "Unidade/quantidade dos itens nao Encontrado. Exclusão não Efetuada.\\n";
             $this->erro_sql .= "Valores : " . $pc17_codigo;
             $this->erro_msg = "Usuário: \\n\\n " . $this->erro_sql . " \\n\\n";
             $this->erro_msg .= str_replace('"', "", str_replace("'", "", "Administrador: \\n\\n " . $this->erro_banco . " \\n"));
             $this->erro_status = "1";
             $this->numrows_excluir = 0;
             return true;
         } else {
             $this->erro_banco = "";
             $this->erro_sql = "Exclusão efetuada com Sucesso\\n";
             $this->erro_sql .= "Valores : " . $pc17_codigo;
             $this->erro_msg = "Usuário: \\n\\n " . $this->erro_sql . " \\n\\n";
             $this->erro_msg .= str_replace('"', "", str_replace("'", "", "Administrador: \\n\\n " . $this->erro_banco . " \\n"));
             $this->erro_status = "1";
             $this->numrows_excluir = pg_affected_rows($result);
             return true;
         }
     }
 }
 function excluir($e63_numemp = null, $dbwhere = null)
 {
     if ($dbwhere == null || $dbwhere == "") {
         $resaco = $this->sql_record($this->sql_query_file($e63_numemp));
     } else {
         $resaco = $this->sql_record($this->sql_query_file(null, "*", null, $dbwhere));
     }
     if ($resaco != false || $this->numrows != 0) {
         for ($iresaco = 0; $iresaco < $this->numrows; $iresaco++) {
             $resac = db_query("select nextval('db_acount_id_acount_seq') as acount");
             $acount = pg_result($resac, 0, 0);
             $resac = db_query("insert into db_acountacesso values({$acount}," . db_getsession("DB_acessado") . ")");
             $resac = db_query("insert into db_acountkey values({$acount},5672,'{$e63_numemp}','E')");
             $resac = db_query("insert into db_acount values({$acount},892,5672,'','" . AddSlashes(pg_result($resaco, $iresaco, 'e63_numemp')) . "'," . db_getsession('DB_datausu') . "," . db_getsession('DB_id_usuario') . ")");
             $resac = db_query("insert into db_acount values({$acount},892,5673,'','" . AddSlashes(pg_result($resaco, $iresaco, 'e63_codhist')) . "'," . db_getsession('DB_datausu') . "," . db_getsession('DB_id_usuario') . ")");
         }
     }
     $sql = " delete from empemphist\n                    where ";
     $sql2 = "";
     if ($dbwhere == null || $dbwhere == "") {
         if ($e63_numemp != "") {
             if ($sql2 != "") {
                 $sql2 .= " and ";
             }
             $sql2 .= " e63_numemp = {$e63_numemp} ";
         }
     } else {
         $sql2 = $dbwhere;
     }
     $result = db_query($sql . $sql2);
     if ($result == false) {
         $this->erro_banco = str_replace("\n", "", @pg_last_error());
         $this->erro_sql = "Históricos dos Empenhos nao Excluído. Exclusão Abortada.\\n";
         $this->erro_sql .= "Valores : " . $e63_numemp;
         $this->erro_msg = "Usuário: \\n\\n " . $this->erro_sql . " \\n\\n";
         $this->erro_msg .= str_replace('"', "", str_replace("'", "", "Administrador: \\n\\n " . $this->erro_banco . " \\n"));
         $this->erro_status = "0";
         $this->numrows_excluir = 0;
         return false;
     } else {
         if (pg_affected_rows($result) == 0) {
             $this->erro_banco = "";
             $this->erro_sql = "Históricos dos Empenhos nao Encontrado. Exclusão não Efetuada.\\n";
             $this->erro_sql .= "Valores : " . $e63_numemp;
             $this->erro_msg = "Usuário: \\n\\n " . $this->erro_sql . " \\n\\n";
             $this->erro_msg .= str_replace('"', "", str_replace("'", "", "Administrador: \\n\\n " . $this->erro_banco . " \\n"));
             $this->erro_status = "1";
             $this->numrows_excluir = 0;
             return true;
         } else {
             $this->erro_banco = "";
             $this->erro_sql = "Exclusão efetuada com Sucesso\\n";
             $this->erro_sql .= "Valores : " . $e63_numemp;
             $this->erro_msg = "Usuário: \\n\\n " . $this->erro_sql . " \\n\\n";
             $this->erro_msg .= str_replace('"', "", str_replace("'", "", "Administrador: \\n\\n " . $this->erro_banco . " \\n"));
             $this->erro_status = "1";
             $this->numrows_excluir = pg_affected_rows($result);
             return true;
         }
     }
 }
 function excluir($y07_sequencial = null, $dbwhere = null)
 {
     if ($dbwhere == null || $dbwhere == "") {
         $resaco = $this->sql_record($this->sql_query_file($y07_sequencial));
     } else {
         $resaco = $this->sql_record($this->sql_query_file(null, "*", null, $dbwhere));
     }
     if ($resaco != false || $this->numrows != 0) {
         for ($iresaco = 0; $iresaco < $this->numrows; $iresaco++) {
             $resac = db_query("select nextval('db_acount_id_acount_seq') as acount");
             $acount = pg_result($resac, 0, 0);
             $resac = db_query("insert into db_acountacesso values({$acount}," . db_getsession("DB_acessado") . ")");
             $resac = db_query("insert into db_acountkey values({$acount},8197,'{$y07_sequencial}','E')");
             $resac = db_query("insert into db_acount values({$acount},1380,8197,'','" . AddSlashes(pg_result($resaco, $iresaco, 'y07_sequencial')) . "'," . db_getsession('DB_datausu') . "," . db_getsession('DB_id_usuario') . ")");
             $resac = db_query("insert into db_acount values({$acount},1380,8198,'','" . AddSlashes(pg_result($resaco, $iresaco, 'y07_aidof')) . "'," . db_getsession('DB_datausu') . "," . db_getsession('DB_id_usuario') . ")");
             $resac = db_query("insert into db_acount values({$acount},1380,8199,'','" . AddSlashes(pg_result($resaco, $iresaco, 'y07_ip')) . "'," . db_getsession('DB_datausu') . "," . db_getsession('DB_id_usuario') . ")");
             $resac = db_query("insert into db_acount values({$acount},1380,8200,'','" . AddSlashes(pg_result($resaco, $iresaco, 'y07_data')) . "'," . db_getsession('DB_datausu') . "," . db_getsession('DB_id_usuario') . ")");
             $resac = db_query("insert into db_acount values({$acount},1380,8201,'','" . AddSlashes(pg_result($resaco, $iresaco, 'y07_hora')) . "'," . db_getsession('DB_datausu') . "," . db_getsession('DB_id_usuario') . ")");
         }
     }
     $sql = " delete from aidofweb\n                    where ";
     $sql2 = "";
     if ($dbwhere == null || $dbwhere == "") {
         if ($y07_sequencial != "") {
             if ($sql2 != "") {
                 $sql2 .= " and ";
             }
             $sql2 .= " y07_sequencial = {$y07_sequencial} ";
         }
     } else {
         $sql2 = $dbwhere;
     }
     $result = db_query($sql . $sql2);
     if ($result == false) {
         $this->erro_banco = str_replace("\n", "", @pg_last_error());
         $this->erro_sql = "Dados da web da aidof nao Excluído. Exclusão Abortada.\\n";
         $this->erro_sql .= "Valores : " . $y07_sequencial;
         $this->erro_msg = "Usuário: \\n\\n " . $this->erro_sql . " \\n\\n";
         $this->erro_msg .= str_replace('"', "", str_replace("'", "", "Administrador: \\n\\n " . $this->erro_banco . " \\n"));
         $this->erro_status = "0";
         $this->numrows_excluir = 0;
         return false;
     } else {
         if (pg_affected_rows($result) == 0) {
             $this->erro_banco = "";
             $this->erro_sql = "Dados da web da aidof nao Encontrado. Exclusão não Efetuada.\\n";
             $this->erro_sql .= "Valores : " . $y07_sequencial;
             $this->erro_msg = "Usuário: \\n\\n " . $this->erro_sql . " \\n\\n";
             $this->erro_msg .= str_replace('"', "", str_replace("'", "", "Administrador: \\n\\n " . $this->erro_banco . " \\n"));
             $this->erro_status = "1";
             $this->numrows_excluir = 0;
             return true;
         } else {
             $this->erro_banco = "";
             $this->erro_sql = "Exclusão efetuada com Sucesso\\n";
             $this->erro_sql .= "Valores : " . $y07_sequencial;
             $this->erro_msg = "Usuário: \\n\\n " . $this->erro_sql . " \\n\\n";
             $this->erro_msg .= str_replace('"', "", str_replace("'", "", "Administrador: \\n\\n " . $this->erro_banco . " \\n"));
             $this->erro_status = "1";
             $this->numrows_excluir = pg_affected_rows($result);
             return true;
         }
     }
 }
Ejemplo n.º 30
0
<?php

include 'fpdf153/fpdf.php';
include 'seguridad.php';
include 'seguridad_usu.php';
include 'conectaBD.php';
$correo = $_SESSION["usuario"];
$id = $_REQUEST[id];
$usuario = ejecutaConsulta("Select * from usuario where id='{$id}' and correo='{$correo}';");
$nombre = html_entity_decode(pg_result($usuario, 0, 'nombre'));
$ape1 = html_entity_decode(pg_result($usuario, 0, 'ape1'));
$linea = $nombre . " " . $ape1;
$pdf = new FPDF(L, cm, A4);
$pdf->AddPage();
$pdf->SetFont('Arial', '', 16);
$pdf->Image('img/certifCastellano.jpg', 0, 0, 29.7, 21);
$pdf->MultiCell(27.7, 16, $linea, 0, C);
$pdf->Output('certificado.pdf', I);