Problemas com List/Menu
Possuo o código onde já existe um list/Menu, entretanto eu preciso vinculá-lo a diferentes cidades. Mas já inclui a combo nova de cidades porém não consigo fazer com que a combo(List/menu) modifique conforme a cidade escolhida, irei colocar o código a seguir:
Código de Guia de ruas
<?phprequire_once('inc/user_session.php');require_once('inc/idiomas.php');require_once('inc/db.php');require_once('inc/funcoes.php');if ($MenuCidade != 0 && $MenuCidade != '')$result = $result . " AND COD_CIDADE='$MenuCidade'" or die(mysql_error());$conn = mysql_connect(HOST, USER, PASS);mysql_select_db(DB);$result = mysql_query("SELECT DISTINCT COD_RUAS, COD_RUAT,cod_cidade FROM deslocamento_ru<span style='color:green'>as WHERE COD_RUAS <> 0 AND COD_RUAT <> 0 ORDER BY COD_RUAS");$ind = -1;$dados = array();while ($linha = mysql_fetch_array($result)) { $dados[++$ind][0] = $linha[0]; $result2 = mysql_query("SELECT RUA FROM rua WHERE IDIOMA='$idiomaBackwardComp' AND (COD_RUA = '{$dados[$ind][0]}')"); if (mysql_num_rows($result2) == 1) { $dados[$ind][1] = mysql_result($result2, 0, 'rua'); } $dados[$ind][2] = $linha[1]; $result2 = mysql_query("SELECT RUA FROM rua WHERE IDIOMA='$idiomaBackwardComp' AND (COD_RUA = '{$dados[$ind][2]}')"); if (mysql_num_rows($result2) == 1) { $dados[$ind][3] = mysql_result($result2, 0, 'rua'); }}?><html><head><style>.form { font-family: verdana; font-size: 11px; color: ##999999;; background-color: #FFFFFF; border-color: #666 #2222222 #111111 #777; border-style: solid; border-width: 1px; }</style><title> [ Central de Informações ] - Oferecendo informações para seu bem estar diário.</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link href="novo.css" rel="stylesheet" type="text/css"></head><body leftmargin="0" topmargin="0"><?php require ('req_topo.php'); ?><br><?php require('req_publicidade.php'); ?><br><br><form action="guia_ruas_lista_teste.php" method="GET"><input type="hidden" name="acao" value="rota"><table width="720" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="100%" valign="top"> <table width="524" border="0" align="center" cellpadding="0" cellspacing="0" background="images/guia_fundo.gif"> <tr> <td valign="top"> <?phpif ($_SESSION['idioma'] == I_PORTUGUES) echo '<img src="images/guia_topo_BR.gif" width="524" height="54" hspace="0" vspace="0" border="0">';elseif ($_SESSION['idioma'] == I_INGLES) echo '<img src="images/guia_topo_IN.gif" width="524" height="54" hspace="0" vspace="0" border="0">';?> </td> </tr> </table> <table width="524" border="0" align="center" cellpadding="0" cellspacing="0" background="images/guia_fundo.gif"> <tr> <td> <div align="left"> </div></td> </tr> </table> <table width="524" border="0" align="center" cellpadding="0" cellspacing="0" background="images/guia_fundo.gif"> <tr> <td><table width="95%" border="0" align="center" cellpadding="2" cellspacing="0" background="images/guia_fundo_interno.gif"> <tr> <td width="3%"> </td> <td width="97%"><select name="MenuCidade" id="MenuCidade" class='form'"> <? $q0 = "SELECT cidade,codigo from Cidade "; // Voce logo abaixo esta tentando obter o codigo, precisa incluir na sql $r0 = mysql_query($q0) or die(mysql_error()); $l0 = mysql_num_rows($r0); //print "<option value='0'>TODAS</option>"; for ($c0=0;$c0<$l0;$c0++) { $cod_cid = mysql_result($r0,$c0,"codigo"); $desc_cid = mysql_result($r0,$c0,"cidade"); print "<option value='$cod_cid'>$desc_cid</option>"; } ?> </select></td> </tr> <tr> <td colspan="2"><img src="images/transparente.gif" width="10" height="10"></td> </tr> <tr> <td colspan="2"><strong><img src="images/transparente.gif" width="10" height="10"><img src="images/quadrado.gif" width="7" height="7"> <?php echo $traducoes['partida'] ?></strong></td> </tr> <tr> <td colspan="2"><img src="images/transparente.gif" width="10" height="10"><?php echo $traducoes['selpartida'] ?>:</td> </tr> <tr> <td colspan="2"><img src="images/transparente.gif" width="10" height="10"> <select name="partida" id="select3" class='form'> <?phpwhile ($linha = current($dados)) {?> <option value="<?php echo $linha[0] . ',' . $linha[2] ?>"><?php echo $linha[1] . ' ' . $traducoes['comlateral'] . ' ' . $linha[3] ?></option> <?php next($dados);}?> </select></td> </tr> <tr> <td colspan="2"><img src="images/transparente.gif" width="10" height="10"></td> </tr> </table></td> </tr> </table> <table width="524" border="0" align="center" cellpadding="0" cellspacing="0" background="images/guia_fundo.gif"> <tr> <td> </td> </tr> </table> <table width="524" border="0" align="center" cellpadding="0" cellspacing="0" background="images/guia_fundo.gif"> <tr> <td><table width="95%" border="0" align="center" cellpadding="2" cellspacing="0" background="images/guia_fundo_interno.gif"> <tr> <td><img src="images/transparente.gif" width="10" height="10"></td> </tr> <tr> <td><strong><img src="images/transparente.gif" width="10" height="10"><img src="images/quadrado.gif" width="7" height="7"> <?php echo $traducoes['destino'] ?></strong></td> </tr> <tr> <td height="17"><img src="images/transparente.gif" width="10" height="10"><?php echo $traducoes['logradouro'] ?>:</td> </tr> <tr> <td><img src="images/transparente.gif" width="10" height="10"><input type="text" name="logradouro" id="logradouro" size="45" style="BACKGROUND-COLOR: #FFFFFF; BORDER-BOTTOM: #999999 1px solid; BORDER-LEFT: #999999 1px solid; BORDER-RIGHT: #999999 1px solid; BORDER-TOP: #999999 1px solid; FONT-FAMILY: Verdana; FONT-SIZE: 8pt"></td> </tr> <tr> <td class="rodape"><img src="images/transparente.gif" width="10" height="10"><?php echo isset($msg) || isset($rua_dest) ? '' : $traducoes['informe'] . '.' ?></td> </tr> <tr> <td> <img src="images/transparente.gif" width="10" height="10"></td> </tr> </table></td> </tr> </table> <table width="524" border="0" align="center" cellpadding="0" cellspacing="0" background="images/guia_fundo.gif"> <tr> <td> </td> </tr> </table> <table width="524" border="0" align="center" cellpadding="0" cellspacing="0" background="images/guia_fundo.gif"> <tr> <td><table width="95%" border="0" align="center" cellpadding="2" cellspacing="0" background="images/guia_fundo_interno.gif"> <tr> <td colspan="4"><img src="images/transparente.gif" width="10" height="10"></td> </tr> <tr> <td colspan="4"><strong><img src="images/transparente.gif" width="10" height="10"><img src="images/quadrado.gif" width="7" height="7"> <?php echo $traducoes['tipo'] ?></strong></td> </tr> <tr> <td width="20%" height="17"><img src="images/transparente.gif" width="10" height="10"> <input type="radio" name="tipo_consulta" value="RUA" checked> <?php echo $traducoes['rua'] ?></td> <td width="26%"> <input type="radio" name="tipo_consulta" value="BAIRRO"> <?php echo $traducoes['bairro'] ?></td> <td width="30%"> <input type="radio" name="tipo_consulta" value="REFERENCIA"> <?php echo $traducoes['referencia'] ?></td> <td width="24%"> <input type="radio" name="tipo_consulta" value="COD_RUA"> <?php echo $traducoes['codigo'] ?></td> </tr> <tr> <td colspan="4"> <img src="images/transparente.gif" width="10" height="10"></td> </tr> </table></td> </tr> </table> <table width="524" border="0" align="center" cellpadding="0" cellspacing="0" background="images/guia_fundo.gif"> <tr> <td> </td> </tr> </table> <table width="524" border="0" align="center" cellpadding="0" cellspacing="0" background="images/guia_fundo.gif"> <tr> <td> <?phpif (!isset($msg)) {?> </td> </tr> </table> <table width="524" border="0" align="center" cellpadding="0" cellspacing="0" background="images/guia_fundo.gif"> <tr> <td> </td> </tr> </table> <table width="524" border="0" align="center" cellpadding="0" cellspacing="0" background="images/guia_fundo.gif"> <tr> <td><div align="center"> <?phpif ($_SESSION['idioma'] == I_PORTUGUES) echo '<input type="image" src="images/guia_consultar_BR.gif" width="80" height="20" hspace="0" vspace="0" border="0">';elseif ($_SESSION['idioma'] == I_INGLES) echo '<input type="image" src="images/guia_consultar_IN.gif" width="80" height="20" hspace="0" vspace="0" border="0">';?> </div></td> </tr> </table> <table width="524" border="0" align="center" cellpadding="0" cellspacing="0" background="images/guia_fundo.gif"> <tr> <td> <?php}?> </td> </tr> </table> <table width="524" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><img src="images/guia_base.gif" width="524" height="7"></td> </tr> </table> </td> </tr></table></form><div align="center"><br> <a href="javascript:history.back(1)"> <?phpif ($_SESSION['idioma'] == I_PORTUGUES) echo '<img src="images/bt-voltar.gif" width="61" height="16" border="0">';elseif ($_SESSION['idioma'] == I_INGLES) echo '<img src="images/bt-back.gif" width="61" height="16" border="0">';?> </a><br> <br></div><?php require('req_rodape.php'); ?></body></html>Discussão (7)
Carregando comentários...