prepare("$sql"); $res->execute(); list($descr_cons,$tipo_cons,$id_cons) = $res->fetch(PDO::FETCH_NUM); include("modules/Elezioni/ele.php"); include("inc/funzioni.php"); function come() { global $admin, $bgcolor1, $bgcolor2, $prefix, $dbi, $id_cons, $tipo_cons, $id_cons,$id_cons_gen, $editimage1, $add_content, $add_preamble, $add_title, $vai,$mid,$tab,$op,$editor; if ($tab=='_ele_come') echo "
"._ADMINCOME."

"; elseif ($tab=='_ele_numeri') echo "
"._ADMINNUMERI."

"; elseif ($tab=='_ele_servizi') echo "
"._ADMINSERVIZI."

"; elseif ($tab=='_ele_link') echo "
"._ADMINLINK."

"; //echo "
"; echo "
"._ALLCOME."

\n \n \n \n"; $sql="select mid, title,preamble, content, editimage from ".$prefix.$tab." where id_cons='$id_cons'"; $result = $dbi->prepare("$sql"); $result->execute(); while(list($mid2, $title, $preamble, $content, $editimage) = $result->fetch(PDO::FETCH_NUM)) { echo "" ."" .""; } echo "
"._TITOLO." "._FUNZIONI." 
$title "._EDIT." - "._DELETE." " ."

"; echo "
"; echo "
"; if($vai=='editedit'){ $sql="select title, preamble,content, editimage from ".$prefix.$tab." WHERE mid='$mid' AND id_cons='$id_cons'"; $result = $dbi->prepare("$sql"); $result->execute(); list($add_title,$add_preamble, $add_content, $editimage) = $result->fetch(PDO::FETCH_NUM); } //25.05.2009 $sql="SELECT editor,ed_user FROM ".$prefix."_config"; $res = $dbi->prepare("$sql"); $res->execute(); list($editor,$ed_user) = $res->fetch(PDO::FETCH_NUM); // echo "
"._ADDCOME."

"; echo "
"; echo "
"._TITOLO.":


"; if ($op=="link"){ if ($add_preamble=='')$add_preamble="http://"; echo ""._LINK.":
" ."

"; }else{ echo ""._PREAMBOLO.":
"; //25 maggio 2009 if ($editor=="1"){ // cambiato ckeditori giugno 2015 echo "

"; // old fckeditor //js_textarea("add_preamble", "$add_preamble", "$ed_user", "80", "10"); // 25 --> 24 maggio 2009 editor' }else{ echo "

"; } // echo "

"; } if ($op=='come') echo _CONTENUTO; elseif ($op=='numeri') echo _NUMERITEL; elseif ($op=='servizi') echo _DESCRAPP; elseif ($op=='link') echo _DESCRLINK; echo ":
"; //( "._HELPHTML." )
"; //25 maggio 2009 if ($editor=="1") echo "

"; // js_textarea("add_content", "$add_content", "$ed_user", "80", "20"); // 25 -->24 maggio 2009 editor old else echo "

"; // echo "

"; echo "" ."" ."" .""; if ($vai=='editedit'){ echo "" .""; }else{ echo "" .""; } echo ""; echo "
"; echo""; include ("footer.php"); } function saveedit($mid, $title, $preamble, $content) { global $prefix, $dbi,$id_cons,$id_cons_gen,$tab,$op; $temp=$title.$preamble.$content; if (preg_match("/script/i",$temp)) die("La parola script e' proibita, devi toglierla dal testo."); $sql="update ".$prefix.$tab." set title='$title', preamble='$preamble', content='$content' WHERE mid='$mid' AND id_cons='$id_cons'"; $res = $dbi->prepare("$sql"); $res->execute(); Header("Location: admin.php?op=$op&vai=come&id_cons_gen=$id_cons_gen"); } function addedit($add_title, $add_preamble, $add_content) { global $prefix, $dbi,$id_cons, $id_cons_gen,$tab,$op; $sql="insert into ".$prefix.$tab." (id_cons,title,preamble,content) values ('$id_cons', '$add_title', '$add_preamble','$add_content')"; $res = $dbi->prepare("$sql"); $res->execute(); if (!$res->rowCount()) { exit(); } Header("Location: admin.php?op=$op&vai=come&id_cons_gen=$id_cons_gen"); } function deleteedit($mid, $ok=0) { global $prefix, $dbi, $id_cons,$id_cons_gen,$tab,$op; if($ok) { $sql="delete from ".$prefix.$tab." where mid=$mid and id_cons='$id_cons'"; $res = $dbi->prepare("$sql"); $res->execute(); if (!$res->rowCount()) { return; } Header("Location: admin.php?op=$op&vai=come&id_cons_gen=$id_cons_gen"); } else { ele(); OpenTable(); echo "
"._ADMINCOME."
"; CloseTable(); echo "
"; OpenTable(); echo "
"._REMOVEINFO.""; echo "

[ "._NO." | "._YES." ]
"; CloseTable(); echo""; include("footer.php"); } } switch ($vai){ // or "come" or "servizi" or "editedit" case "come": ele(); come(); break; case "editedit": ele(); come(); break; case "saveedit": saveedit($mid, $add_title, $add_preamble,$add_content); break; case "numeri": ele(); come(); break; case "servizi": ele(); come(); break; case "link": ele(); come(); break; case "addedit": addedit($add_title, $add_preamble,$add_content); break; case "deleteedit": deleteedit($mid, $ok); break; } ?>