source: trunk/client/modules/Elezioni/backup2.php@ 388

Last change on this file since 388 was 323, checked in by roby, 5 years ago
File size: 2.5 KB
RevLine 
[2]1<?php
[322]2global $dbi,$prefix;
3$id_comune=intval($_GET['id_comune']);
4$id_cons_gen=intval($_GET['id_cons_gen']);
[321]5$sql="select id_cons from ".$prefix."_ele_cons_comune where id_cons_gen='$id_cons_gen' and id_comune='$id_comune'" ;
[265]6 $res = $dbi->prepare("$sql");
7 $res->execute();
8
[321]9list($id_cons)=$res->fetch(PDO::FETCH_NUM);
[2]10#echo "id_cons=$id_cons<br/>";
[265]11$sql="select * from ".$prefix."_ele_cons_comune where id_cons='$id_cons'" ;
[321]12scarica_array($sql,$prefix."_ele_cons_comune");
[265]13
14$sql="select * from ".$prefix."_ele_gruppo where id_cons='$id_cons'" ;
[321]15scarica_array($sql,$prefix."_ele_gruppo");
[265]16
17$sql="select * from ".$prefix."_ele_lista where id_cons='$id_cons'" ;
[321]18scarica_array($sql,$prefix."_ele_lista");
[265]19
20$sql="select * from ".$prefix."_ele_candidati where id_cons='$id_cons'" ;
[321]21scarica_array($sql,$prefix."_ele_candidati");
[265]22
23$sql="select * from ".$prefix."_ele_circoscrizione where id_cons='$id_cons'" ;
[321]24scarica_array($sql,$prefix."_ele_circoscrizione");
[265]25
26$sql="select * from ".$prefix."_ele_sede where id_cons='$id_cons'" ;
[321]27scarica_array($sql,$prefix."_ele_sede");
[265]28
29$sql="select * from ".$prefix."_ele_sezioni where id_cons='$id_cons'" ;
[321]30scarica_array($sql,$prefix."_ele_sezioni");
[265]31
32$sql="select * from ".$prefix."_ele_link where id_cons='$id_cons'" ;
[321]33scarica_array($sql,$prefix."_ele_link");
[265]34
35$sql="select * from ".$prefix."_ele_come where id_cons='$id_cons'" ;
[321]36scarica_array($sql,$prefix."_ele_come");
[265]37
38$sql="select * from ".$prefix."_ele_numeri where id_cons='$id_cons'" ;
[321]39scarica_array($sql,$prefix."_ele_numeri");
[265]40
41$sql="select * from ".$prefix."_ele_servizi where id_cons='$id_cons'" ;
[321]42scarica_array($sql,$prefix."_ele_servizi");
[265]43
44$sql="select * from ".$prefix."_ele_voti_candidati where id_cons='$id_cons'" ;
[321]45scarica_array($sql,$prefix."_ele_voti_candidati");
[265]46
47$sql="select * from ".$prefix."_ele_voti_gruppo where id_cons='$id_cons'" ;
[321]48scarica_array($sql,$prefix."_ele_voti_gruppo");
[265]49
50$sql="select * from ".$prefix."_ele_voti_lista where id_cons='$id_cons'" ;
[321]51scarica_array($sql,$prefix."_ele_voti_lista");
[265]52
53$sql="select * from ".$prefix."_ele_voti_parziale where id_cons='$id_cons'" ;
[321]54scarica_array($sql,$prefix."_ele_voti_parziale");
[265]55
56$sql="select * from ".$prefix."_ele_voti_ref where id_cons='$id_cons'" ;
[321]57scarica_array($sql,$prefix."_ele_voti_ref");
58
59
60function scarica_array($sql,$tab){
[322]61 global $dbi;
[265]62 $res_comune = $dbi->prepare("$sql");
63 $res_comune->execute();
[321]64 echo "[$tab]\n";
[323]65 while ($lista = $res_comune->fetch(PDO::FETCH_NUM)) {
[321]66 $x=0;
67 foreach ($lista as $key=>$val) {$riga[$key]=base64_encode($val);
68 if ($x++) echo ":";
69
70 echo "'".$riga[$key]."'";
71 }
72 echo "\n";
[2]73 }
74}
75?>
Note: See TracBrowser for help on using the repository browser.