Changeset 80 for trunk/admin/modules/Elezioni/ele_voti.php
- Timestamp:
- May 19, 2010, 8:16:43 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/modules/Elezioni/ele_voti.php
r76 r80 71 71 72 72 function stato_rilevazione($id_sez,$solosede){ 73 global $id_cons, $prefix, $dbi, $id_cons_gen,$status,$genere,$votol; 73 global $id_cons, $prefix, $dbi, $id_cons_gen,$status,$genere,$votol, $idrefgruppo; 74 75 if($idrefgruppo) $perref= "and id_gruppo='$idrefgruppo'"; 76 else $perref=""; 74 77 $ops=0; 75 78 $status=0; … … 79 82 if($res) 80 83 while (list($ora,$giorno) = mysql_fetch_row($res)){ 81 $query="SELECT sum(voti_complessivi) FROM ".$prefix."_ele_voti_parziale as t1 where t1.id_sez='$id_sez' and t1.orario='$ora' and t1.data='$giorno'";84 $query="SELECT sum(voti_complessivi) FROM ".$prefix."_ele_voti_parziale where id_sez='$id_sez' $perref and orario='$ora' and data='$giorno'"; 82 85 $res2 = mysql_query("$query", $dbi); 83 86 list($voti)=mysql_fetch_row($res2); 84 87 if($voti) { 85 88 if(isset($ora)){ 86 $query="SELECT count(voti_complessivi) FROM ".$prefix."_ele_voti_parziale as t1 where t1.id_cons='$id_cons' and t1.orario='$ora' and t1.data='$giorno'";89 $query="SELECT count(voti_complessivi) FROM ".$prefix."_ele_voti_parziale where id_cons='$id_cons' $perref and orario='$ora' and data='$giorno'"; 87 90 $res3 = mysql_query("$query", $dbi); 88 91 list($numscru)=mysql_fetch_row($res3); … … 93 96 $iscritti=$iscrittim+$iscrittif; 94 97 95 $query="SELECT voti_complessivi, voti_uomini, voti_donne FROM ".$prefix."_ele_voti_parziale as t1 where t1.id_sez='$id_sez' and t1.orario='$ora' and t1.data='$giorno'";98 $query="SELECT voti_complessivi, voti_uomini, voti_donne FROM ".$prefix."_ele_voti_parziale where id_sez='$id_sez' $perref and orario='$ora' and data='$giorno'"; 96 99 $res3 = mysql_query("$query", $dbi); 97 100 list($voti, $uomini, $donne)=mysql_fetch_row($res3); … … 109 112 # return 0; 110 113 #controllo congruenza voti espressi 114 #per referendum 115 if($genere==0){ 116 $res2= mysql_query("SELECT si,no,validi,nulli,bianchi,contestati FROM ".$prefix."_ele_voti_ref where id_sez='$id_sez' and id_gruppo='$idrefgruppo'", $dbi); 117 $refscru=mysql_num_rows($res2); 118 if($refscru){ 119 # echo "$voti - $ora - $giorno :<br>"; 120 list($si,$no,$validi,$nulli,$bianchi,$contestati)=mysql_fetch_row($res2); 121 if(($si+$no==$validi) and ($validi+$nulli+$bianchi+$contestati==$voti)) {$status=1;return (-4);} 122 else return (4); 123 } else {$status=0; return (-4);} 124 } 125 #per le altre consultazione 111 126 $res2= mysql_query("SELECT sum(validi) FROM ".$prefix."_ele_sezioni where id_cons='$id_cons'", $dbi); 112 127 if($res2){ … … 185 200 //if ($max>=64){ 186 201 $i=0; 202 echo "\n<table align=\"left\" width=\"100%\" border=\"3\"><tr bgcolor=\"$bgcolor1\"><td>"; 203 204 205 echo "<div id=\"navmenu\"> <ul>"; 187 206 while(list($sez_num, $sez_id ,$sede_id) = mysql_fetch_row($res)) { 188 207 $ops=''; … … 194 213 $sezstat=0; #die($ops); 195 214 global $status; 196 $sezstat=stato_rilevazione($sez_id,$solosede); 197 $cursez=''; 215 global $idrefgruppo; $idrefgruppo=''; 216 if($genere==0){ 217 $resref = mysql_query("SELECT id_gruppo FROM ".$prefix."_ele_gruppo where id_cons='$id_cons'", $dbi); 218 while(list($idrefgruppo)=mysql_fetch_row($resref)) { 219 $sezstat=stato_rilevazione($sez_id,$solosede); 220 if ($sezstat>0) break; 221 } 222 }else 223 $sezstat=stato_rilevazione($sez_id,$solosede); 224 $cursez="style=\" background: #bbbbbb;"; 198 225 $bgsez=""; 199 226 # if ($sezstat==(-1)) $bgsez="#99CC33"; #verde 200 if ($status==1 and $sezstat<0) { $ops=abs($sezstat);$bgsez="#99CC33";} #verde 227 228 # if ($status==1 and $sezstat<0) { $ops=abs($sezstat);$bgsez="#99CC33";} #verde 229 if ($status==1 and $sezstat<0) { $ops=abs($sezstat);$cursez="style=\" background: #99CC33;";} #verde 201 230 elseif ($sezstat<0) {$ops=abs($sezstat);} 202 231 elseif ($sezstat>0) { 203 $bgsez="#FF3300";#rosso; 232 # $bgsez="#FF3300";#rosso; 233 $cursez="style=\" background: #FF3300;";#rosso; 204 234 if ($sezstat) $ops=$sezstat; else $ops=1; 205 235 } 206 else{$ bgsez="";}236 else{$cursez="style=\" background: #8CC8C7;";} 207 237 if(!$ops) $ops=1; 208 238 $res2= mysql_query("SELECT num_sez FROM ".$prefix."_ele_sezioni where id_sez='$id_sez'", $dbi); 209 239 list($numero_sez) = mysql_fetch_row($res2); 210 if ($sez_num==$numero_sez) {$cursez= "style=\" border-color: YELLOW; border-width: 5px; 211 \"";}#$bgsez="#FFFF00";} 212 echo "\n<td align=\"center\" width=\"5%\" bgcolor=\"$bgsez\" $cursez><b><a href=\"admin.php?op=voti&id_cons_gen=$id_cons_gen&id_circ=$circ_id&id_sede=$sede_id&id_sez=$sez_id&ops=$ops&do=spoglio&id_lista=$id_lista\">$sez_num</a></b></td>\n"; 213 if (($i%$nums) ==0) echo "</tr>\n<tr bgcolor=\"$bgcolor1\">"; 240 # if ($sez_num==$numero_sez) {$cursez= "style=\" border-color: YELLOW; border-width: 5px;\"";} 241 if ($sez_num==$numero_sez) {$cursez.= " border: solid; border-color: YELLOW; border-width: 4px; border-left: solid gray 4px; border-top: solid gray 4px;\"";} else $cursez.="\""; 242 # echo "\n<td align=\"center\" width=\"5%\" bgcolor=\"$bgsez\" $cursez><b><a href=\"admin.php?op=voti&id_cons_gen=$id_cons_gen&id_circ=$circ_id&id_sede=$sede_id&id_sez=$sez_id&ops=$ops&do=spoglio&id_lista=$id_lista\">$sez_num</a></b></td>\n"; 243 echo "\n<li $cursez><b><a href=\"admin.php?op=voti&id_cons_gen=$id_cons_gen&id_circ=$circ_id&id_sede=$sede_id&id_sez=$sez_id&ops=$ops&do=spoglio&id_lista=$id_lista\">$sez_num</a></b></li>\n"; 244 # if (($i%$nums) ==0) echo "</ul></div></td></tr></table>\n"; #<tr bgcolor=\"$bgcolor1\"> 214 245 } 215 246 //} 216 247 echo "</ul></div></td></tr></table>\n"; 217 248 # echo"</td></tr></table>"; 218 249 //}// fine tabella per numero sezioni … … 229 260 echo "\n<td bgcolor=\"$bgcolor1\" align=\"left\">"; 230 261 //echo "<h6>"; 231 echo "\n<table align=\"left\" width=\"100%\" border=\"3\"><tr bgcolor=\"$bgcolor1\">";262 # echo "\n<table align=\"left\" width=\"100%\" border=\"3\"><tr bgcolor=\"$bgcolor1\"><td>"; 232 263 numeri_sezione(22); 233 echo "<td></td></tr></table>\n"; 264 # echo "<td></td></tr></table>\n"; 265 # echo "</td></tr></table>\n"; 234 266 echo "\n</td></tr><tr><td>\n"; 235 267 … … 379 411 380 412 //$bgcolor1="#b0b0b0"; 381 echo "<hr><table border=\"0\" width=\"60%\" align=\"center\"><tr>"; 413 # echo "<hr><table border=\"0\" width=\"60%\" align=\"center\"><tr>"; 414 echo "<hr><table class=\"table-menu\"><tr>"; 382 415 echo "\n<td bgcolor=\"$bgcolor1\" align=\"center\"><b><a href=\"admin.php?op=voti&id_cons_gen=$id_cons_gen&id_sez=$id_sez&id_circ=$id_circ&id_sede=$id_sede&do=spoglio&ops=1\">"._AFFLUENZE."</a></b></td>\n"; 383 416 if(!($genere==4) and !($votog)){ //if(!($genere==4) and !($tipo_cons==10 or $tipo_cons==11)){ … … 462 495 list($validi,$nulli,$bianchi,$contestati,$votinulli) = mysql_fetch_row($result); 463 496 # if ($validi+$nulli+$bianchi) die("entra($genere==3) OR ($genere==5)) and !$id_lista and ($fascia>$limite)"); 464 echo "<table border=\"0\" width=\"100%\" align=\"center\"><tr>";497 echo "<table class=\"table-menu\" style=\"width: 100%;\"><tr>"; 465 498 $res_lis = mysql_query("SELECT id_lista, descrizione,num_lista from ".$prefix."_ele_lista where id_cons=$id_cons $circo order by num_lista",$dbi); 466 499 $num_liste = mysql_num_rows($res_lis); … … 505 538 list($tot) = mysql_fetch_row($res2); 506 539 if ($validi+$nulli+$bianchi+$contestati+$votinulli+$sg!=$tot and $validi+$sg>0){ 507 echo "<table border=\"0\" width=\"50%\" align=\"center\"><tr><td style=\"background-color: rgb(255, 0, 0); align=center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br><b> "._ATT_VOTANTI." ".$tot." "._NO_TOT_VOTI." ".($validi+$nulli+$bianchi+$contestati+$votinulli+$sg)."</b><br></td></table>";540 echo "<table class=\"table-menu\" style=\"width: 50%;\"><tr><td style=\"background-color: rgb(255, 0, 0); align=center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br><b> "._ATT_VOTANTI." ".$tot." "._NO_TOT_VOTI." ".($validi+$nulli+$bianchi+$contestati+$votinulli+$sg)."</b><br></td></table>"; 508 541 } 509 542 510 543 if((($voti_sez)!=$validi2) and ($voti_sez>0)){ 511 echo "<table border=\"0\" width=\"50%\" align=\"center\"><tr><td style=\"background-color: rgb(255, 0, 0); align=center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br><b> "._ATT_VOTI." ".($voti_sez)." "._NO_VAL_VOTI." ".$validi2."</b><br></td></tr></table>";544 echo "<table class=\"table-menu\" style=\"width: 50%;\"><tr><td style=\"background-color: rgb(255, 0, 0); align=center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br><b> "._ATT_VOTI." ".($voti_sez)." "._NO_VAL_VOTI." ".$validi2."</b><br></td></tr></table>"; 512 545 } 513 546 } … … 523 556 ."<input type=\"hidden\" name=\"tabella\" value=\"$tab\">" 524 557 ."<input type=\"hidden\" name=\"id_lista\" value=\"$id_lista\">\n"; 525 echo "<table border=\"0\" width=\"90%\" align=\"center\">";558 echo "<table class=\"table-menu\" style=\"width: 90%; color: black\">"; 526 559 echo "<tr><td bgcolor=\"$bgcolor1\" align=\"left\" width=\"32\">"; 527 560 if ($genere<4){ … … 565 598 $res = mysql_query("SELECT * FROM ".$prefix."$tab where id_cons='$id_cons' and id_sez='$id_sez' $cond_sele", $dbi); 566 599 $pro= mysql_fetch_array($res, 3); 567 echo "<td align=\"right\"><input name=\"voti$i\" value=\"".$pro['voti']."\" size=\"7\" >";600 echo "<td align=\"right\"><input name=\"voti$i\" value=\"".$pro['voti']."\" size=\"7\" style=\"text-align:right\">"; 568 601 echo "<input type=\"hidden\" name=\"id_cand$i\" value=\"$id_cand\"></td></tr>\n"; 569 602 $i++; … … 591 624 ."<td align=\"left\"><b> $descr_lista</b></td>"; 592 625 $cond_sele="and id_lista=$id_lista3"; 593 echo "<td align=\"right\"><input name=\"voti$i\" value=\"".$pro['voti']."\" size=\"7\" >";626 echo "<td align=\"right\"><input name=\"voti$i\" value=\"".$pro['voti']."\" size=\"7\" style=\"text-align:right\">"; 594 627 echo "<input type=\"hidden\" name=\"id_lista$i\" value=\"$id_lista3\"></td></tr>\n"; 595 628 $i++; … … 601 634 if(!$votog) { 602 635 if (($genere==3 OR $genere==5) and (!$id_lista) and ($fascia>$limite)) { //gruppo e liste 603 echo "<tr bgcolor=\"$bgcolor2\"><td></td><td><b>"._SOLO_GRUPPO."</b></td><td align=\"center\"><input type=\"hidden\" name=\"id_sez\" value=\"$id_sez\"><input name=\"sg\" value=\"$sg\" size=\"5\" ></td></tr>";604 echo "<tr bgcolor=\"$bgcolor2\"><td></td><td><b>"._NULLI_LISTE."</b></td><td align=\"center\"><input name=\"votinulli\" value=\"$votinulli\" size=\"5\" >"605 ."</td></tr><tr bgcolor=\"$bgcolor2\"><td></td><td><b>"._CONTESTATI_LISTE."</b></td><td align=\"center\"><input name=\"contestati\" value=\"$contestati\" size=\"5\" ></td></tr>";636 echo "<tr bgcolor=\"$bgcolor2\"><td></td><td><b>"._SOLO_GRUPPO."</b></td><td align=\"center\"><input type=\"hidden\" name=\"id_sez\" value=\"$id_sez\"><input name=\"sg\" value=\"$sg\" size=\"5\" style=\"text-align:right\"></td></tr>"; 637 echo "<tr bgcolor=\"$bgcolor2\"><td></td><td><b>"._NULLI_LISTE."</b></td><td align=\"center\"><input name=\"votinulli\" value=\"$votinulli\" size=\"5\" style=\"text-align:right\">" 638 ."</td></tr><tr bgcolor=\"$bgcolor2\"><td></td><td><b>"._CONTESTATI_LISTE."</b></td><td align=\"center\"><input name=\"contestati\" value=\"$contestati\" size=\"5\" style=\"text-align:right\"></td></tr>"; 606 639 607 640 }elseif (($genere==3 OR $genere==5) and !$votoc and $fascia>$limite){ //}elseif ($tipo_cons!=10 and $tipo_cons!=11){ … … 719 752 function votanti($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops,$ov,$mv,$gv,$msv,$av){ 720 753 //function votanti($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops,$ov,$mv,$gv,$msv,$av){ 721 global $aid, $prefix, $dbi,$tipo_cons,$genere,$id_cons_gen ;754 global $aid, $prefix, $dbi,$tipo_cons,$genere,$id_cons_gen,$vismf; 722 755 $bgcolor1=$_SESSION['bgcolor2']; 723 756 OpenTable(); 724 echo "<tr><td> </td></tr>";725 757 $res = mysql_query("SELECT orario,data FROM ".$prefix."_ele_rilaff where id_cons_gen=$id_cons_gen order by data,orario ", $dbi); 726 758 $num = mysql_num_rows($res); … … 728 760 list($maschi,$femmine)=mysql_fetch_row($ressez); 729 761 $y=0; 762 echo "<tr><td> </td></tr>"; 763 if(!isset($vismf)) $vismf=0; 730 764 while (list($ora,$giorno)= mysql_fetch_row($res)){ 731 765 $y++; 732 766 echo "\n<tr><td>"; 733 767 echo "<form name=\"votanti$y\" action=\"admin.php\">"; 734 echo "<table border=\"0\" width=\"100%\" align=\"center\"><tr>";768 echo "<table class=\"table-menu\" style=\"width: 100%; color: black;\"><tr>"; 735 769 if ($genere==0){ //e' un referendum 736 770 echo "<td bgcolor=\"$bgcolor1\" align=\"center\" width=\"32\"><b>"._NUM."</b></td>"; … … 774 808 echo "</tr><tr style=\"background-color: rgb(255, 0, 0); align=center\">"; 775 809 }else{ 776 echo "</tr><tr align=\"center\">";810 echo "</tr><tr class=\"tr-dx\">"; 777 811 } 778 812 if ($genere==0){ // e' un referendum … … 782 816 list ($anno,$mese,$di)=explode('-',$giorno); 783 817 echo "<td align=\"center\">$ora</td><td align=\"center\">$di-$mese-$anno</td>"; 784 if ($voti_u > $maschi) echo "<td align=\"center\" bgcolor=\"red\"> <input";785 else echo "<td align=\"center\"> <input";786 if ($y<$num ) { echo " type=\"hidden\"";}818 if ($voti_u > $maschi) echo "<td align=\"center\" bgcolor=\"red\">"; 819 else echo "<td align=\"center\">"; 820 if ($y<$num and $vismf==0 and $voti_u==0) { echo "<input type=\"hidden\"";}else echo "<input type=\"text\" style=\"text-align:right\""; 787 821 echo " name=\"voti_u$i\" value=\"$voti_u\" size=\"5\"></td>"; 788 if ($voti_d > $femmine) echo "<td align=\"center\" bgcolor=\"red\"> <input";789 else echo "<td align=\"center\"> <input";790 if ($y<$num ) { echo " type=\"hidden\"";}822 if ($voti_d > $femmine) echo "<td align=\"center\" bgcolor=\"red\">"; 823 else echo "<td align=\"center\">"; 824 if ($y<$num and $vismf==0 and $voti_d==0) { echo "<input type=\"hidden\"";}else echo "<input type=\"text\" style=\"text-align:right\""; 791 825 echo " name=\"voti_d$i\" value=\"$voti_d\" size=\"5\"></td>"; 792 if ($voti_t > ($maschi+$femmine)) echo "<td align=\"center\" bgcolor=\"red\"><input name=\"voti_t$i\" value=\"$voti_t\" size=\"5\">";793 else echo "<td align=\"center\"><input name=\"voti_t$i\" value=\"$voti_t\" size=\"5\" >";826 if ($voti_t > ($maschi+$femmine)) echo "<td align=\"center\" bgcolor=\"red\"><input type=\"text\" name=\"voti_t$i\" value=\"$voti_t\" size=\"5\" style=\"text-align:right\">"; 827 else echo "<td align=\"center\"><input name=\"voti_t$i\" value=\"$voti_t\" size=\"5\" style=\"text-align:right\">"; 794 828 echo "<input type=\"hidden\" name=\"id_parz$i\" value=\"$id_parz\">" 795 829 ."<input type=\"hidden\" name=\"data$i\" value=\"$giorno\">" … … 918 952 $tot_voti=$validi+$tot_nulli+$sg+$conts+$nullis; 919 953 920 echo "<tr bgcolor=\"$bgcolor2\" align=\"center\"><td align=\"left\"><input name=\"validi\" value=\"$validi\" size=\"5\" >";954 echo "<tr bgcolor=\"$bgcolor2\" align=\"center\"><td align=\"left\"><input name=\"validi\" value=\"$validi\" size=\"5\" style=\"text-align:right\">"; 921 955 /* if(($genere==3 or $genere==5) and !$votog and $ops==3){ 922 956 echo "</td><td>$nulli" … … 924 958 echo "<input type=\"hidden\" name=\"nulli\" value=\"$nulli\"><input type=\"hidden\" name=\"bianchi\" value=\"$bianchi\">"; 925 959 }else{ */ 926 echo "</td><td><input name=\"nulli\" value=\"$nulli\" size=\"5\" >"927 ."</td><td><input name=\"bianchi\" value=\"$bianchi\" size=\"5\" >";960 echo "</td><td><input name=\"nulli\" value=\"$nulli\" size=\"5\" style=\"text-align:right\">" 961 ."</td><td><input name=\"bianchi\" value=\"$bianchi\" size=\"5\" style=\"text-align:right\">"; 928 962 // } 929 echo "</td><td><input name=\"votinulli\" value=\"$votinulli\" size=\"5\" >"930 ."</td><td><input name=\"contestati\" value=\"$contestati\" size=\"5\" >"963 echo "</td><td><input name=\"votinulli\" value=\"$votinulli\" size=\"5\" style=\"text-align:right\">" 964 ."</td><td><input name=\"contestati\" value=\"$contestati\" size=\"5\" style=\"text-align:right\">" 931 965 ."</td><td>$tot_nulli" 932 966 ."</td><td>$tot_voti</td><td>" … … 1041 1075 $result = mysql_query("SELECT voti_uomini,voti_donne, voti_complessivi FROM ".$prefix."_ele_voti_parziale where id_sez='$id_sez' and id_cons='$id_cons' and (voti_uomini > 0 or voti_donne > 0)", $dbi); 1042 1076 list( $voti_u, $voti_d, $voti_t) = mysql_fetch_row($result); 1043 echo "<table border=\"0\" width=\"50%\" align=\"center\">"1077 echo "<table class=\"table-menu\" style=\"width: 50%; color: black;\">" 1044 1078 ."<tr><td></td><td align=\"center\"></td><td bgcolor=\"$bgcolor1\" align=\"center\">"._VOTIU."</td><td bgcolor=\"$bgcolor1\" align=\"center\">"._VOTID."</td><td bgcolor=\"$bgcolor1\" align=\"center\">"._VOTIT."</td></tr>" 1045 1079 ."<tr><td></td><td bgcolor=\"$bgcolor1\" align=\"center\">"._TOT_ULT."</td><td bgcolor=\"$bgcolor2\" align=\"center\">$voti_u</td><td align=\"center\" bgcolor=\"$bgcolor2\">$voti_d</td><td bgcolor=\"$bgcolor2\" align=\"center\">$voti_t</td></tr>"; 1046 1080 echo "</table>"; 1047 1081 } 1048 echo "<table border=\"0\" width=\"50%\" align=\"center\"><tr>";1082 echo "<table class=\"table-menu\" style=\"width: 50%; color: black\"><tr>"; 1049 1083 if ($genere==0){ 1050 1084 $res = mysql_query("SELECT id_gruppo,si+no,validi,nulli,bianchi,contestati FROM ".$prefix."_ele_voti_ref where id_cons='$id_cons' and id_sez='$id_sez' ", $dbi); … … 1086 1120 ."<input type=\"hidden\" name=\"id_circ\" value=\"$id_circ\">" 1087 1121 ."<input type=\"hidden\" name=\"id_sede\" value=\"$id_sede\">"; 1088 echo "<br><br> <table border=\"0\" width=\"60%\" align=\"center\"><tr align=\"center\" bgcolor=\"$bgcolor1\">"1122 echo "<br><br> <table class=\"table-menu\" style=\"width: 60%; color: black\"><tr align=\"center\" bgcolor=\"$bgcolor1\">" 1089 1123 ."<td width=\"3%\"><b>"._NUM."</b></td>" 1090 1124 ."<td width=\"50%\"><b>"._GRUPPO."</b></td>"; … … 1128 1162 echo "<td align=\"center\"><input type=\"hidden\" name=\"id_gruppo$i\" value=\"$id_gruppo\"><b>$num_gruppo</b>" 1129 1163 ."</td><td align=\"left\" width=\"50%\"><b> $descr[0] </b>"; 1130 $pro['si']=$pro['si']>0? $pro['si']:0;1131 $pro['no']=$pro['no']>0? $pro['no']:0;1132 $pro['validi']=$pro['validi']>0? $pro['validi']:0;1133 $pro['bianchi']=$pro['bianchi']>0? $pro['bianchi']:0;1134 $pro['contestati']=$pro['contestati']>0? $pro['contestati']:0;1135 $pro['nulli']=$pro['nulli']>0? $pro['nulli']:0;1164 $pro['si']=(isset($pro['si']) and $pro['si']>0) ? $pro['si']:0; 1165 $pro['no']=(isset($pro['no']) and $pro['no']>0) ? $pro['no']:0; 1166 $pro['validi']=(isset($pro['validi']) and $pro['validi']>0) ? $pro['validi']:0; 1167 $pro['bianchi']=(isset($pro['bianchi']) and $pro['bianchi']>0) ? $pro['bianchi']:0; 1168 $pro['contestati']=(isset($pro['contestati']) and $pro['contestati']>0) ? $pro['contestati']:0; 1169 $pro['nulli']=(isset($pro['nulli']) and $pro['nulli']>0) ? $pro['nulli']:0; 1136 1170 $tot_nulli=$pro['nulli']+$pro['bianchi']+$pro['contestati']; 1137 echo "</td><td align=\"right\" width=\"3%\"><input name=\"si$i\" value=\"".$pro['si']."\" size=\"7\" ></td>";1138 echo "</td><td align=\"right\" width=\"3%\"><input name=\"no$i\" value=\"".$pro['no']."\" size=\"7\" ></td>";1139 echo "</td><td align=\"right\" width=\"3%\"><input name=\"val$i\" value=\"".$pro['validi']."\" size=\"7\" ></td>";1140 echo "</td><td align=\"right\"><input name=\"bia$i\" value=\"".$pro['bianchi']."\" size=\"7\" ></td>";1141 echo "</td><td align=\"right\"><input name=\"con$i\" value=\"".$pro['contestati']."\" size=\"7\" ></td>";1142 echo "</td><td align=\"right\"><input name=\"nul$i\" value=\"".$pro['nulli']."\" size=\"7\" ></td>";1171 echo "</td><td align=\"right\" width=\"3%\"><input name=\"si$i\" value=\"".$pro['si']."\" size=\"7\" style=\"text-align:right\"></td>"; 1172 echo "</td><td align=\"right\" width=\"3%\"><input name=\"no$i\" value=\"".$pro['no']."\" size=\"7\" style=\"text-align:right\"></td>"; 1173 echo "</td><td align=\"right\" width=\"3%\"><input name=\"val$i\" value=\"".$pro['validi']."\" size=\"7\" style=\"text-align:right\" ></td>"; 1174 echo "</td><td align=\"right\"><input name=\"bia$i\" value=\"".$pro['bianchi']."\" size=\"7\" style=\"text-align:right\"></td>"; 1175 echo "</td><td align=\"right\"><input name=\"con$i\" value=\"".$pro['contestati']."\" size=\"7\" style=\"text-align:right\"></td>"; 1176 echo "</td><td align=\"right\"><input name=\"nul$i\" value=\"".$pro['nulli']."\" size=\"7\" style=\"text-align:right\"></td>"; 1143 1177 echo "</td><td align=\"right\">$tot_nulli</td>"; 1144 1178 }else{ … … 1147 1181 $res = mysql_query("SELECT * FROM ".$prefix."_ele_voti_gruppo where id_cons='$id_cons' and id_sez='$id_sez' and id_gruppo='$id_gruppo' ", $dbi); 1148 1182 $pro= mysql_fetch_array($res, 3); 1149 echo "</td><td align=\"right\"><input name=\"voti$i\" value=\"".$pro['voti']."\" size=\"7\" ></td>";1183 echo "</td><td align=\"right\"><input name=\"voti$i\" value=\"".$pro['voti']."\" size=\"7\" style=\"text-align:right\"></td>"; 1150 1184 $tot_pref += $pro['voti']; 1151 1185 } … … 1274 1308 $op($vari); //chiamata a funzione variabile con parametri variabili (da cambiare!) 1275 1309 } 1276 echo"</td></tr></table> </div>";1310 echo"</td></tr></table>"; 1277 1311 include ("footer.php"); 1278 1312 ?>
Note:
See TracChangeset
for help on using the changeset viewer.