prepare("$sql"); $res->execute(); list($tipo_cons,$id_cons) = $res->fetch(PDO::FETCH_NUM); include("modules/Elezioni/funzionidata.php"); include("modules/Elezioni/ele.php"); if (isset($param['do'])) get_magic_quotes_gpc() ? $do=$param['do']:$do=addslashes($param['do']); else $do=''; if (isset($param['min'])) $min=intval($param['min']); else $min=0; if (isset($param['ok'])) get_magic_quotes_gpc() ? $ok=$param['ok']:$ok=addslashes($param['ok']); else $ok=''; if (isset($param['descrizione'])) get_magic_quotes_gpc() ? $descrizione=$param['descrizione']:$descrizione=addslashes($param['descrizione']); else $descrizione=''; if (isset($param['id_conf'])) $id_conf=intval($param['id_conf']); else $id_conf=''; if (isset($param['limite'])) get_magic_quotes_gpc() ? $limite=$param['limite']:$limite=addslashes($param['limite']); else $limite=''; if (isset($param['consin'])) get_magic_quotes_gpc() ? $consin=$param['consin']:$consin=addslashes($param['consin']); else $consin=''; if (isset($param['infpremio'])) get_magic_quotes_gpc() ? $infpremio=$param['infpremio']:$infpremio=addslashes($param['infpremio']); else $infpremio=''; if (isset($param['listinfsbar'])) get_magic_quotes_gpc() ? $listinfsbar=$param['listinfsbar']:$listinfsbar=addslashes($param['listinfsbar']); else $listinfsbar=''; if (isset($param['infminpremio'])) get_magic_quotes_gpc() ? $infminpremio=$param['infminpremio']:$infminpremio=addslashes($param['infminpremio']); else $infminpremio=''; if (isset($param['listinfconta'])) get_magic_quotes_gpc() ? $listinfconta=$param['listinfconta']:$listinfconta=addslashes($param['listinfconta']); else $listinfconta=''; if (isset($param['suppremio'])) get_magic_quotes_gpc() ? $suppremio=$param['suppremio']:$suppremio=addslashes($param['suppremio']); else $suppremio=''; if (isset($param['supsbarramento'])) get_magic_quotes_gpc() ? $supsbarramento=$param['supsbarramento']:$supsbarramento=addslashes($param['supsbarramento']); else $supsbarramento=''; if (isset($param['supminpremio'])) get_magic_quotes_gpc() ? $supminpremio=$param['supminpremio']:$supminpremio=addslashes($param['supminpremio']); else $supminpremio=''; if (isset($param['listsupconta'])) get_magic_quotes_gpc() ? $listsupconta=$param['listsupconta']:$listsupconta=addslashes($param['listsupconta']); else $listsupconta=''; #if (isset($param['infdisgiunto'])) get_magic_quotes_gpc() ? $infdisgiunto=$param['infdisgiunto']:$infdisgiunto=addslashes($param['infdisgiunto']); else $infdisgiunto=''; #if (isset($param['supdisgiunto'])) get_magic_quotes_gpc() ? $supdisgiunto=$param['supdisgiunto']:$supdisgiunto=addslashes($param['supdisgiunto']); else $supdisgiunto=''; if (isset($param['help'])) $help=intval($param['help']); /******************************************************/ /*Funzione di visualizzazione globale */ /*****************************************************/ function all() { global $tipo_cons,$param,$currentlang, $bgcolor1, $bgcolor2, $prefix, $dbi, $offset, $min, $id_cons,$id_cons_gen,$id_comune,$do,$id_conf, $language,$help; if (isset($help)) include("language/$language/ele_confcons.html"); echo "

"; //-----------------------visualizza blocco inserimento - $sql="SELECT * FROM ".$prefix."_ele_conf"; //da modificare $res = $dbi->prepare("$sql"); $res->execute(); $max = $res->rowCount(); $nuovo_gruppo=$max+1; echo "" .""; if ($do=='modify') { $sql="SELECT * FROM ".$prefix."_ele_conf where id_conf='$id_conf'"; $resl = $dbi->prepare("$sql"); $resl->execute(); $gru=$resl->fetch(PDO::FETCH_BOTH); $nuovo_gruppo=$gru['id_conf']; echo ""; }else{ $gru['id_conf']=$nuovo_gruppo;$gru['descrizione']='';$gru['limite']='';$gru['consin']='';$gru['infpremio']='';$gru['listinfsbar']='';$gru['listinfconta']='';$gru['supminpremio']='';$gru['infminpremio']='';$gru['suppremio']='';$gru['supsbarramento']='';$gru['listsupconta']=''; echo ""; } echo "" .""; $sel= ($gru['consin']==1) ? "selected":""; echo "" .""; echo "" ."" .""; $sel= ($gru['listinfconta']==1) ? "selected":""; echo"" .""; echo "" ."" .""; $sel= ($gru['listsupconta']==1) ? "selected":""; echo ""; if ($do=='modify') echo ""; else echo ""; echo ""; $sql="SELECT * FROM ".$prefix."_ele_conf"; $res = $dbi->prepare("$sql"); $res->execute(); $max = $res->rowCount(); $sql="select * from ".$prefix."_ele_conf ORDER BY id_conf LIMIT $min,$offset"; $result = $dbi->prepare("$sql"); $result->execute(); while(list($id_conf,$descrizione,$limite, $consin,$infpremio, $supsbarramento, $suppremio, $listinfsbar, $listinfconta, $listsupconta) = $result->fetch(PDO::FETCH_NUM)) { $bgcolor1=($bgcolor1==$_SESSION['bgcolor1'])?$_SESSION['bgcolor2']:$_SESSION['bgcolor1']; echo "" .""; /* ."" ."" ."" ."" ."" ."" ."" ."" */ echo ""; } echo "
"; // echo ""._NUM."".$gru['id_conf']."" echo ""._DESCR."
"._LIMITE.""._CONSIN."
"._SISTEMA_MAGGIORITARIO."
"._INFPREMIO.""._LISTINFSBAR."
"._INFMINPREMIO.""._LISTINFCONTA."
"._SISTEMA_PROPORZIONALE."
"._SUPPREMIO.""._SUPSBAR."
"._SUPMINPREMIO.""._LISTSUPCONTA.""; echo "" ."" ."
$id_conf$descrizione$limite$consin$infpremio$supsbarramento$suppremio$listinfsbar$listinfconta$listsupconta[ "._EDIT."]"; if (!isset($numtemp)) echo "["._DELETE." ]"; else echo "["._DELETE." ]"; echo "
"; // #'Pagina precedente' e 'Pagina Successiva' echo""; $prev=$min-$offset; if ($prev>=0) { echo ""; } $next=$min+$offset; if ($next>=($offset-1)) { if($next>=$max) $next = $max; else { echo ""; } } echo "
"; echo "$offset "._PREV_MATCH.""; echo "$offset "._NEXT_MATCH."

"; } //*********************************************************** //Funzione di inserimento e gestione dei gruppi //************************************************************ function confcons($ok, $do) { global $prefix, $dbi, $id_cons,$simbolo2,$genere,$id_cons_gen,$id_comune,$min,$id_conf,$descrizione, $limite,$consin,$infpremio,$listinfsbar,$infminpremio,$listinfconta,$supsbarramento,$suppremio,$supminpremio,$listsupconta; $aid=$_SESSION['aid']; $perms=ChiSei($id_cons_gen); if ($perms >128) { if ($do == "delete") { if ($ok !="1") { ele(); echo "


"._DOMCANCELLA." "._DESCR." $descrizione ?
"; echo "[ "._NO." ] - ["._YES." ]";exit; }else{ $sql="delete from ".$prefix."_ele_conf where id_conf='$id_conf'"; $result = $dbi->prepare("$sql"); $result->execute(); if (!$result->rowCount()) return; Header("Location: admin.php?op=confconsiglio&id_cons_gen=$id_cons_gen&id_conf=$id_conf&min=$min"); } } elseif ($do == "add") { if ($descrizione) { $sqlset=''; $sql="insert into ".$prefix."_ele_conf(id_conf,descrizione, limite,consin,infpremio,supsbarramento,suppremio,listinfsbar,listinfconta,listsupconta,infminpremio,supminpremio) values ('$id_conf','$descrizione','$limite','$consin','$infpremio','$supsbarramento','$suppremio','$listinfsbar','$listinfconta','$listsupconta','$infminpremio','$supminpremio')"; $result = $dbi->prepare("$sql"); $result->execute(); if (!$result->rowCount()) return; Header("Location: admin.php?op=confconsiglio&id_cons_gen=$id_cons_gen&min=$min"); } else { ele(); OpenTable(); echo "
"._GESTIONE." "._CONF." "; echo "

"._IMM." "._CONF."
"; CloseTable(); } } elseif ($do == "update") { $sql="update ".$prefix."_ele_conf set descrizione='$descrizione', limite='$limite', consin='$consin', infpremio='$infpremio', supsbarramento='$supsbarramento', suppremio='$suppremio', listinfsbar='$listinfsbar', listinfconta='$listinfconta', listsupconta='$listsupconta', infminpremio='$infminpremio', supminpremio='$supminpremio' where id_conf='$id_conf' "; $result = $dbi->prepare("$sql"); $result->execute(); Header("Location: admin.php?op=confconsiglio&id_cons_gen=$id_cons_gen&min=$min"); } } } if ($do and $do!="modify") confcons($ok, $do); ele(); all(); echo""; include("footer.php"); ?>