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

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