Exemplo n.º 1
0
session_start();
require "inc/db.php";
require "class/cut.php";
if (isset($_GET['x'])) {
    $x = 0;
} else {
    $x = 1;
}
$a = "SELECT post.id,post.titolo, post.testo, log.data, rubrica.utente FROM main.log, main.usr, main.rubrica, main.post WHERE log.utente = usr.id AND log.record = post.id AND usr.rubrica = rubrica.id AND post.pubblica = 1 AND post.cat = 1 AND log.tabella = 'post' AND log.operazione = 'I' order by log.data desc;";
$b = pg_query($connection, $a);
while ($c = pg_fetch_array($b)) {
    $data = split(" ", $c['data']);
    $data = $data[0];
    //$testo = strip_tags($p['testo']);
    $testo = cutHtmlText($c['testo'], 300, "...", false, false, false);
    $post .= "<tr>";
    $post .= "<td>";
    $post .= "<header class='giallo'>" . $c['titolo'] . "</header>";
    $post .= "<article>";
    $post .= $testo;
    $post .= "<div class='buttonFooter'><a href='postView.php?p=" . $c['id'] . "' title='Leggi tutto'><i class='fa fa-arrow-right hidden-aria='true'></i> Leggi tutto</a></div>";
    $post .= "</article>";
    $post .= "<footer>Pubblicato da <strong>" . $c['utente'] . "</strong> il <strong>" . $data . "</strong></footer>";
    $post .= "</td>";
    $post .= "</tr>";
}
?>
<!DOCTYPE html>
<html>
  <head>
Exemplo n.º 2
0
$extres = pg_query($connection, $extq);
$ext = pg_fetch_array($extres);
if (!$ext['ext']) {
    $extent = "594297.89483444,3654301.447749,6244523.0248882,6589483.3334912";
} else {
    $coo = explode(",", str_replace(" ", ",", substr($ext['ext'], 4, -1)));
    $extent = str_replace(" ", ",", substr($ext['ext'], 4, -1));
}
//post
$postq = "SELECT p.titolo, p.testo, p.pubblica, p.id FROM main.post p, main.log WHERE p.id = log.record AND log.tabella = 'post' AND log.operazione = 'I' AND p.pubblica = 1 order by log.data desc limit 5;";
$postr = pg_query($connection, $postq);
$r = pg_num_rows($postr);
while ($post = pg_fetch_array($postr)) {
    $data = explode(" ", $post["data"]);
    $p = strip_tags($post['testo']);
    $p = cutHtmlText($p, 140, "...", false, false, false);
    $postList .= "<li>";
    $postList .= "<span class='headline'>";
    $postList .= "<a href='postView.php?p=" . $post['id'] . "' class='transition' title='Visualizza post completo'>" . $post['titolo'] . "</a>";
    $postList .= "</span>";
    $postList .= "<p class='date'>" . $data[0] . "</p>";
    $postList .= "<div class='postList'>" . $p . "</div>";
    $postList .= "</li>";
}
// open data documents lista
$odquery = "SELECT odd.titolo, odd.categoria, odf.tipo, odf.link, l.sigla as licenza FROM liste.licenze l, main.log, main.opendata odd, main.opendatafile odf WHERE odd.id = log.record AND odf.licenza = l.id AND odf.opendata = odd.id AND log.tabella = 'opendata' AND log.operazione = 'I' ORDER BY log.data DESC LIMIT 10;";
$odres = pg_query($connection, $odquery);
while ($od = pg_fetch_array($odres)) {
    switch ($od['tipo']) {
        case 'pdf':
            $ico = '<i class="fa fa-file-pdf-o" aria-hidden="true"></i>';
Exemplo n.º 3
0
<?php

session_start();
require "inc/db.php";
require "class/cut.php";
$a = "select l.id, l.anno, c.categoria, l.nome, l.descrizione from main.lavoro l, liste.cat c where l.tipo = c.id order by l.anno desc, l.nome asc;";
$b = pg_query($connection, $a);
while ($c = pg_fetch_array($b)) {
    $descrizione = nl2br($c['descrizione']);
    $post .= "<tr>";
    $post .= "<td><a href='lavoro.php?l=" . $c['id'] . "'><i class='fa fa-arrow-right'></i></a></td>";
    $post .= "<td>" . $c['anno'] . "</td>";
    $post .= "<td>" . $c['categoria'] . "</td>";
    $post .= "<td>" . $c['nome'] . "</td>";
    $post .= "<td>" . cutHtmlText($descrizione, 500, '...', false, false, true) . "</td>";
    $post .= "</tr>";
}
?>
<!DOCTYPE html>
<html>
  <head>
      <?php 
require "inc/meta.php";
?>
      <link href="css/style.css" rel="stylesheet" media="screen" />
      <link href="lib/FooTable/css/footable.core.min.css" rel="stylesheet" media="screen" />
      <style>
        .footable th:nth-child(1){width:5%;}
        .footable th:nth-child(2){width:5%;}
        .footable th:nth-child(3){width:20%;}
        .footable th:nth-child(4){width:30%;}