function ripristina(t,n,id){ if(t=='r')m1='la rubrica' if(t=='s')m1='la sottorubrica' if(t=='a')m1='l\'articolo' a=confirm('Ripristinare '+m1+' \''+n+'\' ('+id+')?') if(a)document.location.href= modUrl +'&info=articoli&info2=cestino&mode=rip&type='+t+'&id='+id } function change(t){ if(t==1){m1='la rubrica';m2='la sottorubrica'}else{m1='la sottorubrica';m2='l\'articolo'} alert('Selezionare tra quelle esistenti '+m1+' nella quale inserire '+m2); document.getElementById('chg').style.display='block'; } function subChg(t){ a=document.getElementById('newSup').value; b=document.getElementById('newSup').options[document.getElementById('newSup').selectedIndex].text; document.location.href= modUrl +'&info=articoli&info2=cestino&mode=rip&type='+ t +'&id=".$id."&new='+ a +'&nome='+b } function empty(){ a = confirm('Vuoi svuotare completamente il cestino?'); if(a)document.location.href= modUrl +'&info=articoli&info2=cestino&mode=empty'; }

".$cmz['148'];if($type=='s')echo $cmzLabel['53'];else echo $cmzLabel['149']; echo "

   

"; //RIPRISTINA if($mode=="rip"){ //rubrica if($type=='r'){ $q = "UPDATE CMZ_rubriche SET cancellato=0,cancellato_data='',visibile=1 WHERE idr=".$id; $conn->Execute($q); echo ""; } //sottorubrica if($type=='s'){ $q = "SELECT CMZ_rubriche.idr,CMZ_rubriche.cancellato,CMZ_rubriche.nome FROM CMZ_rubriche INNER JOIN CMZ_sottorubriche ON CMZ_rubriche.idr=CMZ_sottorubriche.idr WHERE idsr=".$id; $r = $conn->Execute($q); $rw = $r->fields; if(!$rw['cancellato'] && !$conf){ $q = "UPDATE CMZ_sottorubriche SET cancellato=0,cancellato_data='',visibile=1 WHERE idsr=".$id; $conn->Execute($q); echo ""; } else { if(!$conf && !$new){ echo ""; } else{ if($new){ $q = "UPDATE CMZ_sottorubriche SET cancellato=0,cancellato_data='',visibile=1,idr=".$new." WHERE idsr=".$id; $conn->Execute($q); $nm = $_GET['nome']; } else{ $q = "UPDATE CMZ_rubriche SET cancellato=0,cancellato_data='',visibile=1 WHERE idr=".$rw['idr']; $conn->Execute($q); $q = "UPDATE CMZ_sottorubriche SET cancellato=0,cancellato_data='',visibile=1 WHERE idsr=".$id; $conn->Execute($q); $nm = $rw['nome']; } echo ""; } } } //articolo if($type=='a'){ $q = "SELECT CMZ_sottorubriche.idsr,CMZ_sottorubriche.cancellato,CMZ_sottorubriche.nome,CMZ_rubriche.idr FROM CMZ_sottorubriche INNER JOIN CMZ_articoli ON CMZ_articoli.idsr=CMZ_sottorubriche.idsr INNER JOIN CMZ_rubriche ON CMZ_rubriche.idr=CMZ_sottorubriche.idr WHERE ida=".$id; $r = $conn->Execute($q); $rw = $r->fields; if(!$rw['cancellato'] && !$conf){ $q = "UPDATE CMZ_articoli SET cancellato=0,cancellato_data='',visibile=1 WHERE ida=".$id; $conn->Execute($q); echo ""; } else { if(!$conf && !$new){ echo ""; } else{ if($new){ $q = "UPDATE CMZ_articoli SET cancellato=0,cancellato_data='',visibile=1,idsr=".$new." WHERE ida=".$id; $conn->Execute($q); $nm = $_GET['nome']; } else{ $q = "UPDATE CMZ_rubriche SET cancellato=0,cancellato_data='',visibile=1 WHERE idr=".$rw['idr']; $conn->Execute($q); $q = "UPDATE CMZ_sottorubriche SET cancellato=0,cancellato_data='',visibile=1 WHERE idsr=".$rw['idsr']; $conn->Execute($q); $q = "UPDATE CMZ_articoli SET cancellato=0,cancellato_data='',visibile=1 WHERE ida=".$id; $conn->Execute($q); $nm = $rw['nome']; } echo ""; } } } } //FINE RIPRISTINA //SVUOTA if($mode=="empty"){ $q = "SELECT idr FROM CMZ_rubriche WHERE idu=".$idCustUser." AND cancellato=1"; $r = $conn->Execute($q); while(!$r->EOF){ $rw = $r->fields; $conn->Execute("DELETE FROM CMZ_rubriche WHERE idr=".$rw[idr]); $q2 = "SELECT idsr FROM CMZ_sottorubriche WHERE idr=".$rw[idr]." AND cancellato=1"; $r2 = $conn->Execute($q2); while(!$r2->EOF){ $rw2 = $r2->fields; $conn->Execute("DELETE FROM CMZ_sottorubriche WHERE idsr=".$rw2[idsr]); $q3 = "SELECT ida FROM CMZ_articoli WHERE idsr=".$rw2[idsr]." AND cancellato=1"; $r3 = $conn->Execute($q3); while(!$r3->EOF){ $rw3 = $r3->fields; $conn->Execute("DELETE FROM CMZ_articoli WHERE ida=".$rw3[ida]); $r3->MoveNext(); } $r2->MoveNext(); } $r->MoveNext(); } $q2 = "SELECT idsr FROM CMZ_sottorubriche INNER JOIN CMZ_rubriche ON CMZ_rubriche.idr=CMZ_sottorubriche.idr WHERE idu=".$idCustUser." AND CMZ_sottorubriche.cancellato=1"; $r2 = $conn->Execute($q2); while(!$r2->EOF){ $rw2 = $r2->fields; $conn->Execute("DELETE FROM CMZ_sottorubriche WHERE idsr=".$rw2[idsr]); $q3 = "SELECT ida FROM CMZ_articoli WHERE idsr=".$rw2[idsr]." AND cancellato=1"; $r3 = $conn->Execute($q3); while(!$r3->EOF){ $rw3 = $r3->fields; $conn->Execute("DELETE FROM CMZ_articoli WHERE ida=".$rw3[ida]); $r3->MoveNext(); } $r2->MoveNext(); } $q3 = "SELECT ida FROM CMZ_articoli INNER JOIN CMZ_rubriche ON CMZ_rubriche.idr=CMZ_sottorubriche.idr INNER JOIN CMZ_sottorubriche ON CMZ_sottorubriche.idsr=CMZ_articoli.idsr WHERE idu=".$idCustUser." AND CMZ_articoli.cancellato=1"; $r3 = $conn->Execute($q3); while(!$r3->EOF){ $rw3 = $r3->fields; $conn->Execute("DELETE FROM CMZ_articoli WHERE ida=".$rw3[ida]); $r3->MoveNext(); } echo ""; } //FINE SVUOTA echo "

Cestino

\n"; //rubriche $q = "SELECT idr,nome,cancellato_data FROM CMZ_rubriche WHERE idu=".$idCustUser." AND cancellato=1 ORDER BY cancellato_data DESC"; $r = $conn->Execute($q); if($r->RecordCount())echo ""; while(!$r->EOF){ $rw = $r->fields; echo ""; $d=1; $r->MoveNext(); } //sottorubriche $q = "SELECT idsr,CMZ_sottorubriche.nome,CMZ_sottorubriche.cancellato_data FROM CMZ_sottorubriche INNER JOIN CMZ_rubriche ON CMZ_sottorubriche.idr=CMZ_rubriche.idr WHERE idu=".$idCustUser." AND CMZ_sottorubriche.cancellato=1 ORDER BY CMZ_sottorubriche.cancellato_data DESC"; $r = $conn->Execute($q); if($r->RecordCount())echo ""; while(!$r->EOF){ $rw = $r->fields; echo ""; $d=1; $r->MoveNext(); } //articoli $q = "SELECT ida,CMZ_articoli.titolo,CMZ_articoli.cancellato_data FROM CMZ_articoli INNER JOIN CMZ_sottorubriche ON CMZ_articoli.idsr=CMZ_sottorubriche.idsr INNER JOIN CMZ_rubriche ON CMZ_sottorubriche.idr=CMZ_rubriche.idr WHERE idu=".$idCustUser." AND CMZ_articoli.cancellato=1 ORDER BY CMZ_articoli.cancellato_data DESC"; $r = $conn->Execute($q); if($r->RecordCount())echo ""; while(!$r->EOF){ $rw = $r->fields; echo ""; $d=1; $r->MoveNext(); } if(!$d)echo ""; echo "\n
Nome Data Canc -
Rubriche
".$rw['nome']." ".strftime("%d/%m/%Y %H:%M",$rw['cancellato_data'])." Ripristina
Sottorubriche
".$rw['nome']." ".strftime("%d/%m/%Y %H:%M",$rw['cancellato_data'])." Ripristina
Articoli
".$rw['titolo']." ".strftime("%d/%m/%Y %H:%M",$rw['cancellato_data'])." Ripristina
"; echo "\n

"; echo "\n<< Torna Agli Articoli | Svuota il cestino"; echo "\n

"; echo "\n
"; ?>