source: trunk/client/file.php@ 2

Last change on this file since 2 was 2, checked in by root, 15 years ago

importo il progetto

File size: 2.0 KB
Line 
1<?php
2
3include("config.php");
4if(!$dbi = mysql_connect($dbhost, $dbuname, $dbpass)){
5die("<center><img src=\"images/logo.gif\" target=\"Logo Avviso Errore\"><br><br><b>Ci sono dei problemi di connessione al Server $dbtype, chiediamo scusa per l'inconveniente.<br><br>Provate piu' tardi, Grazie.</b><br><font color=\"#ff0000\">". mysql_error()."</font></center>");
6}
7$fase=intval($_GET['fase']);
8
9if(!mysql_select_db($dbname)){
10die("<center><img src=src=\"images/logo.gif\" target=\"Logo Avviso Errore\"><br><br><b>Ci sono dei problemi di connessione al DataBase $dbtype, chiediamo scusa per l'inconveniente.<br><br>Provate piu' tardi, Grazie.</b><br><font color=\"#ff0000\">". mysql_error()."</font></center>");
11}
12if ($fase=='1'){
13 $res = mysql_query("SELECT id_cons_gen,descrizione from ".$prefix."_ele_consultazione order by descrizione",$dbi);
14Header("content-type: application/x-javascript");
15echo "document.write(\"<b><select name=\'id_cons_gen2\'>";
16
17while(list($id_cons_gen2,$descr) = mysql_fetch_row($res)) {
18 echo "<option value=\'$id_cons_gen2\'>$descr";
19 }
20 echo "</select>";
21mysql_data_seek($res,0);
22while(list($id_cons_gen2,$descr) = mysql_fetch_row($res)) {
23 echo "<input type=\'hidden\' name=\'$id_cons_gen2\' value=\'$descr\'>";
24 }
25echo "</b>\")";
26
27}elseif ($fase=='2'){
28 $id_cons_gen2=intval($_GET['id_cons_gen2']);
29 $rescons = mysql_query("SELECT descrizione from ".$prefix."_ele_consultazione where id_cons_gen='$id_cons_gen'",$dbi);
30 list($descr_cons) = mysql_fetch_row($rescons);
31 $res = mysql_query("SELECT t2.id_comune,t2.descrizione from ".$prefix."_ele_cons_comune as t1 left join ".$prefix."_ele_comuni as t2 on t1.id_comune=t2.id_comune where t1.id_cons_gen=$id_cons_gen2 order by t2.descrizione ",$dbi);
32Header("content-type: application/x-javascript");
33echo "document.write(\"<b><input type=\'hidden\' name=\'id_cons_gen2\' value=\'$id_cons_gen2\'><select name=\'id_comune2\'>";
34
35while(list($id_comune2,$descr) = mysql_fetch_row($res)) {
36 echo "<option value=\'$id_comune2\'>$descr";
37 }
38 echo "</select>";
39echo "</b>\")";
40}
41
42
43?>
Note: See TracBrowser for help on using the repository browser.