Changeset 358 for trunk/admin/modules
- Timestamp:
- Feb 22, 2022, 10:40:08 PM (3 years ago)
- Location:
- trunk/admin/modules/Elezioni
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/modules/Elezioni/ele.php
r336 r358 58 58 59 59 if (!$perms) $perms=ChiSei($id_cons_gen); 60 //include("modules/Elezioni/language/lang-$currentlang.php");60 include_once("modules/Elezioni/language/lang-$currentlang.php"); 61 61 //************************************************************************** 62 62 // ELE … … 71 71 # include("modules/Elezioni/testa.php"); 72 72 //immagine bullet 73 73 $bullet="<img src=\"temi/$tema/images/bullet.gif\" alt =\" \" align=\"left\" border=\"0\">"; 74 74 $bullet_red="<img src=\"temi/$tema/images/bullet_red.gif\" alt =\" \" align=\"left\" border=\"0\">"; 75 75 $bgcolor1='#e7e7e7'; … … 264 264 </td> 265 265 <td valign=\"top\" width=\"150\">"; 266 if ($op!='consultazione' and $perms>0 and $nrcirco and ($nrlista or $nrgruppo) ) {266 if ($op!='consultazione' and $perms>0 and $nrcirco and ($nrlista or $nrgruppo) and ! $espandi) { 267 267 echo "<a href=\"admin.php?op=voti&id_cons_gen=$id_cons_gen&do=spoglio\">$bullet "._GEST." "._SPOGLIO."</a><br>"; 268 268 if ($nraff) { -
trunk/admin/modules/Elezioni/ele_candidato.php
r352 r358 303 303 $num_cand++; 304 304 } 305 ################### 305 306 $sql="select id_gruppo,num_lista from ".$prefix."_ele_lista where id_lista='$id_lista'"; 306 307 $sth = $dbi->prepare("$sql"); … … 311 312 $sth->execute(); 312 313 $result=$sth->rowCount(); 313 $sql="insert into ".$prefix."_ele_log values ('$id_cons','$id_sez','$username','$data','$tempo','','ADD:id_lista:$id_lista,num_lista:$num_lista,cognome:$cognome,nome:$nome','".$prefix."_ele_candidati')"; 314 $sql="insert into ".$prefix."_ele_log values ('$id_cons','$id_sez','$username','$data','$tempo','','ADD:id_lista:$id_lista,num_lista:$num_lista,cognome:$cognome,nome:$nome','".$prefix."_ele_candidati')"; 315 ######### 314 316 $sth = $dbi->prepare("$sql"); 315 317 $sth->execute(); … … 324 326 }elseif ($do == "update") { 325 327 $pro= $sthcan->fetch(PDO::FETCH_BOTH); 326 328 ################ 327 329 $sql="select id_gruppo,num_lista from ".$prefix."_ele_lista where id_lista='$id_lista'"; 328 330 $sth = $dbi->prepare("$sql"); … … 333 335 if (isset($simbolo)) {$cond.=", simbolo='$simbolo'";} 334 336 $sql="update ".$prefix."_ele_candidati set id_lista='$id_lista', num_lista='$num_lista', cognome='$cognome', nome='$nome', num_cand='$num_cand' $cond where id_cand='$id_cand' "; 337 ###### 335 338 $sth = $dbi->prepare("$sql"); 336 339 $sth->execute(); -
trunk/admin/modules/Elezioni/ele_consultazioni.php
r344 r358 83 83 echo "} \n"; 84 84 echo "</script>\n"; 85 86 ############## onsubmit=\"check_aid()\" 87 /* echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n" 88 ."//-->\n"; 89 echo "function check_aid() { 90 var elem=document.getElementById('descrcons'); var num=elem.length; alert (\"Please fill in your first name.\".num); 91 for (i=0; i < elem.length; i++) { var sel=elem[i].value; 92 if (elem[i].value == document.consultazione.descr_cons2.value) { 93 document.consultazione.descr_cons2.style.backgroundColor = \"#ccc\"; 94 document.consultazione.descr_cons2.focus(); 95 return false; 96 } 97 } 98 return false; 99 } 100 101 function hide(){ 102 var elem = document.getElementById('descrcons'); 103 elem.style.display = 'none'; 104 }"; 105 106 echo "</script>\n"; */ 107 ################### 108 $sql="select descrizione from ".$prefix."_ele_consultazione"; 109 $sth = $dbi->prepare("$sql"); 110 $sth->execute(); 111 $row = $sth->fetch(PDO::FETCH_NUM); 112 echo "<select id=\"descrcons\" style=\"visibility:hidden;\">"; 113 while(list($val)=$sth->fetch(PDO::FETCH_NUM)) { 114 echo "<option value=\"$val\">$val</option>"; 115 } 116 echo "</select>"; 85 117 ######################### 86 118 if (isset($help)) include("language/$language/ele_consultazioni.html"); … … 127 159 echo "<option value=\"$dfa1\" selected>$dfa1</option>"; anno(); 128 160 echo "</td></tr><tr>"; 129 $resdel = daticonscom(); 130 if(count($resdel)==0) 131 echo "<td><fieldset><legend>"._SPUNTALABEL1."</legend><label id=\"prov\">"._VIASPUNTAELIMINA." <input type=\"checkbox\" id=\"pwd3\"name=\"pwd3\" value=\"\" onclick=\"del_cons()\"></label></fieldset></td>"; 161 $sql="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'"; 162 $sth = $dbi->prepare("$sql"); 163 $sth->execute(); 164 $resdel=$sth->rowCount(); 165 if($resdel==0) 166 echo "<td colspan=\"2\"><fieldset><legend>"._SPUNTALABEL1."</legend><label id=\"prov\">"._VIASPUNTAELIMINA." <input type=\"checkbox\" id=\"pwd3\"name=\"pwd3\" value=\"\" onclick=\"del_cons()\" size=\"200px\"></label></fieldset></td>"; 132 167 else echo "<td></td>"; 133 echo "< td><input type=\"submit\" id=\"update\" name=\"update\" value=\""._MODIFY."\">"168 echo "</tr><tr><td><input type=\"submit\" id=\"update\" name=\"update\" value=\""._MODIFY."\">" 134 169 ."</td></tr></table></form>"; 135 170 } else { … … 249 284 $id_consulta=$id_cons_gen; 250 285 $sql="insert into ".$prefix."_ele_consultazione (descrizione,data_inizio,data_fine,tipo_cons) values ('$descr_cons2','$data_inizio','$data_fine','$tipocons')"; 251 $sth = $dbi->prepare("$sql"); 252 $sth->execute(); 253 286 try { 287 $sth = $dbi->prepare("$sql"); 288 $sth->execute(); 289 }catch(PDOException $e) { 290 if ($e->getCode() == 23000) 291 echo "<h2 style=\"color:red;\"> Inserimento fallito: Esiste già una consultazione con il nome \"$descr_cons2\"</h2"; 292 else 293 echo "<h2 style=\"color:red;\"> Inserimento fallito: ". $e->getMessage()."</h2"; 294 } 254 295 } else { 255 296 OpenTable(); … … 262 303 $data_fine="$dfa-$dfm-$dfg"; 263 304 $sql="update ".$prefix."_ele_consultazione set descrizione='$descr_cons2',data_inizio='$data_inizio',data_fine='$data_fine' WHERE id_cons_gen='$id_cons_gen'"; 264 $sth = $dbi->prepare("$sql"); 265 $sth->execute(); 305 try { 306 $sth = $dbi->prepare("$sql"); 307 $sth->execute(); 308 }catch(PDOException $e) { 309 if ($e->getCode() == 23000) 310 echo "<h2 style=\"color:red;\"> Inserimento fallito: Esiste già una consultazione con il nome \"$descr_cons2\"</h2"; 311 else 312 echo "<h2 style=\"color:red;\"> Inserimento fallito: ". $e->getMessage()."</h2"; 313 } 266 314 if (!$sth->rowCount()) return; 267 315 Header("Location: admin.php?op=consultazione&id_cons_gen=$id_cons_gen"); -
trunk/admin/modules/Elezioni/ele_controlli.php
r338 r358 388 388 389 389 if($err){ 390 if(!$id_lista) $id_lista=0; //$controllo; 391 $sql="insert into ".$prefix."_ele_controlli value('$id_cons','$id_sez','$tipo','$id_lista')"; 392 $res = $dbi->prepare("$sql"); 393 $res->execute(); 390 $sql="select * from ".$prefix."_ele_controlli where tipo='lista' and id_sez='$id_sez' "; 391 $res = $dbi->prepare("$sql"); 392 $res->execute(); 393 if(!$res->rowCount()) { 394 if(!$id_lista) $id_lista=0; //$controllo; 395 $sql="insert into ".$prefix."_ele_controlli value('$id_cons','$id_sez','$tipo','$id_lista')"; 396 $res = $dbi->prepare("$sql"); 397 $res->execute(); 398 } 394 399 } 395 400 -
trunk/admin/modules/Elezioni/ele_operatori.php
r344 r358 26 26 if (isset($_GET['passwd'])) $passwd=addslashes($param['passwd']); else $passwd=''; 27 27 if (isset($_GET['passwd2'])) $passwd2=addslashes($param['passwd2']); else $passwd2=''; 28 if (isset($_GET['stato']) && $aid2!='admin') $stato=intval($param['stato']); else $stato=0; 28 29 29 30 include("modules/Elezioni/funzionidata.php"); … … 37 38 global $aid, $offset, $prefix, $dbi,$id_cons,$aid2,$id_sede,$id_cons_gen,$mex,$perms; 38 39 //echo $perms;die(); 40 39 41 $bgcolor1=$_SESSION['bgcolor1']; 40 42 $id_comune=$_SESSION['id_comune']; … … 44 46 $rescom->execute(); 45 47 list($descr_com) = $rescom->fetch(PDO::FETCH_NUM); 46 $sql="SELECT aid,name,email FROM ".$prefix."_authors where aid='$aid2' and id_comune='$id_comune'";48 $sql="SELECT aid,name,email,adminop FROM ".$prefix."_authors where aid='$aid2' and id_comune='$id_comune'"; 47 49 $resmod = $dbi->prepare("$sql"); 48 50 $resmod->execute(); 49 list ($aid2,$name,$email ) = $resmod->fetch(PDO::FETCH_NUM);51 list ($aid2,$name,$email,$attivo) = $resmod->fetch(PDO::FETCH_NUM); 50 52 if (isset($_GET['mex'])){ 51 53 echo "<table align=\"center\"><tr><td style=\"background-color: rgb(255, 0, 0)\">"; … … 65 67 echo "</tr><tr align=\"center\">"; 66 68 echo "<td><input type=\"hidden\" name=\"pag_op\" value=\"admin.php?op=operatori&id_cons_gen=$id_cons_gen&aid2=\">"; 67 echo "<select name=\"aid2\" onChange=\"top.location.href=this.form.pag_op.value+this.form.aid2.options[this.form.aid2.selectedIndex].value;return false\">";68 echo "<option value=\"\"> ";69 echo "<select id=\"aid2\" name=\"aid2\" onChange=\"top.location.href=this.form.pag_op.value+this.form.aid2.options[this.form.aid2.selectedIndex].value;return false\">"; 70 echo "<option value=\"\">Nuovo Utente"; 69 71 while(list($utente)=$resins->fetch(PDO::FETCH_NUM)){ 70 72 $sel= ($utente == $aid2) ? "selected":""; … … 86 88 echo "<td bgcolor=\"$bgcolor1\"><b>"._NOME."</b></td>" 87 89 ."<td bgcolor=\"$bgcolor1\"><b>"._EMAIL."</b></td>"; 90 echo "<td bgcolor=\"$bgcolor1\"><b>"._STATO."</b></td>"; 91 92 88 93 echo "<td bgcolor=\"$bgcolor1\"><b>"._FUNZIONI."</b></td></tr>"; 89 94 echo "<tr align=\"center\"><td>"; … … 98 103 echo "<td align=\"center\"><input type=password name=\"passwd2\" size=\"12\"></td>"; 99 104 echo "<td><input name=\"name\" value=\"$name\"></td>"; 100 echo "<td><input name=\"email\" value=\"$email\">"; 105 echo "<td><input name=\"email\" value=\"$email\"></td>"; 106 if($attivo==0) {$sel2="selected"; $sel3='';} else {$sel2=''; $sel3="selected";} 107 echo "<td><select name=\"stato\"><option value=\"0\" $sel2>Attivo<option value=\"1\" $sel3>Disattivo<option value=\"2\" >Elimina</select>"; 101 108 echo "<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">"; 102 109 echo "<input type=\"hidden\" name=\"ok\" value=0></td>"; … … 113 120 } 114 121 115 function operatori($do,$aid2,$name,$email,$passwd,$passwd2,$id_comune ) {122 function operatori($do,$aid2,$name,$email,$passwd,$passwd2,$id_comune,$stato) { 116 123 global $aid, $prefix, $dbi, $id_cons,$id_cons_gen,$currentlang; 117 124 $perms=ChiSei($id_cons_gen); 125 if($passwd!=$passwd2) { 126 $mex="- Le password non coincidono! -<br>"; 127 header("location:admin.php?op=operatori&id_cons_gen=$id_cons_gen&aid2=$aid2&name=$name&email=$email&mex=$mex&stato=$stato"); 128 } 118 129 119 130 if ($perms!=256) $id_comune=$_SESSION['id_comune']; … … 124 135 $res->execute(); 125 136 $max=$res->rowCount(); 126 if ($ passwd==$passwd2 and $max==0){127 if ($aid2=='admin') $super=' 1,0,0,'; else $super = '0,1,0,';128 $sql="insert into ".$prefix."_authors (aid,name,id_comune,email,pwd,counter,adminop,admincomune,adminsuper,admlanguage) values ('$aid2','$name','$id_comune' , '$email','".md5($passwd)."', 0,$super'$currentlang')";137 if ($max==0){ 138 if ($aid2=='admin') $super='0,1,0,'; else $super = '0,0,0,'; 139 $sql="insert into ".$prefix."_authors (aid,name,id_comune,email,pwd,counter,adminop,admincomune,adminsuper,admlanguage) values ('$aid2','$name','$id_comune' , '$email','".md5($passwd)."','0',$super'$currentlang')"; 129 140 $res = $dbi->prepare("$sql"); 130 141 $res->execute(); … … 133 144 $res = $dbi->prepare("$sql"); 134 145 $res->execute(); 135 136 Header("Location: admin.php?op=operatori&id_cons_gen=$id_cons_gen ");146 } 147 Header("Location: admin.php?op=operatori&id_cons_gen=$id_cons_gen&aid2=$aid2"); 137 148 }else{ 138 149 $mex=''; 139 if($passwd!=$passwd2) $mex="- Le password non coincidono! -<br>";140 150 if($max>0) $mex.=" - Utente <b>$aid2</b> presente in archivio! - "; 141 header("location:admin.php?op=operatori&id_cons_gen=$id_cons_gen&aid2=$aid2&name=$name&email=$email&mex=$mex");142 151 } 143 152 } elseif ($do == "update") { 144 $sql="update ".$prefix."_authors set name='$name',pwd='".md5($passwd)."', email='$email' where id_comune='$id_comune' and aid='$aid2' "; 145 $res = $dbi->prepare("$sql"); 146 $res->execute(); 153 if($passwd!='') $mexpwd="pwd='".md5($passwd)."',"; else $mexpwd=''; 154 if($stato==2){ 155 $sql="delete from ".$prefix."_authors where aid='$aid2' and id_comune=$id_comune"; 156 $res = $dbi->prepare("$sql"); 157 $res->execute(); 158 }else{ 159 $sql="update ".$prefix."_authors set name='$name', $mexpwd email='$email', adminop='$stato' where id_comune='$id_comune' and aid='$aid2' "; 160 $res = $dbi->prepare("$sql"); 161 $res->execute(); 162 } 147 163 $result=$res->rowCount(); 164 if($stato!=0){ 165 $sql="delete from ".$prefix."_ele_operatori where id_comune='$id_comune' and aid='$aid2' "; 166 $res = $dbi->prepare("$sql"); 167 $res->execute(); 168 } 148 169 if (!$result) return; 149 170 if ($aid2==$aid) $_SESSION['pwd']=md5($passwd); … … 157 178 // switch 158 179 //**************************** 159 if ($do) operatori($do,$aid2,$name,$email,$passwd,$passwd2,$id_comune );180 if ($do) operatori($do,$aid2,$name,$email,$passwd,$passwd2,$id_comune,$stato); 160 181 ele(); 161 182 all(); -
trunk/admin/modules/Elezioni/ele_permessi.php
r344 r358 24 24 list($tipo_cons,$id_cons) = $res->fetch(PDO::FETCH_NUM); 25 25 if (isset($param['aid2'])) $aid2=addslashes($param['aid2']); else $aid2=''; 26 if (isset($param['id_sede'])) $id_sede=intval($param['id_sede']); else $id_sede= '';26 if (isset($param['id_sede'])) $id_sede=intval($param['id_sede']); else $id_sede=0; 27 27 if (isset($param['do'])) $do=addslashes($param['do']); else $do=''; 28 28 if (isset($param['permessi'])) $permessi=addslashes($param['permessi']); else $permessi=''; … … 30 30 if (isset($param['ok'])) $ok=intval($param['ok']); else $ok=''; 31 31 if (isset($param['mex'])) $mex=addslashes($param['mex']); else $mex=''; 32 if (isset($param['id_sez'])) $id_sez=intval($param['id_sez']); else $id_sez=0; 32 33 33 34 include("modules/Elezioni/funzionidata.php"); … … 39 40 //crea la pagina delle affluenze 40 41 function all() { 41 global $adminop,$adminsuper,$admincomune,$aid, $offset, $prefix, $dbi,$id_cons,$aid2,$permessi,$id_sede,$id_cons_gen,$id_comune,$mex ;42 global $adminop,$adminsuper,$admincomune,$aid, $offset, $prefix, $dbi,$id_cons,$aid2,$permessi,$id_sede,$id_cons_gen,$id_comune,$mex,$id_sez; 42 43 $bgcolor1=$_SESSION['bgcolor1']; 44 echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n" 45 46 ."//-->\n"; 47 echo "function controlloref(idsede,idsez) {\n"; 48 echo "let element = window.document.getElementById(idsede); \n"; 49 echo "let elecontr = window.document.getElementById(idsez); \n"; 50 echo "element.selectedIndex = 0 ; \n"; 51 echo "}\n"; 52 echo "function controllosez(idsez, idsede) {\n"; 53 echo "let element = window.document.getElementById(idsez); \n"; 54 echo "let elecontr = window.document.getElementById(idsede); \n"; 55 echo "element.selectedIndex = 0; \n"; 56 echo "}\n"; 57 echo "</script>\n"; 43 58 if (isset($mex)){ 44 59 echo "<table align=\"center\"><tr><td style=\"background-color: rgb(255, 0, 0)\">"; … … 54 69 echo "<td><b>"._UTENTE."</b></td>" 55 70 ."<td bgcolor=\"$bgcolor1\"><b>"._SEDE."</b></td>" 71 ."<td bgcolor=\"$bgcolor1\"><b>"._SEZIONE."</b></td>" 56 72 ."<td bgcolor=\"$bgcolor1\"><b>"._PERMESSI."</b></td>"; 57 73 echo "<td bgcolor=\"$bgcolor1\"><b>"._FUNZIONI."</b></td></tr>"; … … 71 87 72 88 if (!$listmp) $listmp="''"; 73 $sql="select aid from ".$prefix."_authors where id_comune=$id_comune and (admincomune= 1and aid not in ($listmp)) order by aid"; // operatori registrati ma non ancora autorizzati89 $sql="select aid from ".$prefix."_authors where id_comune=$id_comune and (admincomune=0 and adminop=0 and aid not in ($listmp)) order by aid"; // operatori registrati ma non ancora autorizzati 74 90 $resins = $dbi->prepare("$sql"); 75 91 $resins->execute(); 76 77 92 78 93 echo "<form name=\"autorizza\" action=\"admin.php\">" 79 94 ."<input type=\"hidden\" name=\"op\" value=\"permessi\">"; … … 90 105 $ressede = $dbi->prepare("$sql"); 91 106 $ressede->execute(); 92 echo "<td><select name=\"id_sede\">";107 echo "<td><select id=\"id_sede\" name=\"id_sede\" onchange=controllosez('id_sez','id_sede')>"; 93 108 echo "<option value=\"0\"> "._TUTTESEDI; 94 109 if($ressede->rowCount()) … … 99 114 } 100 115 echo "</select></td>"; 116 $sql="SELECT id_sez, num_sez from ".$prefix."_ele_sezioni where id_cons=$id_cons order by num_sez"; 117 $ressez = $dbi->prepare("$sql"); 118 $ressez->execute(); 119 echo "<td><select id=\"id_sez\" name=\"id_sez\" onchange=controlloref('id_sede','id_sez')>"; 120 echo "<option value=\"0\"> "; 121 if($ressez->rowCount()) 122 while(list($id,$descr)=$ressez->fetch(PDO::FETCH_NUM)){ 123 $sel= ($id == $id_sez) ? "selected":""; 124 $arr[$id]=$descr; 125 echo "<option value=\"$id\" $sel>$descr"; 126 } 127 echo "</select></td>"; 101 128 echo "<td><select name=\"permessi\">"; 102 129 if(!isset($permessi)) $permessi=16; … … 115 142 if($resmod->rowCount()){ 116 143 $i=1; 117 while (list($id_cons2,$id_sede2,$id_comunetemp,$perm,$utente ) = $resmod->fetch(PDO::FETCH_NUM)){144 while (list($id_cons2,$id_sede2,$id_comunetemp,$perm,$utente,$id_circ2,$id_sez2) = $resmod->fetch(PDO::FETCH_NUM)){ 118 145 $bgcolor1=($bgcolor1==$_SESSION['bgcolor1'])?$_SESSION['bgcolor2']:$_SESSION['bgcolor1']; 119 146 echo "<form name=\"modello$i\" action=\"admin.php\">" … … 128 155 $ressede = $dbi->prepare("$sql"); 129 156 $ressede->execute(); 130 echo "<td><select name=\"id_sede\">"; 131 echo "<option value=\"0\"> "._TUTTESEDI; 157 echo "<td><select id=\"id_sede$i\" name=\"id_sede\" onchange=controllosez('id_sez$i','id_sede$i')>"; 158 # if($id_sez2) 159 # echo "<option value=\"0\"> "; 160 # else 161 echo "<option value=\"0\"> "._TUTTESEDI; 132 162 while(list($id,$descr)=$ressede->fetch(PDO::FETCH_NUM)){ 133 163 $sel= ($id == $id_sede2) ? "selected":""; … … 136 166 } 137 167 echo "</select></td>"; 168 $sql="SELECT id_sez, num_sez from ".$prefix."_ele_sezioni where id_cons=$id_cons order by num_sez"; 169 $ressez = $dbi->prepare("$sql"); 170 $ressez->execute(); 171 echo "<td><select id=\"id_sez$i\" name=\"id_sez\" onchange=controlloref('id_sede$i','id_sez$i')>"; 172 echo "<option value=\"0\"> "; 173 if($ressez->rowCount()) 174 while(list($id,$descr)=$ressez->fetch(PDO::FETCH_NUM)){ 175 $sel= ($id == $id_sez2) ? "selected":""; 176 $arr[$id]=$descr; 177 echo "<option value=\"$id\" $sel>$descr"; 178 } 179 echo "</select></td>"; 138 180 echo "<td><select name=\"permessi\">"; 139 181 if(!isset($perm)) $perm=16; … … 153 195 } 154 196 155 function permessi($ok, $do,$aid2,$id_sede,$permessi,$id_comune ) {197 function permessi($ok, $do,$aid2,$id_sede,$permessi,$id_comune,$id_sez) { 156 198 global $prefix, $dbi, $id_cons,$id_cons_gen,$currentlang; 157 199 $perms=ChiSei($id_cons_gen); … … 159 201 if ($perms>32 and $permessi<$perms and $aid2) { 160 202 if ($do == "autorizza") { 161 $sql="insert into ".$prefix."_ele_operatori (id_cons,id_sede,id_comune,permessi,aid ) values ('$id_cons','$id_sede','$id_comune','$permessi','$aid2')";203 $sql="insert into ".$prefix."_ele_operatori (id_cons,id_sede,id_comune,permessi,aid,id_sez) values ('$id_cons','$id_sede','$id_comune','$permessi','$aid2','$id_sez')"; 162 204 $res = $dbi->prepare("$sql"); 163 205 $res->execute(); 164 206 Header("Location: admin.php?op=permessi&id_cons_gen=$id_cons_gen"); 165 207 } elseif ($do == "update") { 166 $sql="update ".$prefix."_ele_operatori set id_sede='$id_sede' , permessi='$permessi' where id_cons='$id_cons' and aid='$aid2' ";208 $sql="update ".$prefix."_ele_operatori set id_sede='$id_sede', permessi='$permessi', id_sez='$id_sez' where id_cons='$id_cons' and aid='$aid2' "; 167 209 $res = $dbi->prepare("$sql"); 168 210 $res->execute(); … … 178 220 // switch 179 221 //**************************** 180 if ($do) permessi($ok, $do,$aid2,$id_sede,$permessi,$id_comune );222 if ($do) permessi($ok, $do,$aid2,$id_sede,$permessi,$id_comune,$id_sez); 181 223 ele(); 182 224 all(); -
trunk/admin/modules/Elezioni/ele_voti.php
r352 r358 413 413 $result = $dbi->prepare("$sql"); 414 414 $result->execute(); 415 415 416 416 417 417 list($numprefs,$fascia,$id_conf,$flagsg,$disgiunto)=$result->fetch(PDO::FETCH_NUM); … … 677 677 echo "<td bgcolor=\"$bgcolor1\" align=\"left\"><b>"._DESCR."</b></td>" 678 678 ."<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VOTI."</b></td>"; 679 if($dettnulli && !$disgiunto && $tipo_cons!=18 && $tipo_cons!=19)680 echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._NULLI_LISTE."</b></td>";679 # if($dettnulli && !$disgiunto && $tipo_cons!=18 && $tipo_cons!=19) 680 # echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._NULLI_LISTE."</b></td>"; 681 681 if($disgiunto){ 682 682 echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._SOLOLIS."</b></td>"; … … 775 775 $cond_sele="and id_lista=$id_lista3"; 776 776 echo "<td align=\"right\" $errcolor><input name=\"voti$i\" value=\"".$voti."\" size=\"7\" style=\"text-align:right\">"; 777 if($dettnulli && !$disgiunto && $tipo_cons!=18 && $tipo_cons!=19) { echo "</td><td align=\"right\"><input name=\"vnpl$i\" value=\"".$vnpl."\" size=\"7\" style=\"text-align:right\">"; $tvnpl+=$vnpl;}777 # if($dettnulli && !$disgiunto && $tipo_cons!=18 && $tipo_cons!=19) { echo "</td><td align=\"right\"><input name=\"vnpl$i\" value=\"".$vnpl."\" size=\"7\" style=\"text-align:right\">"; $tvnpl+=$vnpl;} 778 778 if($disgiunto) {echo "</td><td align=\"right\"><input name=\"slpl$i\" value=\"".$slpl."\" size=\"7\" style=\"text-align:right\">"; $tslpl+=$slpl;} 779 779 echo "<input type=\"hidden\" name=\"id_lista$i\" value=\"$id_lista3\"></td>"; … … 786 786 if(!$id_lista) { 787 787 echo "<tr bgcolor=\"$bgcolor1\"><td></td><td><font size=\"3\">"._TOT._VOTI_LISTA."</font></td><td align=\"center\"><font size=\"3\">$tot_pref</font></td>"; 788 if($dettnulli && !$disgiunto && $tipo_cons!=18 && $tipo_cons!=19)789 echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><font size=\"3\">".$tvnpl."</font></td>";788 # if($dettnulli && !$disgiunto && $tipo_cons!=18 && $tipo_cons!=19) 789 # echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><font size=\"3\">".$tvnpl."</font></td>"; 790 790 if($disgiunto) 791 791 echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><font size=\"3\">".$tslpl."</font></td>"; -
trunk/admin/modules/Elezioni/query.sql
r285 r358 65 65 $sql = "SELECT tipo_cons,descrizione,id_cons_gen FROM ".$prefix."_ele_consultazione order by data_fine desc limit 0,1 "; 66 66 else 67 $sql = "SELECT t1.tipo_cons,t1.descrizione,t2.id_cons_gen FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2, ".$prefix."_ele_operatori as t3 where t3.id_comune=$id_comune and t3.id_comune=t2.id_comune and t1.id_cons_gen=t2.id_cons_gen and t2.chiusa='0' and (t3.id_cons=t2.id_cons or t3.id_cons=0) and t3.permessi>0 and t3.aid='$aid' order by t1.data_fine desc limit 0,1 "; 67 $sql = "SELECT t1.tipo_cons,t1.descrizione,t2.id_cons_gen FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2, ". 68 $prefix."_ele_operatori as t3 where t3.id_comune=$id_comune and t3.id_comune=t2.id_comune and t1.id_cons_gen=t2.id_cons_gen and t2.chiusa='0' and (t3.id_cons=t2.id_cons or t3.id_cons=0) and t3.permessi>0 and t3.aid='$aid' order by t1.data_fine desc limit 0,1 "; 68 69 } 69 70 $sth = $dbi->prepare("$sql"); -
trunk/admin/modules/Elezioni/salva_aff.php
r344 r358 48 48 $res = $dbi->prepare("$query"); 49 49 $res->execute(); 50 $BASE=substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['REQUEST_URI'], "/")-16); 51 list($id_cons)=$res->fetch(PDO::FETCH_NUM); 50 list($id_cons)=$res->fetch(PDO::FETCH_NUM); 52 51 $query="select id_parz from ".$prefix."_ele_voti_parziale where data='$data' and orario='$orario' and id_sez='$id_sez' and id_gruppo='$id_gruppo'"; 53 52 $res = $dbi->prepare("$query"); 54 53 $res->execute(); 55 54 $righe=$res->rowCount(); 56 list($id_parz)=$res->fetch(PDO::FETCH_NUM); 55 list($id_parz)=$res->fetch(PDO::FETCH_NUM); 57 56 if($righe){ #la riga Ú presente e viene aggiorata 58 57 $arr=$res->fetch(PDO::FETCH_BOTH); … … 88 87 controllo_aff($id_cons,$id_sez,$id_parz); 89 88 include("ele_colora_sez.php"); 89 $BASE=substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['REQUEST_URI'], "/")-16); 90 90 91 91 Header("Location: ".$BASE."admin.php?op=voti&id_cons_gen=$id_cons_gen&id_circ=$id_circ&id_sede=$id_sede&id_sez=$id_sez&ops=1&do=spoglio"); -
trunk/admin/modules/Elezioni/salva_gruppi.php
r352 r358 123 123 $BASE=substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['REQUEST_URI'], "/")-16); 124 124 Header("Location: ".$BASE."admin.php?op=voti&id_cons_gen=$id_cons_gen&id_circ=$id_circ&id_sede=$id_sede&id_sez=$id_sez&do=spoglio&ops=$ops"); 125 125 126 ################################# 126 127 -
trunk/admin/modules/Elezioni/salva_liste.php
r352 r358 58 58 $res->execute(); 59 59 list($circo)=$res->fetch(PDO::FETCH_NUM); 60 61 60 if ($circo) $iscirco="and id_circ=$id_circ"; else $iscirco=''; 62 61 if($id_lista){ … … 90 89 91 90 ################## 92 # if($id_lista){ 91 # if($id_lista){ 92 93 #$andlis="and 93 94 if($pwd3==1) { 94 $sql="delete from ".$prefix."_ele_voti_candidati where id_cons='$id_cons' and id_sez='$id_sez'"; 95 if($id_lista) $condiz="and id_cand in (select id_cand from ".$prefix."_ele_candidati where id_cons='$id_cons' and id_lista='$id_lista')"; else $condiz=''; 96 $sql="delete from ".$prefix."_ele_voti_candidati where id_sez='$id_sez' $condiz"; 95 97 $res = $dbi->prepare("$sql"); 96 98 $res->execute(); … … 111 113 112 114 }elseif($id_lista){ 115 113 116 foreach($idcand as $idkey=>$idc){ 114 117 $sql="select num_cand from ".$prefix."_ele_voti_candidati where id_sez='$id_sez' and id_cand='$idc'"; … … 161 164 $BASE=substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['REQUEST_URI'], "/")-16); 162 165 Header("Location: ".$BASE."admin.php?op=voti&id_cons_gen=$id_cons_gen&id_circ=$id_circ&id_sede=$id_sede&id_sez=$id_sez&do=spoglio&ops=$ops"); 166 167 168 169 163 170 ################################# 164 171
Note:
See TracChangeset
for help on using the changeset viewer.