    <?php
 $consulta=ConsultarProducto($_GET['idremate']);

  function ConsultarProducto($idremate)
  {
    include 'conexion.php';
    $sentencia="SELECT * FROM remate WHERE idremate='".$idremate."' ";
    $resultado=$conexion->query($sentencia) or die ("Error consultar ".mysqli_error($conexion));
    $row=$resultado->fetch_assoc();
    return [
      $row['idremate'],
      $row['nombremate'],
      $row['fecha'],

    ];

  }
  
  
  session_start();
  require '../funcs/conexion.php';
  include '../funcs/funcs.php';
	
	if(!isset($_SESSION['id'])){
		header("Location: index.php");
	}
	
	$rut = $_SESSION['usuario'];
	$nombre = $_SESSION['nombre'];
	$tipo_usuario = $_SESSION['id_tipo'];
	
	
?>

<!DOCTYPE html>
<html dir="ltr" lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Title -->
<title>Remates Judiciales Online</title>
<!-- Favicon -->
<link href="images/ICONO.png" sizes="128x128" rel="shortcut icon" />
<link href="images/ICONO.png" sizes="128x128" rel="shortcut icon" type="image/x-icon" />
<!-- css file -->
<link rel="stylesheet" href="../css/bootstrap.min.css">
<link rel="stylesheet" href="../css/style.css">
<link rel="stylesheet" href="../css/theme-color.css">
<!-- Responsive stylesheet -->
<link rel="stylesheet" href="../css/responsive.css">
 <script type="text/javascript">
  var int=self.setInterval("refresh()",10000);
  function refresh()
  {
    location.reload(true);
  }
</script>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<div class="wrapper">
	<div id="preloader" class="preloader">
		<div id="pre" class="preloader_container"><div class="preloader_disabler btn btn-default">Disable Preloader</div></div>
	</div>
  	<div class="ulockd-header-topped">
  		<div class="container">
  			<div class="row">
  				<div class="col-md-4">
  					<div class="ulockd-social-linked">
  						<ul class="list-inline">
  							<li><a href="#"><i class="fa fa-facebook"></i></a></li>
  							<li><a href="#"><i class="fa fa-rss"></i></a></li>
  							<li><a href="#"><i class="fa fa-google-plus"></i></a></li>
  							<li><a href="#"><i class="fa fa-pinterest"></i></a></li>
  							<li><a href="#"><i class="fa fa-instagram"></i></a></li>
  						</ul>
  					</div>
  				</div>
  				<div class="col-md-4">
  					<div class="ulockd-welcm-ht text-center">
	  					<p class="ulockd-welcntxt">Bienvenido<span class="text-thm1"> Rjo.cl </span></p>
  					</div>
  				</div>
  			
  			</div>
  		</div>
  	</div>
  	<div class="ulockd-header-middle">
  		<div class="container">
  			<div class="row">
  				<div class="col-xs-12 col-sm-4 col-md-4">
					<div class="ulockd-contact-info text-right">
						<div class="ulockd-icon pull-right"><span class="flaticon-web-page-home"></span></div>
						<div class="ulockd-info">
							<h3>Ubicados</h3>
							<p class="ulockd-cell">Moneda 2552. Santiago. // Coronel Ruta 160 Km. 22 - Coronel</p>
						</div>
					</div>
  				</div>
  				<div class="col-xs-12 col-sm-4 col-md-4">
  					<div class="ulockd-welcm-hmddl text-center">
						<a href="index.html" class="ulockd-factr-main-logo"><img src="images/header-logo.png" alt=""></a>
  					</div>  					
  				</div>
  				<div class="col-xs-12 col-sm-4 col-md-4">
					<div class="ulockd-ohour-info">
						<div class="ulockd-icon pull-left"><span class="flaticon-clock-1"></span></div>
						<div class="ulockd-info">
							<h3>Abierto</h3>
							<p class="ulockd-addrss">9:00-20:00</p>
						</div>
					</div>
  				</div>
  			</div>
  		</div>
  	</div>

	<!-- Header Styles -->
	<header class="header-nav">
		<div class="main-header-nav navbar-scrolltofixed">
			<div class="container">
			    <nav class="navbar navbar-default bootsnav ulockd-menu-style-one light-red">
					<!-- Start Top Search -->
			        <div class="top-search">
			            <div class="container">
			                <div class="input-group">
			                    <span class="input-group-addon"><i class="fa fa-search"></i></span>
			                    <input type="text" class="form-control" placeholder="Search">
			                    <span class="input-group-addon close-search"><i class="fa fa-times"></i></span>
			                </div>
			            </div>
			        </div>
			        <!-- End Top Search -->

			        <div class="container ulockd-pad-zero">
			            
			            <!-- End Atribute Navigation -->

			            <!-- Start Header Navigation -->
			            <div class="navbar-header">
			                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-menu">
			                    <i class="fa fa-bars"></i>
			                </button>
			            </div>
			            <!-- End Header Navigation -->

			            <!-- Collect the nav links, forms, and other content for toggling -->
			            <div class="collapse navbar-collapse" id="navbar-menu">
			                <ul class="nav navbar-nav navbar-left">
			                    <li class="dropdown">
			                        <a href="inic_adm.php" >INICIO</a>
			                    </li>
			                    <li class="dropdown">
			                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">INFORMACION</a>
			                        <ul class="dropdown-menu">
					                    <li class="dropdown">
					                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">PUBLICIDAD</a>
					                        <ul class="dropdown-menu">
												<li><a href='admpublicidad.php?id=1'>PRINCIPAL</a></li>
					                        </ul>
					                    </li>
					                    <li class="dropdown">
					                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">ADMINISTRATIVO</a>
					                        <ul class="dropdown-menu">
												<li><a href="dcontac1.php?iddatos=1">CONTACTO</a></li>
												<li><a href="listap.php">PB</a></li>
												<li><a href="admremate.php">REMATES</a></li>
												<li><a href="listabtm.php">BOTONES</a></li>
					                        </ul>
					                    </li>
			                        </ul>
			                    </li>
			                    <li class="dropdown">
			                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">USUARIOS</a>
			                        <ul class="dropdown-menu">
										<li><a href="usuactivo.php">ACTIVOS</a></li>
										<li><a href="usuinactivo.php">INACTIVOS</a></li>
			                        </ul>
			                    </li>
			                    <li class="dropdown">
			                        <a href="autos.php">AUTOS</a>
			                     </li>
                                <li class="dropdown">
                                    <a href="#"  data-toggle="dropdown">BIENES</a>
                                </li>
			                    <li class="dropdown">
			                        <a href="#"  data-toggle="dropdown">PROPIEDADES</a>
			                    </li>
			                    <li class="dropdown">
			                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">REMATES</a>
			                        <ul class="dropdown-menu">
										<li><a href="list_remateact.php">ACTIVOS</a></li>
										<li><a href="list_remateinac.php">INACTIVOS</a></li>
			                        </ul>
			                    </li>
			                    <li class="dropdown">
			                        <a href="../logout.php" >CERRAR</a>
			                    </li>
			                </ul>
			            </div><!-- /.navbar-collapse -->
			        </div>

			        <!-- Start Side Menu -->
			        <div class="side ulockd-bgthm">
			            <a href="#" class="close-side"><i class="fa fa-times"></i></a>
			            <div class="widget">
			                <h4 class="title">Custom Pages</h4>
			                <ul class="link">
			                    <li><a href="#">About</a></li>
			                    <li><a href="#">Services</a></li>
			                    <li><a href="#">Blog</a></li>
			                    <li><a href="#">Portfolio</a></li>
			                    <li><a href="#">Contact</a></li>
			                </ul>
			            </div>
			            <div class="widget">
			                <h4 class="title">Additional Links</h4>
			                <ul class="link">
			                    <li><a href="#">Retina Homepage</a></li>
			                    <li><a href="#">New Page Examples</a></li>
			                    <li><a href="#">Parallax Sections</a></li>
			                    <li><a href="#">Shortcode Central</a></li>
			                    <li><a href="#">Ultimate Font Collection</a></li>
			                    <li><img title="Facebook Feed With Client File" class="img-responsive ulockd-mrgn1210" src="images/resource/image3.png" alt="image3.png"></li>
			                </ul>
			            </div>
			        </div>
			        <!-- End Side Menu -->
			        
			    </nav>
			</div>
		</div>		
	</header>
	
	<!-- Our Team -->
	<section class="ulockd-team-ip-one">
		<div class="container">
		     <H1>REMATE</H1>
	<table class="table table-striped">
	    <thead>
         <th></th>
        <th></th><?php 
								 echo" <th><a href='#'> <button type='button' class='btn btn-SUCCESS'>REMATE DE AUTO </button> </a> </th>";
								
								?>
        <th></th>
        <th> </th>
        <th></th>
        
        <th></th><?php 
								 echo" <th><a href='subastadm.php?idremate=".$consulta[0]."'> <button type='button' class='btn btn-warning'>REMATE DE BIENES </button> </a> </th>";
								
								?>
        <th></th>
        <th></th>
      </thead>
	   <thead >
        <th></th>
        
        
        
        <th></th>
      </thead>
      <thead class="bg-warning">
        <th>LOTE</th>
        <th>PATENTE</th>
        <th>MARCA</th>
        <th>MODELO</th>
        <th>A&Ntilde;O</th>
        <th></th>
        <th>OFERTA MAYOR</th>
        <th>PERSONA</th>
        <th>VEHICULO</th>
        <th> <!--<a href="https://zoom.us/j/8454632543" target="_blank"> <button type="button" class="btn btn-info"> ZOOM </button> </a>CLAVE: 7HVR4T--> </th>
        <th> </th>
      </thead>
      
      
      <?php
      include "conexion.php";
      $sentencia="SELECT * FROM auto where hora=$consulta[0] ORDER BY lote ASC" ;
      $resultado= $conexion->query($sentencia) or die (mysqli_error($conexion));
      while($filas=$resultado ->fetch_assoc())
      {
        echo "<tr>";
          echo "<td>"; echo $filas['lote']; echo "</td>";
          echo "<td>"; echo $filas['patente']; echo "</td>";
          echo "<td>"; echo $filas['marca']; echo "</td>";
          echo "<td>"; echo $filas['modelo']; echo "</td>";
          echo "<td>"; echo $filas['ano']; echo "</td>";
          echo "<td>";  echo "</td>";
          echo "<td>";echo"$ "; echo $filas['precio']; echo "</td>";
          echo "<td>"; echo $filas['nombre']; echo "</td>";
          echo "<td>"; echo "<img src='".$filas['imagen']."' width='100'>"; echo "</td>";
          echo "<td>  <a href='admoferta.php?patente=".$filas['patente']."'> <button type='button' class='btn btn-success'>OFERTAR</button> </a> </td>";
          if ($filas['rematado']==1){
          echo "<td>  <p>ACTIVO</p> </td>";
          }else if($filas['rematado']==0){
          echo "<td>  <p>REMATADO</p> </td>";
          }
        echo "</tr>";
      }
      ?>
      <thead>
         <th></th>
        <th></th><?php 
								 echo" <th><a href='#'> <button type='button' class='btn btn-SUCCESS'>REMATE DE AUTO </button> </a> </th>";
								
								?>
        <th></th>
        <th> </th>
        <th></th>
        
        <th></th><?php 
								 echo" <th><a href='subastadm.php?idremate=".$consulta[0]."'> <button type='button' class='btn btn-warning'>REMATE DE BIENES </button> </a> </th>";
								
								?>
        <th></th>
        <th></th>
      </thead>
    </table>
		</div>
	</section>
	<?php include ('pieadm.php') ?>