Changeset 132 for trunk/client
- Timestamp:
- Jun 12, 2011, 1:56:35 PM (13 years ago)
- Location:
- trunk/client/modules/Elezioni
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/modules/Elezioni/grafici.php
r127 r132 26 26 27 27 function affluenze_graf(){ 28 global $bgcolor1, $bgcolor2, $prefix, $dbi, $offset,$genere,$votog,$votol,$votoc,$circo, $min,$id_cons,$tipo_cons,$id_cons_gen,$csv,$id_comune,$id_circ ;28 global $bgcolor1, $bgcolor2, $prefix, $dbi, $offset,$genere,$votog,$votol,$votoc,$circo, $min,$id_cons,$tipo_cons,$id_cons_gen,$csv,$id_comune,$id_circ, $tema; 29 29 // icone 30 30 if ($circo) $circos="and t2.id_circ='$id_circ'"; … … 89 89 // totali 90 90 91 if($tema=='tour') $andcond='data desc,orario desc limit 0,1'; else $andcond='data,orario'; 91 92 92 93 $res = mysql_query("select orario,data from ".$prefix."_ele_rilaff where id_cons_gen='$id_cons_gen' order by data,orario", $dbi); 93 $res = mysql_query("select orario,data from ".$prefix."_ele_rilaff where id_cons_gen='$id_cons_gen' order by $andcond", $dbi); 94 94 while(list($orario,$data) = mysql_fetch_row($res)) { 95 95 list ($ore,$minuti,$secondi)=explode(':',$orario); … … 158 158 159 159 function graf_votanti(){ 160 global $op, $prefix, $dbi, $offset, $min,$descr_cons,$genere,$votog,$votol,$votoc,$circo, $id_cons,$tipo_cons,$id_comune,$id_cons_gen,$id_circ,$csv,$w,$l,$siteistat,$flash,$tour ;160 global $op, $prefix, $dbi, $offset, $min,$descr_cons,$genere,$votog,$votol,$votoc,$circo, $id_cons,$tipo_cons,$id_comune,$id_cons_gen,$id_circ,$csv,$w,$l,$siteistat,$flash,$tour,$tema; 161 161 162 162 … … 227 227 if ($numero!=0){ 228 228 229 echo "<center><h2><br />"; 229 230 231 232 $res1 = mysql_query("SELECT sum(maschi+femmine) from ".$prefix."_ele_sezioni as t1 left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t1.id_cons='$id_cons' $circos",$dbi); 233 list($tot_aventi) = mysql_fetch_row($res1); 234 235 if ($genere!=0) { 236 echo "<center><h2>"; 230 237 echo "<b>"._DETTAGLIO." "._VOTIE."</b> - "; 231 238 echo "<i> "._SEZSCRU." $numero "._SU." $sezioni </i>"; 232 echo "<br /></h2></center>"; 233 234 235 236 $res1 = mysql_query("SELECT sum(maschi+femmine) from ".$prefix."_ele_sezioni as t1 left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t1.id_cons='$id_cons' $circos",$dbi); 237 list($tot_aventi) = mysql_fetch_row($res1); 238 239 if ($genere!=0) { 239 echo "</h2></center>"; 240 240 241 241 $res1 = mysql_query("SELECT sum(validi+nulli+bianchi+contestati) as tot, … … 243 243 from ".$prefix."_ele_sezioni as t1 left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t1.id_cons='$id_cons' $circos having tot>0",$dbi); 244 244 }else{ 245 246 if($tema=='tour'){ 247 248 list($max_ruotag) =mysql_fetch_row($res1); 249 if (isset($_SESSION['ruotag'])) { $ruotag=$_SESSION['ruotag'];} 250 else {$ruotag=1;$_SESSION['ruotag']=1;} 251 if ($ruotag>=$max_ruotag) {$ruotag=1;} 252 else {$ruotag++;} 253 $_SESSION['ruotag']=$ruotag; 254 $res1 = mysql_query("SELECT count(0) from ".$prefix."_ele_voti_ref AS t1 LEFT JOIN ".$prefix."_ele_gruppo AS t2 ON t1.id_gruppo = t2.id_gruppo WHERE t1.id_cons ='$id_cons' AND t2.num_gruppo ='$ruotag'",$dbi); 255 list($numero)=mysql_fetch_row($res1); 256 echo "<center><h2>"; 257 echo "<b>"._DETTAGLIO." "._VOTIE."</b> - "; 258 echo "<i> "._SEZSCRU." $numero "._SU." $sezioni </i>"; 259 echo "</h2></center>"; 260 261 $res1 = mysql_query("SELECT sum( t1.validi + t1.nulli + t1.bianchi + t1.contestati ) AS tot, sum( t1.validi ) , sum( t1.nulli ) , sum( t1.bianchi ) , sum( t1.contestati ) , t1.id_gruppo 262 FROM ".$prefix."_ele_voti_ref AS t1 LEFT JOIN ".$prefix."_ele_gruppo AS t2 ON t1.id_gruppo = t2.id_gruppo 263 WHERE t1.id_cons ='$id_cons' AND t2.num_gruppo ='$ruotag' GROUP BY t1.id_gruppo HAVING tot >0",$dbi); 264 } else 245 265 $res1 = mysql_query("SELECT sum(validi+nulli+bianchi+contestati) as tot, 246 266 sum(validi),sum(nulli),sum(bianchi),sum(contestati), id_gruppo … … 272 292 273 293 274 275 294 276 echo "<table width=\"100%\" class=\"modulo\"><tr><td valign=\"top\" >"; 277 278 echo "<table width=\"500\" cellspacing=\"3\" style=\"text-align:center;\">"; 279 if ($genere==0) {echo "<tr><td><h4>"._GRUPPO." $num_gruppo <br/> $descr_gruppo</h4><br/><br/></td></tr>";} 295 echo "<table width=\"100%\" class=\"modulo\"><tr>"; 296 if ($genere==0) echo "<td colspan=\"2\" valign=\"top\" >"; 297 else echo "<td valign=\"top\" >"; 298 299 echo "<table cellspacing=\"5\" style=\"text-align:center;\">"; 300 if ($genere==0) {echo "<tr><td colspan=\"4\"><h4>"._GRUPPO." $num_gruppo <br/> $descr_gruppo</h4></td></tr>";} 280 301 echo " 281 <tr class=\"bggray3\"><td ><b>"._AVENTI."</b></td><td>$tot_aventi</td><td><span class=\"red\">100%</span></td></tr>282 283 <tr class=\"bggray3\"><td ><b>"._VOTANTI."</b></td><td>$tot_votanti</td><td><span class=\"red\">$perc_votanti%</span></td></tr>284 285 <tr class=\"bggray3\"><td >"._VALIDI."</td><td>$validi</td><td><span class=\"red\">$perc_validi%</span></td></tr>286 287 <tr class=\"bggray3\"><td >"._NULLI."</td><td>$nulli</td><td><span class=\"red\">$perc_nulli%</span></td></tr>288 289 <tr class=\"bggray3\"><td >"._BIANCHI."</td><td>$bianchi</td><td><span class=\"red\">$perc_bianchi%</span></td></tr>290 291 <tr class=\"bggray3\"><td >"._CONTESTATI."</td><td>$contestati</td><td><span class=\"red\">$perc_conte%</span></td></tr>302 <tr class=\"bggray3\"><td style=\"text-align: right;\"><b>"._AVENTI."</b></td><td>$tot_aventi</td><td><span class=\"red\">100%</span></td></td></td></tr> 303 304 <tr class=\"bggray3\"><td style=\"text-align: right;\"><b>"._VOTANTI."</b></td><td>$tot_votanti</td><td><span class=\"red\">$perc_votanti%</span></td></tr> 305 306 <tr class=\"bggray3\"><td style=\"text-align: right;\">"._VALIDI."</td><td>$validi</td><td><span class=\"red\">$perc_validi%</span></td></tr> 307 308 <tr class=\"bggray3\"><td style=\"text-align: right;\">"._NULLI."</td><td>$nulli</td><td><span class=\"red\">$perc_nulli%</span></td></tr> 309 310 <tr class=\"bggray3\"><td style=\"text-align: right;\">"._BIANCHI."</td><td>$bianchi</td><td><span class=\"red\">$perc_bianchi%</span></td></tr> 311 312 <tr class=\"bggray3\"><td style=\"text-align: right;\">"._CONTESTATI."</td><td>$contestati</td><td><span class=\"red\">$perc_conte%</span></td></tr> 292 313 293 314 </table>"; … … 337 358 338 359 function graf_gruppo(){ 339 global $admin, $bgcolor1, $bgcolor5, $prefix, $dbi, $offset, $min,$descr_cons,$genere,$votog,$votol,$votoc,$circo, $id_cons,$id_cons_gen,$id_comune,$id_circ,$tipo_cons,$w,$l,$op,$siteistat,$flash,$visgralista ;360 global $admin, $bgcolor1, $bgcolor5, $prefix, $dbi, $offset, $min,$descr_cons,$genere,$votog,$votol,$votoc,$circo, $id_cons,$id_cons_gen,$id_comune,$id_circ,$tipo_cons,$w,$l,$op,$siteistat,$flash,$visgralista,$tema; 340 361 if ($siteistat==$id_comune) $logo=$siteistat; else $logo=''; // logo per il comune 341 362 $logo=verificasimbolo(); // carica_logo da funzioni.php … … 540 561 }else{ 541 562 // tot voti 563 if($tema=='tour'){ 564 $res1 = mysql_query("SELECT count(0) 565 from ".$prefix."_ele_gruppo where id_cons=$id_cons",$dbi); 566 list($max_ruotag) =mysql_fetch_row($res1); 567 if (isset($_SESSION['ruotag'])) { $ruotag=$_SESSION['ruotag'];} 568 else {$ruotag=1;$_SESSION['ruotag']=1;} 569 $res = mysql_query("select sum(t1.validi),t1.id_gruppo from ".$prefix."_$tab as t1 left join soraldo_ele_gruppo as t2 on t1.id_gruppo=t2.id_gruppo where t1.id_cons='$id_cons' and t2.num_gruppo='$ruotag' group by t1.id_gruppo", $dbi); 570 }else 542 571 $res = mysql_query(" 543 572 select sum(validi),id_gruppo from ".$prefix."_$tab where id_cons=$id_cons group by id_gruppo", $dbi); … … 569 598 echo "<tr><td bgcolor=\"$bgcolor1\">$num_gruppo - $descrizione</b></td></tr><tr></table> 570 599 <table><tr> 571 <td > "._SI."</td><td>$si</td>572 <td > %</td><td>$percsi</td>573 <td > "._NO."</td><td>$no</td>574 <td > %</td><td>$percno</td><tr>600 <td ><b>"._SI.":</b> </td><td>$si</td> 601 <td ><b>%</b> </td><td>$percsi</td> 602 <td ><b>"._NO.":</b> </td><td>$no</td> 603 <td ><b>%</b> </td><td>$percno</td><tr> 575 604 </table></td><td><center><br />"; 576 605 … … 695 724 function flash_torta($gruppos,$pre,$y,$x){ 696 725 //if (!defined('FLASH')) die(); 697 726 include_once ("class/charts.php"); 698 727 // inizio grafico torta flash 699 728 -
trunk/client/modules/Elezioni/index.php
r129 r132 684 684 }else{ $perc_si=0;$perc_no=0;} 685 685 686 687 686 $var1="<table class=\"table-80\" style=\"text-align: center;\">"; 687 688 if($ora){ 688 689 list ($ore,$minuti,$secondi)=explode(':',$ora); 689 $var1="<table class=\"table-80\"> 690 <tr> 690 $var1.= "<tr> 691 691 <td class=\"redbig\"> 692 692 <h2>"._PERC_ASS." $ore,$minuti:<span class=\"redbig\"> $perc_tot% </span></h2></td> 693 693 </tr>"; 694 694 } 695 695 696 696 $var1 .="<tr> … … 711 711 echo "<tr> 712 712 <td class=\"bggray\"><h1><b>$num_gruppo</b></h1></td> 713 <td class=\"table-main\" ><h1>$descr_gruppo</h1> $var1</td>";713 <td class=\"table-main\" style=\"text-align: left;\"><h1>$descr_gruppo</h1> $var1</td>"; 714 714 if($tipo_cons!=2 and $prognome) 715 715 echo "<td onmouseover=\"this.style.cursor='pointer';\" onclick=\"javascript:window.open('modules.php?name=Elezioni&file=foto&id_gruppo=$id_gruppo2&pdfvis=1')\">";
Note:
See TracChangeset
for help on using the changeset viewer.