Changeset 336
- Timestamp:
- Sep 23, 2020, 11:32:27 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/admin.php
r333 r336 252 252 $sth = $dbi->prepare("select id_cons_gen from ".$prefix."_ele_cons_comune where preferita='1' and (id_comune='$id_comune' or id_comune=0)"); 253 253 $sth->execute(); 254 $row = $sth->fetch(PDO::FETCH_BOTH); 255 $id_cons_gen=$row[0]; 254 $row = $sth->fetch(PDO::FETCH_BOTH); 255 if($sth->rowCount()) 256 $id_cons_gen=$row[0]; 257 else 258 $id_cons_gen=0; 256 259 } 257 260 $currentlang=$_SESSION['lang']; -
trunk/admin/modules/Elezioni/ele.php
r297 r336 44 44 include_once("modules/Elezioni/query.sql"); 45 45 46 $row=setconsultazione(); $tipo_cons=$row[0]; $descr_cons=$row[1];$id_cons_gen=$row[2]; 47 $row=tipocons(); $genere=$row[0];$votog=$row[1];$votol=$row[2];$votoc=$row[3];$conscirc=$row[4]; 46 $row=setconsultazione(); 47 if(isset($row[0])) { 48 $tipo_cons=$row[0]; $descr_cons=$row[1]; $id_cons_gen=$row[2]; 49 } else { 50 $tipo_cons=0; $descr_cons=''; $id_cons_gen=0; 51 } 52 $row=tipocons(); 53 if(isset($row[0])) { 54 $genere=$row[0];$votog=$row[1];$votol=$row[2];$votoc=$row[3];$conscirc=$row[4]; 55 } else { 56 $genere=0;$votog=0;$votol=0;$votoc=0;$conscirc=0; 57 } 48 58 49 59 if (!$perms) $perms=ChiSei($id_cons_gen); -
trunk/admin/modules/Elezioni/ele_affluenze.php
r256 r336 126 126 $orario="$ov:$mv:00"; 127 127 $row = daticonsultazione(); 128 # mysql_query("SELECT data_inizio, data_fine FROM ".$prefix."_ele_consultazione WHERE id_cons_gen ='$id_cons_gen'", $dbi); 129 $dadata=$row['data_inizio']; $adata=$row['data_fine']; 130 $dadata=strtotime($dadata); 131 $adata=strtotime($adata); 132 $cdata=strtotime($data); 128 $dadata=$row['data_inizio']; $adata=$row['data_fine']; 129 $dadata=strtotime($dadata); 130 $adata=strtotime($adata); 131 $cdata=strtotime($data); 133 132 // verifica se data e ora esiste e fa l'upgrade 134 133 $sql = "select * from ".$prefix."_ele_rilaff where id_cons_gen='$id_cons_gen' and data='$data' and orario='$orario'"; 135 134 $sth = $dbi->prepare("$sql"); 136 135 $sth->execute(); 137 # $row = $sth->fetchAll();138 136 $tipo= $sth->rowCount(); 139 137 if(($tipo==0) and ($dadata <= $cdata) and ($adata >= $cdata)){ -
trunk/admin/modules/Elezioni/ele_confcons.php
r317 r336 59 59 global $tipo_cons,$param,$currentlang, $bgcolor1, $bgcolor2, $prefix, $dbi, $offset, $min, $id_cons,$id_cons_gen,$id_comune,$do,$id_conf, $language,$help; 60 60 61 // $restemp = mysql_query("select count(0) from ".$prefix."_ele_conf where id_conf='$id_conf'", $dbi);62 // list($numtemp)=mysql_fetch_row($restemp);63 64 61 if (isset($help)) include("language/$language/ele_confcons.html"); 65 66 62 echo "<center><br><table border=\"0\" width=\"100%\">"; 67 63 -
trunk/admin/modules/Elezioni/ele_configurazione.php
r257 r336 29 29 include("modules/Elezioni/ele.php"); 30 30 $row=cur_cons(); 31 $tipo_cons=$row[0];$id_cons=$row[1]; 31 if(isset($row[0])) {$tipo_cons=$row[0];$id_cons=$row[1];} else {$tipo_cons=0; $id_cons=0;} 32 32 33 33 if (isset($param['do'])) get_magic_quotes_gpc() ? $do=$param['do']:$do=addslashes($param['do']); else $do=''; … … 63 63 global $tipo_cons,$param,$currentlang, $bgcolor1, $bgcolor2, $prefix, $prefix2, $dbi, $offset, $min, $id_cons,$id_cons_gen,$id_comune,$do,$tema,$language,$help; 64 64 global $gkey,$ed_user,$googlemaps,$editor,$tema_on; 65 // $restemp = mysql_query("select count(0) from ".$prefix."_ele_conf where tema='$tema'", $dbi);66 // list($numtemp)=mysql_fetch_row($restemp);67 65 68 66 … … 234 232 $sth = $dbi->prepare("$sql"); 235 233 $sth->execute(); 236 $row = $sth->fetch(PDO::FETCH_BOTH); 237 $id = intval($row[0]); 238 234 if($sth->rowCount()) { 235 $row = $sth->fetch(PDO::FETCH_BOTH); 236 $id = intval($row[0]); 237 } else { 238 $id=0; 239 } 239 240 if (empty($id)) { // inserisce widget db se non esiste 240 241 $sql="insert into ".$prefix."_ele_temi (id,tema) values ( NULL,'$files')"; -
trunk/admin/modules/Elezioni/ele_consultazioni.php
r306 r336 55 55 if (!isset($min)) $min=0; 56 56 if (isset($param['id_cons_gen'])){ 57 $id_cons_gen=intval($param['id_cons_gen']); 58 $row=descr_cons(); 59 $tipo_cons=$row[0]; 60 #$res = mysql_query("SELECT tipo_cons FROM ".$prefix."_ele_consultazione where id_cons_gen=$id_cons_gen " , $dbi); 61 #list($tipo_cons) = mysql_fetch_row($res); 57 $id_cons_gen=intval($param['id_cons_gen']); 58 $row=descr_cons(); 59 if(isset($row[0])) $tipo_cons=$row[0]; else $tipo_cons=0; 62 60 } else { 63 $id_cons_gen=0;64 $tipo_cons=0;61 $id_cons_gen=0; 62 $tipo_cons=0; 65 63 } 66 64 /******************************************************/ -
trunk/admin/modules/Elezioni/ele_desc_fasce.php
r189 r336 13 13 if (isset($_GET['fascia'])) $fasciacom=intval($_GET['fascia']); else $fasciacom=0; 14 14 include("../../config.php"); 15 $dbi=mysql_connect($dbhost, $dbuname, $dbpass) or die("Connessione non riuscita: " . mysql_error()); 16 mysql_select_db($dbname)or die("Connessione non riuscita:" . mysql_error()); 17 mysql_query("SET NAMES 'utf8'", $dbi); 18 $rescomu = mysql_query("SELECT id_fascia,abitanti from ".$prefix."_ele_fasce where id_conf='$id_conf'", $dbi); 19 20 echo "<select name=\"idfascia\">"; 21 echo "<option value=\"0\"> "; 22 $inffascia=0; 23 while(list($id,$abitanti)=mysql_fetch_row($rescomu)){ 24 $sel=''; 25 if ($id == $fasciacom) $sel="selected"; elseif ($id==1) $sel="selected"; 26 echo "<option value=\"$id\" $sel>$inffascia - $abitanti"; 27 $inffascia=$abitanti; 28 } 29 echo "</select>"; 15 try{ 16 $dbi = new PDO("mysql:host=$dbhost;charset=latin1", $dbuname, $dbpass, array(PDO::ATTR_EMULATE_PREPARES => false, PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION)); 17 $sql = "use $dbname"; 18 $dbi->exec($sql); 19 } 20 catch(PDOException $e) 21 { 22 echo $sql . "<br>" . $e->getMessage(); 23 } 24 $sql="SELECT id_fascia,abitanti from ".$prefix."_ele_fasce where id_conf='$id_conf'"; 25 $sth = $dbi->prepare("$sql"); 26 $sth->execute(); 27 echo "<select name=\"idfascia\">"; 28 echo "<option value=\"0\"> "; 29 $inffascia=0; 30 while(list($id,$abitanti)=$sth->fetch(PDO::FETCH_NUM)){ 31 $sel=''; 32 if ($id == $fasciacom) $sel="selected"; elseif ($id==1) $sel="selected"; 33 echo "<option value=\"$id\" $sel>$inffascia - $abitanti"; 34 $inffascia=$abitanti; 35 } 36 echo "</select>"; 30 37 31 38 ?> -
trunk/admin/modules/Elezioni/ele_lista.php
r258 r336 57 57 $circo=''; 58 58 $sql="SELECT circo FROM ".$prefix."_ele_tipo where tipo_cons='$tipo_cons'"; 59 # $res = mysql_query("SELECT circo FROM ".$prefix."_ele_tipo where tipo_cons='$tipo_cons' and lingua='$currentlang'", $dbi);60 59 $res = $dbi->prepare("$sql"); 61 60 $res->execute(); -
trunk/admin/modules/Elezioni/ele_operatori_admin.php
r257 r336 138 138 if ($do == "add") { 139 139 if ($aid2) { 140 # $result = mysql_query("select * from ".$prefix."_ele_operatori where aid='$aid2'", $dbi);141 140 $sql="insert into ".$prefix."_ele_operatori (id_cons,id_sede,id_comune,permessi,aid) values ('0','0','$id_comune2','$permessi','$aid2')"; 142 141 $res = $dbi->prepare("$sql"); -
trunk/admin/modules/Elezioni/ele_widget.php
r256 r336 25 25 26 26 $id_comune=$_SESSION['id_comune']; 27 #$res = mysql_query("SELECT t1.tipo_cons,t2.id_cons FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_cons_gen='$id_cons_gen' and t2.id_comune='$id_comune' " , $dbi);28 27 29 28 include("modules/Elezioni/funzionidata.php"); 30 29 include("modules/Elezioni/ele.php"); 31 30 $row=cur_cons(); 32 $tipo_cons=$row[0];$id_cons=$row[1]; 31 if(isset($row[0])) {$tipo_cons=$row[0];$id_cons=$row[1];} else {$tipo_cons=0; $id_cons=0;} 33 32 34 33 if (isset($param['do'])) get_magic_quotes_gpc() ? $do=$param['do']:$do=addslashes($param['do']); else $do=''; … … 68 67 $sth->execute(); 69 68 $row = $sth->fetch(PDO::FETCH_BOTH); 70 $idwid=$row[0]; 71 $id = intval($idwid); 69 if(isset($row[0])) { 70 $idwid=$row[0]; 71 $id = intval($idwid); 72 } else $id=0; 72 73 73 74 if (empty($id)) { // inserisce widget db se non esiste -
trunk/admin/modules/Elezioni/importa.php
r334 r336 278 278 include("footer.php"); 279 279 280 281 282 283 284 285 286 287 288 289 290 /* 291 foreach ($ar_gruppo as $rigagruppo){ 292 $newidg=0; 293 $oldidg=0; 294 foreach($rigagruppo as $key=>$campo){ 295 if ($key==0) $valori="'$idcns',"; 296 elseif ($key==1) {$valori.= "null"; $oldidg=$campo;} 297 elseif ($key==6) $valori.= ",0"; 298 else $valori.= ",'$campo'"; 299 if ($key==2) $numgruppo= $campo; 300 } 301 if(isset($valori)){ 302 $res_gruppo = mysql_query("insert into ".$prefix."_ele_gruppo values($valori)" ,$dbi)||die("(1104) Non e' stato possibile inserire i gruppi nel database! contattare l'amministratore".mysql_error()); 303 $resnew = mysql_query("select id_gruppo from ".$prefix."_ele_gruppo where num_gruppo='$numgruppo' and id_cons='$idcns'" ,$dbi); 304 list ($newidg) = mysql_fetch_row($resnew); 305 unset($valori); 306 foreach ($ar_lista as $rigalista){ 307 $oldidl=0; 308 foreach($rigalista as $key=>$campo){ 309 if ($key==0) $valori="'$idcns',"; 310 elseif ($key==1) {$valori.= "null";$oldidl=$campo;} 311 elseif ($key==3) {$valori.= ",'$newidg'"; if ($campo!=$oldidg) $okl=1;} 312 elseif ($key==4) $valori.= ",0"; 313 else $valori.= ",'$campo'"; 314 if ($key==2) $numlista= $campo; 315 } 316 if(isset($valori)){ 317 if ($okl) {$okl=0;continue;} 318 $res_lista = mysql_query("insert into ".$prefix."_ele_lista values($valori)" ,$dbi)||die("(1104) Non e' stato possibile inserire le liste nel database! contattare l'amministratore".mysql_error()); 319 $reslnew = mysql_query("select id_lista from ".$prefix."_ele_lista where num_lista='$numlista' and id_cons='$idcns'" ,$dbi); 320 list ($newidl) = mysql_fetch_row($reslnew); 321 unset($valori); 322 foreach ($ar_candi as $rigacandi){ 323 foreach($rigacandi as $key=>$campo){if (count($rigacandi)!=8) {unset($valori);continue;} 324 if ($key==0) $valori= "null,"; 325 elseif ($key==1) $valori.="'$idcns',"; 326 elseif ($key==2) {$valori.= "'$newidl'"; if ($campo!=$oldidl) $okc=1;} 327 else $valori.= ",'$campo'"; 328 } 329 if(isset($valori)){ 330 if ($okc) {$okc=0;continue;} 331 $res_lista = mysql_query("insert into ".$prefix."_ele_candidati values($valori)" ,$dbi)||die("(1104) Non e' stato possibile inserire i candidati nel database! contattare l'amministratore".mysql_error()); 332 } 333 } 334 } 335 } 336 } 337 } 338 */ 280 339 281 340 282 ?> -
trunk/admin/modules/Elezioni/restore.php
r257 r336 41 41 $currentLine = 0; 42 42 $cntFile = count($arrFile); 43 // $res_comune = mysql_query("delete from ".$prefix."_ele_lista where id_cons='10'" ,$dbi); if(!$res_comune) echo "delete ".$prefix."_ele_lista where id_cons='10'--- errore di cancellazione".mysql_error();44 43 // Write contents, inserting $item as first item 45 44 $tabs=array($prefix."_ele_cons_comune",$prefix."_ele_gruppo",$prefix."_ele_lista",$prefix."_ele_candidati",$prefix."_ele_circoscrizione",$prefix."_ele_sede",$prefix."_ele_sezioni",$prefix."_ele_link",$prefix."_ele_come",$prefix."_ele_numeri",$prefix."_ele_servizi",$prefix."_ele_voti_candidati",$prefix."_ele_voti_gruppo",$prefix."_ele_voti_lista",$prefix."_ele_voti_parziale",$prefix."_ele_voti_ref"); -
trunk/admin/modules/Elezioni/scarica.php
r284 r336 22 22 if ($perms<32 or !$id_cons_gen) die("Non hai i permessi per inserire dati, o non hai scelto la consultazione!"); 23 23 $id_comune=$_SESSION['id_comune']; 24 //$res = mysql_query("SELECT t1.tipo_cons,t2.id_cons FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_cons_gen='$id_cons_gen' and t2.id_comune='$id_comune' " , $dbi);25 //list($tipo_cons,$id_cons) = mysql_fetch_row($res);26 24 27 25 include("modules/Elezioni/funzionidata.php"); -
trunk/admin/temi/default/index.php
r256 r336 18 18 $sth->execute(); 19 19 $row = $sth->fetch(PDO::FETCH_BOTH); 20 $descr_consultazione=$row[0]; 20 if($sth->rowCount()) 21 $descr_consultazione=$row[0]; 22 else 23 $descr_consultazione=''; 21 24 $sql="select descrizione from ".$prefix."_ele_comuni where id_comune='$id_comune'"; 22 25 $sth = $dbi->prepare("$sql"); 23 26 $sth->execute(); 24 27 $row = $sth->fetch(PDO::FETCH_BOTH); 25 $descr_comune=$row[0]; 28 if($sth->rowCount()) 29 $descr_comune=$row[0]; 30 else 31 $descr_comune=''; 26 32 27 33 echo "<div class=\"container\"><table width=\"95%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"table-main\"> -
trunk/admin/temi/facebook/menu.php
r257 r336 58 58 $sth->execute(); 59 59 $row = $sth->fetch(PDO::FETCH_BOTH); 60 $esiste_multi= mysql_num_rows($rescomu);60 $esiste_multi=$sth->rowCount(); 61 61 if ($esiste_multi>=1) { 62 62 echo " <li> … … 129 129 ***********************************/ 130 130 131 $res = mysql_query("SELECT count(0) FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons' ", $dbi);132 131 $sql = "SELECT count(0) FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons'"; 133 132 $sth = $dbi->prepare("$sql"); -
trunk/admin/versione.php
r335 r336 1 1 <?php 2 2 3 $versione = "3.0 rev 33 5";3 $versione = "3.0 rev 336"; 4 4 $version_number = $versione; 5 $datarel = "2 2settembre 2020";5 $datarel = "23 settembre 2020"; 6 6 $version = "Eleonline $version_number (<i>Data Release: $datarel</i>)"; 7 7 -
trunk/client/versione.php
r335 r336 1 1 <?php 2 2 3 $versione = "3.0 rev 33 5";3 $versione = "3.0 rev 336"; 4 4 $version_number = $versione; 5 $datarel = "2 2settembre 2020";5 $datarel = "23 settembre 2020"; 6 6 $version = "Eleonline $version_number (<i>Data Release: $datarel</i>)"; 7 7 -
trunk/install/common.php
r2 r336 33 33 $arr[$name] = strip_tags( $arr[$name] ); 34 34 } 35 if (!get_magic_quotes_gpc()) { 36 $arr[$name] = addslashes( $arr[$name] ); 37 } 35 $arr[$name] = addslashes( $arr[$name] ); 38 36 } 39 37 return $arr[$name]; -
trunk/install/includes/database.php
r2 r336 1 <?php1 <?php 2 2 3 3 /************************************************************************/ … … 53 53 * @param boolean If true and there is an error, go offline 54 54 */ 55 function database( $host='localhost', $user, $pass, $db='', $table_prefix='', $goOffline=true ) {55 function __construct( $host='localhost', $user, $pass, $db='', $table_prefix='', $goOffline=true ) { 56 56 // perform a number of fatality checks, then die gracefully 57 57 if (!function_exists( 'mysql_connect' )) { … … 141 141 return $q . $s . $q; 142 142 } else { 143 return $q{0} . $s . $q{1}; 143 # return $q{0} . $s . $q{1}; 144 return $q[0] . $s . $q[1]; 144 145 } 145 146 } … … 227 228 } 228 229 $l = $k - 1; 229 while ($l >= 0 && $sql {$l} == '\\') {230 while ($l >= 0 && $sql[$l] == '\\') { #deprecated 230 231 $l--; 231 232 $escaped = !$escaped; … … 680 681 * @param string $key name of the primary key field in the table 681 682 */ 682 function mosDBTable( $table, $key, &$db ) {683 function __construct( $table, $key, &$db ) { 683 684 $this->_tbl = $table; 684 685 $this->_tbl_key = $key;
Note:
See TracChangeset
for help on using the changeset viewer.