source: trunk/client/inc/javascript.php@ 64

Last change on this file since 64 was 64, checked in by roby, 15 years ago

icorretto calcolo percentuali in visualizzazione riepilogo voti (da completare con arrotondamento percentuali) + vari aggiustamenti

File size: 3.8 KB
Line 
1<?php
2/************************************************************************/
3/* Eleonline - Raccolta e diffusione dei dati elettorali */
4/* by Luciano Apolito & Roberto Gigli */
5/* http://www.eleonline.it */
6/* info@eleonline.it luciano@aniene.net rgigli@libero.it */
7/************************************************************************/
8
9if (stristr(htmlentities($_SERVER['PHP_SELF']), "javascript.php")) {
10 Header("Location: ../index.php");
11 die();
12}
13
14##################################################
15# Include funzioni javascript #
16##################################################
17#timer per tema tour
18# inizio rotazione
19if (isset($_SESSION['ruota']))
20{
21?>
22
23 <script type="text/javascript" language="javascript">
24<!--
25function loadpage() {
26
27thetimer = setTimeout("changepage()", 20000);
28
29
30}
31
32function changepage() {
33
34newlocation = "<?php echo "modules.php?csv=1&block=0&id_cons_gen=".$_GET['id_cons_gen']."&id_comune=".$_GET['id_comune']; ?>"
35location = newlocation
36}
37// --></script>
38
39<?php
40}
41# fine rotazione
42# googlemaps per sezioni
43# variabili nel config.php
44# gkey= chiave google reperibile per il proprio sito qui
45# http://code.google.com/intl/it/apis/maps/signup.html
46# googlemaps 1=attivo 2: disattivo
47# funzione by eleonline.it
48#########################################################
49
50function googlemaps(){
51global $dbi,$prefix,$id_comune,$googlemaps,$op,$gkey,$lang;
52# recupera gli inidirizzi
53 $id_sede=$_GET['id_sede'];
54 $sql = mysql_query("SELECT descrizione FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ", $dbi);
55 list($comune) = mysql_fetch_row($sql);
56 $sql = mysql_query("select indirizzo from ".$prefix."_ele_sede where id_sede='$id_sede'", $dbi);
57 list($indirizzo)=mysql_fetch_row($sql);
58 $indirizzocomune="$indirizzo , $comune , $lang";
59# javascript per mappa
60$jsmaps ="
61 <div id=\"mapsearch\" style=\"margin:0 auto 0;\">
62 <span style=\"color:#676767;font-size:11px;margin:10px;padding:4px;\">Loading...</span>
63 </div>
64
65
66 <script src=\"http://maps.google.com/maps?file=api&amp;v=2&amp;key=$gkey\"
67 type=\"text/javascript\"></script>
68 <script src=\"http://www.google.com/uds/api?file=uds.js&v=1.0&source=uds-msw&key=$gkey\"
69 type=\"text/javascript\"></script>
70 <style type=\"text/css\">
71 @import url(\"http://www.google.com/uds/css/gsearch.css\");
72 </style>
73 <script type=\"text/javascript\">
74 window._uds_msw_donotrepair = true;
75 </script>
76 <script src=\"http://www.google.com/uds/solutions/mapsearch/gsmapsearch.js?mode=new\"
77 type=\"text/javascript\"></script>
78 <style type=\"text/css\">
79 @import url(\"http://www.google.com/uds/solutions/mapsearch/gsmapsearch.css\");
80 </style>
81
82 <style type=\"text/css\">
83 .gsmsc-mapDiv {
84 height : 350px;
85 }
86
87 .gsmsc-idleMapDiv {
88 height : 350px;
89 }
90
91 #mapsearch {
92 width : 450px;
93 margin: 10px;
94 padding: 4px;
95 }
96 </style>
97 <script type=\"text/javascript\">
98 function LoadMapSearchControl() {
99
100 var options = {
101 zoomControl : GSmapSearchControl.ZOOM_CONTROL_ENABLE_ALL,
102 title : \"$indirizzo\",
103 url : \"http://www.eleonline.it\",
104 idleMapZoom : GSmapSearchControl.ACTIVE_MAP_ZOOM+1,
105 activeMapZoom : GSmapSearchControl.ACTIVE_MAP_ZOOM+1
106 }
107
108 new GSmapSearchControl(
109 document.getElementById(\"mapsearch\"),
110 \"$indirizzocomune\",
111 options
112 );
113
114 }
115
116 GSearch.setOnLoadCallback(LoadMapSearchControl);
117 </script>
118
119 <center>";
120
121return $jsmaps;
122}
123
124
125?>
Note: See TracBrowser for help on using the repository browser.