include "admin/config.php";
$lista = $_GET['id'];
if ($lista != '') {
$get_estado = sprintf("SELECT estado FROM estados WHERE id = '%s'", //sql injection
mysql_real_escape_string($lista));// sql injection
$get_estado = mysql_query($get_estado);//sql injection
$get_row = mysql_fetch_array($get_estado);
echo "".$get_row['estado']."
";
$tipo = $_GET["tipo"];
$query = "SELECT * FROM rp_representante WHERE fk_cidade = ".$lista." AND tipo = '".$tipo."' ORDER BY loja";
$result = mysql_query($query) or die(mysql_error());
if (mysql_num_rows($result) > 0){
while ($row = mysql_fetch_array($result)){
$loja = $row["loja"];
$contato = $row["contato"];
$telefone = $row['telefone'];
$telefone2 = $row['telefone2'];
$celular = $row['celular'];
$endereco = $row['endereco'];
$bairro = $row['bairro'];
$cidade = $row['cidade'];
$email = $row['email'];
$site = $row['site'];
?>
if ($loja != "") { ?>
|
|
} ?>
if ($contato != "") { ?>
|
|
} ?>
if ($telefone != "") { ?>
|
|
} ?>
if ($telefone2 != "") { ?>
|
|
} ?>
if ($celular != "") { ?>
|
|
} ?>
if ($endereco != "") { ?>
|
|
} ?>
if ($bairro != "") { ?>
|
|
} ?>
if ($cidade != "") { ?>
|
|
} ?>
if ($email != "") { ?>
|
|
} ?>
if ($site != "") { ?>
|
|
} ?>
}
echo "
";
}else {echo "Não temos representantes neste Estado!
";}
}
?>