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

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