Changeset 366 for trunk/admin/modules/Elezioni/ele_permessi.php
- Timestamp:
- May 15, 2022, 10:18:37 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/modules/Elezioni/ele_permessi.php
r359 r366 200 200 if ($perms>32 and $permessi<$perms and $aid2) { 201 201 if ($do == "autorizza") { 202 $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')";202 $sql="select num_sez from ".$prefix."_ele_sezioni where id_sez='$id_sez'"; 203 203 $res = $dbi->prepare("$sql"); 204 $res->execute(); 204 $res->execute(); 205 list ($num_sez)=$res->fetch(PDO::FETCH_NUM); 206 $sql="select data_inizio from ".$prefix."_ele_consultazione where id_cons_gen='$id_cons_gen'"; 207 $compl = $dbi->prepare("$sql"); 208 $compl->execute(); 209 list ($datarif)= $compl->fetch(PDO::FETCH_NUM); 210 $sql="select id_cons from ".$prefix."_ele_cons_comune where id_comune='$id_comune' and id_cons_gen in (select id_cons_gen from ".$prefix."_ele_consultazione where data_inizio='$datarif')"; 211 $compl = $dbi->prepare("$sql"); 212 $compl->execute(); 213 while(list ($id_cons)= $compl->fetch(PDO::FETCH_NUM)){ 214 $sql="select id_sez, id_sede from ".$prefix."_ele_sezioni where id_cons='$id_cons' and num_sez='$num_sez'"; 215 $res = $dbi->prepare("$sql"); 216 $res->execute(); 217 if(!$res->rowCount()) continue; 218 list ($id_sez,$id_sede)=$res->fetch(PDO::FETCH_NUM); 219 $sql="select aid from ".$prefix."_ele_operatori where id_cons='$id_cons' and aid='$aid2'"; 220 $res = $dbi->prepare("$sql"); 221 $res->execute(); 222 if($res->rowCount()) continue; 223 $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')"; 224 $res = $dbi->prepare("$sql"); 225 $res->execute(); 226 } 205 227 Header("Location: admin.php?op=permessi&id_cons_gen=$id_cons_gen"); 206 228 } elseif ($do == "update") {
Note:
See TracChangeset
for help on using the changeset viewer.