[2] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | include("config.php");
|
---|
| 4 | if(!$dbi = mysql_connect($dbhost, $dbuname, $dbpass)){
|
---|
| 5 | die("<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 |
|
---|
| 9 | if(!mysql_select_db($dbname)){
|
---|
| 10 | die("<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 | }
|
---|
[23] | 12 | mysql_query("SET NAMES 'utf8'", $dbi);
|
---|
[2] | 13 | if ($fase=='1'){
|
---|
| 14 | $res = mysql_query("SELECT id_cons_gen,descrizione from ".$prefix."_ele_consultazione order by descrizione",$dbi);
|
---|
| 15 | Header("content-type: application/x-javascript");
|
---|
| 16 | echo "document.write(\"<b><select name=\'id_cons_gen2\'>";
|
---|
| 17 |
|
---|
| 18 | while(list($id_cons_gen2,$descr) = mysql_fetch_row($res)) {
|
---|
| 19 | echo "<option value=\'$id_cons_gen2\'>$descr";
|
---|
| 20 | }
|
---|
| 21 | echo "</select>";
|
---|
| 22 | mysql_data_seek($res,0);
|
---|
| 23 | while(list($id_cons_gen2,$descr) = mysql_fetch_row($res)) {
|
---|
| 24 | echo "<input type=\'hidden\' name=\'$id_cons_gen2\' value=\'$descr\'>";
|
---|
| 25 | }
|
---|
| 26 | echo "</b>\")";
|
---|
| 27 |
|
---|
| 28 | }elseif ($fase=='2'){
|
---|
| 29 | $id_cons_gen2=intval($_GET['id_cons_gen2']);
|
---|
[33] | 30 | $rescons = mysql_query("SELECT descrizione from ".$prefix."_ele_consultazione where id_cons_gen='$id_cons_gen2'",$dbi);
|
---|
[2] | 31 | list($descr_cons) = mysql_fetch_row($rescons);
|
---|
| 32 | $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);
|
---|
| 33 | Header("content-type: application/x-javascript");
|
---|
| 34 | echo "document.write(\"<b><input type=\'hidden\' name=\'id_cons_gen2\' value=\'$id_cons_gen2\'><select name=\'id_comune2\'>";
|
---|
| 35 |
|
---|
| 36 | while(list($id_comune2,$descr) = mysql_fetch_row($res)) {
|
---|
| 37 | echo "<option value=\'$id_comune2\'>$descr";
|
---|
| 38 | }
|
---|
| 39 | echo "</select>";
|
---|
| 40 | echo "</b>\")";
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 |
|
---|
| 44 | ?>
|
---|