"; /******************************************************/ /*Funzione di visualizzazione globale */ /*****************************************************/ //crea la pagina delle affluenze function all() { global $bgcolor1, $bgcolor2, $prefix, $dbi, $offset, $min,$id_cons_gen,$language,$help; if (isset($help)) include("language/$language/ele_affluenze.html"); echo "


" ."" .""; # echo ""; echo ""; $row=getaffluenze(); $max = count($row); echo "" ."" ."" .""; echo ""; echo ""; echo ""; if ($max != "0") { $i=1; foreach($row as $aff) { $id_cons2=$aff[0]; $orario=$aff[1]; $data=$aff[2]; // esplode la data $bgcolor1=($bgcolor1==$_SESSION['bgcolor1'])?$_SESSION['bgcolor2']:$_SESSION['bgcolor1']; list($av1,$msv1,$gv1) = explode("-",$data); list($ov1,$mv1,$sv1) = explode(":",$orario); $i++; echo ""; echo ""; echo ""; echo "" .""; } } echo "
"._ORA.""._DATA."  
"; echo ""; minuti(); echo ""; $aff = daticonsultazione(); $data=$aff['data_inizio'];$fine=$aff['data_fine']; list ($anno,$mese,$giorno)=explode('-',$data); list ($annof,$mesef,$giornof)=explode('-',$fine); echo ""; mese(); echo "" ."
 
$ov1,$mv1$gv1-$msv1-$av1
" .""; echo "" .""; echo "" ."" ."" ."" ."" ."" ."" ."
"; } // memorizza le affluenze function rec_add_aff($do,$ov,$mv,$gv,$msv,$av,$tipo,$ok, $modello) { global $prefix, $dbi,$id_cons_gen; $perms=ChiSei(0); if ($perms<256) die("Non hai i permessi per eseguire questa operazione!"); $data="$av-$msv-$gv"; $orario="$ov:$mv:00"; $row = daticonsultazione(); # mysql_query("SELECT data_inizio, data_fine FROM ".$prefix."_ele_consultazione WHERE id_cons_gen ='$id_cons_gen'", $dbi); $dadata=$row['data_inizio']; $adata=$row['data_fine']; $dadata=strtotime($dadata); $adata=strtotime($adata); $cdata=strtotime($data); // verifica se data e ora esiste e fa l'upgrade $sql = "select * from ".$prefix."_ele_rilaff where id_cons_gen='$id_cons_gen' and data='$data' and orario='$orario'"; $sth = $dbi->prepare("$sql"); $sth->execute(); $row = $sth->fetchAll(); $tipo= $sth->rowCount(); if(($tipo==0) and ($dadata <= $cdata) and ($adata >= $cdata)){ if(checkdate(intval($msv),intval($gv),intval($av))){ $sql="insert into ".$prefix."_ele_rilaff values ('$id_cons_gen','$orario','$data')"; $sth = $dbi->prepare("$sql"); $sth->execute(); } Header("Location: admin.php?op=rec_add_aff&id_cons_gen=$id_cons_gen"); } elseif ($do==2) { if ($ok !="1") { ele(); OpenTable(); echo "


"._DOMCANCELLA." ?
"; echo "[ "._NO." ] - ["._YES." ]"; CloseTable(); include("footer.php"); die(); }else{ $sql = "select id_cons from ".$prefix."_ele_cons_comune where id_cons_gen='$id_cons_gen'"; $sth = $dbi->prepare("$sql"); $sth->execute(); $row2 = $sth->fetchAll(); foreach($row2 as $id_cons2) { $sql = "delete from ".$prefix."_ele_voti_parziale where id_cons='$id_cons2' and data='$data' and orario='$orario'"; $sth = $dbi->prepare("$sql"); $sth->execute(); } $sql = "delete from ".$prefix."_ele_rilaff where id_cons_gen='$id_cons_gen' and data='$data' and orario='$orario'"; $sth = $dbi->prepare("$sql"); $sth->execute(); Header("Location: admin.php?op=rec_add_aff&id_cons_gen=$id_cons_gen&contr=$data"); } }else{ Header("Location: admin.php?op=rec_add_aff&id_cons_gen=$id_cons_gen&contr=$data"); } } if($do) rec_add_aff($do,$ov,$mv,$gv,$msv,$av,$tipo,$ok, $modello); ele(); OpenTable(); all(); CloseTable(); include("footer.php"); ?>