<?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","YYY");
mysql_select_db("DATABASE",$link);
$query2="SELECT COUNT( CONCAT(categoria.CodigoCA,'-', subcategorias.CodigoSC)) as TODOSMEN FROM categoria LEFT JOIN subcategorias ON subcategorias.CodigoCA=categoria.CodigoCA ";
$result2 = mysql_query($query2) ;
if (mysql_num_rows ($result2))
{while ($row = mysql_fetch_assoc($result2)) {
$NCATSUB="{$row['TODOSMEN']}"; }
}
$query3="SELECT CONCAT(categoria.CodigoCA,'-', subcategorias.CodigoSC,'-', categoria.NombreCA,'-', subcategorias.NombreSC) AS NIN FROM categoria LEFT JOIN subcategorias ON subcategorias.CodigoCA=categoria.CodigoCA GROUP BY categoria.CodigoCA, subcategorias.CodigoSC order by categoria.NombreCA, subcategorias.NombreSC ";
$result3 = mysql_query($query3) ;
while ($line = mysql_fetch_array($result3, MYSQL_ASSOC)) {
;
foreach ($line as $col_value) {
$varD = $col_value;
list( $CodigoCA[],$CodigoSC[],$Categoria[],$Subcategoria[]) = split( '[-]', $varD );
}
}
}
?>
<!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>Inicio</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" />
</head>
<body bgcolor="#C0DFFD">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<?php
require_once("class_MENU.php");
$menu = new MENU();
$menu->openHtmlTest(); // this exists just for test the class.
/* --------------------------- */
$j=0 ;
$h=1 ;
$menu->addMenuName(Principal);
$menu->addMenuImg("imagen3.php?categor=PRINCIPAL");
$menu->addSubMenu(PRINCIPAL,"index.htm","_top");
$menu->buildMenu();
while($j < $NCATSUB )
{
if( $CodigoCA[$j]!= $CodigoCA[$h] )
{ if($j!= 0) { $menu->buildMenu();}
$menu->addMenuName($Categoria[$j]);
$menu->addMenuImg("imagen3.php?categor=$Categoria[$j]");
$menu->addSubMenu($Subcategoria[$j],"housecenterframe.php?categor=".$Categoria[$j]."&subcateg=".$Subcategoria[$j]."","housecenterframe");
$h = $j ;
$j++ ; } // name, link, target }
else { $menu->addSubMenu($Subcategoria[$j],"housecenterframe.php?categor=".$Categoria[$j]."&subcateg=".$Subcategoria[$j]."","housecenterframe");
;
$j++ ;
}
} /* --------------------------- */
$menu->buildMenu();
$menu->addMenuName(Contactos);
$menu->addMenuImg("imagen3.php?categor=CONTACTENOS");
$menu->addSubMenu(CONTACTENOS,"contactenos.php","_top");
$menu->buildMenu();
/* --------------------------- */
// Show all builded menu.
@$menu->showMenu($_GET['selected_menu']); // this parameter maintain menu on the opened one!
/* --------------------------- */
@$menu->closeHtmlTest($_GET["argument"]);
?>
</table>
</body>
</html>