<?php
include("./libreria/class.carrito.php");
include("./libreria/class.mysql.php");
include("./libreria/conn.php");
session_start();
include("./libreria/funciones.php");
include('./libreria/inicia_sesion_carrito.php');
if(!isset($_SESSION["sMostrarPrecios"])){
$_SESSION["sMostrarPrecios"]=1;
}
if(isset($_GET["precios"])){
if($_GET["precios"]=="1"){
$_SESSION["sMostrarPrecios"]=1;
}elseif($_GET["precios"]==="0"){
$_SESSION["sMostrarPrecios"]=0;
}
header("Location: index.php");
exit;
}
if(isset($_POST['service']) && $_POST['service'] <> ''){
if(isset($_POST["tipoNeumatico"]) && $_POST["tipoNeumatico"]>0){
$where=" AND fk_producto2_cat='".$_POST["tipoNeumatico"]."'";
}
$sql="SELECT DISTINCT(P.pro_descripcion_buscador) FROM t_producto2 P, t_producto2_texto PT WHERE P.pk_producto2=PT.fk_producto2 AND PT.fk_idioma=1 AND P.pro_activo AND P.pro_descripcion_buscador LIKE '".$_POST['service']."%' ".$where." ORDER BY P.pro_descripcion_buscador LIMIT 0,10";
$res=mysqli_query($sql);
while($reg=mysqli_fetch_array($res)){
echo '<div class="suggest-element"><a data="'.$reg["pro_descripcion_buscador"].'" id="service'.$reg['pk_producto2'].'">'.$reg["pro_descripcion_buscador"].'</a></div>';
}
exit;
}
if($_GET[cerrar]=="ok"){
$_SESSION[usuario]="";
}
/*if($_SESSION[usuario]<>""){
header("Location: ./acceso_cliente.php");
exit;
}*/
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel=�icon� type=�image/png� href=�images/favicon.png�/>
<title>Neumaticos Recambios Segorbe</title>
<script type='text/javascript' src='./libreria/jquery-autocomplete.js'></script>
<script type="text/javascript" src="./libreria/run.js"></script>
<script>
function getCookie(name){
var cname = name + "=";
var dc = document.cookie;
if (dc.length > 0) {
begin = dc.indexOf(cname);
if (begin != -1) {
begin += cname.length;
end = dc.indexOf(";", begin);
if (end == -1) end = dc.length;
return unescape(dc.substring(begin, end));
}
}
return null;
}
function setCookie(name, value, expires, path, domain, secure) {
document.cookie = name + "=" + escape(value) +
((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
((path == null) ? "" : "; path=" + path) +
((domain == null) ? "" : "; domain=" + domain) +
((secure == null) ? "" : "; secure");
}
function delCookie (name,path,domain) {
if (getCookie(name)) {
document.cookie = name + "=" +
((path == null) ? "" : "; path=" + path) +
((domain == null) ? "" : "; domain=" + domain) +
"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}
function cargarcookie(info){
// Cu�ntas veces
var usuario = getCookie('usuario')
if ( usuario!= null) {
document.form1.user.value=usuario;
}
}
</script>
<script type="text/javascript">
$(document).ready(function() {
//Al escribr dentro del input con id="service"
$('#breferencia').keyup(function(){
var tipoNeumatico = $('#btipo').val();
//Obtenemos el value del input
var service = $(this).val();
var dataString = 'service='+service+'&tipoNeumatico='+tipoNeumatico;
if(service=='' || service==null){
$('#suggestions').fadeOut(1);
}else{
//Le pasamos el valor del input al ajax
$.ajax({
type: "POST",
url: "index.php",
data: dataString,
success: function(data) {
//Escribimos las sugerencias que nos manda la consulta
$('#suggestions').fadeIn(1000).html(data);
//Al hacer click en algua de las sugerencias
$('.suggest-element a').live('click', function(){
//Obtenemos la id unica de la sugerencia pulsada
var id = $(this).attr('id');
//Editamos el valor del input con data de la sugerencia pulsada
$('#breferencia').val($('#'+id).attr('data'));
//Hacemos desaparecer el resto de sugerencias
$('#suggestions').fadeOut(1000);
//alert('Has seleccionado el '+id+' '+$('#'+id).attr('data'));
return false;
});
}
});
}
});
});
</script>
<style>
.suggest-element{
padding-left:5px;
padding-top:5px;
padding-bottom:5px;
width:120px;
cursor:pointer;
border-bottom:1px solid #000;
}
.suggest-element a, .suggest-element a:hover{
font-family:Verdana, Geneva, sans-serif;
font-size:11px;
color:#000;
font-weight:normal;
display:inline;
width:100%;
}
#suggestions {
width:150px;
height:80px;
overflow: auto;
background-color:#FFF;
display:none;
}
</style>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<link href="estilos.css" rel="stylesheet" type="text/css">
<link href="styleshop.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.Estilo1 {color: #FFB442}
-->
</style>
<?php include("includes/cookies.php");?>
</head>
<?php
$img_cabecera="cabecera-index.jpg";
include("includes/cabecera.php"); ?>
<table width="754" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td align="center" valign="top">
<table width="100%" height="40" border="0" cellpadding="0" cellspacing="0">
<?php
if($_SESSION["usuario"]<>""){
if(permiteBusquedasConsultas()){
?>
<tr>
<td width="608" height="238" colspan="3" valign="top" class="backBuscadorNew">
<table width="100%" border="0">
<tr>
<td width="178" valign="top" class="buscaMini">
<form name="formBusca01" method="get" action="listado.php">
<table width="95%" border="0">
<tr>
<td class="titulo">Tipología:<br />
<select name="btipo" id="btipo" style="width:140px;">
<option value="0"> - Todos - </option>
<?php
$sql="SELECT * FROM t_producto2_cat PC, t_producto2_cat_texto PCT WHERE PC.pk_producto2_cat=PCT.fk_producto2_cat AND PCT.fk_idioma=1 AND PC.pro_cat_activo ORDER BY PC.pro_cat_orden";
$res=mysqli_query($sql);
while($reg=mysqli_fetch_array($res)){
?>
<option value="<?=$reg["pk_producto2_cat"];?>"><?=$reg["pro_cat_nombre"];?></option>
<?php
}?>
</select>
</td>
</tr>
<tr>
<td class="titulo">Referencia<br>
<input name="breferencia" id="breferencia" style="width:140px;" class="campo" type="text" autocomplete="off" /><br>
<div class="txtMini">Ejemplo: 1557013</div><div id="suggestions"></div>
</td>
</tr>
<tr>
<td><input name="buscar" type="submit" class="boton" value="Buscar" style="background-color:#000;" /></td>
</tr>
</table>
</td>
<td> </td>
<td width="210" valign="top" class="buscaMini"><?php include("includes/buscador.php");?></td>
</tr>
</table>
</form>
</td>
</tr>
<?php
}
}else{
?>
<tr>
<td width="608" height="153" colspan="3" valign="top">
<?php
if(isMobile()){?>
<img src="./uploads/fotoflash.jpg" />
<?php
}else{
$obj=new conectarBBDD(SERVER,USER,PASS,BBDD);
$obj->conectar();
$obj->consultar("select * from t_banner B, t_banner_texto BC WHERE B.pk_banner=BC.fk_banner && BC.fk_idioma=1 && B.pk_banner=0 AND B.ban_activo=1 ORDER BY B.ban_orden");
$num_reg=$obj->obtenNumRegs();
if($num_reg>0){
$reg=$obj->obtendatos();
?>
<img src="./uploads/banner/<?=$reg->ban_imagen;?>" width="750" height="372" >
</td>
</tr>
<?php }
}?>
<?php }?>
<tr>
<td>
<table width="754" border="0" cellspacing="0" cellpadding="0" style="float:left; margin-top:10px;">
<tr>
<?php
$obj=new conectarBBDD(SERVER,USER,PASS,BBDD);
$obj->conectar();
$obj->consultar("select * from t_banner B, t_banner_texto BC WHERE B.pk_banner=BC.fk_banner && BC.fk_idioma=1 && B.ban_orden=2 AND B.ban_activo=1 ORDER BY B.ban_orden");
$num_reg=$obj->obtenNumRegs();
if($num_reg>0){
$reg=$obj->obtendatos();
}
if($_SESSION["sMostrarPrecios"]==1){
$enlace="./uploads/banner/1_img_presupuesto.jpg";
$url="./index.php?precios=0";
$titulo="Acceder a Presupuestos";
}else{
$enlace="./uploads/banner/1_img_pedido.jpg";
$url="./index.php?precios=1";
$titulo="Acceder a Pedidos";
}
?>
<td width="290px" height="120" rowspan="2"><a href="<?=$url;?>"><img src="<?=$enlace;?>" width="290" border="0" alt="<?=$titulo?>" title="<?=$titulo?>" /></a></td>
<!--<td width="290px" height="120" rowspan="2"><?php if($num_reg>0){?><?php if($reg->ban_enlace<>""){?><a href="<?=$reg->ban_enlace;?>"<?php if($reg->ban_target==1){?> target="_blank"<?php }?>><?php }?><img src="./uploads/banner/<?=$reg->ban_imagen;?>" width="290" border="0" alt="<?=$reg->ban_titulo?>" title="<?=$reg->ban_titulo?>" /><?php if($reg->ban_enlace<>""){?></a><?php }?><?php }?></td>-->
<?php
$obj=new conectarBBDD(SERVER,USER,PASS,BBDD);
$obj->conectar();
$obj->consultar("select * from t_banner B, t_banner_texto BC WHERE B.pk_banner=BC.fk_banner && BC.fk_idioma=1 && B.ban_orden=3 AND B.ban_activo=1 ORDER BY B.ban_orden");
$num_reg=$obj->obtenNumRegs();
if($num_reg>0){
$reg=$obj->obtendatos();
}
?>
<td rowspan="2"><?php if($num_reg>0){?><?php if($reg->ban_enlace<>""){?><a href="<?=$reg->ban_enlace;?>"<?php if($reg->ban_target==1){?> target="_blank"<?php }?>><?php }?><img src="./uploads/banner/<?=$reg->ban_imagen;?>" width="290" border="0" alt="<?=$reg->ban_titulo?>" title="<?=$reg->ban_titulo?>" /><?php if($reg->ban_enlace<>""){?></a><?php }?><?php }?></td>
</tr>
<tr>
</tr>
<tr>
<td height="14"></td>
<td></td>
</tr>
<tr>
<?php
$obj=new conectarBBDD(SERVER,USER,PASS,BBDD);
$obj->conectar();
$obj->consultar("select * from t_banner B, t_banner_texto BC WHERE B.pk_banner=BC.fk_banner && BC.fk_idioma=1 && B.ban_orden=4 AND B.ban_activo=1 ORDER BY B.ban_orden");
$num_reg=$obj->obtenNumRegs();
if($num_reg>0){
$reg=$obj->obtendatos();
}
?>
<td height="60"><?php if($num_reg>0){?><?php if($reg->ban_enlace<>""){?><a href="<?=$reg->ban_enlace;?>"<?php if($reg->ban_target==1){?> target="_blank"<?php }?>><?php }?><img src="./uploads/banner/<?=$reg->ban_imagen;?>" width="290" border="0" alt="<?=$reg->ban_titulo?>" title="<?=$reg->ban_titulo?>" /><?php if($reg->ban_enlace<>""){?></a><?php }?><?php }?></td>
<?php
$obj=new conectarBBDD(SERVER,USER,PASS,BBDD);
$obj->conectar();
$obj->consultar("select * from t_banner B, t_banner_texto BC WHERE B.pk_banner=BC.fk_banner && BC.fk_idioma=1 && B.ban_orden=5 AND B.ban_activo=1 ORDER BY B.ban_orden");
$num_reg=$obj->obtenNumRegs();
if($num_reg>0){
$reg=$obj->obtendatos();
}
?>
<td><?php if($num_reg>0){?><?php if($reg->ban_enlace<>""){?><a href="<?=$reg->ban_enlace;?>"<?php if($reg->ban_target==1){?> target="_blank"<?php }?>><?php }?><img src="./uploads/banner/<?=$reg->ban_imagen;?>" width="290" border="0" alt="<?=$reg->ban_titulo?>" title="<?=$reg->ban_titulo?>" /><?php if($reg->ban_enlace<>""){?></a><?php }?><?php }?></td>
</tr>
</table>
</td>
</tr>
</table></td>
</tr>
</table>
<table width="756" height="52" border="0" cellpadding="0" cellspacing="0" style="float:left; margin-top:20px">
<tr>
<td width="756" height="52" background="images/sinal_clientes.jpg"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="textobajo">
<tr>
<td width="3%"> </td>
<td width="93%" align="center" style="color:#FFF">Calle de la Molineta, 2 Canet de Berenguer (Valencia) Tel.96 269 83 24 Fax.96 267 21 75 </td>
<td width="4%"> </td>
</tr>
</table></td>
</tr>
</table></html>
</tr>
</table>
<?php include("includes/columnaderecha.php"); ?>
<?php include("includes/pie.php"); ?>