| 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'] = "prodotti";
?>
<!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" />
<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 src="js/tabs/jquery-1.4.4.min.js" type="text/javascript"></script>
<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() {
$(document).ready(function() { $("table").tablesorter({ widgets: ['zebra'], headers: { 0: { sorter: false }, 1: { sorter: false }, 4: { sorter: false }, 5: { sorter: false } } }); });
});
</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>
<link href="js/tabs/tab.css" rel="stylesheet" type="text/css" />
<script src="js/tabs/jquery.hashchange.min.js" type="text/javascript"></script>
<script src="js/tabs/jquery.easytabs.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#tab-container-3').easytabs({
animate: false,
tabActiveClass: "selected-tab",
panelActiveClass: "displayed"
});
});
</script>
<!--<script type="text/javascript" src="js/catselect/jquery-1.3.2.js"></script>-->
<script type="text/javascript" src="js/catselect/select.js"></script>
<script src="js/jquery.jeditable.js" type="text/javascript"></script>
<script language="javascript">
$(function() {
$(".text_edit_it").editable("gestione_prodotti_azione.php?action=prodotti_edit_articoli&cmd=it", { indicator : "<img src='images/loading_edit.gif'>", submitdata: { _method: "put" }, select : true, submit : 'SALVA', cssclass : "editable", width : "270px", loadtext : 'Updating…' });
$(".text_edit_en").editable("gestione_prodotti_azione.php?action=prodotti_edit_articoli&cmd=en", { indicator : "<img src='images/loading_edit.gif'>", submitdata: { _method: "put" }, select : true, submit : 'SALVA', cssclass : "editable", width : "270px", loadtext : 'Updating…' });
$(".text_edit_fr").editable("gestione_prodotti_azione.php?action=prodotti_edit_articoli&cmd=fr", { indicator : "<img src='images/loading_edit.gif'>", submitdata: { _method: "put" }, select : true, submit : 'SALVA', cssclass : "editable", width : "270px", loadtext : 'Updating…' });
$(".text_edit_de").editable("gestione_prodotti_azione.php?action=prodotti_edit_articoli&cmd=de", { indicator : "<img src='images/loading_edit.gif'>", submitdata: { _method: "put" }, select : true, submit : 'SALVA', cssclass : "editable", width : "270px", loadtext : 'Updating…' });
$(".text_edit_sp").editable("gestione_prodotti_azione.php?action=prodotti_edit_articoli&cmd=sp", { indicator : "<img src='images/loading_edit.gif'>", submitdata: { _method: "put" }, select : true, submit : 'SALVA', cssclass : "editable", width : "270px", loadtext : 'Updating…' });
$(".text_edit_p1").editable("gestione_prodotti_azione.php?action=prodotti_edit_articoli&cmd=p1", { indicator : "<img src='images/loading_edit.gif'>", submitdata: { _method: "put" }, select : true, submit : 'SALVA', cssclass : "editable", width : "168px", loadtext : 'Updating…' });
$(".text_edit_p2").editable("gestione_prodotti_azione.php?action=prodotti_edit_articoli&cmd=p2", { indicator : "<img src='images/loading_edit.gif'>", submitdata: { _method: "put" }, select : true, submit : 'SALVA', cssclass : "editable", width : "168px", loadtext : 'Updating…' });
$(".text_edit_p3").editable("gestione_prodotti_azione.php?action=prodotti_edit_articoli&cmd=p3", { indicator : "<img src='images/loading_edit.gif'>", submitdata: { _method: "put" }, select : true, submit : 'SALVA', cssclass : "editable", width : "168px", loadtext : 'Updating…' });
});
</script>
<script type="text/javascript" src="js/form_controllo.js"></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 = "prodotti"; }
switch ($action) {
case 'prodotti': prodotti(); break;
case 'prodotti_modulo_step1': prodotti_modulo_step1(); break;
case 'prodotti_modulo_step2': prodotti_modulo_step2(); break;
case 'prodotti_edit': prodotti_edit(); break;
case 'cerca': cerca(); break;
default: prodotti(); break;
}
///////////////////////////////////////////////////////////////////////////////////////////
/// PRODOTTI //////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function prodotti(){
$prefix = PREFIX;
$server = SERVER;
$directory = PRODOTTIDIRECTORY;
$tipo = $_REQUEST['tipo'];
$pages = $_REQUEST['pages'];
$cat1 = $_REQUEST['cat1'];
if( empty($_REQUEST['cat2']) ){ $cat2 = '0'; }else{ $cat2 = $_REQUEST['cat2']; }
if( empty($_REQUEST['cat3']) ){ $cat3 = '0'; }else{ $cat3 = $_REQUEST['cat3']; }
$m = $_REQUEST['m'];
$o = $_REQUEST['o'];
include_once 'js/catselect/select.class.php';
$opt = new SelectList();
$h1_categoria1 = mysql_fetch_assoc(mysql_query("SELECT * FROM ".$prefix."_prodotti_categoria1 WHERE id_categoria1 = '$cat1'"));
$h1_categoria2 = mysql_fetch_assoc(mysql_query("SELECT * FROM ".$prefix."_prodotti_categoria2 WHERE id_categoria2 = '$cat2'"));
$h1_categoria3 = mysql_fetch_assoc(mysql_query("SELECT * FROM ".$prefix."_prodotti_categoria3 WHERE id_categoria3 = '$cat3'"));
$controllolo = mysql_query( "SELECT * FROM ".$prefix."_prodotti WHERE data = '0000-00-00 00:00:00'");
while( $row_controllolo = mysql_fetch_assoc($controllolo)) {
$c_id_prodotto = $row_controllolo['id_prodotto'];
$carica_img = mysql_query("SELECT * FROM ".$prefix."_prodotti_img WHERE id_prodotto = '$c_id_prodotto'");
while ( $row_carica_img = @mysql_fetch_array($carica_img) ) {
$immagine = $row_carica_img['immagine']; if ( $immagine != "" ) { unlink('../'.$directory.'/'.$immagine.''); }
}
$carica_all = mysql_query("SELECT * FROM ".$prefix."_prodotti WHERE id_prodotto = '$c_id_prodotto'");
while ( $row_carica_all = @mysql_fetch_array($carica_all) ) {
$allegato1 = $row_carica_all['allegato1']; if ( $allegato1 != "" ) { unlink('../'.$directory.'/'.$allegato1.''); }
$allegato2 = $row_carica_all['allegato2']; if ( $allegato2 != "" ) { unlink('../'.$directory.'/'.$allegato2.''); }
$allegato3 = $row_carica_all['allegato3']; if ( $allegato3 != "" ) { unlink('../'.$directory.'/'.$allegato3.''); }
}
$delete_img = "DELETE FROM ".$prefix."_prodotti_img WHERE id_prodotto = '$c_id_prodotto'" ;
if(mysql_query($delete_img)){ }else{ echo status_errore(); }
$delete_scheda = "DELETE FROM ".$prefix."_prodotti_scheda WHERE id_prodotto = '$c_id_prodotto'" ;
if(mysql_query($delete_scheda)){ }else{ echo status_errore(); }
$delete_prodotto = "DELETE FROM ".$prefix."_prodotti WHERE id_prodotto = '$c_id_prodotto'" ;
if(mysql_query($delete_prodotto)){ }else{ echo status_errore(); }
}
// MARCA
if( $m == "0" ){ $where_m = " "; }else{ $where_m = " && id_autore = '$m' "; }
// OFFERTE
if( $o == "0" ){
$active_o = ''; $where_o = " ";
$menu_o = '<li><a href="gestione_prodotti.php?action=prodotti&tipo='.$tipo.'&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o=1" class="offerta">IN OFFERTA</a></li>';
}elseif( $o == "1" ){
$active_o = ' active'; $where_o = " && offerta = '1' ";
$menu_o = '<li><a href="gestione_prodotti.php?action=prodotti&tipo='.$tipo.'&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o=0" class="offerta active">IN OFFERTA</a></li>';
}
// CATEGORIA
if( $cat1 == "0" && $cat2 == "0" && $cat3 == "0" ){
$where_cat = "";
$tag_h1 = '<b>ARCHIVIO GENERALE</b>';
}elseif( $cat1 != "0" && $cat2 == "0" && $cat3 == "0"){
$where_cat = " && id_categoria1 = '$cat1' ";
$tag_h1 = 'ARCHIVIO > <b>'.stripslashes($h1_categoria1['categoria1_it']).'</b>';
}elseif( $cat1 != "0" && $cat2 != "0" && $cat3 == "0"){
$where_cat = " && id_categoria1 = '$cat1' && id_categoria2 = '$cat2'";
$tag_h1 = 'ARCHIVIO > '.stripslashes($h1_categoria1['categoria1_it']).' > <b>'.stripslashes($h1_categoria2['categoria2_it']).'</b>';
}elseif( $cat1 != "0" && $cat2 != "0" && $cat3 != "0"){
$where_cat = " && id_categoria1 = '$cat1' && id_categoria2 = '$cat2' && id_categoria3 = '$cat3'";
$tag_h1 = 'ARCHIVIO > '.stripslashes($h1_categoria1['categoria1_it']).' > '.stripslashes($h1_categoria2['categoria2_it']).' > <b>'.stripslashes($h1_categoria3['categoria3_it']).'</b>';
}
// TIPO
if( $tipo == 'tutte' ){
$active_tutte = ' active'; $active_attive = ''; $active_nascoste = ''; $where_tipo = '';
}elseif( $tipo == 'attive' ){
$active_tutte = ''; $active_attive = ' active'; $active_nascoste = ''; $where_tipo = " && stato = '1'";
}elseif( $tipo == 'nascoste' ) {
$active_tutte = ''; $active_attive = ''; $active_nascoste = ' active'; $where_tipo = " && stato = '0'";
}
// CHECK WHERE
$tag_where = "WHERE controllo = '1' $where_tipo $where_cat $where_o $where_m ";
$total = mysql_query( "SELECT id_prodotto FROM ".$prefix."_prodotti $tag_where ");
$numero_notizie = mysql_num_rows( $total );
echo'
<h1>GESTIONE LIBRI > '.$tag_h1.'</h1>
<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_prodotti.php?action=prodotti&tipo='.$tipo.'&pages=15&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'" ';if($pages=='15'){echo' selected="selected"';}else{echo'';} echo' >15</option>
<option value="gestione_prodotti.php?action=prodotti&tipo='.$tipo.'&pages=30&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'" ';if($pages=='30'){echo' selected="selected"';}else{echo'';} echo' >30</option>
<option value="gestione_prodotti.php?action=prodotti&tipo='.$tipo.'&pages=50&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'" ';if($pages=='50'){echo' selected="selected"';}else{echo'';} echo' >50</option>
<option value="gestione_prodotti.php?action=prodotti&tipo='.$tipo.'&pages=100&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'" ';if($pages=='100'){echo' selected="selected"';}else{echo'';} echo' >100</option>
<option value="gestione_prodotti.php?action=prodotti&tipo='.$tipo.'&pages=150&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'" ';if($pages=='150'){echo' selected="selected"';}else{echo'';} echo' >150</option>
</select>
</form>
</li>
<li><a href="gestione_prodotti.php?action=prodotti&tipo=tutte&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'" class="tutte'.$active_tutte.'">TUTTE</a></li>
<li><a href="gestione_prodotti.php?action=prodotti&tipo=attive&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'" class="attive'.$active_attive.'">ATTIVE</a></li>
<li><a href="gestione_prodotti.php?action=prodotti&tipo=nascoste&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'" class="nascoste'.$active_nascoste.'">NASCOSTE</a></li>
'.$menu_o.'
<li class="num">Totale: <b>'.$numero_notizie.'</b></li>
</ul>
</div>
<div id="submenu">
<ul id="navsub">
<li><a href="gestione_prodotti.php?action=prodotti&tipo=tutte&pages=12&cat1=0&cat2=0&cat3=0&m=0&o=0" title="RESET ARCHIVIO"><img src="images/btn_reset.png" alt="RESET ARCHIVIO" class="btn_reset"/></a></li>
<li>
<form name="form" id="form" method="get">
<input name="tipo" type="hidden" value="'.$tipo.'" /><input name="pages" type="hidden" value="'.$pages.'" />
<input name="cat2" type="hidden" value="'.$cat2.'" />
<input name="cat3" type="hidden" value="'.$cat3.'" />
<label class="label">Categoria: </label>
<select name="cat1" id="categoria1" class="finestra" style="width:85px;">'; echo $opt->ShowCategoria1(); echo'</select>
<label class="label" class="finestra">Autore: </label>
<select name="m" class="finestra" style="width:85px;">
<option value="0" ';if($m == "0"){echo' selected="selected"';}else{echo'';} echo' >scegli...</option>';
$select_autore = mysql_query("SELECT * FROM ".$prefix."_prodotti_autori ORDER BY autore ASC");
while ( $row_select_autore = @mysql_fetch_array($select_autore) ) {
$id_autore = $row_select_autore['id_autore'];
$autore = stripslashes($row_select_autore['autore']);
echo '<option value="'.$id_autore.'" ';if($m == $id_autore){echo' selected="selected"';}else{echo'';} echo'>'.$autore.'</option>';
}
echo'
</select>
<input name="o" type="hidden" value="'.$o.'" />
<input type="submit" name="submit" id="submit" value="CARICA" />
</form>
</li>
<li>
<form action="gestione_prodotti.php?action=cerca" enctype="multipart/form-data" name="form" id="form" method="post" >
<input name="tipo" type="hidden" value="tutte" /><input name="pages" type="hidden" value="'.$pages.'" />
<input name="m" type="hidden" value="0" /><input name="o" type="hidden" value="0" />
<input name="cat1" type="hidden" value="0" /><input name="cat2" type="hidden" value="0" />
<input name="cat3" type="hidden" value="0" />
<label class="label">Cerca: </label><input name="search" type="text" class="input" />
<input type="submit" name="submit" id="submit" value="RICERCA LIBERA" />
</form>
</li>
</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_prodotti.php?action=prodotti&tipo='.$tipo.'&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'&'; // NOME PAGINA
$pager = new YCPager( $p, $numero_notizie, $limite, $redirect_to );
$offset = $pager->getQueryOffset();
echo'
<form action="gestione_prodotti_azione.php?action=prodotti_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.'" />
<input name="m" type="hidden" value="'.$m.'" /><input name="o" type="hidden" value="'.$o.'" />
<input name="cat1" type="hidden" value="'.$cat1.'" /><input name="cat2" type="hidden" value="'.$cat2.'" />
<input name="cat3" type="hidden" value="'.$cat3.'" />
<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" style="background-image:none;"><b>Azione</b></td>
<th width="70" align="center" axis="number"><b>Data</b></td>
<th align="left" axis="string"><b>Libro</b></td>
<th width="60" align="center" style="background-image:none;"><b>Recensioni</b></td>
<th width="60" align="center" style="background-image:none;"><b>Offerta</b></td>
<th width="50" align="center" style="background-image:none;"><b>Stato</b></td>
</tr>
</thead>
<tbody>
';
$carica = mysql_query( "SELECT * FROM ".$prefix."_prodotti $tag_where ORDER BY id_prodotto DESC LIMIT $limite OFFSET $offset ");
while( $row_carica = mysql_fetch_assoc($carica)) {
$id_prodotto = $row_carica['id_prodotto'];
$articolo_it = stripslashes($row_carica['articolo_it']);
$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']);
$offerta = stripslashes($row_carica['offerta']);
if( $stato == '1' ){
$tag_stato = '<a href="gestione_prodotti_azione.php?action=prodotti_stato&tipo='.$tipo.'&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'&act=s&stato=0&id_prodotto='.$id_prodotto.'" title="NASCONDERE QUESTO LIBRO" onclick="return confirm(\'ATTENZIONE. NASCONDERE QUESTO LIBRO?\')"><img src="images/btn_stato_vedi.png" alt="NASCONDERE LIBRO" border="0"/></a>';
}elseif( $stato == '0' ){
$tag_stato = '<a href="gestione_prodotti_azione.php?action=prodotti_stato&tipo='.$tipo.'&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'&m=0&o=0&act=s&stato=1&id_prodotto='.$id_prodotto.'" title="ATTIVARE QUESTO LIBRO" onclick="return confirm(\'ATTENZIONE. ATTIVARE QUESTO LIBRO?\')"><img src="images/btn_stato_nascondi.png" alt="ATTIVARE LIBRO" border="0"/></a>';
}
if( $offerta == '1' ){
$tag_offerta = '<a href="gestione_prodotti_azione.php?action=prodotti_stato&tipo='.$tipo.'&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'&act=o&offerta=0&id_prodotto='.$id_prodotto.'" title="TOGLIERE DALLE OFFERTE QUESTO LIBRO" onclick="return confirm(\'ATTENZIONE. TOGLIERE DALLE OFFERTE QUESTO LIBRO?\')"><img src="images/stato_offerta_1.png" alt="TOGLIERE DALLE OFFERTE QUESTO LIBRO" border="0"/></a>';
}elseif( $offerta == '0' ){
$tag_offerta = '<a href="gestione_prodotti_azione.php?action=prodotti_stato&tipo='.$tipo.'&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'&act=o&offerta=1&id_prodotto='.$id_prodotto.'" title="METTI TRA LE OFFERTE QUESTO LIBRO" onclick="return confirm(\'ATTENZIONE. METTI TRA LE OFFERTE QUESTO LIBRO?\')"><img src="images/stato_offerta_0.png" alt="METTI TRA LE OFFERTE QUESTO LIBRO" border="0"/></a>';
}
$count_recensione = mysql_query( "SELECT id_prodotto FROM ".$prefix."_prodotti_recensioni WHERE id_prodotto = '$id_prodotto' ");
$numero_recensione = mysql_num_rows( $count_recensione );
echo'
<tr id="'.$id_prodotto.'" >
<td><input type="checkbox" name="check[]" value="'.$id_prodotto.'" style="margin:3px 0px 0px 3px;"/></td>
<td align="center">
<a href="gestione_prodotti.php?action=prodotti_edit&tipo='.$tipo.'&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'&id_prodotto='.$id_prodotto.'" title="MODIFICA LIBRO"><img src="images/btn_edit.png" alt="MODIFICA LIBRO" border="0"/></a>
<a href="gestione_prodotti_azione.php?action=prodotti_readd&tipo='.$tipo.'&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'&id_prodotto='.$id_prodotto.'" title="RIPUBBLICARE LIBRO" onclick="return confirm(\'ATTENZIONE. RIPUBBLICARE QUESTO LIBRO?\')"><img src="images/btn_readd.png" alt="RIPUBBLICARE LIBRO" border="0"/></a>
<a href="gestione_prodotti_azione.php?action=prodotti_duply&tipo='.$tipo.'&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'&id_prodotto='.$id_prodotto.'" title="DUPLICARE LIBRO" onclick="return confirm(\'ATTENZIONE. DUPLICARE QUESTO PRODOTTO?\')"><img src="images/btn_copy.png" alt="DUPLICARE LIBRO" border="0"/></a>
<a href="gestione_prodotti_azione.php?action=prodotti_delete&tipo='.$tipo.'&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'&id_prodotto='.$id_prodotto.'" title="ELIMINA LIBRO" onclick="return confirm(\'ATTENZIONE. ELIMINARE QUESTO LIBRO?\')"><img src="images/btn_delete.png" alt="ELIMINA LIBRO" border="0"/></a>
</td>
<td>'.$data_corretta.'</td>
<td><a href="'.$server.'/prodotti_scheda.php?id_prodotto='.$id_prodotto.'" target="_blank">'.$articolo_it.'</a></td>
<td align="center"><a href="gestione_recensioni.php?tipo=tutte&pages=12&id_prodotto='.$id_prodotto.'" title="Recensioni libro" >'.$numero_recensione.'</a></td>
<td align="center">'.$tag_offerta.'</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>Libro</b></td>
<th align="center"><b>Offerta</b></td>
<th align="center"><b>Stato</b></td>
</tr>
</tfoot>
</table>
</form>
';
if ( $numero_notizie > $limite ) { $pager->getPager(); }else{ echo''; }
}else{ echo'<p>Non esiste nessuno prodotto nell\'archivio!</p>'; }
echo'<p class="add_style"><a href="gestione_prodotti.php?action=prodotti_modulo_step1&act=step1&tipo='.$tipo.'&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'" class="add_button">Aggiungi Libro</a></p>';
}
///////////////////////////////////////////////////////////////////////////////////////////
/// PRODOTTI MODULO STEP1 /////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function prodotti_modulo_step1(){
$prefix = PREFIX;
$act = $_REQUEST['act'];
$tipo = $_REQUEST['tipo'];
$pages = $_REQUEST['pages'];
$cat1 = $_REQUEST['cat1'];
$cat2 = $_REQUEST['cat2'];
$cat3 = $_REQUEST['cat3'];
$m = $_REQUEST['m'];
$o = $_REQUEST['o'];
$carica_lingua = mysql_fetch_assoc(mysql_query("SELECT * FROM ".$prefix."_prodotti_lingua WHERE id_lang = '1'"));
if( $carica_lingua['lang_it'] == "1" ){
$lang_it = '<img src="images/flag/lang_it.png" alt="" class="flag" /><input name="lang_it" type="checkbox" class="checkbox" value="1" checked="checked" />';
}elseif( $carica_lingua['lang_it'] == "0" ){ $lang_it = ''; }
if( $carica_lingua['lang_en'] == "1" ){
$lang_en = '<img src="images/flag/lang_en.png" alt="" class="flag" /><input name="lang_en" type="checkbox" class="checkbox" value="1" checked="checked" />';
}elseif( $carica_lingua['lang_en'] == "0" ){ $lang_en = ''; }
if( $carica_lingua['lang_fr'] == "1" ){
$lang_fr = '<img src="images/flag/lang_fr.png" alt="" class="flag" /><input name="lang_fr" type="checkbox" class="checkbox" value="1" checked="checked" />';
}elseif( $carica_lingua['lang_fr'] == "0" ){ $lang_fr = ''; }
if( $carica_lingua['lang_de'] == "1" ){
$lang_de = '<img src="images/flag/lang_de.png" alt="" class="flag" /><input name="lang_de" type="checkbox" class="checkbox" value="1" checked="checked" />';
}elseif( $carica_lingua['lang_de'] == "0" ){ $lang_de = ''; }
if( $carica_lingua['lang_sp'] == "1" ){
$lang_sp = '<img src="images/flag/lang_sp.png" alt="" class="flag" /><input name="lang_sp" type="checkbox" class="checkbox" value="1" checked="checked" />';
}elseif( $carica_lingua['lang_sp'] == "0" ){ $lang_sp = ''; }
echo'
<h1>GESTIONE LIBRI > <b>NUOVO PRODOTTO</b></h1>
<form action="gestione_prodotti_azione.php?action=prodotti_save" method="post" enctype="multipart/form-data" name="modulo" id="modulo">
<div class="bloccco">
<p><label class="label_title">SELEZIONA LINGUA DEL CARRELLO:</label></p>
<p>'.$lang_it.''.$lang_en.''.$lang_fr.''.$lang_de.''.$lang_sp.'</p>
</div>
<input name="tipo" type="hidden" value="'.$tipo.'" />
<input name="act" type="hidden" value="'.$act.'" />
<input name="pages" type="hidden" value="'.$pages.'" />
<input name="cat1" type="hidden" value="'.$cat1.'" />
<input name="cat2" type="hidden" value="'.$cat2.'" />
<input name="cat3" type="hidden" value="'.$cat3.'" />
<input name="m" type="hidden" value="'.$m.'" />
<input name="o" type="hidden" value="'.$o.'" />
<p><label class="label"></label><input type="submit" name="submit" id="submit" value="CONTINUA" /></p>
</form>
<p> </p>
<p class="back_style"><a href="gestione_prodotti.php?action=prodotti&tipo='.$tipo.'&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'" class="back_button">Torna Indietro</a></p>
';
}
///////////////////////////////////////////////////////////////////////////////////////////
/// PRODOTTI MODULO STEP2 /////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function prodotti_modulo_step2(){
$prefix = PREFIX;
$dim = PRODOTTIDIMENSIONI;
$act = $_REQUEST['act'];
$tipo = $_REQUEST['tipo'];
$pages = $_REQUEST['pages'];
$cat1 = $_REQUEST['cat1'];
$cat2 = $_REQUEST['cat2'];
$cat3 = $_REQUEST['cat3'];
$m = $_REQUEST['m'];
$o = $_REQUEST['o'];
$carica_lingua = mysql_fetch_assoc(mysql_query("SELECT * FROM ".$prefix."_prodotti_lingua WHERE id_lang = '1'"));
$id_prodotto = isset($_GET['id_prodotto']) ? (int)$_GET['id_prodotto'] : 0;
$carica_prodotto = mysql_fetch_assoc(mysql_query("SELECT * FROM ".$prefix."_prodotti WHERE id_prodotto = '$id_prodotto'"));
include_once 'js/catselect/select.class.php';
$opt = new SelectList();
if( $carica_lingua['lang_it'] == "1" ){ $prod_lang_it = '<p style=\"margin-bottom:2px;\"><img src=\"images/flag/lang_it.png\" alt=\"\" class=\"flag_prod\" /><input name=\"prodotto["+num+"][titolo_it]\" type=\"text\" class=\"input_prod\" maxlength=\"255\"/></p>'; }elseif( $carica_lingua['lang_it'] == "0" ){ $prod_lang_it = ''; }
if( $carica_lingua['lang_en'] == "1" ){ $prod_lang_en = '<p style=\"margin-bottom:2px;\"><img src=\"images/flag/lang_en.png\" alt=\"\" class=\"flag_prod\" /><input name=\"prodotto["+num+"][titolo_en]\" type=\"text\" class=\"input_prod\" maxlength=\"255\"/></p>'; }elseif( $carica_lingua['lang_en'] == "0" ){ $prod_lang_en = ''; }
if( $carica_lingua['lang_fr'] == "1" ){ $prod_lang_fr = '<p style=\"margin-bottom:2px;\"><img src=\"images/flag/lang_fr.png\" alt=\"\" class=\"flag_prod\" /><input name=\"prodotto["+num+"][titolo_fr]\" type=\"text\" class=\"input_prod\" maxlength=\"255\"/></p>'; }elseif( $carica_lingua['lang_fr'] == "0" ){ $prod_lang_fr = ''; }
if( $carica_lingua['lang_de'] == "1" ){ $prod_lang_de = '<p style=\"margin-bottom:2px;\"><img src=\"images/flag/lang_de.png\" alt=\"\" class=\"flag_prod\" /><input name=\"prodotto["+num+"][titolo_de]\" type=\"text\" class=\"input_prod\" maxlength=\"255\"/></p>'; }elseif( $carica_lingua['lang_de'] == "0" ){ $prod_lang_de = ''; }
if( $carica_lingua['lang_sp'] == "1" ){ $prod_lang_sp = '<p style=\"margin-bottom:2px;\"><img src=\"images/flag/lang_sp.png\" alt=\"\" class=\"flag_prod\" /><input name=\"prodotto["+num+"][titolo_sp]\" type=\"text\" class=\"input_prod\" maxlength=\"255\"/></p>'; }elseif( $carica_lingua['lang_sp'] == "0" ){ $prod_lang_sp = ''; }
echo'
<script src="js/jquery.maskedinput-1.3.js" type="text/javascript"></script>
<script type="text/javascript">
function addList_addprodotto(){
var ni = document.getElementById(\'divList_addprodotto\');
var numi = document.getElementById(\'count_addprodotto\');
var num = (document.getElementById("count_addprodotto").value -1)+ 2;
numi.value = num;
var divIdName1 = "my1"+num+"Div";
var newdiv = document.createElement(\'div\');
newdiv.setAttribute("id",divIdName1);
newdiv.innerHTML = "<div class=\"prod\"><div class=\"art\"><p style=\"margin-bottom:2px;\"><label class=\"label_h1\">Formato del libro</label></p>'.$prod_lang_it.''.$prod_lang_en.''.$prod_lang_fr.''.$prod_lang_de.''.$prod_lang_sp.'</div><div class=\"prezzo\"><div class=\"bloc\"> <p style=\"margin-bottom:4px;\"><label class=\"label_prezzo\">Prezzo:</label></p><p style=\"margin-bottom:4px;\"><input name=\"prodotto["+num+"][prezzo]\" type=\"text\" class=\"input_prezzo\"/><span class=\"text\"><b> €</b> <i>(Es. scrivere: <b>15.50</b>)</i></span></p></div><div class=\"bloc\"><p style=\"margin-bottom:4px;\"><label class=\"label_prezzo\">Prezzo per confronto:</label></p><p style=\"margin-bottom:4px;\"><input name=\"prodotto["+num+"][prezzo_confronto]\" type=\"text\" class=\"input_prezzo\"/><span class=\"text\"><b> €</b> <i>(Es. scrivere: <b>18.50</b>)</i></span></p></div><div class=\"bloc\"><p style=\"margin-bottom:4px;\"><label class=\"label_prezzo\">Peso: <i>(Il peso viene tarato in kg)</i></label></p><p style=\"margin-bottom:4px;\"><input name=\"prodotto["+num+"][peso]\" type=\"text\" class=\"input_prezzo\"/><span class=\"text\"><b> Kg</b> <i>(Es. scrivere: <b>4.80</b>)</i></span></p></div></div><div class=\"delete\"><a href=\"javascript:;\" onclick=\"removeEvent_addprodotto(\'"+divIdName1+"\')\"><img src=\"images/btn_delete.png\" alt=\"\" class=\"ic_del\" /></a></div></div>";
ni.appendChild(newdiv);
}
function removeEvent_addprodotto(divNum1){
var d1 = document.getElementById(\'divList_addprodotto\');
var olddiv = document.getElementById(divNum1);
d1.removeChild(olddiv);
}
</script>
<script type="text/javascript" src="js/swfupload/swfupload.js"></script>
<script type="text/javascript" src="js/swfupload/jquery.swfupload.js"></script>
<script type="text/javascript">
$(function(){
$(\'#swfupload-controllo\').swfupload({
upload_url: "gestione_prodotti_upload.php?id_prodotto='.$id_prodotto.'&id_categoria1=0&id_categoria2=0&id_categoria3=0&id_editore=0&id_autore=0",
file_post_name: \'uploadfile\',
file_size_limit : "1024",
file_types : "*.jpg;*.png;*.gif*.jpeg",
file_types_description : "Image files",
file_upload_limit : 0,
flash_url : "js/swfupload/swfupload.swf",
button_image_url : \'js/swfupload/XPButtonUploadText_61x22.png\',
button_width : 61,
button_height : 22,
button_placeholder : $(\'#button\')[0],
debug: false
})
.bind(\'fileQueued\', function(event, file){
var listitem=\'<li id="\'+file.id+\'" >\'+
\'File: <em>\'+file.name+\'</em> (\'+Math.round(file.size/1024)+\' KB) <span class="progressvalue" ></span>\'+
\'<div class="progressbar" ><div class="progress" ></div></div>\'+
\'<p class="status" >In attesa di</p>\'+
\'<span class="cancel" > </span>\'+
\'</li>\';
$(\'#log\').append(listitem);
$(\'li#\'+file.id+\' .cancel\').bind(\'click\', function(){
var swfu = $.swfupload.getInstance(\'#swfupload-controllo\');
swfu.cancelUpload(file.id);
$(\'li#\'+file.id).slideUp(\'fast\');
});
// start the upload since it\'s queued
$(this).swfupload(\'startUpload\');
})
.bind(\'fileQueueError\', function(event, file, errorCode, message){
alert(\'La dimensione del file \'+file.name+\' è superiore al limite\');
})
.bind(\'fileDialogComplete\', function(event, numFilesSelected, numFilesQueued){
$(\'#queuestatus\').text(\'File selezionati: \'+numFilesSelected+\' / File in coda: \'+numFilesQueued);
})
.bind(\'uploadStart\', function(event, file){
$(\'#log li#\'+file.id).find(\'p.status\').text(\'Caricamento...\');
$(\'#log li#\'+file.id).find(\'span.progressvalue\').text(\'0%\');
$(\'#log li#\'+file.id).find(\'span.cancel\').hide();
})
.bind(\'uploadProgress\', function(event, file, bytesLoaded){
//Show Progress
var percentage=Math.round((bytesLoaded/file.size)*100);
$(\'#log li#\'+file.id).find(\'div.progress\').css(\'width\', percentage+\'%\');
$(\'#log li#\'+file.id).find(\'span.progressvalue\').text(percentage+\'%\');
})
.bind(\'uploadSuccess\', function(event, file, serverData){
var item=$(\'#log li#\'+file.id);
item.find(\'div.progress\').css(\'width\', \'100%\');
item.find(\'span.progressvalue\').text(\'100%\');
var pathtofile=\'<a href="uploads/\'+file.name+\'" target="_blank" >view »</a>\';
item.addClass(\'success\').find(\'p.status\').html(\'Immagine caricata sul server!!!\');
})
.bind(\'uploadComplete\', function(event, file){
// upload has completed, try the next one in the queue
$(this).swfupload(\'startUpload\');
})
});
</script>
<h1>GESTIONE LIBRI > <b>NUOVO LIBRO</b></h1>
<form action="gestione_prodotti_azione.php?action=prodotti_save" method="post" enctype="multipart/form-data" name="modulo_prodotti" id="modulo_prodotti">
<input name="tipo" type="hidden" value="'.$tipo.'" />
<input name="act" type="hidden" value="step2" />
<input name="pages" type="hidden" value="'.$pages.'" />
<input name="cat1" type="hidden" value="'.$cat1.'" />
<input name="cat2" type="hidden" value="'.$cat2.'" />
<input name="cat3" type="hidden" value="'.$cat3.'" />
<input name="m" type="hidden" value="'.$m.'" />
<input name="o" type="hidden" value="'.$o.'" />
<input name="id_prodotto" type="hidden" value="'.$id_prodotto.'" />
<div id="tab-container-3">
<ul>
<li><a href="#config" class="config" tabindex="1" title="CONFIGURAZIONE GENERALE"> </a></li>';
if( $carica_lingua['lang_it'] == "1" ){ echo '<li><a href="#lang_it" class="lang_it" title="DESCRIZIONE IN LINGUA ITALIANA"> </a></li>'; }elseif( $carica_lingua['lang_it'] == "0" ){ echo ''; }
if( $carica_lingua['lang_en'] == "1" ){ echo '<li><a href="#lang_en" class="lang_en" title="DESCRIZIONE IN LINGUA INGLESE"> </a></li>'; }elseif( $carica_lingua['lang_en'] == "0" ){ echo ''; }
if( $carica_lingua['lang_fr'] == "1" ){ echo '<li><a href="#lang_fr" class="lang_fr" title="DESCRIZIONE IN LINGUA FRANCESE"> </a></li>'; }elseif( $carica_lingua['lang_fr'] == "0" ){ echo ''; }
if( $carica_lingua['lang_de'] == "1" ){ echo '<li><a href="#lang_de" class="lang_de" title="DESCRIZIONE IN LINGUA TEDESCA"> </a></li>'; }elseif( $carica_lingua['lang_de'] == "0" ){ echo ''; }
if( $carica_lingua['lang_sp'] == "1" ){ echo '<li><a href="#lang_sp" class="lang_sp" title="DESCRIZIONE IN LINGUA SPAGNOLA"> </a></li>'; }elseif( $carica_lingua['lang_sp'] == "0" ){ echo ''; }
echo'
<li><a href="#immagini" class="immagini" title="IMMAGINI"> </a></li>
<li><a href="#prodotti" class="prodotti" title="AGGIUNGI LIBRI"> </a></li>
<li><a href="#save" class="save" title="SALVA"> </a></li>
</ul>
<div class="panel-container">
<div id="config" class="tab-container-3">
<p style="margin-bottom:1px;"><label class="h1" style="width:699px;">CONFIGURAZIONE GENERALE</label></p>
<p style="margin-bottom:1px;">
<label class="label">Categoria:</label>
<select name="id_categoria1" id="categoria1" class="finestra">'; echo $opt->ShowCategoria1(); echo'</select>
</p>
<input name="id_categoria2" type="hidden" value="0" />
<input name="id_categoria3" type="hidden" value="0" />
<!--
<p style="margin-bottom:1px;">
<label class="label">Categoria:</label>
<select name="id_categoria2" id="categoria2" class="finestra"><option>Scegli...</option></select>
</p>
<p style="margin-bottom:1px;">
<label class="label">Sotto-Categoria:</label>
<select name="id_categoria3" id="categoria3" class="finestra"><option>Scegli...</option></select>
</p>
-->
<p style="margin-bottom:1px;">
<label class="label">Editore:</label>
<select name="id_editore" class="finestra">
<option value="" ';if($value_id_editore == ""){echo' selected="selected"';}else{echo'';} echo' ></option>';
$select_editore = mysql_query("SELECT * FROM ".$prefix."_prodotti_editore ORDER BY editore ASC");
while ( $row_select_editore = @mysql_fetch_array($select_editore) ) {
$id_editore = $row_select_editore['id_editore'];
$editore = stripslashes($row_select_editore['editore']);
echo '<option value="'.$id_editore.'" ';if($carica_prodotto['id_editore'] == "0"){echo' selected="selected"';}else{echo'';} echo' >'.$editore.'</option>';
}
echo'
</select>
</p>
<p style="margin-bottom:1px;">
<label class="label">Autore:</label>
<select name="id_autore" class="finestra">
<option value="" ';if($value_id_autore == ""){echo' selected="selected"';}else{echo'';} echo' ></option>';
$select_autore = mysql_query("SELECT * FROM ".$prefix."_prodotti_autori ORDER BY autore ASC");
while ( $row_select_autore = @mysql_fetch_array($select_autore) ) {
$id_autore = $row_select_autore['id_autore'];
$autore = stripslashes($row_select_autore['autore']);
echo '<option value="'.$id_autore.'">'.$autore.'</option>';
}
echo'
</select>
</p>
<p style="margin-bottom:1px;">
<label class="label">Legatura:</label>
<input name="legatura" type="text" class="input" style="width:295px;" />
</p>
<p style="margin-bottom:1px;">
<label class="label">N° Pagine:</label>
<input name="pagine" type="text" class="input" style="width:80px;" />
</p>
<p style="margin-bottom:1px;">
<label class="label">Data di pubblicazione:</label>
<input name="pubblicazione" type="text" class="input" style="width:80px;" id="pubblicazione"/>
</p>
<p style="margin-bottom:1px;">
<label class="label">ISBN:</label>
<input name="isbn" type="text" class="input" style="width:295px;" />
</p>
<p style="margin-bottom:1px;">
<label class="label">In Offerta:</label>
<input type="radio" name="offerta" value="1" class="radio"/><span class="text_radio">SI</span>
<input type="radio" name="offerta" value="0" class="radio" checked="checked"/><span class="text_radio">NO</span>
</p>
<p style="margin-bottom:1px;">
<label class="label">Stato:</label>
<input type="radio" name="stato" value="1" class="radio" checked="checked"/><span class="text_radio">ATTIVO</span>
<input type="radio" name="stato" value="0" class="radio"/><span class="text_radio">NASCOSTO</span>
</p>
<p style="margin-bottom:1px;">
<label class="label">Esaurito:</label>
<input type="radio" name="esaurito" value="1" class="radio" /><span class="text_radio">SI</span>
<input type="radio" name="esaurito" value="0" class="radio" checked="checked"/><span class="text_radio">NO</span>
</p>
<p style="margin-bottom:1px;">
<label class="label">Allegato PDF 1:</label>
<input name="allegato1" type="file" class="file" size="30" />
</p>
<p style="margin-bottom:1px;">
<label class="label">Allegato PDF 2:</label>
<input name="allegato2" type="file" class="file" size="30" />
</p>
<p style="margin-bottom:1px;">
<label class="label">Allegato PDF 3:</label>
<input name="allegato3" type="file" class="file" size="30" />
</p>
</div>
<div id="immagini" class="tab-container-3">
<p style="margin-bottom:1px;"><label class="h1" style="width:699px;">IMMAGINI</label></p>
<p>
<label class="label">Carica foto:</label>
<input type="button" id="button" />
<span class="text_radio"><i><b>('.$dim.')</b></i></span>
</p>
<div id="swfupload-controllo">
<p id="queuestatus" ></p>
<ol id="log"></ol>
</div>
</div>
<script type="text/javascript">
// <![CDATA[
jQuery(function($) {
$.mask.definitions[\'~\']=\'[+-]\';
$(\'#pubblicazione\').mask(\'99/99/9999\');
});
// ]]>
</script>
';
if( $carica_lingua['lang_it'] == "1" ){
echo'
<div id="lang_it" class="tab-container-3">
<p style="margin-bottom:1px;"><label class="h1" style="width:699px;">CONTENUTI LINGUA ITALIANA</label></p>
<p style="margin-bottom:1px;"><label class="label" >Titolo Libro:</label><input name="articolo_it" type="text" class="input" maxlength="255"/></p>
<div class="descrizione">
<div class="divlabel"><label class="label" style="height:430px;">Descrizione:</label></div>
<div style="width:510px; padding:0px; margin: 1px 0px 1px 1px; float:left;">
<textarea id="descrizione_it" name="descrizione_it" class="textarea"></textarea>
<script type="text/javascript">
//<![CDATA[
CKEDITOR.replace( \'descrizione_it\',{
toolbar : \'News\',
width: 523,
height: 295,
skin : \'kama\',
extraPlugins : \'docprops\',
extraPlugins : \'youtube\',
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>
</div>
</div>
';
}elseif( $carica_lingua['lang_it'] == "0" ){ echo ''; }
if( $carica_lingua['lang_en'] == "1" ){
echo'
<div id="lang_en" class="tab-container-3">
<p style="margin-bottom:1px;"><label class="h1" style="width:699px;">CONTENUTI LINGUA INGLESE</label></p>
<p style="margin-bottom:1px;"><label class="label">Titolo Libro:</label><input name="articolo_en" type="text" class="input" maxlength="255"/></p>
<div class="descrizione">
<div class="divlabel"><label class="label" style="height:430px;">Descrizione:</label></div>
<div style="width:510px; padding:0px; margin: 1px 0px 1px 1px; float:left;">
<textarea id="descrizione_en" name="descrizione_en" class="textarea"></textarea>
<script type="text/javascript">
//<![CDATA[
CKEDITOR.replace( \'descrizione_en\',{
toolbar : \'News\',
width: 523,
height: 295,
skin : \'kama\',
extraPlugins : \'docprops\',
extraPlugins : \'youtube\',
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>
</div>
</div>
';
}elseif( $carica_lingua['lang_en'] == "0" ){ echo ''; }
if( $carica_lingua['lang_fr'] == "1" ){
echo'
<div id="lang_fr" class="tab-container-3">
<p style="margin-bottom:1px;"><label class="h1" style="width:699px;">CONTENUTI LINGUA FRANCESE</label></p>
<p style="margin-bottom:1px;"><label class="label">Titolo Libro:</label><input name="articolo_fr" type="text" class="input" maxlength="255"/></p>
<div class="descrizione">
<div class="divlabel"><label class="label" style="height:430px;">Descrizione:</label></div>
<div style="width:510px; padding:0px; margin: 1px 0px 1px 1px; float:left;">
<textarea id="descrizione_fr" name="descrizione_fr" class="textarea" ></textarea>
<script type="text/javascript">
//<![CDATA[
CKEDITOR.replace( \'descrizione_fr\',{
toolbar : \'News\',
width: 523,
height: 295,
skin : \'kama\',
extraPlugins : \'docprops\',
extraPlugins : \'youtube\',
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>
</div>
</div>
';
}elseif( $carica_lingua['lang_fr'] == "0" ){ echo ''; }
if( $carica_lingua['lang_de'] == "1" ){
echo'
<div id="lang_de" class="tab-container-3">
<p style="margin-bottom:1px;"><label class="h1" style="width:699px;">CONTENUTI LINGUA TEDESCA</label></p>
<p style="margin-bottom:1px;"><label class="label">Titolo Libro:</label><input name="articolo_de" type="text" class="input" maxlength="255"/></p>
<div class="descrizione">
<div class="divlabel"><label class="label" style="height:430px;">Descrizione:</label></div>
<div style="width:510px; padding:0px; margin: 1px 0px 1px 1px; float:left;">
<textarea id="descrizione_de" name="descrizione_de" class="textarea" ></textarea>
<script type="text/javascript">
//<![CDATA[
CKEDITOR.replace( \'descrizione_de\',{
toolbar : \'News\',
width: 523,
height: 295,
skin : \'kama\',
extraPlugins : \'docprops\',
extraPlugins : \'youtube\',
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>
</div>
</div>
';
}elseif( $carica_lingua['lang_de'] == "0" ){ echo ''; }
if( $carica_lingua['lang_sp'] == "1" ){
echo'
<div id="lang_sp" class="tab-container-3">
<p style="margin-bottom:1px;"><label class="h1" style="width:699px;">CONTENUTI LINGUA SPAGNOLA</label></p>
<p style="margin-bottom:1px;"><label class="label">Titolo Libro:</label><input name="articolo_sp" type="text" class="input" maxlength="255"/></p>
<div class="descrizione">
<div class="divlabel"><label class="label" style="height:430px;">Descrizione:</label></div>
<div style="width:510px; padding:0px; margin: 1px 0px 1px 1px; float:left;">
<textarea id="descrizione_sp" name="descrizione_sp" class="textarea" ></textarea>
<script type="text/javascript">
//<![CDATA[
CKEDITOR.replace( \'descrizione_sp\',{
toolbar : \'News\',
width: 523,
height: 295,
skin : \'kama\',
extraPlugins : \'docprops\',
extraPlugins : \'youtube\',
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>
</div>
</div>
';
}elseif( $carica_lingua['lang_sp'] == "0" ){ echo ''; }
echo'
<div id="prodotti" class="tab-container-3">
<p style="margin-bottom:10px;"><label class="h1">INSERISCI LIBRI</label></p>
<input type="hidden" value="0" id="count_addprodotto" />
<div id="divList_addprodotto"> </div>
<p class="add_style2"><a href="javascript:addList_addprodotto();" class="add_button">Aggiungi Libro</a></p>
<p> </p>
</div>
<div id="save" class="tab-container-3">
<p style="margin-bottom:10px;"><label class="h1" style="width:699px;">SALVA</label></p>
<p>Attenzione! Prima di salvare il libro controlla di aver riempito tutti i campi.</p>
<p><input type="submit" name="submit" id="submit" value="SALVA" onclick="return confirm(\'SEI SICURO?\')"/></p>
</div>
</div>
</div>
</form>
<p> </p><p> </p>
<p class="back_style"><a href="gestione_prodotti.php?action=prodotti&tipo='.$tipo.'&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'" class="back_button">Torna Indietro</a></p>
';
}
///////////////////////////////////////////////////////////////////////////////////////////
/// PRODOTTI EDIT /////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function prodotti_edit(){
$prefix = PREFIX;
$directory = PRODOTTIDIRECTORY;
$dim = PRODOTTIDIMENSIONI;
if( isset($_GET['act']) ){ $act = $_GET['act']; }elseif( isset($_POST['act']) ){ $act = $_POST['act']; }
if( isset($_GET['tipo']) ){ $tipo = $_GET['tipo']; }elseif( isset($_POST['tipo']) ){ $tipo = $_POST['tipo']; }
if( isset($_GET['pages']) ){ $pages = $_GET['pages']; }elseif( isset($_POST['pages']) ){ $pages = $_POST['pages']; }
if( isset($_GET['cat1']) ){ $cat1 = $_GET['cat1']; }elseif( isset($_POST['cat1']) ){ $cat1 = $_POST['cat1']; }
if( isset($_GET['cat2']) ){ $cat2 = $_GET['cat2']; }elseif( isset($_POST['cat2']) ){ $cat2 = $_POST['cat2']; }
if( isset($_GET['cat3']) ){ $cat3 = $_GET['cat3']; }elseif( isset($_POST['cat3']) ){ $cat3 = $_POST['cat3']; }
if( isset($_GET['m']) ){ $m = $_GET['m']; }elseif( isset($_POST['m']) ){ $m = $_POST['m']; }
if( isset($_GET['o']) ){ $o = $_GET['o']; }elseif( isset($_POST['o']) ){ $o = $_POST['o']; }
if( isset($_GET['id_prodotto']) ){ $id_prodotto = $_GET['id_prodotto']; }elseif( isset($_POST['id_prodotto']) ){ $id_prodotto = $_POST['id_prodotto']; }
$carica_lingua = mysql_fetch_assoc(mysql_query("SELECT * FROM ".$prefix."_prodotti_lingua WHERE id_lang = '1'"));
$carica_prodotto = mysql_fetch_assoc(mysql_query("SELECT * FROM ".$prefix."_prodotti WHERE id_prodotto = '$id_prodotto'"));
$carica_categoria1 = mysql_fetch_assoc(mysql_query("SELECT * FROM ".$prefix."_prodotti_categoria1 WHERE id_categoria1 = '".$carica_prodotto['id_categoria1']."'"));
$carica_categoria2 = mysql_fetch_assoc(mysql_query("SELECT * FROM ".$prefix."_prodotti_categoria2 WHERE id_categoria2 = '".$carica_prodotto['id_categoria2']."'"));
$carica_categoria3 = mysql_fetch_assoc(mysql_query("SELECT * FROM ".$prefix."_prodotti_categoria3 WHERE id_categoria3 = '".$carica_prodotto['id_categoria3']."'"));
include_once 'js/catselect/select.class.php';
$opt = new SelectList();
$value_pubblicazione = substr($carica_prodotto['pubblicazione'],8,2).'/'.substr($carica_prodotto['pubblicazione'],5,2).'/'.substr($carica_prodotto['pubblicazione'],0,4);
if( $carica_lingua['lang_it'] == "1" ){ $prod_lang_it = '<p style=\"margin-bottom:2px;\"><img src=\"images/flag/lang_it.png\" alt=\"\" class=\"flag_prod\" /><input name=\"prodotto["+num+"][titolo_it]\" type=\"text\" class=\"input_prod\" maxlength=\"255\"/></p>'; }elseif( $carica_lingua['lang_it'] == "0" ){ $prod_lang_it = ''; }
if( $carica_lingua['lang_en'] == "1" ){ $prod_lang_en = '<p style=\"margin-bottom:2px;\"><img src=\"images/flag/lang_en.png\" alt=\"\" class=\"flag_prod\" /><input name=\"prodotto["+num+"][titolo_en]\" type=\"text\" class=\"input_prod\" maxlength=\"255\"/></p>'; }elseif( $carica_lingua['lang_en'] == "0" ){ $prod_lang_en = ''; }
if( $carica_lingua['lang_fr'] == "1" ){ $prod_lang_fr = '<p style=\"margin-bottom:2px;\"><img src=\"images/flag/lang_fr.png\" alt=\"\" class=\"flag_prod\" /><input name=\"prodotto["+num+"][titolo_fr]\" type=\"text\" class=\"input_prod\" maxlength=\"255\"/></p>'; }elseif( $carica_lingua['lang_fr'] == "0" ){ $prod_lang_fr = ''; }
if( $carica_lingua['lang_de'] == "1" ){ $prod_lang_de = '<p style=\"margin-bottom:2px;\"><img src=\"images/flag/lang_de.png\" alt=\"\" class=\"flag_prod\" /><input name=\"prodotto["+num+"][titolo_de]\" type=\"text\" class=\"input_prod\" maxlength=\"255\"/></p>'; }elseif( $carica_lingua['lang_de'] == "0" ){ $prod_lang_de = ''; }
if( $carica_lingua['lang_sp'] == "1" ){ $prod_lang_sp = '<p style=\"margin-bottom:2px;\"><img src=\"images/flag/lang_sp.png\" alt=\"\" class=\"flag_prod\" /><input name=\"prodotto["+num+"][titolo_sp]\" type=\"text\" class=\"input_prod\" maxlength=\"255\"/></p>'; }elseif( $carica_lingua['lang_sp'] == "0" ){ $prod_lang_sp = ''; }
$check = $_REQUEST['check'];
if( $carica_prodotto['allegato1'] != "" ){
$value_allegato1 = '
<span class="edit_allegato" style="width:150px; margin:1px;"> <a href="../'.$directory.'/'.$carica_prodotto['allegato1'].'" target="_blank"><img src="images/pdf.png" alt="" class="images" /></a> [ <input name="del_all1" type="checkbox" class="checkbox" style="float: left; margin-right:5px; " value="1" /> ELIMINA ]
</span>
';
}else{ $value_allegato1 = ''; }
if( $carica_prodotto['allegato2'] != "" ){
$value_allegato2 = '
<span class="edit_allegato" style="width:150px; margin:1px;"> <a href="../'.$directory.'/'.$carica_prodotto['allegato2'].'" target="_blank"><img src="images/pdf.png" alt="" class="images" /></a> [ <input name="del_all2" type="checkbox" class="checkbox" style="float: left; margin-right:5px; " value="1" /> ELIMINA ]
</span>
';
}else{ $value_allegato2 = ''; }
if( $carica_prodotto['allegato3'] != "" ){
$value_allegato3 = '
<span class="edit_allegato" style="width:150px; margin:1px;"> <a href="../'.$directory.'/'.$carica_prodotto['allegato3'].'" target="_blank"><img src="images/pdf.png" alt="" class="images" /></a> [ <input name="del_all3" type="checkbox" class="checkbox" style="float: left; margin-right:5px; " value="1" /> ELIMINA ]
</span>
';
}else{ $value_allegato3 = ''; }
if( $_REQUEST['check'] == "ERROR" ){
$status_check = '<span class="text_errore"><b style="color:#F00;">ATTENZIONE! IL SALVATAGGIO NON È STATO ESEGUITO.</b><br />Ricordati di inserire la categoria e la sotto-categoria.</span>';
}else{
$status_check = '';
}
echo'
<script type="text/javascript">
function addList_addprodotto(){
var ni = document.getElementById(\'divList_addprodotto\');
var numi = document.getElementById(\'count_addprodotto\');
var num = (document.getElementById("count_addprodotto").value -1)+ 2;
numi.value = num;
var divIdName1 = "my1"+num+"Div";
var newdiv = document.createElement(\'div\');
newdiv.setAttribute("id",divIdName1);
newdiv.innerHTML = "<div class=\"prod\"><div class=\"art\"><p style=\"margin-bottom:2px;\"><label class=\"label_h1\">Formato libro</label></p> '.$prod_lang_it.''.$prod_lang_en.''.$prod_lang_fr.''.$prod_lang_de.''.$prod_lang_sp.'</div><div class=\"prezzo\"><div class=\"bloc\"> <p style=\"margin-bottom:4px;\"><label class=\"label_prezzo\">Prezzo:</label></p><p style=\"margin-bottom:4px;\"><input name=\"prodotto["+num+"][prezzo]\" type=\"text\" class=\"input_prezzo\"/><span class=\"text\"><b> €</b> <i>(Es. scrivere: <b>15.50</b>)</i></span></p></div><div class=\"bloc\"><p style=\"margin-bottom:4px;\"><label class=\"label_prezzo\">Prezzo per confronto:</label></p><p style=\"margin-bottom:4px;\"><input name=\"prodotto["+num+"][prezzo_confronto]\" type=\"text\" class=\"input_prezzo\"/><span class=\"text\"><b> €</b> <i>(Es. scrivere: <b>18.50</b>)</i></span></p></div><div class=\"bloc\"><p style=\"margin-bottom:4px;\"><label class=\"label_prezzo\">Peso: <i>(Il peso viene tarato in kg)</i></label></p><p style=\"margin-bottom:4px;\"><input name=\"prodotto["+num+"][peso]\" type=\"text\" class=\"input_prezzo\"/><span class=\"text\"><b> Kg</b> <i>(Es. scrivere: <b>4.80</b>)</i></span></p></div></div><div class=\"delete\"><a href=\"javascript:;\" onclick=\"removeEvent_addprodotto(\'"+divIdName1+"\')\"><img src=\"images/btn_delete.png\" alt=\"\" class=\"ic_del\" /></a></div></div>";
ni.appendChild(newdiv);
}
function removeEvent_addprodotto(divNum1){
var d1 = document.getElementById(\'divList_addprodotto\');
var olddiv = document.getElementById(divNum1);
d1.removeChild(olddiv);
}
</script>
<script type="text/javascript" src="js/swfupload/swfupload.js"></script>
<script type="text/javascript" src="js/swfupload/jquery.swfupload.js"></script>
<script type="text/javascript">
$(function(){
$(\'#swfupload-controllo\').swfupload({
upload_url: "gestione_prodotti_upload.php?id_prodotto='.$id_prodotto.'&id_categoria1='.$carica_prodotto['id_categoria1'].'&id_categoria2='.$carica_prodotto['id_categoria2'].'&id_categoria3='.$carica_prodotto['id_categoria3'].'&id_editore='.$carica_prodotto['id_editore'].'&id_autore='.$carica_prodotto['id_autore'].'",
file_post_name: \'uploadfile\',
file_size_limit : "1024",
file_types : "*.jpg;*.png;*.gif*.jpeg",
file_types_description : "Image files",
file_upload_limit : 0,
flash_url : "js/swfupload/swfupload.swf",
button_image_url : \'js/swfupload/XPButtonUploadText_61x22.png\',
button_width : 61,
button_height : 22,
button_placeholder : $(\'#button\')[0],
debug: false
})
.bind(\'fileQueued\', function(event, file){
var listitem=\'<li id="\'+file.id+\'" >\'+
\'File: <em>\'+file.name+\'</em> (\'+Math.round(file.size/1024)+\' KB) <span class="progressvalue" ></span>\'+
\'<div class="progressbar" ><div class="progress" ></div></div>\'+
\'<p class="status" >In attesa di</p>\'+
\'<span class="cancel" > </span>\'+
\'</li>\';
$(\'#log\').append(listitem);
$(\'li#\'+file.id+\' .cancel\').bind(\'click\', function(){
var swfu = $.swfupload.getInstance(\'#swfupload-controllo\');
swfu.cancelUpload(file.id);
$(\'li#\'+file.id).slideUp(\'fast\');
});
// start the upload since it\'s queued
$(this).swfupload(\'startUpload\');
})
.bind(\'fileQueueError\', function(event, file, errorCode, message){
alert(\'La dimensione del file \'+file.name+\' è superiore al limite\');
})
.bind(\'fileDialogComplete\', function(event, numFilesSelected, numFilesQueued){
$(\'#queuestatus\').text(\'File selezionati: \'+numFilesSelected+\' / File in coda: \'+numFilesQueued);
})
.bind(\'uploadStart\', function(event, file){
$(\'#log li#\'+file.id).find(\'p.status\').text(\'Caricamento...\');
$(\'#log li#\'+file.id).find(\'span.progressvalue\').text(\'0%\');
$(\'#log li#\'+file.id).find(\'span.cancel\').hide();
})
.bind(\'uploadProgress\', function(event, file, bytesLoaded){
//Show Progress
var percentage=Math.round((bytesLoaded/file.size)*100);
$(\'#log li#\'+file.id).find(\'div.progress\').css(\'width\', percentage+\'%\');
$(\'#log li#\'+file.id).find(\'span.progressvalue\').text(percentage+\'%\');
})
.bind(\'uploadSuccess\', function(event, file, serverData){
var item=$(\'#log li#\'+file.id);
item.find(\'div.progress\').css(\'width\', \'100%\');
item.find(\'span.progressvalue\').text(\'100%\');
var pathtofile=\'<a href="uploads/\'+file.name+\'" target="_blank" >view »</a>\';
item.addClass(\'success\').find(\'p.status\').html(\'Immagine caricata sul server!!!\');
})
.bind(\'uploadComplete\', function(event, file){
// upload has completed, try the next one in the queue
$(this).swfupload(\'startUpload\');
})
});
</script>
<h1>GESTIONE LIBRI > <b>MODIFICA LIBRO</b></h1>
<form action="gestione_prodotti_azione.php?action=prodotti_edit" method="post" enctype="multipart/form-data" name="modulo_prodotti" id="modulo_prodotti">
<input name="tipo" type="hidden" value="'.$tipo.'" />
<input name="act" type="hidden" value="edit" />
<input name="pages" type="hidden" value="'.$pages.'" />
<input name="cat1" type="hidden" value="'.$cat1.'" />
<input name="cat2" type="hidden" value="'.$cat2.'" />
<input name="cat3" type="hidden" value="'.$cat3.'" />
<input name="m" type="hidden" value="'.$m.'" />
<input name="o" type="hidden" value="'.$o.'" />
<input name="id_prodotto" type="hidden" value="'.$id_prodotto.'" />
<div id="tab-container-3">
<ul>
<li><a href="#config" class="config" tabindex="1" title="CONFIGURAZIONE GENERALE"> </a></li>';
if( $carica_lingua['lang_it'] == "1" && $carica_prodotto['lang_it'] == "1" ){ echo '<li><a href="#lang_it" class="lang_it" title="DESCRIZIONE IN LINGUA ITALIANA"> </a></li>'; }elseif( $carica_lingua['lang_it'] == "0" ){ echo ''; }
if( $carica_lingua['lang_en'] == "1" && $carica_prodotto['lang_en'] == "1" ){ echo '<li><a href="#lang_en" class="lang_en" title="DESCRIZIONE IN LINGUA INGLESE"> </a></li>'; }elseif( $carica_lingua['lang_en'] == "0" ){ echo ''; }
if( $carica_lingua['lang_fr'] == "1" && $carica_prodotto['lang_fr'] == "1" ){ echo '<li><a href="#lang_fr" class="lang_fr" title="DESCRIZIONE IN LINGUA FRANCESE"> </a></li>'; }elseif( $carica_lingua['lang_fr'] == "0" ){ echo ''; }
if( $carica_lingua['lang_de'] == "1" && $carica_prodotto['lang_de'] == "1" ){ echo '<li><a href="#lang_de" class="lang_de" title="DESCRIZIONE IN LINGUA TEDESCA"> </a></li>'; }elseif( $carica_lingua['lang_de'] == "0" ){ echo ''; }
if( $carica_lingua['lang_sp'] == "1" && $carica_prodotto['lang_sp'] == "1" ){ echo '<li><a href="#lang_sp" class="lang_sp" title="DESCRIZIONE IN LINGUA SPAGNOLA"> </a></li>'; }elseif( $carica_lingua['lang_sp'] == "0" ){ echo ''; }
echo'
<li><a href="#edit_prodotti" class="edit_prodotti" title="MODIFICA LIBRI"> </a></li>
<li><a href="#prodotti" class="prodotti" title="AGGIUNGI LIBRO"> </a></li>
<li><a href="#immagini" class="immagini" title="IMMAGINI CARICATE"> </a></li>
</ul>
<div class="panel-container">
<div id="config" class="tab-container-3">
<p style="margin-bottom:1px;"><label class="h1" style="width:699px;">CONFIGURAZIONE GENERALE</label></p>
<p style="margin-bottom:1px;">
<label class="label" style="height:32px; line-height:32px;">Lingua Prodotto:</label>';
if( $carica_lingua['lang_it'] == "1" ){
echo '<img src="images/flag/lang_it.png" alt="" class="flag" /><input name="prod_lang_it" type="checkbox" class="checkbox" value="1" ';if($carica_prodotto['lang_it']=='1'){echo' checked="checked"';}else{echo'';} echo' />';
}elseif( $carica_lingua['lang_it'] == "0" ){ echo ''; }
if( $carica_lingua['lang_en'] == "1" ){
echo '<img src="images/flag/lang_en.png" alt="" class="flag" /><input name="prod_lang_en" type="checkbox" class="checkbox" value="1" ';if($carica_prodotto['lang_en']=='1'){echo' checked="checked"';}else{echo'';} echo' />';
}elseif( $carica_lingua['lang_en'] == "0" ){ echo ''; }
if( $carica_lingua['lang_fr'] == "1" ){
echo '<img src="images/flag/lang_fr.png" alt="" class="flag" /><input name="prod_lang_fr" type="checkbox" class="checkbox" value="1" ';if($carica_prodotto['lang_fr']=='1'){echo' checked="checked"';}else{echo'';} echo' />';
}elseif( $carica_lingua['lang_fr'] == "0" ){ echo ''; }
if( $carica_lingua['lang_de'] == "1" ){
echo '<img src="images/flag/lang_de.png" alt="" class="flag" /><input name="prod_lang_de" type="checkbox" class="checkbox" value="1" ';if($carica_prodotto['lang_de']=='1'){echo' checked="checked"';}else{echo'';} echo' />';
}elseif( $carica_lingua['lang_de'] == "0" ){ echo ''; }
if( $carica_lingua['lang_sp'] == "1" ){
echo '<img src="images/flag/lang_sp.png" alt="" class="flag" /><input name="prod_lang_sp" type="checkbox" class="checkbox" value="1" ';if($carica_prodotto['lang_sp']=='1'){echo' checked="checked"';}else{echo'';} echo' />';
}elseif( $carica_lingua['lang_sp'] == "0" ){ echo ''; }
echo'
</p>
<p style="margin-bottom:1px;">
<label class="label">Categoria:</label>
<select name="id_categoria1" id="categoria1" class="finestra">
<option value="" ';if($carica_categoria['id_categoria1'] == ""){echo' selected="selected"';}else{echo'';} echo' ></option>';
$select_categoria1 = mysql_query("SELECT * FROM ".$prefix."_prodotti_categoria1 ORDER BY categoria1_it ASC");
while ( $row_select_categoria1 = @mysql_fetch_array($select_categoria1) ) {
$id_categoria1 = $row_select_categoria1['id_categoria1'];
$categoria1_it = stripslashes($row_select_categoria1['categoria1_it']);
echo '<option value="'.$id_categoria1.'" ';if($carica_prodotto['id_categoria1'] == $id_categoria1){echo' selected="selected"';}else{echo'';} echo' >'.$categoria1_it.'</option>';
}
echo'
</select>
</p>
<input name="id_categoria2" type="hidden" value="'.$id_categoria2.'" />
<input name="id_categoria3" type="hidden" value="'.$id_categoria3.'" />
<p style="margin-bottom:1px;">
<label class="label">Editore:</label>
<select name="id_editore" class="finestra">
<option value="" ';if($carica_categoria['id_editore'] == ""){echo' selected="selected"';}else{echo'';} echo' ></option>';
$select_editore = mysql_query("SELECT * FROM ".$prefix."_prodotti_editore ORDER BY editore ASC");
while ( $row_select_editore = @mysql_fetch_array($select_editore) ) {
$id_editore = $row_select_editore['id_editore'];
$editore = stripslashes($row_select_editore['editore']);
echo '<option value="'.$id_editore.'" ';if($carica_prodotto['id_editore'] == $id_editore){echo' selected="selected"';}else{echo'';} echo' >'.$editore.'</option>';
}
echo'
</select>
</p>
<p style="margin-bottom:1px;">
<label class="label">Autore:</label>
<select name="id_autore" class="finestra">
<option value="" ';if($carica_categoria['id_autore'] == ""){echo' selected="selected"';}else{echo'';} echo' ></option>';
$select_autore = mysql_query("SELECT * FROM ".$prefix."_prodotti_autori ORDER BY autore ASC");
while ( $row_select_autore = @mysql_fetch_array($select_autore) ) {
$id_autore = $row_select_autore['id_autore'];
$autore = stripslashes($row_select_autore['autore']);
echo '<option value="'.$id_autore.'" ';if($carica_prodotto['id_autore'] == $id_autore){echo' selected="selected"';}else{echo'';} echo' >'.$autore.'</option>';
}
echo'
</select>
</p>
<p style="margin-bottom:1px;">
<label class="label">Legatura:</label>
<input name="legatura" type="text" class="input" style="width:295px;" value="'.stripslashes($carica_prodotto['legatura']).'" />
</p>
<p style="margin-bottom:1px;">
<label class="label">N° Pagine:</label>
<input name="pagine" type="text" class="input" style="width:80px;" value="'.stripslashes($carica_prodotto['pagine']).'" />
</p>
<p style="margin-bottom:1px;">
<label class="label">Data di pubblicazione:</label>
<input name="pubblicazione" type="text" class="input" style="width:80px;" id="pubblicazione" value="'.stripslashes($value_pubblicazione).'"/>
</p>
<p style="margin-bottom:1px;">
<label class="label">ISBN:</label>
<input name="isbn" type="text" class="input" style="width:295px;" value="'.stripslashes($carica_prodotto['isbn']).'"/>
</p>
<p style="margin-bottom:1px;">
<label class="label">In Offerta:</label>
<input type="radio" name="offerta" value="1" class="radio" ';if($carica_prodotto['offerta']=='1'){echo' checked="checked"';}else{echo'';} echo' /><span class="text_radio">SI</span>
<input type="radio" name="offerta" value="0" class="radio" ';if($carica_prodotto['offerta']=='0'){echo' checked="checked"';}else{echo'';} echo' /><span class="text_radio">NO</span>
</p>
<p style="margin-bottom:1px;">
<label class="label">Stato:</label>
<input type="radio" name="stato" value="1" class="radio" ';if($carica_prodotto['stato']=='1'){echo' checked="checked"';}else{echo'';} echo' /><span class="text_radio">ATTIVO</span>
<input type="radio" name="stato" value="0" class="radio" ';if($carica_prodotto['stato']=='0'){echo' checked="checked"';}else{echo'';} echo' /><span class="text_radio">NASCOSTO</span>
</p>
<p style="margin-bottom:1px;">
<label class="label">Esaurito:</label>
<input type="radio" name="esaurito" value="1" class="radio" ';if($carica_prodotto['esaurito']=='1'){echo' checked="checked"';}else{echo'';} echo' /><span class="text_radio">SI</span>
<input type="radio" name="esaurito" value="0" class="radio" ';if($carica_prodotto['esaurito']=='0'){echo' checked="checked"';}else{echo'';} echo' /><span class="text_radio">NO</span>
</p>
<p style="margin-bottom:1px;">
<label class="label" style="height:27px; line-height:27px;">Allegato PDF 1:</label>
'.$value_allegato1.'
<span class="edit_allegato" style="width:300px; padding:1px; margin:1px;"><input name="allegato1" type="file" class="file" size="30" /></span>
</p>
<p style="margin-bottom:1px;">
<label class="label" style="height:27px; line-height:27px;">Allegato PDF 2:</label>
'.$value_allegato2.'
<span class="edit_allegato" style="width:300px; padding:1px; margin:1px;"><input name="allegato2" type="file" class="file" size="30" /></span>
</p>
<p style="margin-bottom:1px;">
<label class="label" style="height:27px; line-height:27px;">Allegato PDF 3:</label>
'.$value_allegato3.'
<span class="edit_allegato" style="width:300px; padding:1px; margin:1px;"><input name="allegato3" type="file" class="file" size="30" /></span>
</p>
<p style="margin-bottom:1px;">
<label class="label" style="height:32px; line-height:32px;">Salva:</label>
<input name="configurazione" type="submit" value="SALVA" class="submit ic" />
'.$status_check.'
</p>
</div>
<div id="immagini" class="tab-container-3">
<p style="margin-bottom:1px;"><label class="h1" style="width:699px;">IMMAGINI</label></p>';
$carica_img = mysql_query( "SELECT * FROM ".$prefix."_prodotti_img WHERE id_prodotto = '$id_prodotto'");
while( $row_carica_img = mysql_fetch_assoc($carica_img)) {
$id_prodotto_img = $row_carica_img['id_prodotto_img'];
$immagine = stripslashes($row_carica_img['immagine']);
echo'
<div class="images">
<div class="cont_images"><img src="../'.$directory.'/'.$immagine.'" alt="" class="ic_images" /></div>
<div class="cont_del"><a href="gestione_prodotti_azione.php?action=prodotti_delete_img&tipo='.$tipo.'&pages='.$pages.'&id_prodotto='.$id_prodotto.'&id_prodotto_img='.$id_prodotto_img.'"><img src="images/btn_delete.png" alt="" class="ic_del" /></a></div>
</div>
';
}
echo'
<p>
<label class="label">Carica altre foto:</label>
<input type="button" id="button" />
<span class="text_radio"><i><b>('.$dim.')</b></i></span>
</p>
<div id="swfupload-controllo">
<p id="queuestatus" ></p>
<ol id="log"></ol>
</div>
</div>
';
if( $carica_lingua['lang_it'] == "1" && $carica_prodotto['lang_it'] == "1" ){
echo'
<div id="lang_it" class="tab-container-3">
<p style="margin-bottom:1px;"><label class="h1" style="width:699px;">CONTENUTI LINGUA ITALIANA</label></p>
<p style="margin-bottom:1px;"><label class="label" >Titolo libro:</label><input name="articolo_it" type="text" class="input" maxlength="255" value="'.htmlspecialchars(stripslashes($carica_prodotto['articolo_it'])).'"/></p>
<div class="descrizione">
<div class="divlabel"><label class="label" style="height:390px;">Descrizione:</label></div>
<div style="width:510px; padding:0px; margin: 1px 0px 1px 1px; float:left;">
<textarea id="descrizione_it" name="descrizione_it" class="textarea">'.htmlspecialchars(stripslashes($carica_prodotto['descrizione_it'])).'</textarea>
<script type="text/javascript">
//<![CDATA[
CKEDITOR.replace( \'descrizione_it\',{
toolbar : \'News\',
width: 523,
height: 255,
skin : \'kama\',
extraPlugins : \'docprops\',
extraPlugins : \'youtube\',
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>
</div>
<p style="margin-bottom:1px;"><label class="label" style="height:32px; line-height:32px;">Salva:</label><input name="desc_it" type="submit" value="SALVA" class="submit ic" /></p>
</div>
';
}elseif( $carica_lingua['lang_it'] == "0" ){ echo ''; }
if( $carica_lingua['lang_en'] == "1" && $carica_prodotto['lang_en'] == "1" ){
echo'
<div id="lang_en" class="tab-container-3">
<p style="margin-bottom:1px;"><label class="h1" style="width:699px;">CONTENUTI LINGUA INGLESE</label></p>
<p style="margin-bottom:1px;"><label class="label">Titolo libro:</label><input name="articolo_en" type="text" class="input" maxlength="255" value="'.htmlspecialchars(stripslashes($carica_prodotto['articolo_en'])).'"/></p>
<div class="descrizione">
<div class="divlabel"><label class="label" style="height:390px;">Descrizione:</label></div>
<div style="width:510px; padding:0px; margin: 1px 0px 1px 1px; float:left;">
<textarea id="descrizione_en" name="descrizione_en" class="textarea">'.htmlspecialchars(stripslashes($carica_prodotto['descrizione_en'])).'</textarea>
<script type="text/javascript">
//<![CDATA[
CKEDITOR.replace( \'descrizione_en\',{
toolbar : \'News\',
width: 523,
height: 255,
skin : \'kama\',
extraPlugins : \'docprops\',
extraPlugins : \'youtube\',
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>
</div>
<p style="margin-bottom:1px;"><label class="label" style="height:32px; line-height:32px;">Salva:</label><input name="desc_en" type="submit" value="SALVA" class="submit ic" /></p>
</div>
';
}elseif( $carica_lingua['lang_en'] == "0" ){ echo ''; }
if( $carica_lingua['lang_fr'] == "1" && $carica_prodotto['lang_fr'] == "1" ){
echo'
<div id="lang_fr" class="tab-container-3">
<p style="margin-bottom:1px;"><label class="h1" style="width:699px;">CONTENUTI LINGUA FRANCESE</label></p>
<p style="margin-bottom:1px;"><label class="label">Titolo libro:</label><input name="articolo_fr" type="text" class="input" maxlength="255" value="'.htmlspecialchars(stripslashes($carica_prodotto['articolo_fr'])).'"/></p>
<div class="descrizione">
<div class="divlabel"><label class="label" style="height:390px;">Descrizione:</label></div>
<div style="width:510px; padding:0px; margin: 1px 0px 1px 1px; float:left;">
<textarea id="descrizione_fr" name="descrizione_fr" class="textarea">'.htmlspecialchars(stripslashes($carica_prodotto['descrizione_fr'])).'</textarea>
<script type="text/javascript">
//<![CDATA[
CKEDITOR.replace( \'descrizione_fr\',{
toolbar : \'News\',
width: 523,
height: 255,
skin : \'kama\',
extraPlugins : \'docprops\',
extraPlugins : \'youtube\',
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>
</div>
<p style="margin-bottom:1px;"><label class="label" style="height:32px; line-height:32px;">Salva:</label><input name="desc_fr" type="submit" value="SALVA" class="submit ic" /></p>
</div>
';
}elseif( $carica_lingua['lang_fr'] == "0" ){ echo ''; }
if( $carica_lingua['lang_de'] == "1" && $carica_prodotto['lang_de'] == "1" ){
echo'
<div id="lang_de" class="tab-container-3">
<p style="margin-bottom:1px;"><label class="h1" style="width:699px;">CONTENUTI LINGUA TEDESCA</label></p>
<p style="margin-bottom:1px;"><label class="label">Titolo libro:</label><input name="articolo_de" type="text" class="input" maxlength="255" value="'.htmlspecialchars(stripslashes($carica_prodotto['articolo_de'])).'"/></p>
<div class="descrizione">
<div class="divlabel"><label class="label" style="height:390px;">Descrizione:</label></div>
<div style="width:510px; padding:0px; margin: 1px 0px 1px 1px; float:left;">
<textarea id="descrizione_de" name="descrizione_de" class="textarea">'.htmlspecialchars(stripslashes($carica_prodotto['descrizione_de'])).'</textarea>
<script type="text/javascript">
//<![CDATA[
CKEDITOR.replace( \'descrizione_de\',{
toolbar : \'News\',
width: 523,
height: 255,
skin : \'kama\',
extraPlugins : \'docprops\',
extraPlugins : \'youtube\',
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>
</div>
<p style="margin-bottom:1px;"><label class="label" style="height:32px; line-height:32px;">Salva:</label><input name="desc_de" type="submit" value="SALVA" class="submit ic" /></p>
</div>
';
}elseif( $carica_lingua['lang_de'] == "0" ){ echo ''; }
if( $carica_lingua['lang_sp'] == "1" && $carica_prodotto['lang_sp'] == "1" ){
echo'
<div id="lang_sp" class="tab-container-3">
<p style="margin-bottom:1px;"><label class="h1" style="width:699px;">CONTENUTI LINGUA SPAGNOLA</label></p>
<p style="margin-bottom:1px;"><label class="label">Titolo libro:</label><input name="articolo_sp" type="text" class="input" maxlength="255" value="'.htmlspecialchars(stripslashes($carica_prodotto['articolo_sp'])).'"/></p>
<div class="descrizione">
<div class="divlabel"><label class="label" style="height:390px;">Descrizione:</label></div>
<div style="width:510px; padding:0px; margin: 1px 0px 1px 1px; float:left;">
<textarea id="descrizione_sp" name="descrizione_sp" class="textarea">'.htmlspecialchars(stripslashes($carica_prodotto['descrizione_sp'])).'</textarea>
<script type="text/javascript">
//<![CDATA[
CKEDITOR.replace( \'descrizione_sp\',{
toolbar : \'News\',
width: 523,
height: 255,
skin : \'kama\',
extraPlugins : \'docprops\',
extraPlugins : \'youtube\',
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>
</div>
<p style="margin-bottom:1px;"><label class="label" style="height:32px; line-height:32px;">Salva:</label><input name="desc_sp" type="submit" value="SALVA" class="submit ic" /></p>
</div>
';
}elseif( $carica_lingua['lang_sp'] == "0" ){ echo ''; }
echo'
<div id="prodotti" class="tab-container-3">
<p style="margin-bottom:10px;"><label class="h1">INSERISCI LIBRO</label></p>
<input type="hidden" value="0" id="count_addprodotto" />
<div id="divList_addprodotto"> </div>
<p class="add_style2"><a href="javascript:addList_addprodotto();" class="add_button">Aggiungi Libro</a></p>
<p> </p>
<p style="margin-bottom:1px;"><label class="label" style="height:32px; line-height:32px;">Salva:</label><input name="add_prodotti" type="submit" value="SALVA" class="submit ic" /></p>
</div>
<div id="edit_prodotti" class="tab-container-3">
<p style="margin-bottom:10px;"><label class="h1">MODIFICA LIBRI</label></p>
';
$list_prodotti = mysql_query( "SELECT * FROM ".$prefix."_prodotti_scheda WHERE id_prodotto = '$id_prodotto' ORDER BY id_prodotto_scheda");
while( $row_list_prodotti = mysql_fetch_assoc($list_prodotti)) {
$id_prodotto_scheda = $row_list_prodotti['id_prodotto_scheda'];
$titolo_it = stripslashes($row_list_prodotti['titolo_it']);
$titolo_en = stripslashes($row_list_prodotti['titolo_en']);
$titolo_fr = stripslashes($row_list_prodotti['titolo_fr']);
$titolo_de = stripslashes($row_list_prodotti['titolo_de']);
$titolo_sp = stripslashes($row_list_prodotti['titolo_sp']);
$prezzo = stripslashes($row_list_prodotti['prezzo']);
$prezzo_confronto = stripslashes($row_list_prodotti['prezzo_confronto']);
$peso = stripslashes($row_list_prodotti['peso']);
$stato = stripslashes($row_list_prodotti['stato']);
if( $stato == "1" ){
$tag_stato = '<a href="gestione_prodotti_azione.php?action=prodotti_edit_articoli&cmd=stato&stato=0&tipo='.$tipo.'&pages='.$pages.'&cat='.$cat.'&catsub='.$catsub.'&id_prodotto='.$id_prodotto.'&id_prodotto_scheda='.$id_prodotto_scheda.'"><img src="images/btn_stato_vedi.png" alt="" class="ic_stato" /></a>';
}elseif( $stato == "0" ){
$tag_stato = '<a href="gestione_prodotti_azione.php?action=prodotti_edit_articoli&cmd=stato&stato=1&tipo='.$tipo.'&pages='.$pages.'&cat='.$cat.'&catsub='.$catsub.'&id_prodotto='.$id_prodotto.'&id_prodotto_scheda='.$id_prodotto_scheda.'"><img src="images/btn_stato_nascondi.png" alt="" class="ic_stato" /></a>';
}
if( $carica_lingua['lang_it'] == "1" ){
$tag_input_it = '<p style="margin-bottom:2px;"><img src="images/flag/lang_it.png" alt="" class="flag_prod" /><span class="text_edit_it" id="'.$id_prodotto_scheda.'">'.$titolo_it.'</span></p>';
}elseif( $carica_lingua['lang_it'] == "" ){ $tag_input_it = ''; }
if( $carica_lingua['lang_en'] == "1" ){
$tag_input_en = '<p style="margin-bottom:2px;"><img src="images/flag/lang_en.png" alt="" class="flag_prod" /><span class="text_edit_en" id="'.$id_prodotto_scheda.'">'.$titolo_en.'</span></p>';
}elseif( $carica_lingua['lang_en'] == "" ){ $tag_input_en = ''; }
if( $carica_lingua['lang_fr'] == "1" ){
$tag_input_fr = '<p style="margin-bottom:2px;"><img src="images/flag/lang_fr.png" alt="" class="flag_prod" /><span class="text_edit_fr" id="'.$id_prodotto_scheda.'">'.$titolo_fr.'</span></p>';
}elseif( $carica_lingua['lang_fr'] == "" ){ $tag_input_fr = ''; }
if( $carica_lingua['lang_de'] == "1" ){
$tag_input_de = '<p style="margin-bottom:2px;"><img src="images/flag/lang_de.png" alt="" class="flag_prod" /><span class="text_edit_de" id="'.$id_prodotto_scheda.'">'.$titolo_de.'</span></p>';
}elseif( $carica_lingua['lang_de'] == "" ){ $tag_input_de = ''; }
if( $carica_lingua['lang_sp'] == "1" ){
$tag_input_sp = '<p style="margin-bottom:2px;"><img src="images/flag/lang_sp.png" alt="" class="flag_prod" /><span class="text_edit_sp" id="'.$id_prodotto_scheda.'">'.$titolo_sp.'</span></p>';
}elseif( $carica_lingua['lang_sp'] == "" ){ $tag_input_sp = ''; }
echo'
<div class="prod">
<div class="art">
<p style="margin-bottom:2px;"><label class="label_h1">Formato libro</label></p>
'.$tag_input_it.''.$tag_input_en.''.$tag_input_fr.''.$tag_input_de.''.$tag_input_sp.'
</div>
<div class="prezzo">
<div class="bloc">
<p style="margin-bottom:4px;"><label class="label_prezzo">Prezzo:</label></p>
<p style="margin-bottom:4px;"><span class="text_edit_p1" id="'.$id_prodotto_scheda.'">'.$prezzo.'</span><span class="text"><b> €</b> <i>(Es. scrivere: <b>15.50</b>)</i></span></p>
</div>
<div class="bloc">
<p style="margin-bottom:4px;"><label class="label_prezzo">Prezzo per confronto:</label></p>
<p style="margin-bottom:4px;"><span class="text_edit_p2" id="'.$id_prodotto_scheda.'">'.$prezzo_confronto.'</span><span class="text"><b> €</b> <i>(Es. scrivere: <b>18.50</b>)</i></span></p>
</div>
<div class="bloc">
<p style="margin-bottom:4px;"><label class="label_prezzo">Peso: <i>(Il peso viene tarato in kg)</i></label></p>
<p style="margin-bottom:4px;"><span class="text_edit_p3" id="'.$id_prodotto_scheda.'">'.$peso.'</span><span class="text"><b> Kg</b> <i>(Es. scrivere: <b>4.80</b>)</i></span></p>
</div>
</div>
<div class="delete">
<a href="gestione_prodotti_azione.php?action=prodotti_edit_articoli&cmd=delete&tipo='.$tipo.'&pages='.$pages.'&cat='.$cat.'&catsub='.$catsub.'&id_prodotto='.$id_prodotto.'&id_prodotto_scheda='.$id_prodotto_scheda.'"><img src="images/btn_delete.png" alt="" class="ic_del" /></a>
'.$tag_stato.'
</div>
</div>
';
}
echo'
</div>
</div>
</div>
</form>
<p> </p><p> </p>
<p class="back_style"><a href="gestione_prodotti.php?action=prodotti&tipo='.$tipo.'&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'" class="back_button">Torna Indietro</a></p>
';
}
///////////////////////////////////////////////////////////////////////////////////////////
/// CERCA /////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function cerca(){
$prefix = PREFIX;
$server = SERVER;
$directory = PRODOTTIDIRECTORY;
include_once 'js/catselect/select.class.php';
$opt = new SelectList();
if( isset($_GET['tipo']) ){ $tipo = $_GET['tipo']; }elseif( isset($_POST['tipo']) ){ $tipo = $_POST['tipo']; }
if( isset($_GET['pages']) ){ $pages = $_GET['pages']; }elseif( isset($_POST['pages']) ){ $pages = $_POST['pages']; }
if( isset($_GET['cat1']) ){ $cat1 = $_GET['cat1']; }elseif( isset($_POST['cat1']) ){ $cat1 = $_POST['cat1']; }
if( isset($_GET['cat2']) ){ $cat2 = $_GET['cat2']; }elseif( isset($_POST['cat2']) ){ $cat2 = $_POST['cat2']; }
if( isset($_GET['cat3']) ){ $cat3 = $_GET['cat3']; }elseif( isset($_POST['cat3']) ){ $cat3 = $_POST['cat3']; }
if( isset($_GET['m']) ){ $m = $_GET['m']; }elseif( isset($_POST['m']) ){ $m = $_POST['m']; }
if( isset($_GET['o']) ){ $o = $_GET['o']; }elseif( isset($_POST['o']) ){ $o = $_POST['o']; }
if( isset($_GET['search']) ){ $search_cod = $_GET['search']; }elseif( isset($_POST['search']) ){ $search_cod = $_POST['search']; }
$search = mysql_real_escape_string($search_cod);
$search1 = strtolower($search_cod);
$search2 = strtoupper($search_cod);
$controllolo = mysql_query( "SELECT * FROM ".$prefix."_prodotti WHERE data = '0000-00-00 00:00:00'");
while( $row_controllolo = mysql_fetch_assoc($controllolo)) {
$c_id_prodotto = $row_controllolo['id_prodotto'];
$carica_img = mysql_query("SELECT * FROM ".$prefix."_prodotti_img WHERE id_prodotto = '$c_id_prodotto'");
while ( $row_carica_img = @mysql_fetch_array($carica_img) ) {
$immagine = $row_carica_img['immagine']; if ( $immagine != "" ) { unlink('../'.$directory.'/'.$immagine.''); }
}
$carica_all = mysql_query("SELECT * FROM ".$prefix."_prodotti WHERE id_prodotto = '$c_id_prodotto'");
while ( $row_carica_all = @mysql_fetch_array($carica_all) ) {
$allegato1 = $row_carica_all['allegato1']; if ( $allegato1 != "" ) { unlink('../'.$directory.'/'.$allegato1.''); }
$allegato2 = $row_carica_all['allegato2']; if ( $allegato2 != "" ) { unlink('../'.$directory.'/'.$allegato2.''); }
$allegato3 = $row_carica_all['allegato3']; if ( $allegato3 != "" ) { unlink('../'.$directory.'/'.$allegato3.''); }
}
$delete_img = "DELETE FROM ".$prefix."_prodotti_img WHERE id_prodotto = '$c_id_prodotto'" ;
if(mysql_query($delete_img)){ }else{ echo status_errore(); }
$delete_scheda = "DELETE FROM ".$prefix."_prodotti_scheda WHERE id_prodotto = '$c_id_prodotto'" ;
if(mysql_query($delete_scheda)){ }else{ echo status_errore(); }
$delete_prodotto = "DELETE FROM ".$prefix."_prodotti WHERE id_prodotto = '$c_id_prodotto'" ;
if(mysql_query($delete_prodotto)){ }else{ echo status_errore(); }
}
// MARCA
if( $m == "0" ){ $where_m = " "; }else{ $where_m = " && id_autore = '$m' "; }
// OFFERTE
if( $o == "0" ){
$active_o = ''; $where_o = " ";
$menu_o = '<li><a href="gestione_prodotti.php?action=cerca&tipo='.$tipo.'&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o=1&search='.$search1.'" class="offerta">IN OFFERTA</a></li>';
}elseif( $o == "1" ){
$active_o = ' active'; $where_o = " && offerta = '1' ";
$menu_o = '<li><a href="gestione_prodotti.php?action=cerca&tipo='.$tipo.'&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o=0&search='.$search1.'" class="offerta active">IN OFFERTA</a></li>';
}
// CATEGORIA
if( $cat1 == "0" && $cat2 == "0" && $cat3 == "0" ){
$where_cat = "";
}elseif( $cat1 != "0" && $cat2 == "0" && $cat3 == "0"){
$where_cat = " && id_categoria1 = '$cat1' ";
}elseif( $cat1 != "0" && $cat2 != "0" && $cat3 == "0"){
$where_cat = " && id_categoria1 = '$cat1' && id_categoria2 = '$cat2'";
}elseif( $cat1 != "0" && $cat2 != "0" && $cat3 != "0"){
$where_cat = " && id_categoria1 = '$cat1' && id_categoria2 = '$cat2' && id_categoria3 = '$cat3'";
}
// TIPO
if( $tipo == 'tutte' ){
$active_tutte = ' active'; $active_attive = ''; $active_nascoste = ''; $where_tipo = '';
}elseif( $tipo == 'attive' ){
$active_tutte = ''; $active_attive = ' active'; $active_nascoste = ''; $where_tipo = " && stato = '1'";
}elseif( $tipo == 'nascoste' ) {
$active_tutte = ''; $active_attive = ''; $active_nascoste = ' active'; $where_tipo = " && stato = '0'";
}
// CHECK WHERE
$tag_where = " controllo = '1' $where_cat $where_o ";
$total = mysql_query("SELECT *, MATCH( ".$prefix."_prodotti.articolo_it, ".$prefix."_prodotti.keyword, ".$prefix."_prodotti_scheda.codice, ".$prefix."_prodotti_scheda.titolo_it, ".$prefix."_prodotti_scheda.prezzo )AGAINST( '$search1 $search2' IN BOOLEAN MODE) as score FROM ".$prefix."_prodotti LEFT JOIN ".$prefix."_prodotti_scheda ON ".$prefix."_prodotti.id_prodotto = ".$prefix."_prodotti_scheda.id_prodotto WHERE $tag_where AND MATCH( ".$prefix."_prodotti.articolo_it, ".$prefix."_prodotti.keyword, ".$prefix."_prodotti_scheda.codice, ".$prefix."_prodotti_scheda.titolo_it, ".$prefix."_prodotti_scheda.prezzo ) AGAINST('$search1 $search2' IN BOOLEAN MODE) GROUP BY ".$prefix."_prodotti.id_prodotto");
$numero_notizie = mysql_num_rows( $total );
echo'
<h1>GESTIONE LIBRI > CERCA > <b>'.stripslashes($_REQUEST['search']).'</b></h1>
<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_prodotti.php?action=cerca&tipo='.$tipo.'&pages=15&cat1=0&cat2=0&cat3=0&m=0&o='.$o.'&search='.$search1.'" ';if($pages=='15'){echo' selected="selected"';}else{echo'';} echo' >15</option>
<option value="gestione_prodotti.php?action=cerca&tipo='.$tipo.'&pages=30&cat1=0&cat2=0&cat3=0&m=0&o='.$o.'&search='.$search1.'" ';if($pages=='30'){echo' selected="selected"';}else{echo'';} echo' >30</option>
<option value="gestione_prodotti.php?action=cerca&tipo='.$tipo.'&pages=50&cat1=0&cat2=0&cat3=0&m=0&o='.$o.'&search='.$search1.'" ';if($pages=='50'){echo' selected="selected"';}else{echo'';} echo' >50</option>
<option value="gestione_prodotti.php?action=cerca&tipo='.$tipo.'&pages=100&cat1=0&cat2=0&cat3=0&m=0&o='.$o.'&search='.$search1.'" ';if($pages=='100'){echo' selected="selected"';}else{echo'';} echo' >100</option>
<option value="gestione_prodotti.php?action=cerca&tipo='.$tipo.'&pages=150&cat1=0&cat2=0&cat3=0&m=0&o='.$o.'&search='.$search1.'" ';if($pages=='150'){echo' selected="selected"';}else{echo'';} echo' >150</option>
</select>
</form>
</li>
<li><a href="gestione_prodotti.php?action=cerca&tipo=tutte&pages='.$pages.'&cat1=0&cat2=0&cat3=0&m=0&o='.$o.'&search='.$search1.'" class="tutte'.$active_tutte.'">TUTTE</a></li>
<li><a href="gestione_prodotti.php?action=cerca&tipo=attive&pages='.$pages.'&cat1=0&cat2=0&cat3=0&m=0&o='.$o.'&search='.$search1.'" class="attive'.$active_attive.'">ATTIVE</a></li>
<li><a href="gestione_prodotti.php?action=cerca&tipo=nascoste&pages='.$pages.'&cat1=0&cat2=0&cat3=0&m=0&o='.$o.'&search='.$search1.'" class="nascoste'.$active_nascoste.'">NASCOSTE</a></li>
'.$menu_o.'
<li class="num">Totale: <b>'.$numero_notizie.'</b></li>
</ul>
</div>
<div id="submenu">
<ul id="navsub">
<li>
<form name="form" id="form" method="get">
<input name="tipo" type="hidden" value="'.$tipo.'" /><input name="pages" type="hidden" value="'.$pages.'" />
<label class="label">Reparto: </label>
<select name="cat1" id="categoria1" class="finestra" style="width:85px;">'; echo $opt->ShowCategoria1(); echo'</select>
<label class="label" class="finestra">Categoria: </label>
<select name="cat2" id="categoria2" class="finestra" style="width:85px;"><option value="0">Scegli...</option></select>
<label class="label" class="finestra">Sotto-Categoria: </label>
<select name="cat3" id="categoria3" class="finestra" style="width:85px;"><option value="0">Scegli...</option></select>
<label class="label" class="finestra">Marca: </label>
<select name="m" class="finestra" style="width:85px;">
<option value="0" ';if($m == "0"){echo' selected="selected"';}else{echo'';} echo' >Scegli...</option>';
$select_marca = mysql_query("SELECT * FROM ".$prefix."_prodotti_marca ORDER BY marca ASC");
while ( $row_select_marca = @mysql_fetch_array($select_marca) ) {
$id_autore = $row_select_marca['id_autore'];
$marca = stripslashes($row_select_marca['marca']);
echo '<option value="'.$id_autore.'" ';if($m == $id_autore){echo' selected="selected"';}else{echo'';} echo'>'.$marca.'</option>';
}
echo'
</select>
<input name="o" type="hidden" value="'.$o.'" />
<input type="submit" name="submit" id="submit" value="CARICA" />
</form>
</li>
</div>
<div id="submenu">
<ul id="navsub">
<li><a href="gestione_prodotti.php?action=prodotti&tipo=tutte&pages=12&cat1=0&cat2=0&cat3=0&m=0&o=0" title="RESET ARCHIVIO"><img src="images/btn_reset.png" alt="RESET ARCHIVIO" class="btn_reset"/></a></li>
<li>
<form action="gestione_prodotti.php?action=cerca" enctype="multipart/form-data" name="form" id="form" method="post" >
<input name="tipo" type="hidden" value="tutte" /><input name="pages" type="hidden" value="'.$pages.'" />
<input name="m" type="hidden" value="0" /><input name="o" type="hidden" value="0" />
<input name="cat1" type="hidden" value="0" /><input name="cat2" type="hidden" value="0" />
<input name="cat3" type="hidden" value="0" />
<label class="label">Cerca: </label><input name="search" type="text" class="input" />
<input type="submit" name="submit" id="submit" value="RICERCA LIBERA" />
</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_prodotti.php?action=cerca&tipo='.$tipo.'&pages='.$pages.'&cat1=0&cat2=0&cat3=0&m=0&o='.$o.'&search='.$search.'&'; // NOME PAGINA
$pager = new YCPager( $p, $numero_notizie, $limite, $redirect_to );
$offset = $pager->getQueryOffset();
echo'
<form action="gestione_prodotti_azione.php?action=prodotti_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.'" />
<input name="m" type="hidden" value="'.$m.'" /><input name="o" type="hidden" value="'.$o.'" />
<input name="cat1" type="hidden" value="'.$cat1.'" /><input name="cat2" type="hidden" value="'.$cat2.'" />
<input name="cat3" type="hidden" value="'.$cat3.'" />
<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" style="background-image:none;"><b>Azione</b></td>
<th width="70" align="center" axis="number"><b>Data</b></td>
<th align="left" axis="string"><b>Prodotti</b></td>
<th width="60" align="center" style="background-image:none;"><b>Offerta</b></td>
<th width="50" align="center" style="background-image:none;"><b>Stato</b></td>
</tr>
</thead>
<tbody>
';
$carica = mysql_query( "SELECT *, MATCH( ".$prefix."_prodotti.articolo_it, ".$prefix."_prodotti.keyword, ".$prefix."_prodotti_scheda.codice, ".$prefix."_prodotti_scheda.titolo_it, ".$prefix."_prodotti_scheda.prezzo )AGAINST( '$search1 $search2' IN BOOLEAN MODE) as score FROM ".$prefix."_prodotti LEFT JOIN ".$prefix."_prodotti_scheda ON ".$prefix."_prodotti.id_prodotto = ".$prefix."_prodotti_scheda.id_prodotto WHERE $tag_where AND MATCH( ".$prefix."_prodotti.articolo_it, ".$prefix."_prodotti.keyword, ".$prefix."_prodotti_scheda.codice, ".$prefix."_prodotti_scheda.titolo_it, ".$prefix."_prodotti_scheda.prezzo ) AGAINST('$search1 $search2' IN BOOLEAN MODE) GROUP BY ".$prefix."_prodotti.id_prodotto LIMIT $limite OFFSET $offset ");
while( $row_carica = mysql_fetch_assoc($carica)) {
$id_prodotto = $row_carica['id_prodotto'];
$articolo_it = stripslashes($row_carica['articolo_it']);
$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']);
$offerta = stripslashes($row_carica['offerta']);
if( $stato == '1' ){
$tag_stato = '<a href="gestione_prodotti_azione.php?action=prodotti_stato&tipo='.$tipo.'&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'&act=s&stato=0&id_prodotto='.$id_prodotto.'" title="NASCONDERE QUESTO PRODOTTO" onclick="return confirm(\'ATTENZIONE. NASCONDERE QUESTO PRODOTTO?\')"><img src="images/btn_stato_vedi.png" alt="NASCONDERE PRODOTTO" border="0"/></a>';
}elseif( $stato == '0' ){
$tag_stato = '<a href="gestione_prodotti_azione.php?action=prodotti_stato&tipo='.$tipo.'&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'&m=0&o=0&act=s&stato=1&id_prodotto='.$id_prodotto.'" title="ATTIVARE QUESTO PRODOTTO" onclick="return confirm(\'ATTENZIONE. ATTIVARE QUESTO PRODOTTO?\')"><img src="images/btn_stato_nascondi.png" alt="ATTIVARE PRODOTTO" border="0"/></a>';
}
if( $offerta == '1' ){
$tag_offerta = '<a href="gestione_prodotti_azione.php?action=prodotti_stato&tipo='.$tipo.'&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'&act=o&offerta=0&id_prodotto='.$id_prodotto.'" title="TOGLIERE DALLE OFFERTE QUESTO PRODOTTO" onclick="return confirm(\'ATTENZIONE. TOGLIERE DALLE OFFERTE QUESTO PRODOTTO?\')"><img src="images/stato_offerta_1.png" alt="TOGLIERE DALLE OFFERTE QUESTO PRODOTTO" border="0"/></a>';
}elseif( $offerta == '0' ){
$tag_offerta = '<a href="gestione_prodotti_azione.php?action=prodotti_stato&tipo='.$tipo.'&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'&act=o&offerta=1&id_prodotto='.$id_prodotto.'" title="METTI TRA LE OFFERTE QUESTO PRODOTTO" onclick="return confirm(\'ATTENZIONE. METTI TRA LE OFFERTE QUESTO PRODOTTO?\')"><img src="images/stato_offerta_0.png" alt="METTI TRA LE OFFERTE QUESTO PRODOTTO" border="0"/></a>';
}
$count_recensione = mysql_query( "SELECT id_prodotto FROM ".$prefix."_prodotti_recensioni WHERE id_prodotto = '$id_prodotto' ");
$numero_recensione = mysql_num_rows( $count_recensione );
echo'
<tr id="'.$id_prodotto.'" >
<td><input type="checkbox" name="check[]" value="'.$id_prodotto.'" style="margin:3px 0px 0px 3px;"/></td>
<td align="center">
<a href="gestione_prodotti.php?action=prodotti_edit&tipo='.$tipo.'&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'&id_prodotto='.$id_prodotto.'" title="MODIFICA PRODOTTO"><img src="images/btn_edit.png" alt="MODIFICA PRODOTTO" border="0"/></a>
<a href="gestione_prodotti_azione.php?action=prodotti_readd&tipo='.$tipo.'&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'&id_prodotto='.$id_prodotto.'" title="RIPUBBLICARE PRODOTTO" onclick="return confirm(\'ATTENZIONE. RIPUBBLICARE QUESTO PRODOTTO?\')"><img src="images/btn_readd.png" alt="RIPUBBLICARE PRODOTTO" border="0"/></a>
<a href="gestione_prodotti_azione.php?action=prodotti_duply&tipo='.$tipo.'&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'&id_prodotto='.$id_prodotto.'" title="DUPLICARE PRODOTTO" onclick="return confirm(\'ATTENZIONE. DUPLICARE QUESTO PRODOTTO?\')"><img src="images/btn_copy.png" alt="DUPLICARE PRODOTTO" border="0"/></a>
<a href="gestione_prodotti_azione.php?action=prodotti_delete&tipo='.$tipo.'&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'&id_prodotto='.$id_prodotto.'" title="ELIMINA PRODOTTO" onclick="return confirm(\'ATTENZIONE. ELIMINARE QUESTO PRODOTTO?\')"><img src="images/btn_delete.png" alt="ELIMINA PRODOTTO" border="0"/></a>
</td>
<td>'.$data_corretta.'</td>
<td><a href="'.$server.'/prodotto_leggi.php?id_prodotto='.$id_prodotto.'" target="_blank">'.$articolo_it.'</a></td>
<td align="center">'.$tag_offerta.'</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>Prodotti</b></td>
<th align="center"><b>Offerta</b></td>
<th align="center"><b>Stato</b></td>
</tr>
</tfoot>
</table>
</form>
';
if ( $numero_notizie > $limite ) { $pager->getPager(); }else{ echo''; }
}else{ echo'<p>Non esiste nessuno prodotto nell\'archivio!</p>'; }
echo'<p class="add_style"><a href="gestione_prodotti.php?action=prodotti_modulo_step1&act=step1&tipo='.$tipo.'&pages='.$pages.'&cat1='.$cat1.'&cat2='.$cat2.'&cat3='.$cat3.'&m='.$m.'&o='.$o.'" class="add_button">Aggiungi Prodotto</a></p>';
}
?>
</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>