<?php
//Carga de datos de Conexion
require("conexion.php");
//Conexion a base de Datos SQL
$link;
//Buscando informacion del sistema de forma General
$buscando_infoweb = mysql_query("select * FROM infoweb where id_infoweb=1");
//Buscando informacion de la EMPRESA
$buscando_empresa = mysql_query("select * FROM empresa where id_empresa=1");
//CAPTURA DEL FORMULARIO
$form_categoria = $_POST['form_categoria'];
$form_producto = $_POST['form_producto'];
if($form_categoria == "si"){
$enviado = "no";
}else{
$enviado = "si";
}
?>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $infoweb['titulo']; ?></title>
<link href="catalogo.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="texto_blanco" id="cuerpo_superior">
<span class="titulo_superior"><?php echo $empresa['nombre']; ?></span><br />
<?php echo $infoweb['titulo']." V.".$infoweb['version'].".0"; ?><br />
<br />
<?php
//informacion de la emrpsa
echo $empresa['direccion']."<br>";
echo "Telefono: ".$empresa['telefono']."<br>";
echo "Fax: ".$empresa['fax']."<br>";
echo $empresa['mail']."<br>";
?>
<br />
</div>
<div class="texto_blanco" id="cuerpo_info">
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td width="5%"><img src="imagenes/usuarios.jpg" width="16" height="16" /></td>
<td width="42%">
<?php
//Sistema de Contador
include("sist_contador.php");
?></td>
<td width="47%">
<div align="right">
<?php
//Sistema de Contador
?>
</div></td>
<td width="1%"> </td>
<td width="5%"><div align="right"><img src="imagenes/calendar02.gif" alt="" width="16" height="16" /></div></td>
</tr>
</table>
</div>
<div id="cuerpo_general">
<div class="texto_Negro" id="cuerpo_interior">
<form id="form1" name="form1" method="post" action="index.php"><div align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td colspan="2"><div align="left"><strong>BUSQUEDA DE PRODUCTOS</strong></div></td>
<td> </td>
<td><div align="left"><strong>Informacion General</strong></div></td>
</tr>
<tr>
<td width="16%"><div align="left">Categoria</div></td>
<td width="28%"><label>
<div align="left">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="72%"><select name="form_categoria" class="texto_Negro" id="form_categoria">
<option value="si" >Ofertas</option>
<?php
//Visulizando el listado del personal
$buscando_cetegorias = mysql_query("select * FROM categorias order by nombre asc"); ?>
<option value="<?php echo $categorias['id_categorias']; ?>" ><?php echo $categorias['nombre']; ?></option>
<?php
}
?>
</select></td>
<td width="28%"><div align="center"><img src="imagenes/serch.gif" width="14" height="14" /></div></td>
</tr>
</table>
</div>
</label></td>
<td width="4%"> </td>
<td width="52%" rowspan="3" align="left" valign="top"><div align="left">En este sistema usted podra encontrar cualquier informaicon de nuestros productos ofrecidos por nuestra emrpesa.</div></td>
</tr>
<tr>
<td><div align="left">Producto</div></td>
<td><div align="left">
<label>
<input name="form_producto" type="text" class="texto_Negro" id="form_producto" size="16" />
</label>
</div></td>
<td> </td>
</tr>
<tr>
<td colspan="2"><div align="right">
<input name="enviado" type="hidden" id="enviado" value="si" />
<input name="button" type="submit" class="texto_Negro" id="button" value="Buscar" />
</div></td>
<td> </td>
</tr>
</table>
</div>
</form>
</div>
<?php
if($enviado == 'si'){
?>
<table width="408" border="1" cellpadding="4" cellspacing="0" bordercolor="#CCCCCC">
<tr>
<td>Busqueda de Productos</td>
</tr>
</table>
<br />
<?
//Cuerpo BUSQUEDA
$buscando_productos = mysql_query("select * FROM productos where nombre like '%$form_producto%' and categoria_id like '%$form_categoria%' order by precio asc"); ?>
<table width="408" border="1" cellpadding="4" cellspacing="0" bordercolor="#CCCCCC">
<tr>
<td width="29%">
<?php
if($productos['mime'] == ""){?>
<div align="center">
Sin Imagen
</div>
<?php
}else{
?>
<img src="<?php echo "ver.php?id_imagen=$productos[idproductos]"; ?>">
<?php
}
?>
</td>
<td width="71%"><p> <span class="texto_MiniTitulo"><strong>Producto: <?php echo $productos['nombre']; ?></strong></span><br />
Categoria:
<?php
$buscando_cetegorias2 = mysql_query("select * FROM categorias where id_categorias = '$productos[categoria_id]'"); if($categorias2['nombre'] == ""){
echo "Categoria Eliminada";
}else{
echo $categorias2['nombre'];
}
?>
<br />
Informacion: <?php echo $productos['info']; ?><br />
<span class="texto_verde"><strong>
<?php
if($productos['precio'] != 0){
echo "Precio: $ ".$productos['precio'];
}
if($productos['precio'] != 0 && $productos['cantidad'] != 0){
echo " - ";
}
if($productos['cantidad'] != 0){
echo "Cantidad: ".$productos['cantidad'];
}
?></strong></span></p>
</td>
</tr>
</table>
<br />
<?
}
}else{
?>
<table width="408" border="1" cellpadding="4" cellspacing="0" bordercolor="#CCCCCC">
<tr>
<td>Ofertas de Productos</td>
</tr>
</table>
<br />
<?php
//Busqueda de productos
$buscando_productos = mysql_query("select * FROM productos where oferta like '1' and nombre like '%$form_producto%' order by precio asc"); ?>
<table width="408" border="1" cellpadding="4" cellspacing="0" bordercolor="#CCCCCC">
<tr>
<td width="29%">
<?php
if($productos['mime'] == ""){?>
<div align="center">
Sin Imagen
</div>
<?php
}else{
?>
<img src="<?php echo "ver.php?id_imagen=$productos[idproductos]"; ?>">
<?php
}
?>
</td>
<td width="71%"><p> <span class="texto_MiniTitulo"><strong>Producto: <?php echo $productos['nombre']; ?></strong></span><br />
Categoria:
<?php
$buscando_cetegorias2 = mysql_query("select * FROM categorias where id_categorias = '$productos[categoria_id]'"); if($categorias2['nombre'] == ""){
echo "Categoria Eliminada";
}else{
echo $categorias2['nombre'];
}
?>
<br />
Informacion: <?php echo $productos['info']; ?><br />
<span class="texto_verde">
<strong>
<?php
if($productos['precio'] != 0){
echo "Precio: $ ".$productos['precio'];
}
if($productos['precio'] != 0 && $productos['cantidad'] != 0){
echo " - ";
}
if($productos['cantidad'] != 0){
echo "Cantidad: ".$productos['cantidad'];
}
?>
</strong></span></p>
</td>
</tr>
</table>
<br />
<?
}//fin busqueda de productos
}
?>
<br />
</div>
<?php
?>}
</body>
</html>