prepare("$sql");
$sth->execute();
$row = $sth->fetch(PDO::FETCH_BOTH);
if(isset($row[0])) {
$idwid=$row[0];
$id = intval($idwid);
} else $id=0;
if (empty($id)) { // inserisce widget db se non esiste
$sql="insert into ".$prefix."_ele_widget (id,nome_file,titolo,pos_or,pos_ver, attivo) values ( NULL,'$files', '$files','1','','0')";
$sth = $dbi->prepare("$sql");
$sth->execute(); }
}
}
# se non esiste cancella dal db
$sql="SELECT * FROM ".$prefix."_ele_widget";
$sth = $dbi->prepare("$sql");
$sth->execute();
$row2 = $sth->fetchAll();
foreach($row2 as $row){
$esi=0;
for ($i=0; $i < sizeof($tlist); $i++) {
$files=$tlist[$i];
if($row['nome_file']==$files) $esi=1;
}
if($esi!=1){
$sql="DELETE FROM ".$prefix."_ele_widget WHERE id = '$row[id]'";
$sth = $dbi->prepare("$sql");
$sth->execute();
}
}
/******************************************************/
/*Funzione di visualizzazione globale */
/*****************************************************/
function all() {
global $tipo_cons,$param,$currentlang, $bgcolor1, $bgcolor2, $prefix, $prefix2, $dbi, $offset, $min, $id_cons,$id_cons_gen,$id_comune,$do,$tema;
$sql="SELECT * FROM ".$prefix."_ele_widget order by pos_or,pos_ver asc";
$sth = $dbi->prepare("$sql");
$sth->execute();
$row2 = $sth->fetchAll();
echo "
"._CONFIGWIDGET." |