| Server IP : 89.46.109.6 / Your IP : 216.73.216.84 Web Server : Apache System : Linux hlpi1ws-c284v20.ad.aruba.it 6.8.0-139-generic #139-Ubuntu SMP PREEMPT_DYNAMIC Sat Aug 1 03:52:05 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'] = "newsletter";
?>
<!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>
<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>
<link media="screen" rel="stylesheet" href="js/popup/colorbox.css" />
<script src="js/popup/jquery.colorbox.js"></script>
<script> $(document).ready(function(){ $(".preview").colorbox({width:"80%", height:"80%", iframe:true}); }); </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>
</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 = "newsletter"; }
switch ($action) {
case 'newsletter': newsletter(); break;
case 'newsletter_modulo': newsletter_modulo(); break;
case 'categorie': categorie(); break;
case 'categorie_modulo': categorie_modulo(); break;
case 'utente': utente(); break;
case 'utente_modulo': utente_modulo(); break;
case 'select_invio': select_invio(); break;
case 'select': select(); break;
case 'result_invio': result_invio(); break;
default: newsletter(); break;
}
///////////////////////////////////////////////////////////////////////////////////////////
/// NEWSLETTER ////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function newsletter(){
$prefix = PREFIX;
$server = SERVER;
$tipo = $_REQUEST['tipo'];
echo'<h1>GESTIONE NEWSLETTER:</h1>';
if( $tipo == 'tutte' ){
$active_tutte = ' active'; $active_attive = ''; $active_nascoste = '';
$where = "";
}elseif( $tipo == 'inviate' ){
$active_tutte = ''; $active_attive = ' active'; $active_nascoste = '';
$where = "WHERE stato = '1'";
}elseif( $tipo == 'attesa' ) {
$active_tutte = ''; $active_attive = ''; $active_nascoste = ' active';
$where = "WHERE stato = '0'";
}
$total = mysql_query( "SELECT id_newsletter FROM ".$prefix."_newsletter $where ");
$numero_notizie = mysql_num_rows( $total );
echo'
<div id="submenu">
<ul id="navsub">
<li><a href="gestione_newsletter.php?tipo=tutte" class="tutte'.$active_tutte.'">TUTTE</a></li>
<li><a href="gestione_newsletter.php?tipo=inviate" class="attive'.$active_attive.'">INVIATE</a></li>
<li><a href="gestione_newsletter.php?tipo=attesa" class="nascoste'.$active_nascoste.'">IN ATTESA</a></li>
<li class="num">Totale Newsletter: <b>'.$numero_notizie.'</b></li>
</ul>
</div>
';
if( $numero_notizie > 0 ) {
$limite = 15; // NUMERO VISUALIZZAIONI PER PAGINA
$p = !empty($_GET['p']) ? $_GET['p'] : 1;
$redirect_to = 'gestione_newsletter.php?action=newsletter&tipo='.$tipo.'&'; // NOME PAGINA
$pager = new YCPager( $p, $numero_notizie, $limite, $redirect_to );
$offset = $pager->getQueryOffset();
echo'
<table id="tablesorter-demo" class="tablesorter" border="0" cellpadding="0" cellspacing="1">
<thead>
<tr>
<th width="90" align="center" style="background-image: none; padding:0px;"><b>Azione</b></td>
<th width="70" align="center" axis="number"><b>Data</b></td>
<th align="left" axis="string"><b>Newsletter</b></td>
<th width="70" align="center" style="background-image: none; padding:0px;"><b>Inviata</b></td>
</tr>
</thead>
<tbody>
';
$carica = mysql_query( "SELECT * FROM ".$prefix."_newsletter $where ORDER BY id_newsletter DESC LIMIT $limite OFFSET $offset ");
while( $row_carica = mysql_fetch_assoc($carica)) {
$id_newsletter = $row_carica['id_newsletter'];
$titolo = stripslashes($row_carica['titolo']);
$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_newsletter.php?action=select_invio&tipo='.$tipo.'&id_newsletter='.$id_newsletter.'" title="RE-INVIARE QUESTA NEWSLETTER" onclick="return confirm(\'ATTENZIONE. RE-INVIARE QUESTA NEWSLETTER?\')"><img src="images/newsletter_stato_1.png" alt="RE-INVIARE NEWSLETTER" border="0"/></a>';
}elseif( $stato == '0' ){
$tag_stato = '<a href="gestione_newsletter.php?action=select_invio&tipo='.$tipo.'&id_newsletter='.$id_newsletter.'" title="INVIARE QUESTA NEWSLETTER" onclick="return confirm(\'ATTENZIONE. INVIARE QUESTA NEWSLETTER?\')"><img src="images/newsletter_stato_0.png" alt="INVIARE NEWSLETTER" border="0"/></a>';
}
echo'
<tr id="'.$id_news.'" >
<td align="center">
<a class=\'preview\' href="gestione_newsletter_anteprima.php?id_newsletter='.$id_newsletter.'" title="ANTEPRIMA NEWSLETTER"><img src="images/btn_view.png" alt="ANTEPRIMA NEWSLETTER" border="0"/></a>
<a href="gestione_newsletter.php?action=newsletter_modulo&act=edit&tipo='.$tipo.'&id_newsletter='.$id_newsletter.'" title="MODIFICA NEWS"><img src="images/btn_edit.png" alt="MODIFICA NEWSLETTER" border="0"/></a>
<a href="gestione_newsletter_azione.php?action=newsletter_duply&tipo='.$tipo.'&id_newsletter='.$id_newsletter.'" title="DUPLICARE NEWS" onclick="return confirm(\'ATTENZIONE. DUPLICARE QUESTA NEWSLETTER?\')"><img src="images/btn_copy.png" alt="DUPLICARE NEWS" border="0"/></a>
<a href="gestione_newsletter_azione.php?action=newsletter_delete&tipo='.$tipo.'&id_newsletter='.$id_newsletter.'" title="ELIMINA NEWS" onclick="return confirm(\'ATTENZIONE. ELIMINARE QUESTA NEWSLETTER?\')"><img src="images/btn_delete.png" alt="ELIMINA NEWS" border="0"/></a>
</td>
<td>'.$data_corretta.'</td>
<td><b>'.$titolo.'</b></td>
<td align="center">'.$tag_stato.'</td>
</tr>
';
}
echo'
</tbody>
<tfoot>
<tr>
<th align="center"><b>Azione</b></td>
<th align="center"><b>Data</b></td>
<th align="left"><b>Newsletter</b></td>
<th align="center"><b>Inviata</b></td>
</tr>
</tfoot>
</table>
';
if ( $numero_notizie > $limite ) { $pager->getPager(); }else{ echo''; }
}else{ echo''; }
echo'<p class="add_style"><a href="gestione_newsletter.php?action=newsletter_modulo&act=add&tipo='.$tipo.'" class="add_button">Aggiungi Newsletter</a></p>';
}
///////////////////////////////////////////////////////////////////////////////////////////
/// NEWSLETTER MODULO /////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function newsletter_modulo(){
$prefix = PREFIX;
$directory = NEWSLETTERDIRECTORY;
$dimensioni = NEWSLETTERDIMENSIONI;
$act = $_REQUEST['act'];
$tipo = $_REQUEST['tipo'];
if( $act == "add" ){
$tag_h1 = 'NUOVA';
$value_titolo = '';
$value_testo = '';
$value_immagine = '';
$tag_submit = 'SALVA';
$tag_hidden_id = '';
}elseif ( $act == "edit" ){
$id_newsletter = isset($_GET['id_newsletter']) ? (int)$_GET['id_newsletter'] : 0;
$carica_newsletter = mysql_fetch_assoc(mysql_query("SELECT * FROM ".$prefix."_newsletter WHERE id_newsletter = '$id_newsletter'"));
$tag_h1 = 'MODIFICA';
$value_titolo = 'value="'.htmlspecialchars(stripslashes($carica_newsletter['titolo'])).'"';
$value_testo = ''.htmlspecialchars(stripslashes($carica_newsletter['testo'])).'';
if( $carica_newsletter['immagine'] != "" ){
$value_immagine = '
<div class="edit_images1" style="width:170px;">
<img src="../'.$directory.'/'.$carica_newsletter['immagine'].'" alt="" class="images" /> [ <input name="del_img" type="checkbox" class="checkbox" value="1" /> ELIMINA ]</p>
</div>
';
}else{ $value_immagine = ''; }
$tag_submit = 'MODIFICA';
$tag_hidden_id = '<input name="id_newsletter" type="hidden" value="'.$id_newsletter.'" />';
}
echo'
<h1>GESTIONE NEWSLETTER > <b>'.$tag_h1.' NEWSLETTER</b></h1>
<form action="gestione_newsletter_azione.php?action=newsletter_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:490px;">Testo:</label>
<div style="width:538px; padding:0px; margin:2px; float:left;">
<textarea id="descrizione" name="testo" >'.$value_testo.'</textarea>
<script type="text/javascript">
//<![CDATA[
CKEDITOR.replace( \'testo\',{
toolbar : \'News\',
height: 350,
skin : \'kama\',
extraPlugins : \'docprops\',
filebrowserBrowseUrl : \'ckfinder/ckfinder.html\',
filebrowserImageBrowseUrl : \'ckfinder/ckfinder.html?Type=Images\',
filebrowserFlashBrowseUrl : \'ckfinder/ckfinder.html?Type=Flash\',
filebrowserUploadUrl : \'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files\',
filebrowserImageUploadUrl : \'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images\',
filebrowserFlashUploadUrl : \'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash\',
});
//]]>
</script>
</div>
</p>
<p>
<label class="label" style="height:52px; line-height:52px;">Immagine:</label>
'.$value_immagine.'
<div class="edit_images1" style="width:351px; padding:1px;">
<p><input name="immagine" type="file" class="file" size="30" /></p>
<p><i><b>('.$dimensioni.')</b></i></p>
</div>
</p>
<p> '.$tag_hidden_id.'<input name="act" type="hidden" value="'.$act.'" /><input name="tipo" type="hidden" value="'.$tipo.'" /></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_newsletter.php?action=newsletter&tipo='.$tipo.'" class="back_button">Torna Indietro</a></p>
';
}
///////////////////////////////////////////////////////////////////////////////////////////
/// CATEGORIE /////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function categorie(){
$prefix = PREFIX;
$server = SERVER;
echo'<h1>GESTIONE NEWSLETTER > <b>ELENCO CATEGORIE</b></h1>';
$total = mysql_query( "SELECT id_categoria FROM ".$prefix."_newsletter_categoria ");
$numero_notizie = mysql_num_rows( $total );
echo'
<div id="submenu">
<ul id="navsub">
<li class="num">Totale Categorie: <b>'.$numero_notizie.'</b></li>
</ul>
</div>
';
if ( mysql_num_rows($total) <= 0 ) { echo''; }else{
echo'
<table id="tablesorter-demo" class="tablesorter" border="0" cellpadding="0" cellspacing="1">
<thead>
<tr>
<th width="80" align="center"><b>Azione</b></td>
<th align="left" axis="string"><b>Categorie</b></td>
<th align="left" axis="string"><b>N° registrati</b></td>
</tr>
</thead>
<tbody>
';
}
$carica = mysql_query( "SELECT * FROM ".$prefix."_newsletter_categoria ORDER BY categoria ASC ");
while( $row_carica = mysql_fetch_assoc($carica)) {
$id_categoria = $row_carica['id_categoria'];
$categoria = stripslashes($row_carica['categoria']);
$count_utenti = mysql_query("SELECT COUNT(id_categoria) FROM ".$prefix."_newsletter_utenti WHERE id_categoria = '$id_categoria'");
$utenti_count = mysql_fetch_row($count_utenti);
$tot_utenti = $utenti_count[0];
echo'
<tr id="'.$id_categoria.'" >
<td align="center">
<a href="gestione_newsletter.php?action=categorie_modulo&act=edit&id_categoria='.$id_categoria.'" title="MODIFICA CATEGORIA"><img src="images/btn_edit.png" alt="MODIFICA NEWSLETTER" border="0"/></a>
<a href="gestione_newsletter_azione.php?action=categorie_delete&id_categoria='.$id_categoria.'" title="ELIMINA CATEGORIA" onclick="return confirm(\'ATTENZIONE. ELIMINANDO QUESTA CATEGORIA ELIMINERAI ANCHE I SUOI UTENTI REGISTRATI. SEI SICURO?\')"><img src="images/btn_delete.png" alt="ELIMINA CATEGORIA" border="0"/></a>
</td>
<td><b>'.$categoria.'</b></td>
<td>Registrati: <b>'.$tot_utenti.'</b></td>
</tr>
';
}
if ( mysql_num_rows($total) <= 0 ) { echo''; }else{
echo'
</tbody>
<tfoot>
<tr>
<th align="center"><b>Azione</b></td>
<th align="left"><b>Categorie</b></td>
<th align="left"><b>N° registrati</b></td>
</tr>
</tfoot>
</table>
';
}
echo'<p class="add_style"><a href="gestione_newsletter.php?action=categorie_modulo&act=add" class="add_button">Aggiungi Categoria</a></p>';
}
///////////////////////////////////////////////////////////////////////////////////////////
/// CATEGORIE MODULO //////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function categorie_modulo(){
$prefix = PREFIX;
$act = $_REQUEST['act'];
if( $act == "add" ){
$tag_h1 = 'NUOVA';
$value_categoria = '';
$tag_submit = 'SALVA';
$tag_hidden_id = '';
}elseif ( $act == "edit" ){
$id_categoria = isset($_GET['id_categoria']) ? (int)$_GET['id_categoria'] : 0;
$carica_categoria = mysql_fetch_assoc(mysql_query("SELECT * FROM ".$prefix."_newsletter_categoria WHERE id_categoria = '$id_categoria'"));
$tag_h1 = 'MODIFICA';
$value_categoria = 'value="'.htmlspecialchars(stripslashes($carica_categoria['categoria'])).'"';
$tag_submit = 'MODIFICA';
$tag_hidden_id = '<input name="id_categoria" type="hidden" value="'.$id_categoria.'" />';
}
echo'
<h1>GESTIONE NEWSLETTER > ELENCO CATEGORIE > <b>'.$tag_h1.' CATEGORIA</b></h1>
<form action="gestione_newsletter_azione.php?action=categorie_save" method="post" enctype="multipart/form-data" name="modulo" id="modulo" onsubmit="return OkNews(this)">
<p><label class="label">Categoria:</label><input name="categoria" type="text" class="input" '.$value_categoria.'/></p>
<p> '.$tag_hidden_id.'<input name="act" type="hidden" value="'.$act.'" /></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_newsletter.php?action=categorie" class="back_button">Torna Indietro</a></p>
';
}
///////////////////////////////////////////////////////////////////////////////////////////
/// UTENTE ////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function utente(){
$prefix = PREFIX;
$server = SERVER;
echo'<h1>GESTIONE NEWSLETTER > <b>ELENCO UTENTI REGISTRATI</b></h1>';
$total = mysql_query( "SELECT id_utente FROM ".$prefix."_newsletter_utenti ");
$numero_notizie = mysql_num_rows( $total );
echo'
<link href="js/order_alfabetico/listmenu.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/order_alfabetico/jquery-1.3.2.js"></script>
<script type="text/javascript" src="js/order_alfabetico/jquery.listmenu-1.1.js"></script></head>
<script type="text/javascript">
$(function(){ $(\'#myList\').listmenu({ noMatchText: \'Non esistono utenti registrati su questa lettera.\', showCounts: false, cols:{ count:4, gutter:5 }, }); }); </script>
<div id="submenu">
<ul id="navsub">
<li class="num">Totale Utenti: <b>'.$numero_notizie.'</b></li>
</ul>
</div>
<ul id="myList" class="lm-wrapper">
';
$carica = mysql_query( "SELECT * FROM ".$prefix."_newsletter_utenti ORDER BY cognome ASC, nome ASC ");
while( $row_carica = mysql_fetch_assoc($carica)) {
$id_utente = $row_carica['id_utente'];
$cognome = stripslashes($row_carica['cognome']);
$nome = stripslashes($row_carica['nome']);
$id_categoria = stripslashes($row_carica['id_categoria']);
$carica_categoria = mysql_fetch_assoc(mysql_query("SELECT * FROM ".$prefix."_newsletter_categoria WHERE id_categoria = '$id_categoria'"));
echo'
<li>
<p><b>'.$cognome.' '.$nome.'</b><br />CAT: '.stripslashes($carica_categoria['categoria']).'</p>
<p>
<a href="gestione_newsletter.php?action=utente_modulo&act=edit&id_utente='.$id_utente.'" title="MODIFICA UTENTE"><img src="images/btn_edit.png" alt="MODIFICA UTENTE" class="btn"/>Modifica Utente</a></p>
<p>
<a href="gestione_newsletter_azione.php?action=utente_delete&id_utente='.$id_utente.'" title="ELIMINA UTENTE" onclick="return confirm(\'ATTENZIONE. ELIMINARE QUESTO UTENTE REGISTRATO?\')"><img src="images/btn_delete.png" alt="ELIMINA UTENTE" class="btn"/>Elimina Utente</a>
</p>
</li>
';
}
echo'
</ul>
';
}
///////////////////////////////////////////////////////////////////////////////////////////
/// UTENTE MODULO /////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function utente_modulo(){
$prefix = PREFIX;
$act = $_REQUEST['act'];
if( $act == "add" ){
$tag_h1 = 'NUOVO';
$value_cognome = '';
$value_nome = '';
$value_indirizzo = '';
$value_citta = '';
$value_id_provincia = '';
$value_cellulare = '';
$value_id_categoria = '';
$value_email = '';
$tag_submit = 'SALVA';
$tag_hidden_id = '';
}elseif ( $act == "edit" ){
$id_utente = isset($_GET['id_utente']) ? (int)$_GET['id_utente'] : 0;
$carica_utente = mysql_fetch_assoc(mysql_query("SELECT * FROM ".$prefix."_newsletter_utenti WHERE id_utente = '$id_utente'"));
$tag_h1 = 'MODIFICA';
$value_cognome = 'value="'.htmlspecialchars(stripslashes($carica_utente['cognome'])).'"';
$value_nome = 'value="'.htmlspecialchars(stripslashes($carica_utente['nome'])).'"';
$value_indirizzo = 'value="'.htmlspecialchars(stripslashes($carica_utente['indirizzo'])).'"';
$value_citta = 'value="'.htmlspecialchars(stripslashes($carica_utente['citta'])).'"';
$value_id_provincia = $carica_utente['id_provincia'];
$value_cellulare = 'value="'.htmlspecialchars(stripslashes($carica_utente['cellulare'])).'"';
$value_id_categoria = $carica_utente['id_categoria'];
$value_email = 'value="'.htmlspecialchars(stripslashes($carica_utente['email'])).'"';
$tag_submit = 'MODIFICA';
$tag_hidden_id = '<input name="id_utente" type="hidden" value="'.$id_utente.'" />';
}
echo'
<h1>GESTIONE NEWSLETTER > ELENCO UTENTI > <b>'.$tag_h1.' UTENTE</b></h1>
<form action="gestione_newsletter_azione.php?action=utente_save" method="post" enctype="multipart/form-data" name="modulo" id="modulo" onsubmit="return OkNews(this)">
<p><label class="label">Cognome:</label><input name="cognome" type="text" class="input" '.$value_cognome.'/></p>
<p><label class="label">Nome:</label><input name="nome" type="text" class="input" '.$value_nome.'/></p>
<p><label class="label">Indirizzo:</label><input name="indirizzo" type="text" class="input" '.$value_indirizzo.'/></p>
<p><label class="label">Città:</label><input name="citta" type="text" class="input" '.$value_citta.'/></p>
<p>
<label class="label">Provincia:</label>
<select name="id_provincia" class="finestra">
<option value="" ';if($value_id_provincia == '' || $value_id_provincia == '0'){echo' selected="selected"';}else{echo'';} echo'>Seleziona Provincia:</option>';
$query_provincia = mysql_query("SELECT * FROM ".$prefix."_provincie ORDER BY provincia ASC");
while ( $row_query_provincia = @mysql_fetch_array($query_provincia) ) {
$id_provincia = $row_query_provincia['id_provincia'];
$provincia = stripslashes($row_query_provincia['provincia']);
echo '<option value="'.$id_provincia.'" ';if($value_id_provincia == $id_provincia){echo' selected="selected"';}else{echo'';} echo' >'.$provincia.'</option>';
}
echo'
</select>
</p>
<p><label class="label">Tel/Cell:</label><input name="cellulare" type="text" class="input" '.$value_cellulare.'/></p>
<p>
<label class="label">Categoria:</label>
<select name="id_categoria" class="finestra">
<option value="" ';if($value_id_categoria == '' || $value_id_categoria == '0'){echo' selected="selected"';}else{echo'';} echo'>Seleziona Categoria:</option>';
$query_categoria = mysql_query("SELECT * FROM ".$prefix."_newsletter_categoria ORDER BY categoria ASC");
while ( $row_query_categoria = @mysql_fetch_array($query_categoria) ) {
$id_categoria = $row_query_categoria['id_categoria'];
$categoria = stripslashes($row_query_categoria['categoria']);
echo '<option value="'.$id_categoria.'" ';if($value_id_categoria == $id_categoria){echo' selected="selected"';}else{echo'';} echo' >'.$categoria.'</option>';
}
echo'
</select>
</p>
<p><label class="label">Email:</label><input name="email" type="text" class="input" '.$value_email.'/></p>
<p> '.$tag_hidden_id.'<input name="act" type="hidden" value="'.$act.'" /></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_newsletter.php?action=utente" class="back_button">Torna Indietro</a></p>
';
}
///////////////////////////////////////////////////////////////////////////////////////////
/// SELECT INVIO 1 ////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function select_invio(){
$prefix = PREFIX;
$server = SERVER;
$tipo = $_REQUEST['tipo'];
$id_newsletter = isset($_GET['id_newsletter']) ? (int)$_GET['id_newsletter'] : 0;
echo'
<h1>GESTIONE NEWSLETTER > <b> PREPARAZIONE ALL\'INVIO </b></h1>
<ul class="select_invio">
<li><a href="gestione_newsletter.php?action=select&tipo='.$tipo.'&id_newsletter='.$id_newsletter.'&select=cat">INVIA A TUTTA LA CATEGORIA</a></li>
<li><a href="gestione_newsletter.php?action=select&tipo='.$tipo.'&id_newsletter='.$id_newsletter.'&select=utenti&categoria=null">SELEZIONA UTENTI</a></li>
</ul>
';
}
///////////////////////////////////////////////////////////////////////////////////////////
/// SELECT INVIO 2 ////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function select(){
$prefix = PREFIX;
$server = SERVER;
$tipo = $_REQUEST['tipo'];
$select = $_REQUEST['select'];
$id_newsletter = isset($_GET['id_newsletter']) ? (int)$_GET['id_newsletter'] : 0;
echo'
<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>
<h1>GESTIONE NEWSLETTER > <b> PREPARAZIONE ALL\'INVIO </b></h1>
';
$tag_form_apertura = '<form action="gestione_newsletter_azione.php?action=invio" method="post" enctype="multipart/form-data" name="modulo" id="modulo">';
$tag_form_chiusura = '
<input name="id_newsletter" type="hidden" value="'.$id_newsletter.'" />
<input name="tipo" type="hidden" value="'.$tipo.'" />
<input name="select" type="hidden" value="'.$select.'" />
<p><input type="submit" name="submit" id="submit" value="INVIA NEWSLETTER" /></p>
</form>
';
if( $select == "cat" ){
echo'
'.$tag_form_apertura.'
<p>
<label class="label">Categoria:</label>
<select name="id_categoria" class="finestra">
<option value="0" ';if($value_id_categoria == '' || $value_id_categoria == '0'){echo' selected="selected"';}else{echo'';} echo'>---TUTTI---</option>';
$query_categoria = mysql_query("SELECT * FROM ".$prefix."_newsletter_categoria ORDER BY categoria ASC");
while ( $row_query_categoria = @mysql_fetch_array($query_categoria) ) {
$id_categoria = $row_query_categoria['id_categoria'];
$categoria = stripslashes($row_query_categoria['categoria']);
echo '<option value="'.$id_categoria.'" ';if($value_id_categoria == $id_categoria){echo' selected="selected"';}else{echo'';} echo' >'.$categoria.'</option>';
}
echo'
</select>
</p>
'.$tag_form_chiusura.'
';
}elseif( $select == "utenti" ){
$value_categoria = $_REQUEST['categoria'];
echo'
<div id="submenu">
<ul id="navsub">
<li>
<form name="form" id="form" method="get">
<label class="label">Visualizza utenti per categoria: </label>
<select name="jumpMenu" id="jumpMenu" onchange="MM_jumpMenu(\'parent\',this,0)">
<option value="gestione_newsletter.php?action=select&tipo='.$tipo.'&id_newsletter='.$id_newsletter.'&select=utenti&categoria=null" ';if($value_categoria == "null"){echo' selected="selected"';}else{echo'';} echo' >---TUTTI---</option>
';
$query_categoria = mysql_query("SELECT * FROM ".$prefix."_newsletter_categoria ORDER BY categoria ASC");
while ( $row_query_categoria = @mysql_fetch_array($query_categoria) ) {
$id_categoria = $row_query_categoria['id_categoria'];
$categoria = stripslashes($row_query_categoria['categoria']);
echo '<option value="gestione_newsletter.php?action=select&tipo='.$tipo.'&id_newsletter='.$id_newsletter.'&select=utenti&categoria='.$id_categoria.'" ';if($value_categoria == $id_categoria){echo' selected="selected"';}else{echo'';} echo' >'.$categoria.'</option>';
}
echo'
</select>
<input name="tipo" type="hidden" value="'.$tipo.'" />
<input name="select" type="hidden" value="'.$select.'" />
<input name="id_newsletter" type="hidden" value="'.$id_newsletter.'" />
</form>
</li>
</ul>
</div>
'.$tag_form_apertura.'
<table id="tablesorter-demo" class="tablesorter" border="0" cellpadding="0" cellspacing="1">
<thead>
<tr>
<th width="30" align="center" style="background-image: none; padding: 0px;"><input type="checkbox" onclick="checkUncheck(this)" /></td>
<th align="left" axis="number"><b>Cognome</b></td>
<th align="left" axis="string"><b>Nome</b></td>
<th align="left" ><b>Email</b></td>
<th align="left" ><b>Categoria</b></td>
</tr>
</thead>
<tbody>
';
if( $value_categoria == "null" ){ $tag_where = ""; }else{ $tag_where = " WHERE id_categoria = '$value_categoria' "; }
$carica = mysql_query( "SELECT * FROM ".$prefix."_newsletter_utenti $tag_where ORDER BY cognome ASC, nome ASC ");
while( $row_carica = mysql_fetch_assoc($carica)) {
$id_utente = $row_carica['id_utente'];
$cognome = stripslashes($row_carica['cognome']);
$nome = stripslashes($row_carica['nome']);
$email = stripslashes($row_carica['email']);
$id_categoria = stripslashes($row_carica['id_categoria']);
$carica_categoria = mysql_fetch_assoc(mysql_query("SELECT * FROM ".$prefix."_newsletter_categoria WHERE id_categoria = '$id_categoria'"));
echo'
<tr id="'.$id_utente.'" >
<td align="center"><input type="checkbox" name="check[]" value="'.$id_utente.'"/></td>
<td>'.$cognome.'</td>
<td>'.$nome.'</td>
<td>'.$email.'</td>
<td>'.stripslashes($carica_categoria['categoria']).'</td>
</tr>
';
}
echo'
</tbody>
<tfoot>
<tr>
<th align="center"><input type="checkbox" onclick="checkUncheck(this)" /></td>
<th align="left"><b>Cognome</b></td>
<th align="left"><b>Nome</b></td>
<th align="left"><b>Email</b></td>
<th align="left"><b>Categoria</b></td>
</tr>
</tfoot>
</table>
'.$tag_form_chiusura.'
';
}
}
///////////////////////////////////////////////////////////////////////////////////////////
/// RESULT INVIO //////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function result_invio(){
$prefix = PREFIX;
$server = SERVER;
$tipo = $_REQUEST['tipo'];
$status = $_REQUEST['status'];
$id_newsletter = isset($_GET['id_newsletter']) ? (int)$_GET['id_newsletter'] : 0;
if( $status == "error" ){
echo'
<div id="status">
<p align="center"><b>ATTENZIONE!</b> SI È VERIFICATO UN ERRORE.</p>
<p align="center"><img src="images/non_found.png" alt="" /></p>
<p align="center">ATTENDERE REINDIRIZZAMENTO</p>
</div>
';
header("Refresh: 1; URL=gestione_newsletter.php?action=select_invio&tipo=$tipo&id_newsletter=$id_newsletter");
ob_end_flush();
}elseif( $status == "success" ){
$data = date('Y-m-d G:i:s');
mysql_query("UPDATE ".$prefix."_newsletter SET data = '$data', stato = '1' WHERE id_newsletter = '$id_newsletter'");
echo'
<div id="status">
<p align="center"><b>NEWSLETTER INVIATO CON SUCCESSO!</b></p>
<p align="center"><img src="images/login_send.png" alt="" /></p>
<p align="center">ATTENDERE REINDIRIZZAMENTO</p>
</div>
';
header("Refresh: 1; URL=gestione_newsletter.php?action=newsletter&tipo=$tipo");
ob_end_flush();
}
}
?>
</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>