- Timestamp:
- Jun 1, 2025, 5:13:02 PM (6 months ago)
- Location:
- trunk
- Files:
-
- 12 edited
-
admin/modules/Elezioni/importa.php (modified) (10 diffs)
-
admin/versione.php (modified) (1 diff)
-
client/footer.php (modified) (1 diff)
-
client/modules.php (modified) (3 diffs)
-
client/modules/Elezioni/affluenze-inc.php (modified) (2 diffs)
-
client/modules/Elezioni/consiglieri.php (modified) (4 diffs)
-
client/modules/Elezioni/grafici/raffrontivoto.php (modified) (1 diff)
-
client/modules/Elezioni/language/lang-en.php (modified) (1 diff)
-
client/temi/bootstrap/pagine/grafici/affluenza.php (modified) (5 diffs)
-
client/temi/bootstrap/pagine/grafici/affluenza_referendum.php (modified) (9 diffs)
-
client/temi/bootstrap/query.php (modified) (2 diffs)
-
client/versione.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/modules/Elezioni/importa.php
r466 r471 24 24 { 25 25 global $prefix, $dbi; 26 global $ar_gruppo,$ar_lista,$ar_candi,$idcns ;26 global $ar_gruppo,$ar_lista,$ar_candi,$idcns,$dbname; 27 27 28 28 foreach ($ar_gruppo as $rigagruppo){ … … 31 31 $isnew=0; 32 32 $numcampi=count($rigagruppo); 33 $sql="SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '$dbname' AND TABLE_NAME = '".$prefix."_ele_gruppo'"; 34 $resnew = $dbi->prepare("$sql"); 35 $resnew->execute(); 36 list ($campiloc) = $resnew->fetch(PDO::FETCH_NUM); 33 37 foreach($rigagruppo as $key=>$campo){ 34 38 if ($key==0) $valori="'$idcns',"; … … 40 44 else $valori.= ",'".$campo."'"; 41 45 if ($key==2) $numgruppo= $campo; 42 } 43 if($numcampi==10) $valori.=",'','',''";44 if (!$isnew and isset($valori)) $valori.=",null,null";45 if(isset($valori)){46 $sql="insert into ".$prefix."_ele_gruppo values($valori)";47 try {48 $res_gruppo = $dbi->prepare("$sql");49 $res_gruppo->execute();50 }51 catch(PDOException $e)52 {53 echo $sql . "<br>" . $e->getMessage();54 }55 $sql="select id_gruppo from ".$prefix."_ele_gruppo where num_gruppo='$numgruppo' and id_cons='$idcns'";56 $resnew = $dbi->prepare("$sql");57 $resnew->execute();58 list ($newidg) = $resnew->fetch(PDO::FETCH_NUM);59 unset($valori);60 if($oldidg){61 $_SESSION['gruppi']['idg_'.$oldidg]=$newidg;62 $_SESSION['gruppi']['numg_'.$numgruppo]=$numgruppo;63 }46 } 47 $i=$numcampi; 48 if($numcampi<$campiloc) while($i<$campiloc) {$valori.=",''";$i++;} 49 if(isset($valori)){ 50 $sql="insert into ".$prefix."_ele_gruppo values($valori)"; 51 try { 52 $res_gruppo = $dbi->prepare("$sql"); 53 $res_gruppo->execute(); 54 } 55 catch(PDOException $e) 56 { 57 echo $sql . "<br>" . $e->getMessage(); 58 } 59 $sql="select id_gruppo from ".$prefix."_ele_gruppo where num_gruppo='$numgruppo' and id_cons='$idcns'"; 60 $resnew = $dbi->prepare("$sql"); 61 $resnew->execute(); 62 list ($newidg) = $resnew->fetch(PDO::FETCH_NUM); 63 unset($valori); 64 if($oldidg){ 65 $_SESSION['gruppi']['idg_'.$oldidg]=$newidg; 66 $_SESSION['gruppi']['numg_'.$numgruppo]=$numgruppo; 67 } 64 68 } 65 69 } … … 68 72 function inslista() 69 73 { 70 global $prefix, $dbi ;74 global $prefix, $dbi,$dbname; 71 75 global $ar_lista,$idcns; 72 76 … … 85 89 } 86 90 else $newidg=0; 87 $ultimocampo=count($rigalista)-1; 91 $ultimocampo=count($rigalista); 92 $sql="SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '$dbname' AND TABLE_NAME = '".$prefix."_ele_lista'"; 93 $resnew = $dbi->prepare("$sql"); 94 $resnew->execute(); 95 list ($campiloc) = $resnew->fetch(PDO::FETCH_NUM); 88 96 foreach($rigalista as $key=>$campo){ 89 97 if ($key==0) $valori=$idcns.","; … … 92 100 elseif ($key==3) {$valori.= "'$newidg',"; if ($campo!=$oldidg) $okl=1;} 93 101 elseif ($key==4) $valori.= "$numgruppo,"; 94 elseif ($key== $ultimocampo) $valori.= "'$campo'";102 elseif ($key==($ultimocampo-1) ) $valori.= "'$campo'"; 95 103 else $valori.="'".$campo."',"; 96 104 } 97 if($ultimocampo==9) $valori.=",''"; 98 if($key==$ultimocampo){ 105 $i=$ultimocampo; 106 if($ultimocampo<$campiloc) while($i<$campiloc) {$valori.=",''";$i++;} 107 # if($ultimocampo==9) $valori.=",''"; 108 # if($key==$ultimocampo){ 99 109 if ($okl) {$okl=0;continue;} 100 110 $sql="insert into ".$prefix."_ele_lista values($valori)"; … … 105 115 catch(PDOException $e) 106 116 { 107 echo $sql . "<br>" . $e->getMessage(); 117 echo $sql . "<br>" . $e->getMessage(); die(); 108 118 } 109 119 … … 116 126 $_SESSION['liste']['idl_'.$oldidl]=$newidl; 117 127 } 118 }128 # } 119 129 } 120 130 } … … 122 132 function inscandi() 123 133 { 124 global $prefix, $dbi ;134 global $prefix, $dbi,$dbname; 125 135 global $ar_candi,$idcns; 136 $sql="SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '$dbname' AND TABLE_NAME = '".$prefix."_ele_lista'"; 137 $resnew = $dbi->prepare("$sql"); 138 $resnew->execute(); 139 list ($campiloc) = $resnew->fetch(PDO::FETCH_NUM); 126 140 foreach ($ar_candi as $rigacandi){ 127 141 if(!isset($rigacandi[2])) continue; … … 137 151 } 138 152 if(isset($valori) and $valori!=''){ 139 for($x=count($rigacandi);$x< 12;$x++) $valori.=",''";153 for($x=count($rigacandi);$x<$campiloc;$x++) $valori.=",''"; 140 154 if ($okc) {$okc=0;continue;} 141 155 $sql="insert into ".$prefix."_ele_candidati values($valori)"; -
trunk/admin/versione.php
r470 r471 1 1 <?php 2 2 3 $versione = "3.0 rev 47 0";3 $versione = "3.0 rev 471"; 4 4 $version_number = $versione; 5 $datarel = " 24 maggio 2025";5 $datarel = "01 giugno 2025"; 6 6 $version = "Eleonline $version_number (<i>Data Release: $datarel</i>)"; 7 8 7 ?> -
trunk/client/footer.php
r431 r471 6 6 /* info@eleonline.it luciano@aniene.net rgigli@libero.it */ 7 7 /************************************************************************/ 8 if ( $tema=='bootstrap') die();8 if (isset($tema) and $tema=='bootstrap') die(); 9 9 global $csv; 10 10 -
trunk/client/modules.php
r468 r471 119 119 # protezione csrf ottobre 2012 - by l.apolito 120 120 if (file_exists("inc/csrf-magic/csrf-magic.php")) { 121 include_once 'inc/csrf-magic/csrf-magic.php';121 # include_once 'inc/csrf-magic/csrf-magic.php'; 122 122 } 123 123 … … 262 262 $PHP_SELF=$_SERVER['PHP_SELF']; 263 263 $file=(isset($param['file'])) ? htmlentities($param['file']):"index"; 264 if($tema=='spectral' and $file!='foto') $file="index"; 264 265 $name=(isset($param['name'])) ? htmlentities($param['name']):"Elezioni"; 265 266 $op=(isset($param['op'])) ? htmlentities($param['op']):"gruppo"; … … 273 274 $sql->execute(); 274 275 list($id_cons) = $sql->fetch(PDO::FETCH_NUM); 275 276 $percorso=$name; 276 277 if(!file_exists("temi/$tema/index.php")) {$tema='default'; $_SESSION['tema']=$tema;} 277 if($tema=='bootstrap' and !$csv) { 278 $name='../temi/bootstrap'; 279 } 280 ########### 281 282 $modpath = "modules/$name/$file.php"; 278 if($name=='modelli') 279 $percorso='../modelli'; 280 else { 281 if($tema=='bootstrap' and !$csv) { 282 $percorso='../temi/bootstrap'; 283 } 284 ########### 285 } 286 $modpath = "modules/$percorso/$file.php"; 287 283 288 if (file_exists($modpath)) { 284 289 include($modpath); -
trunk/client/modules/Elezioni/affluenze-inc.php
r464 r471 31 31 $riga1=''; 32 32 $testacols=1; 33 $logo=''; 34 $immagine=''; 33 35 #echo "<center>"; 34 36 if($csv==1){ … … 41 43 $descr_com =stripslashes($descr_com); 42 44 # if($xls!=1) {$datipdf .= "<div style=\"width:40%; margin:0px auto;text-align:center;\">";} 45 $logo=verificasimbolo(); 46 $immagine= "<img src=\"modules/Elezioni/images/$logo\" alt=\"logo\">"; 43 47 $siteistat=$id_comune; 44 48 # salva sull'hardisk lo stemma del comune 45 $logo=verificasimbolo();46 $immagine= "<img src=\"modules/Elezioni/images/$logo\" alt=\"logo\">";47 49 $html=''; 48 50 if($xls!=1) { -
trunk/client/modules/Elezioni/consiglieri.php
r469 r471 181 181 echo "<form id=\"gruppo\" action=\"modules.php\">"; 182 182 echo "<table cellspacing=\"0\" cellpadding=\"2\" border=\"1\"><tr class=\"bggray\"><td colspan=\"4\">"._COLLEGAMENTI."</td></tr><tr class=\"bggray\"><td>"; 183 if($tema= 'bootstrap')183 if($tema=='bootstrap') 184 184 echo "<input type=\"hidden\" name=\"op\" value=\"31\"/>"; 185 185 else … … 211 211 echo "<form id=\"numgruppo\" action=\"modules.php\">"; 212 212 echo "<table><tr><td>"._SCELTASIN.":</td><td align=\"left\">"; 213 if($tema= 'bootstrap')213 if($tema=='bootstrap') 214 214 echo "<input type=\"hidden\" name=\"op\" value=\"31\"/>"; 215 215 else … … 681 681 682 682 function stampalista($ar) { 683 global $PNE,$CSEC,$stampa,$stampasind ;683 global $PNE,$CSEC,$stampa,$stampasind,$tema; 684 684 $cmin=_SEGGIMIN; 685 685 $csin=""; … … 751 751 $tmpstampa=ob_get_clean(); 752 752 $stampa=$stampasind.$tmpstampa; 753 # echo $stampa; 753 if(isset($tema) and $tema!='bootstrap') 754 echo $stampa; 754 755 } 755 756 -
trunk/client/modules/Elezioni/grafici/raffrontivoto.php
r105 r471 4 4 5 5 $titvoti=$_GET['titvoti']; 6 $titperc=$_GET['titperc'];6 if(isset($_GET['titperc']) $titperc=$_GET['titperc']; else $titperc=''; 7 7 $altro=$_GET['altro']; 8 8 $desc=$_GET['desc']; -
trunk/client/modules/Elezioni/language/lang-en.php
r318 r471 181 181 define("_VOTI_RAGGR","Sum of ballots"); 182 182 define("_SEDI","Election Site"); 183 define("_LISTA","List");183 if(!defined("_LISTA")) define("_LISTA","List"); 184 184 define("_LISTE","Lists"); 185 185 define("_TEST","If you wont to test Eleonline start inserting username \"suser\" and password \"test\""); -
trunk/client/temi/bootstrap/pagine/grafici/affluenza.php
r465 r471 20 20 if(count($rowpre)){ 21 21 $preidcg=$rowpre[0]['id_cons_gen']; 22 $row=dati_consultazione($preidcg); 23 $descr_cons=$row[0]['descrizione']; 22 24 $rowpre=conscomune($preidcg); 23 25 $preidcons=$rowpre[0][0]; … … 29 31 $voti_prec_percentuali=array(); 30 32 $voti_prec=array(); 33 if($num_aff!=$num_aff_pre) {$rowpre=array(array_pop($rowpre));$diff=1;$num_aff_pre=1;} else $diff=0; 31 34 foreach($rowpre as $val) { 32 35 while($num_aff>$num_aff_pre) { 33 $num_aff_pre++; #die("TESTpiu:$num_aff -- $num_aff_pre");34 36 array_unshift($voti_prec_percentuali,0); 35 37 array_unshift($voti_prec,0); 38 $num_aff_pre++; 36 39 } 37 40 if($num_aff<$num_aff_pre) { 38 $num_aff_pre--; #die("TESTmeno:$num_aff -- $num_aff_pre");41 $num_aff_pre--; 39 42 array_shift($voti_prec_percentuali); 40 43 array_shift($voti_prec); 41 44 continue; 42 45 } 43 44 # $labels[]=[$val[3],$val[4]."$tot"]; 45 $voti_prec_percentuali[]=number_format($val[2]/$totprec*100,2); 46 $voti_prec[]=number_format($val[2],0,'','.'); 46 $voti_prec_percentuali[]= $diff ? 0 : number_format($val[2]/$totprec*100,2); 47 $voti_prec[]= $diff ? 0 : number_format($val[2],0,'','.'); 47 48 } 49 if($diff) {array_shift($voti_prec_percentuali);array_shift($voti_prec);$voti_prec_percentuali[]=number_format($val[2]/$totprec*100,2);$voti_prec[]=number_format($val[2],0,'','.');} 50 48 51 }else{ 49 52 foreach($voti as $val){ … … 53 56 } 54 57 55 /*56 $labels = [57 ['01/03/2025', '14:00'],58 ['01/03/2025', '16:00'],59 ['01/03/2025', '18:00'],60 ['01/03/2025', '20:00']61 ];62 $voti_percentuali = [10, 24.7, 30, 47.5]; // Dati % attuali n.b. i decimali mettere il punto63 $voti = [700, 980, 1200, 2000]; // Voti attuali64 */65 // Affluenza precedente (valore zero o null non mette la barra)66 #$voti_prec_percentuali = [null, 15, 20, 35]; // Dati % Precedente67 #$voti_prec = [500, 600, 700, 1200]; // Dati dei voti68 58 ?> 69 59 <!-- Chart.js --> 70 60 <script src="temi/bootstrap/pagine/grafici/js/chart.umd.js"></script> 71 72 <!--style>73 #chartContainer {74 width: 100%;75 height: 400px;76 margin: 0 auto;77 }78 </style-->79 61 <style> 80 62 #chartContainer { … … 84 66 } 85 67 </style> 68 86 69 <div class="container"> 87 70 <div class="row text-center"> … … 140 123 } <?php if(count($rowpre)) { ?>, 141 124 { 142 label: 'Affluenza Precedente Consultazione',125 label: 'Affluenza Consultazione: <?php echo addslashes($descr_cons); if($diff) echo " (Dato Finale)";?>', 143 126 data: voti_prec_percentuali, 144 127 backgroundColor: 'rgba(70,130,180)', // Blu acciaio -
trunk/client/temi/bootstrap/pagine/grafici/affluenza_referendum.php
r468 r471 17 17 18 18 $row = affluenze_referendum($id_gruppo,0); 19 $num_aff=count($row); 19 20 $labels = array(); 20 21 $voti = array(); 21 22 22 23 foreach ($row as $val) { 23 if (!isset($votest[$val[0] . $val[2] . $val[3]])) {$votest[$val[0] . $val[2] . $val[3]] = $val[1]; $voto[]=$val[1];} 24 if (!isset($votest[$val[0] . $val[2] . $val[3]])) { 25 $votest[$val[0] . $val[2] . $val[3]] = $val[1]; 26 $voto[]=$val[1]; 27 } 24 28 $i = 0; 25 29 foreach ($labels as $val2) … … 35 39 $voti[]=number_format($val,0,'','.'); 36 40 } 37 # 41 # 42 38 43 $predescr=''; 39 44 $rowpre=precedente_consultazione();#array(); … … 48 53 $preid_gruppo=$rowpre[0][0]; 49 54 $rowpre=affluenze_referendum($preid_gruppo,$preidcons); 55 $num_aff_pre=count($rowpre); 50 56 # $labels=array(); 51 57 $voti_prec_percentuali=array(); 52 58 $voti_prec=array(); 59 if($num_aff!=$num_aff_pre) {$rowpre=array(array_pop($rowpre));$diff=1;$num_aff_pre=1;} else $diff=0; 53 60 foreach($rowpre as $val) { 54 # $labels[]=[$val[3],$val[4]."$tot"]; 61 while($num_aff>$num_aff_pre) { 62 array_unshift($voti_prec_percentuali,0); 63 array_unshift($voti_prec,0); 64 $num_aff_pre++; 65 } 66 55 67 $voti_prec_percentuali[]=number_format($val[1]/$totprec*100,2); 56 68 $voti_prec[]=number_format($val[1],0,'','.'); 57 69 } 70 # while(count($rowpre)<count($voti_prec)) 71 # array_unshift($rowpre,0); 72 73 # if($diff) {array_shift($voti_prec_percentuali);array_shift($voti_prec);$voti_prec_percentuali[]=number_format($val[1]/$totprec*100,2);$voti_prec[]=number_format($val[1],0,'','.');} 58 74 }else{ 59 75 foreach($voti as $val){ … … 62 78 } 63 79 } 64 65 80 ?> 66 81 <!-- Chart.js --> 67 82 <script src="temi/bootstrap/pagine/grafici/js/chart.umd.js"></script> 68 83 69 <style> 70 #chartContainer { 71 width: 100%; 72 height: 400px; 73 margin: 0 auto; 74 } 75 </style> 84 76 85 <!-- Blocco select quesito referendum --> 77 86 <div class="container pb-2"> … … 91 100 <h4 class="fw-semibold text-primary mobile-expanded mt-2">Affluenza</h4> 92 101 </div> 102 <?php #$oplink="come"; $infolink="affluenze_sez"; include 'temi/bootstrap/pagine/tab_link_opendata.php'; ?> 93 103 <div class="table-responsive overflow-x"> 94 104 <table class="table mb-0"> … … 96 106 <tr> 97 107 <th>Affluenza</th> 98 <?php $oplink="come"; $infolink="affluenze_sez"; include 'temi/bootstrap/pagine/tab_link_opendata.php'; ?>99 108 <?php if ($scrutinate == $sezionitotali) {?> 100 109 <th class="text-end">Dati finali</th> … … 110 119 </div> 111 120 </div> 112 121 <style> 122 #chartContainer { 123 width: 100%; 124 height: <?php echo min(300 + count($labels) * 30, 900); ?>px; /* L'altezza si adatta al numero di liste */ 125 margin: 0 auto; 126 } 127 </style> 113 128 <!-- Script per il grafico --> 114 129 <script> … … 116 131 117 132 // Passaggio dei dati PHP a JavaScript 118 119 120 133 var labels = <?php echo json_encode($labels); ?>; 121 134 var voti_percentuali = <?php echo json_encode($voti_percentuali); ?>; … … 145 158 } <?php if(count($rowpre)) { ?>, 146 159 { 147 label: 'Affluenza Precedente ( <?php if(strlen($predescr)>0) echo "$predescr)";?>',160 label: 'Affluenza Precedente ( <?php echo addslashes($predescr); if($diff) echo " (Dato Finale)";?>', 148 161 data: voti_prec_percentuali, 149 162 backgroundColor: 'rgba(70,130,180)', // Blu acciaio -
trunk/client/temi/bootstrap/query.php
r468 r471 500 500 if(isset($circo) and $circo) $filtro="and t1.id_circ='$idcirc'"; else $filtro=''; 501 501 if($i==1) $ordine='order by t2.num_circ'; else $ordine='order by t2.descrizione'; 502 $sql="select t1.id_sede,t1.indirizzo,t1.telefono1,t1.telefono2, t1.mappa, t1.filemappa,t2.descrizione,t2.num_circ from ".$prefix."_ele_sede as t1, ".$prefix."_ele_circoscrizione as t2 where t1.id_circ=t2.id_circ and t1.id_cons='$id_cons' $filtro $ordine";502 $sql="select t1.id_sede,t1.indirizzo,t1.telefono1,t1.telefono2, t1.mappa, t1.filemappa,t2.descrizione,t2.num_circ,t1.latitudine,t1.longitudine from ".$prefix."_ele_sede as t1, ".$prefix."_ele_circoscrizione as t2 where t1.id_circ=t2.id_circ and t1.id_cons='$id_cons' $filtro $ordine"; 503 503 $sth = $dbi->prepare("$sql"); 504 504 $sth->execute(); … … 580 580 { 581 581 global $id_cons_gen,$prefix,$dbi,$tipocons,$datainizio,$id_comune; 582 $sql="select t1.* from ".$prefix."_ele_consultazione as t1 left join ".$prefix."_ele_cons_comune as t2 on t2.id_cons_gen=t1.id_cons_gen where t2.id_comune=$id_comune and t2.chiusa<'2' and (t1.tipo_cons=$tipocons) and t1.data_inizio<'$datainizio' order by t1.data_inizio desc limit 0,1"; 582 $tipo=$tipocons; 583 if($tipocons==6 or $tipocons==11 or $tipocons==15 or $tipocons==18) $tipo="'6' or t1.tipo_cons='11' or t1.tipo_cons='15' or t1.tipo_cons='18'"; 584 if($tipocons==7 or $tipocons==10 or $tipocons==16 or $tipocons==19) $tipo="'7' or t1.tipo_cons='10' or t1.tipo_cons='16' or t1.tipo_cons='19'"; 585 586 $sql="select t1.* from ".$prefix."_ele_consultazione as t1 left join ".$prefix."_ele_cons_comune as t2 on t2.id_cons_gen=t1.id_cons_gen where t2.id_comune=$id_comune and t2.chiusa<'2' and (t1.tipo_cons=$tipo) and t1.data_inizio<'$datainizio' order by t1.data_inizio desc limit 0,1"; 583 587 $sth = $dbi->prepare("$sql"); 584 588 $sth->execute(); -
trunk/client/versione.php
r470 r471 1 1 <?php 2 $versione = "3.0 rev 47 0";2 $versione = "3.0 rev 471"; 3 3 $version_number = $versione; 4 $datarel = " 24 maggio 2025";4 $datarel = "01 giugno 2025"; 5 5 $version = "Eleonline $version_number (<i>Data Release: $datarel</i>)"; 6 7 6 ?>
Note:
See TracChangeset
for help on using the changeset viewer.
