| Server IP : 89.46.109.6 / Your IP : 216.73.217.116 Web Server : Apache System : Linux hlpi1ws-c284s07.ad.aruba.it 5.15.0-186-generic #196-Ubuntu SMP Sat Jun 20 16:09:34 UTC 2026 x86_64 User : ID19067310 ( 19067310) PHP Version : 5.3.29 Disable Function : system,popen,dl,passthru,proc_open,shell_exec MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /web/htdocs/www.edizacco.it/home/pannello/ |
Upload File : |
<?php
ob_start();
@session_start();
require_once('../include/connect_db.php');
require_once('include/templates.php');
include('include/sessione.inc.php');
require_once 'include/class.ycpager.php';
$meta_title = TITLE;
$_SESSION['page'] = "bacheca";
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title><?php echo"$meta_title | Area Riservata"; ?></title>
<link href="css/master.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<script type="text/javascript">
function checkUncheck(check)
{
var checks = document.getElementsByName('check[]');
for(i = 0; i < checks.length; i++)
{
checks[i].checked = check.checked;
}
}
</script>
<script type="text/javascript" src="js/controllo_caratteri.js"></script>
<link href="css/paginazione.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="js/sortable_table/themes/style.css" type="text/css" media="print, projection, screen" />
<script type="text/javascript" src="js/sortable_table/js/jquery-latest.js"></script>
<script type="text/javascript" src="js/sortable_table/js/jquery.tablesorter.js"></script>
<script type="text/javascript">
$(function() {
$("#tablesorter-demo").tablesorter({sortList:[[0,0]]});
});
</script>
<script type="text/javascript">
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
</script>
</head>
<body>
<!-- WRAPPER INIZIO -->
<div id="wrapper">
<!-- WRAPPER HEADER INIZIO-->
<div id="wrapper_header">
<div id="header"><?php select_header(); ?></div>
</div>
<!-- WRAPPER HEADER FINE-->
<!-- WRAPPER CONTAINER INIZIO-->
<div id="wrapper_container">
<!-- MENU INIZIO-->
<div id="menu"><?php select_menu(); ?></div>
<!-- MENU FINE-->
<!-- CONTENUTI INIZIO-->
<div id="contenuto">
<?php
// GESTIONE PAGINA
if ( isset($_REQUEST['action']) ) { $action = $_REQUEST['action']; } else { $action = "news"; }
switch ($action) {
case 'news': news(); break;
case 'modulo': modulo(); break;
case 'save': save(); break;
case 'delete': delete(); break;
case 'delete_group': delete_group(); break;
case 'stato': stato(); break;
case 'readd': readd(); break;
case 'duply': duply(); break;
case 'cerca': cerca(); break;
default: news(); break;
}
///////////////////////////////////////////////////////////////////////////////////////////
/// NEWS //////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function news(){
$prefix = PREFIX;
$server = SERVER;
$tipo = $_REQUEST['tipo'];
$pages = $_REQUEST['pages'];
echo'<h1>GESTIONE BACHECA COMUNICAZIONI:</h1>';
if( $tipo == 'tutte' ){
$active_tutte = ' active'; $active_attive = ''; $active_nascoste = '';
$where = "";
}elseif( $tipo == 'attive' ){
$active_tutte = ''; $active_attive = ' active'; $active_nascoste = '';
$where = "WHERE stato = '1'";
}elseif( $tipo == 'nascoste' ) {
$active_tutte = ''; $active_attive = ''; $active_nascoste = ' active';
$where = "WHERE stato = '0'";
}
$total = mysql_query( "SELECT id_bacheca FROM ".$prefix."_bacheca $where ");
$numero_notizie = mysql_num_rows( $total );
echo'
<div id="submenu">
<ul id="navsub">
<li>
<form name="form" id="form">
<label class="label">Visualizza per pagina: </label>
<select name="jumpMenu" id="jumpMenu" onchange="MM_jumpMenu(\'parent\',this,0)">
<option value="gestione_bacheca.php?tipo='.$tipo.'&pages=12" ';if($pages=='12'){echo' selected="selected"';}else{echo'';} echo' >12</option>
<option value="gestione_bacheca.php?tipo='.$tipo.'&pages=24" ';if($pages=='24'){echo' selected="selected"';}else{echo'';} echo' >24</option>
<option value="gestione_bacheca.php?tipo='.$tipo.'&pages=36" ';if($pages=='36'){echo' selected="selected"';}else{echo'';} echo' >36</option>
<option value="gestione_bacheca.php?tipo='.$tipo.'&pages=48" ';if($pages=='48'){echo' selected="selected"';}else{echo'';} echo' >48</option>
<option value="gestione_bacheca.php?tipo='.$tipo.'&pages=60" ';if($pages=='60'){echo' selected="selected"';}else{echo'';} echo' >60</option>
<option value="gestione_bacheca.php?tipo='.$tipo.'&pages=100" ';if($pages=='100'){echo' selected="selected"';}else{echo'';} echo' >100</option>
</select>
</form>
</li>
<li><a href="gestione_bacheca.php?tipo=tutte&pages='.$pages.'" class="tutte'.$active_tutte.'">TUTTE</a></li>
<li><a href="gestione_bacheca.php?tipo=attive&pages='.$pages.'" class="attive'.$active_attive.'">ATTIVE</a></li>
<li><a href="gestione_bacheca.php?tipo=nascoste&pages='.$pages.'" class="nascoste'.$active_nascoste.'">NASCOSTE</a></li>
<li class="num">Totale Comunicati: <b>'.$numero_notizie.'</b></li>
</ul>
</div>
<div id="submenu">
<ul id="navsub">
<li><a href="gestione_bacheca.php?tipo=tutte&pages=12" title="RESET ARCHIVIO"><img src="images/btn_reset.png" alt="RESET ARCHIVIO" class="btn_reset"/></a></li>
<li>
<form action="gestione_bacheca.php?action=cerca" enctype="multipart/form-data" name="form" id="form" method="post" >
<input name="tipo" type="hidden" value="'.$tipo.'" /><input name="pages" type="hidden" value="'.$pages.'" />
<label class="label">Cerca: </label><input name="search" type="text" class="input" />
<input type="submit" name="submit" id="submit" value="CERCA" />
</form>
</li>
</ul>
</div>
';
if( $pages == "" ){ $num_pages = '12'; }else{ $num_pages = $pages; }
if( $numero_notizie > 0 ) {
$limite = $num_pages; // NUMERO VISUALIZZAIONI PER PAGINA
$p = !empty($_GET['p']) ? $_GET['p'] : 1;
$redirect_to = 'gestione_bacheca.php?tipo='.$tipo.'&pages='.$pages.'&'; // NOME PAGINA
$pager = new YCPager( $p, $numero_notizie, $limite, $redirect_to );
$offset = $pager->getQueryOffset();
echo'
<form action="gestione_bacheca.php?action=delete_group" method="post" enctype="multipart/form-data" name="modulo" id="modulo">
<input name="tipo" type="hidden" value="'.$tipo.'" /><input name="pages" type="hidden" value="'.$pages.'" />
<table id="tablesorter-demo" class="tablesorter" border="0" cellpadding="0" cellspacing="1">
<thead>
<tr>
<th width="25" align="center" style="background-image:none; margin:0px;padding:0px;"><input type="checkbox" onclick="checkUncheck(this)" /></td>
<th width="80" align="center"><b>Azione</b></td>
<th width="70" align="center" axis="number"><b>Data</b></td>
<th align="left" axis="string"><b>Titolo</b></td>
<th width="60" align="center" ><b>Stato</b></td>
</tr>
</thead>
<tbody>
';
$carica = mysql_query( "SELECT * FROM ".$prefix."_bacheca $where ORDER BY id_bacheca DESC LIMIT $limite OFFSET $offset ");
while( $row_carica = mysql_fetch_assoc($carica)) {
$id_bacheca = $row_carica['id_bacheca'];
$titolo = stripslashes($row_carica['titolo']);
$testo = substr(strip_tags(stripslashes($row_carica['testo'])), 0, 120);
$gg=substr($row_carica['data'],8,2);
$mm=substr($row_carica['data'],5,2);
$aa=substr($row_carica['data'],0,4);
$data_corretta="$gg/$mm/$aa";
$stato = stripslashes($row_carica['stato']);
if( $stato == '1' ){
$tag_stato = '<a href="gestione_bacheca.php?action=stato&tipo='.$tipo.'&pages='.$pages.'&stato=0&id_bacheca='.$id_bacheca.'" title="NASCONDERE QUESTA COMUNICAZIONE" onclick="return confirm(\'ATTENZIONE. NASCONDERE QUESTA COMUNICAZIONE?\')"><img src="images/btn_stato_vedi.png" alt="NASCONDI COMUNICAZIONE" border="0"/></a>';
}elseif( $stato == '0' ){
$tag_stato = '<a href="gestione_bacheca.php?action=stato&tipo='.$tipo.'&pages='.$pages.'&stato=1&id_bacheca='.$id_bacheca.'" title="ATTIVARE QUESTA COMUNICAZIONE" onclick="return confirm(\'ATTENZIONE. ATTIVARE QUESTA COMUNICAZIONE?\')"><img src="images/btn_stato_nascondi.png" alt="ATTIVARE COMUNICAZIONE" border="0"/></a>';
}
echo'
<tr id="'.$id_bacheca.'" >
<td><input type="checkbox" name="check[]" value="'.$id_bacheca.'" style="margin:3px 0px 0px 3px;"/></td>
<td align="center">
<a href="gestione_bacheca.php?action=modulo&act=edit&tipo='.$tipo.'&pages='.$pages.'&id_bacheca='.$id_bacheca.'" title="MODIFICA NEWS"><img src="images/btn_edit.png" alt="MODIFICA COMUNICATO" border="0"/></a>
<a href="gestione_bacheca.php?action=readd&tipo='.$tipo.'&pages='.$pages.'&id_bacheca='.$id_bacheca.'" title="RIPUBBLICARE NEWS" onclick="return confirm(\'ATTENZIONE. RIPUBBLICARE QUESTO COMUNICATO?\')"><img src="images/btn_readd.png" alt="RIPUBBLICARE NEWS" border="0"/></a>
<a href="gestione_bacheca.php?action=duply&tipo='.$tipo.'&pages='.$pages.'&id_bacheca='.$id_bacheca.'" title="DUPLICARE NEWS" onclick="return confirm(\'ATTENZIONE. DUPLICARE QUESTO COMUNICATO?\')"><img src="images/btn_copy.png" alt="DUPLICARE NEWS" border="0"/></a>
<a href="gestione_bacheca.php?action=delete&tipo='.$tipo.'&pages='.$pages.'&id_bacheca='.$id_bacheca.'" title="ELIMINA NEWS" onclick="return confirm(\'ATTENZIONE. ELIMINARE QUESTO COMUNICATO?\')"><img src="images/btn_delete.png" alt="ELIMINA NEWS" border="0"/></a>
</td>
<td>'.$data_corretta.'</td>
<td><a href="'.$server.'/news_leggi.php?id_bacheca='.$id_bacheca.'" target="_blank">'.$titolo.'</a><br />'.$testo.' <i>[...]</i></td>
<td align="center">'.$tag_stato.'</td>
</tr>
';
}
echo'
</tbody>
<tfoot>
<tr>
<th align="center" colspan="2"><input type="submit" name="submit" id="submit" value="ELIMINA" /></td>
<th align="center"><b>Data</b></td>
<th align="left"><b>Titolo</b></td>
<th align="center"><b>Stato</b></td>
</tr>
</tfoot>
</table>
</form>
<p class="add_style"><a href="gestione_bacheca.php?action=modulo&act=add&tipo='.$tipo.'&pages='.$pages.'" class="add_button">Aggiungi News</a></p>
';
if ( $numero_notizie > $num_pages ) { $pager->getPager(); }else{ echo''; }
}else{
echo'';
}
}
///////////////////////////////////////////////////////////////////////////////////////////
/// MODULO ////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function modulo(){
$prefix = PREFIX;
$directory = NEWSDIRECTORY;
$dimensioni = NEWSDIMENSIONI;
$act = $_REQUEST['act'];
$tipo = $_REQUEST['tipo'];
$pages = $_REQUEST['pages'];
if( $act == "add" ){
$tag_h1 = 'NUOVA';
$value_titolo = '';
$value_testo = '';
$value_stato = '1';
$tag_submit = 'AGGIUNGI';
$tag_hidden_id = '';
$tag_act = '<input name="act" type="hidden" value="add" />';
}elseif ( $act == "edit" ){
$id_bacheca = isset($_GET['id_bacheca']) ? (int)$_GET['id_bacheca'] : 0;
$carica_news = mysql_fetch_assoc(mysql_query("SELECT * FROM ".$prefix."_bacheca WHERE id_bacheca = '$id_bacheca'"));
$tag_h1 = 'MODIFICA';
$value_titolo = 'value="'.htmlspecialchars(stripslashes($carica_news['titolo'])).'"';
$value_testo = ''.htmlspecialchars(stripslashes($carica_news['testo'])).'';
$value_stato = $carica_news['stato'];
$tag_submit = 'MODIFICA';
$tag_hidden_id = '<input name="id_bacheca" type="hidden" value="'.$id_bacheca.'" />';
$tag_act = '<input name="act" type="hidden" value="edit" />';
}
echo'
<h1>GESTIONE BACHECA COMUNICAZIONI > <b>'.$tag_h1.' COMUNICAZIONE</b></h1>
<form action="gestione_bacheca.php?action=save" method="post" enctype="multipart/form-data" name="modulo" id="modulo" onsubmit="return OkNews(this)">
<p><label class="label">Titolo:</label><input name="titolo" type="text" class="input" style="width:535px;" '.$value_titolo.'/></p>
<p>
<label class="label" style="height:275px;">Testo:</label>
<textarea id="descrizione" name="testo" class="textarea2" onKeyUp="limitText(this, 700, this.form.testo_home_counter_uno);" onChange="limitText(this, 700, this.form.testo_home_counter_uno);" >'.$value_testo.'</textarea>
<span class="text_counter_cr" ><i><b>Caratteri rimanenti: </b></i></span><input type="text" name="testo_home_counter_uno" value="700" class="counter_cr"/>
</p>
<p>
<label class="label">Stato:</label>
<input type="radio" name="stato" value="1" class="radio"';if($value_stato=='1'){echo' checked="checked"';}else{echo'';} echo'/><span class="text_radio">ATTIVO</span>
<input type="radio" name="stato" value="0" class="radio"';if($value_stato=='0'){echo' checked="checked"';}else{echo'';} echo'/><span class="text_radio">NASCOSTO</span>
</p>
<p> '.$tag_hidden_id.''.$tag_act.'<input name="tipo" type="hidden" value="'.$tipo.'" /><input name="pages" type="hidden" value="'.$pages.'" /></p>
<p><label class="label"></label><input type="submit" name="submit" id="submit" value="'.$tag_submit.'" /></p>
</form>
<p class="back_style"><a href="gestione_bacheca.php?tipo='.$tipo.'&pages='.$pages.'" class="back_button">Torna Indietro</a></p>
';
}
///////////////////////////////////////////////////////////////////////////////////////////
/// SAVE //////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function save(){
$prefix = PREFIX;
$directory = NEWSDIRECTORY;
$act = addslashes($_POST['act']);
$tipo = addslashes($_POST['tipo']);
$pages = addslashes($_POST['pages']);
$titolo = addslashes($_POST['titolo']);
$testo = addslashes($_POST['testo']);
$stato = addslashes($_POST['stato']);
if( $act == 'add' ) {
$data = date('Y-m-d G:i:s');
$insert = "INSERT INTO ".$prefix."_bacheca (titolo, testo, stato, data) VALUES ('$titolo', '$testo', '$stato', '$data')";
echo'<h1>GESTIONE BACHECA COMUNICAZIONI > <b>NUOVA COMUNICAZIONE</b></h1>';
if(mysql_query($insert)){ echo status_ok(); }else{ echo status_errore(); }
$id_bacheca = mysql_insert_id();
}elseif( $act == 'edit' ){
$id_bacheca = $_POST['id_bacheca'];
$update = "UPDATE ".$prefix."_bacheca SET titolo = '$titolo', testo = '$testo', stato = '$stato' WHERE id_bacheca = '$id_bacheca'";
echo'<h1>GESTIONE BACHECA COMUNICAZIONI > <b>MODIFICA COMUNICAZIONE</b></h1>';
if(mysql_query($update)){ echo status_ok(); }else{ echo status_errore(); }
}elseif( $act == 'readd' ){
$data = date('Y-m-d G:i:s');
$readd = "INSERT INTO ".$prefix."_bacheca (titolo, testo, stato, data) VALUES ('$titolo', '$testo', '$stato', '$data')";
echo'<h1>GESTIONE BACHECA COMUNICAZIONI > <b>RIPUBBLICA COMUNICAZIONE</b></h1>';
if(mysql_query($readd)){ echo status_ok(); }else{ echo status_errore(); }
$id_bacheca = mysql_insert_id();
}
header('Refresh: 1; URL=gestione_bacheca.php?tipo='.$tipo.'&pages='.$pages.'');
ob_end_flush();
}
///////////////////////////////////////////////////////////////////////////////////////////
/// DELETE ////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function delete(){
$prefix = PREFIX;
$directory = NEWSDIRECTORY;
$tipo = addslashes($_REQUEST['tipo']);
$pages = addslashes($_REQUEST['pages']);
$id_bacheca = isset($_GET['id_bacheca']) ? (int)$_GET['id_bacheca'] : 0;
$delete = "DELETE FROM ".$prefix."_bacheca WHERE id_bacheca = '$id_bacheca'" ;
echo'<h1>GESTIONE BACHECA COMUNICAZIONI > <b>ELIMINA COMUNICATO</b></h1>';
if(mysql_query($delete)){ echo status_ok(); }else{ echo status_errore(); }
header('Refresh: 1; URL=gestione_bacheca.php?tipo='.$tipo.'&pages='.$pages.'');
ob_end_flush();
}
///////////////////////////////////////////////////////////////////////////////////////////
/// DELETE GROUP //////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function delete_group(){
$prefix = PREFIX;
$directory = NEWSDIRECTORY;
$tipo = addslashes($_REQUEST['tipo']);
$pages = addslashes($_REQUEST['pages']);
$count = count($_POST['check'.$i]);
if (isset($_POST['check'.$i])) {
$error = "";
foreach ($_POST['check'.$i++] as $_POST['check'.$i]) {
if ( empty($error) ) {
$id_bacheca = $_POST['check'.$i];
$delete = "DELETE FROM ".$prefix."_bacheca WHERE id_bacheca = '$id_bacheca'" ;
if(mysql_query($delete)){ echo status_ok(); }else{ echo status_errore(); }
} else {
die($error);
}
}
}
header("Location: gestione_bacheca.php?tipo=$tipo&pages=$pages");
ob_end_flush();
}
///////////////////////////////////////////////////////////////////////////////////////////
/// STATO /////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function stato(){
$prefix = PREFIX;
$tipo = $_REQUEST['tipo'];
$stato = $_REQUEST['stato'];
$pages = $_REQUEST['pages'];
$id_bacheca = isset($_GET['id_bacheca']) ? (int)$_GET['id_bacheca'] : 0;
if( $stato == '1' ) { $tag_stato = 'COMUNICATO ATTIVATO'; }elseif( $stato == '0' ){ $tag_stato = 'COMUNICATO NASCOSTO'; }
$update = "UPDATE ".$prefix."_bacheca SET stato = '$stato' WHERE id_bacheca = '$id_bacheca'" ;
echo'<h1>GESTIONE BACHECA COMUNICAZIONI > <b>'.$tag_stato.'</b></h1>';
if(mysql_query($update)){ echo status_ok(); }else{ echo status_errore(); }
header('Refresh: 1; URL=gestione_bacheca.php?tipo='.$tipo.'&pages='.$pages.'');
ob_end_flush();
}
///////////////////////////////////////////////////////////////////////////////////////////
/// READD /////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function readd(){
$prefix = PREFIX;
$tipo = $_REQUEST['tipo'];
$pages = $_REQUEST['pages'];
$id_bacheca = isset($_GET['id_bacheca']) ? (int)$_GET['id_bacheca'] : 0;
$carica = mysql_query("SELECT * FROM ".$prefix."_bacheca WHERE id_bacheca = '$id_bacheca'");
while ( $row_carica = @mysql_fetch_array($carica) ) {
$titolo = addslashes($row_carica['titolo']);
$testo = addslashes($row_carica['testo']);
$data = date('Y-m-d G:i:s');
$stato = $row_carica['stato'];
}
$insert = "INSERT INTO ".$prefix."_bacheca (titolo, testo, data, stato) VALUES ('$titolo', '$testo', '$data', '$stato')";
echo'<h1>GESTIONE BACHECA COMUNICAZIONI > <b>RIPUBBLICA COMUNICATO</b></h1>';
if(mysql_query($insert)){
$delete = "DELETE FROM ".$prefix."_bacheca WHERE id_bacheca = '$id_bacheca'" ;
if(mysql_query($delete)){ echo status_ok(); }else{ echo status_errore(); }
}else{ echo status_errore(); }
header('Refresh: 1; URL=gestione_bacheca.php?tipo='.$tipo.'&pages='.$pages.'');
ob_end_flush();
}
///////////////////////////////////////////////////////////////////////////////////////////
/// DUPLY /////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function duply(){
$prefix = PREFIX;
$directory = NEWSDIRECTORY;
$tipo = $_REQUEST['tipo'];
$pages = $_REQUEST['pages'];
$id_bacheca = isset($_GET['id_bacheca']) ? (int)$_GET['id_bacheca'] : 0;
$carica = mysql_query("SELECT * FROM ".$prefix."_bacheca WHERE id_bacheca = '$id_bacheca'");
while ( $row_carica = @mysql_fetch_array($carica) ) {
$titolo = 'DUPLICATO - '.addslashes($row_carica['titolo']);
$testo = addslashes($row_carica['testo']);
$data = date('Y-m-d G:i:s');
$stato = '0';
}
$insert = "INSERT INTO ".$prefix."_bacheca (titolo, testo, data, stato) VALUES ('$titolo', '$testo', '$data', '$stato')";
echo'<h1>GESTIONE BACHECA COMUNICAZIONI > <b>DUPLICA COMUNICATO</b></h1>';
if(mysql_query($insert)){ echo status_ok(); }else{ echo status_errore(); }
header('Refresh: 1; URL=gestione_bacheca.php?tipo=nascoste&pages='.$pages.'');
ob_end_flush();
}
///////////////////////////////////////////////////////////////////////////////////////////
/// CERCA /////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function cerca(){
$prefix = PREFIX;
$server = SERVER;
$tipo = $_POST['tipo'];
$pages = $_POST['pages'];
$search = mysql_real_escape_string($_POST['search']);
$search1 = strtolower($search);
$search2 = strtoupper($search);
echo'<h1>GESTIONE BACHECA COMUNICAZIONI > CERCA > <b>'.stripslashes($_REQUEST['search']).'</b></h1>';
if( $tipo == 'tutte' ){
$active_tutte = ' active'; $active_attive = ''; $active_nascoste = '';
$where = "";
}elseif( $tipo == 'attive' ){
$active_tutte = ''; $active_attive = ' active'; $active_nascoste = '';
$where = "WHERE stato = '1'";
}elseif( $tipo == 'nascoste' ) {
$active_tutte = ''; $active_attive = ''; $active_nascoste = ' active';
$where = "WHERE stato = '0'";
}
$total = mysql_query("SELECT *, MATCH ( titolo, testo) AGAINST('$search1 $search2' IN BOOLEAN MODE) AS attinenza FROM ".$prefix."_bacheca WHERE MATCH( titolo, testo ) AGAINST('$search1 $search2' IN BOOLEAN MODE) ");
$numero_notizie = mysql_num_rows( $total );
echo'
<div id="submenu">
<ul id="navsub">
<li>
<form name="form" id="form">
<label class="label">Visualizza per pagina: </label>
<select name="jumpMenu" id="jumpMenu" onchange="MM_jumpMenu(\'parent\',this,0)">
<option value="gestione_bacheca.php?tipo='.$tipo.'&pages=12" ';if($pages=='12'){echo' selected="selected"';}else{echo'';} echo' >12</option>
<option value="gestione_bacheca.php?tipo='.$tipo.'&pages=24" ';if($pages=='24'){echo' selected="selected"';}else{echo'';} echo' >24</option>
<option value="gestione_bacheca.php?tipo='.$tipo.'&pages=36" ';if($pages=='36'){echo' selected="selected"';}else{echo'';} echo' >36</option>
<option value="gestione_bacheca.php?tipo='.$tipo.'&pages=48" ';if($pages=='48'){echo' selected="selected"';}else{echo'';} echo' >48</option>
<option value="gestione_bacheca.php?tipo='.$tipo.'&pages=60" ';if($pages=='60'){echo' selected="selected"';}else{echo'';} echo' >60</option>
<option value="gestione_bacheca.php?tipo='.$tipo.'&pages=100" ';if($pages=='100'){echo' selected="selected"';}else{echo'';} echo' >100</option>
</select>
</form>
</li>
<li><a href="gestione_bacheca.php?tipo=tutte&pages='.$pages.'" class="tutte'.$active_tutte.'">TUTTE</a></li>
<li><a href="gestione_bacheca.php?tipo=attive&pages='.$pages.'" class="attive'.$active_attive.'">ATTIVE</a></li>
<li><a href="gestione_bacheca.php?tipo=nascoste&pages='.$pages.'" class="nascoste'.$active_nascoste.'">NASCOSTE</a></li>
<li class="num">Totale Comunicati: <b>'.$numero_notizie.'</b></li>
</ul>
</div>
<div id="submenu">
<ul id="navsub">
<li><a href="gestione_bacheca.php?tipo=tutte&pages=12" title="RESET ARCHIVIO"><img src="images/btn_reset.png" alt="RESET ARCHIVIO" class="btn_reset"/></a></li>
<li>
<form action="gestione_bacheca.php?action=cerca" enctype="multipart/form-data" name="form" id="form" method="post" >
<input name="tipo" type="hidden" value="'.$tipo.'" /><input name="pages" type="hidden" value="'.$pages.'" />
<label class="label">Cerca: </label><input name="search" type="text" class="input" />
<input type="submit" name="submit" id="submit" value="CERCA" />
</form>
</li>
</ul>
</div>
';
if( $pages == "" ){ $num_pages = '12'; }else{ $num_pages = $pages; }
if( $numero_notizie > 0 ) {
$limite = $num_pages; // NUMERO VISUALIZZAIONI PER PAGINA
$p = !empty($_GET['p']) ? $_GET['p'] : 1;
$redirect_to = 'gestione_bacheca.php?tipo='.$tipo.'&pages='.$pages.'&'; // NOME PAGINA
$pager = new YCPager( $p, $numero_notizie, $limite, $redirect_to );
$offset = $pager->getQueryOffset();
echo'
<form action="gestione_bacheca.php?action=delete_group" method="post" enctype="multipart/form-data" name="modulo" id="modulo">
<input name="tipo" type="hidden" value="'.$tipo.'" /><input name="pages" type="hidden" value="'.$pages.'" />
<table id="tablesorter-demo" class="tablesorter" border="0" cellpadding="0" cellspacing="1">
<thead>
<tr>
<th width="25" align="center" style="background-image:none; margin:0px;padding:0px;"><input type="checkbox" onclick="checkUncheck(this)" /></td>
<th width="80" align="center"><b>Azione</b></td>
<th width="70" align="center" axis="number"><b>Data</b></td>
<th align="left" axis="string"><b>Titolo</b></td>
<th width="60" align="center" ><b>Stato</b></td>
</tr>
</thead>
<tbody>
';
$carica = mysql_query("SELECT *, MATCH ( titolo, testo) AGAINST('$search1 $search2' IN BOOLEAN MODE) AS attinenza FROM ".$prefix."_bacheca WHERE MATCH( titolo, testo ) AGAINST('$search1 $search2' IN BOOLEAN MODE) LIMIT $limite OFFSET $offset");
while( $row_carica = mysql_fetch_assoc($carica)) {
$id_bacheca = $row_carica['id_bacheca'];
$titolo = stripslashes($row_carica['titolo']);
$testo = substr(strip_tags(stripslashes($row_carica['testo'])), 0, 120);
$gg=substr($row_carica['data'],8,2);
$mm=substr($row_carica['data'],5,2);
$aa=substr($row_carica['data'],0,4);
$data_corretta="$gg/$mm/$aa";
$stato = stripslashes($row_carica['stato']);
if( $stato == '1' ){
$tag_stato = '<a href="gestione_bacheca.php?action=stato&tipo='.$tipo.'&pages='.$pages.'&stato=0&id_bacheca='.$id_bacheca.'" title="NASCONDERE QUESTA COMUNICAZIONE" onclick="return confirm(\'ATTENZIONE. NASCONDERE QUESTA COMUNICAZIONE?\')"><img src="images/btn_stato_vedi.png" alt="NASCONDI COMUNICAZIONE" border="0"/></a>';
}elseif( $stato == '0' ){
$tag_stato = '<a href="gestione_bacheca.php?action=stato&tipo='.$tipo.'&pages='.$pages.'&stato=1&id_bacheca='.$id_bacheca.'" title="ATTIVARE QUESTA COMUNICAZIONE" onclick="return confirm(\'ATTENZIONE. ATTIVARE QUESTA COMUNICAZIONE?\')"><img src="images/btn_stato_nascondi.png" alt="ATTIVARE COMUNICAZIONE" border="0"/></a>';
}
echo'
<tr id="'.$id_bacheca.'" >
<td><input type="checkbox" name="check[]" value="'.$id_bacheca.'" style="margin:3px 0px 0px 3px;"/></td>
<td align="center">
<a href="gestione_bacheca.php?action=modulo&act=edit&tipo='.$tipo.'&pages='.$pages.'&id_bacheca='.$id_bacheca.'" title="MODIFICA NEWS"><img src="images/btn_edit.png" alt="MODIFICA COMUNICATO" border="0"/></a>
<a href="gestione_bacheca.php?action=readd&tipo='.$tipo.'&pages='.$pages.'&id_bacheca='.$id_bacheca.'" title="RIPUBBLICARE NEWS" onclick="return confirm(\'ATTENZIONE. RIPUBBLICARE QUESTO COMUNICATO?\')"><img src="images/btn_readd.png" alt="RIPUBBLICARE NEWS" border="0"/></a>
<a href="gestione_bacheca.php?action=duply&tipo='.$tipo.'&pages='.$pages.'&id_bacheca='.$id_bacheca.'" title="DUPLICARE NEWS" onclick="return confirm(\'ATTENZIONE. DUPLICARE QUESTO COMUNICATO?\')"><img src="images/btn_copy.png" alt="DUPLICARE NEWS" border="0"/></a>
<a href="gestione_bacheca.php?action=delete&tipo='.$tipo.'&pages='.$pages.'&id_bacheca='.$id_bacheca.'" title="ELIMINA NEWS" onclick="return confirm(\'ATTENZIONE. ELIMINARE QUESTO COMUNICATO?\')"><img src="images/btn_delete.png" alt="ELIMINA NEWS" border="0"/></a>
</td>
<td>'.$data_corretta.'</td>
<td><a href="'.$server.'/news_leggi.php?id_bacheca='.$id_bacheca.'" target="_blank">'.$titolo.'</a><br />'.$testo.' <i>[...]</i></td>
<td align="center">'.$tag_stato.'</td>
</tr>
';
}
echo'
</tbody>
<tfoot>
<tr>
<th align="center" colspan="2"><input type="submit" name="submit" id="submit" value="ELIMINA" /></td>
<th align="center"><b>Data</b></td>
<th align="left"><b>Titolo</b></td>
<th align="center"><b>Stato</b></td>
</tr>
</tfoot>
</table>
</form>
<p class="add_style"><a href="gestione_bacheca.php?action=modulo&act=add&tipo='.$tipo.'&pages='.$pages.'" class="add_button">Aggiungi News</a></p>
';
if ( $numero_notizie > $num_pages ) { $pager->getPager(); }else{ echo''; }
}else{
echo'';
}
}
?>
</div>
<!-- CONTENUTI FINE-->
</div>
<!-- WRAPPER CONTAINER FINE-->
<div class="push"></div>
</div>
<!-- WRAPPER FINE -->
<!-- WRAPPER FOOTER INIZIO-->
<div id="wrapper_footer"><?php select_footer(); ?></div>
<!-- WRAPPER FOOTER FINE-->
</body>
</html>