<?php
$CATE = $_GET['categor'];
$SUBCAT = $_GET['subcateg'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- DW6 -->
<head>
<!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
<title>Productos categorizados</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="shortcut icon" href="favicon2.ico">
<link rel="stylesheet" href="mm_travel2.css" type="text/css" />
<style type="text/css">
<!--
.Estilo2 {
font-size: 24px;
font-weight: bold;
}
.Estilo3 {font-size: 18px}
-->
</style>
</head>
<body bgcolor="#C0DFFD" on onload="" language="JavaScript">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50"><img src="mm_spacer.gif" alt="" width="50" height="1" border="0" /></td>
<td colspan="2" valign="top"><img src="mm_spacer.gif" alt="" width="305" height="1" border="0" /><br />
<br />
<br />
<table border="0" cellspacing="0" cellpadding="0" width="441">
<tr>
<?php
include("global.inc.php");
$error.="<li>No ha ingresado uno de los datos requeridos. Por favor vuelva atraz y pruebe nuevamente.";
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$link = mysql_connect("localhost","xxx","YYYY");
mysql_select_db("DATABASE",$link);
$query1="SELECT CONCAT(modcatsub.CodigoCA,'-', modcatsub.CodigoSC,'-', modcatsub.CodigoM,'-', modcatsub.CodigoMO), marcas.Marca, modelos.ModeloN FROM modcatsub LEFT JOIN categoria ON modcatsub.CodigoCA=categoria.CodigoCA LEFT JOIN subcategorias ON modcatsub.CodigoCA=subcategorias.CodigoCA and modcatsub.CodigoSC=subcategorias.CodigoSC LEFT JOIN marcas ON modcatsub.CodigoM=marcas.CodigoM LEFT JOIN modelos ON modcatsub.CodigoM=modelos.CodigoM and modcatsub.CodigoMO=modelos.CodigoMO WHERE categoria.NombreCA='".$CATE."' AND subcategorias.NombreSC='".$SUBCAT."' ORDER BY categoria.CodigoCA, modcatsub.CodigoSC, modcatsub.CodigoM, modcatsub.CodigoMO ";
$result1 = mysql_query($query1) or die('Query failed: ' . mysql_error());
echo "<table border = 1>\n";
?>
</tr>
<tr>
<TH COLSPAN="8"><h5><?php echo "CATEGORIA: $CATE "; ?></h5></TH>
</tr>
<tr>
<TH COLSPAN="8"><h5><?php echo "SUBCATEGORIA: $SUBCAT"; ?></h5></TH>
</tr>
<tr>
<th>Código</th>
<th>Marca</th>
<th>Modelo</th>
<th>Descripción</th>
<th>Precio</th>
</tr>
<TR>
<TD><?php
while ($line = mysql_fetch_array($result1, MYSQL_ASSOC)) {
echo "\t<tr> \n";
foreach ($line as $col_value) {
echo "\t \t <td>$col_value </td> \n";
}
echo "\t</tr>\n";
} }
echo "</table>\n";
mysql_free_result($result1);
// Closing connection
mysql_close($link);
?> </td>
</tr>
</table> </td>
<td width="50"><img src="mm_spacer.gif" alt="" width="50" height="1" border="0" /></td>
</tr>
<tr>
<td width="50"> </td>
<td width="171"> </td>
<td width="170"> </td>
<td width="50"> </td>
</tr>
</table>
</body>
</html>