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

  function ConsultarProducto($cod)
  {
    include 'conexion.php';
    $sentencia="SELECT * FROM propiedades WHERE cod='".$cod."' ";
    $resultado=$conexion->query($sentencia) or die ("Error consultar auto".mysqli_error($conexion));
    $filas=$resultado->fetch_assoc();
    return [
      $filas['cod'],
      $filas['producto'],
      $filas['cantidad'],
      $filas['precio'],
      $filas['imagen'],
      $filas['oferta'],
      $filas['estado'],
      $filas['nombre'],
      $filas['hora'],
      $filas['rematado'],
      $filas['lote'],
      $filas['descripcion'],

    ];

  }
  
  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 class="col-md-4">
  					<div class="ulockd-welcm-ht text-right">
	  					<p class="ulockd-welcntxt">Telefono<span class="text-thm1"> (+56) 931970230</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 About -->
	<section class="ulockd-about-one">
		<div class="container">
		    
			            <form id="booking_form" class="booking_form text-center" name="booking_form"  action="oferta2propiedades.php" method="POST" enctype= "multipart/form-data" novalidate="novalidate">
			              <input type="hidden" name="cod" value="<?php echo $_GET['cod']?>" >
			<div class="row">
				<div class="col-sm-12 col-md-12 ">
					<div class="booking_form_style1 text-center">
		                <!-- Booking Form Sart-->
		                <div class="messages"></div>
							<div class="row">
							    	<?php   echo "<td><a href='subastadmp.php?idremate=".$consulta[8]."'> <button type='button' class='btn btn-success'><h3>VOLVER A LA SALA</h3></button> </a> </td>";?>
							    	<a href="https://zoom.us/j/8454632543" target="_blank"> <button type='button' class='btn btn-info'><h3>ZOOM</h3></button> </a> </td>
							    
							     <div class="col-sm-12">
				                	<h3>SUBASTA DE VEHICULO.</h3>
				                </div>
				                <div class="panel-body" >
                        <div class="form-group">
                            <div class="col-md-4">
                          <h4><label for="nombre" class="col-md-1 control-label  ">USUARIO:</label></h4>
                          
                          <h4> <select class="form-group col-md-12" name="nombre">
                            <?php
                              $query = $mysqli -> query ("SELECT * FROM palo");
                              while ($valores = mysqli_fetch_array($query)) {
                                echo '<option value="'.$valores[nombre].'">'.$valores[nombre].'</option>';
                              }
                            ?>
      </select></h4>
                          </div>
                      </div>

                          
                </div>
				                 <div class="form-group col-md-6">
                  <?php
      include "conexion.php";
      $sentencia="SELECT *  FROM propiedades B, remate R WHERE B.hora=R.idremate && B.cod='$consulta[0]' ";
      $resultado= $conexion->query($sentencia) or die (mysqli_error($conexion));
      while($filas=$resultado ->fetch_assoc())
      { 
       echo  $filas['link'] ;
        }
        ?>
                 
                  <div class="form-group col-md-9">
                  <img src="<?php echo $consulta[4] ?>" class="img-thumbnail" >
              </div>
               </div>
               <div class="form-group col-md-6">
                   

              <div class="form-group  col-md-9 has-warning">
                  
                <h1><label style="color:#FF0000" for="precio" class="col-md-15 control-label"> LOTE <?php echo $consulta[10]?></label></h1>
                <h2><label for="precio" class="col-md-15 control-label">Ultima Oferta Recibida:</label></h2>
                <h1><label style="color:#FF0000" for="precio" class="col-md-15 control-label"> $ <?php echo $consulta[3]?></label></h1>
                <h1><label style="color:#FF0000" for="nombre" class="col-md-15 control-label"><?php echo $consulta[7]?> </label></h1>

              </div>
              <div class="form-group  col-md-9 has-warning">
                  
                <h3><label for="precio" class="col-md-15 control-label">Incremente para ganar:</label></h3>
              </div>
              <div class="form-group col-md-12"> 
              <?php if( $consulta[9]==1){ ?>
              <?php
      include "conexion.php";
      $sentencia="SELECT * FROM buttom where status=1 and cod<=3";
      $resultado= $conexion->query($sentencia) or die (mysqli_error($conexion));
      while($filas=$resultado ->fetch_assoc())
      { 
                  echo $filas['marca1'];  echo $consulta[3]+ $filas['monto'];  echo $filas['marca2']; echo $consulta[3] + $filas['monto']; echo $filas['marca3'];  echo $filas['boton']; echo $filas['marca4'];
      }
      ?>
                  </div>
                  
                  
                  
       <div class="form-group col-md-12"> 
              <?php
      include "conexion.php";
      $sentencia="SELECT * FROM buttom where status=1 and cod>=4";
      $resultado= $conexion->query($sentencia) or die (mysqli_error($conexion));
      while($filas=$resultado ->fetch_assoc())
      { 
                  echo $filas['marca1'];  echo $consulta[3]+ $filas['monto'];  echo $filas['marca2']; echo $consulta[3] + $filas['monto']; echo $filas['marca3'];  echo $filas['boton']; echo $filas['marca4'];
      }
      ?>
      <?php } ?>
                  </div>
                  
                </div>
                <h4><b>Detalles:</b></h4>
                  <h5> <b> PRODUCTO: </b><?php echo $consulta[1] ?>.<b> CANTIDAD:  </b> <?php echo $consulta[2] ?>.</h5>
                  <h5><b>DESCRIPCION </b><?php echo   $consulta[11] ?>.</h5>
                  <h5><b>PRECIO: </b> <?php echo $consulta[3] ?>.</h5>
				                
				                
				                
				             </form>  
				                    
			                </div>
			                
			 
				
				<div class="col-sm-4">
                           <form id="booking_form" class="booking_form text-center" name="booking_form"  action="actualizar2.php" method="POST" enctype= "multipart/form-data" novalidate="novalidate">
			             <input type="hidden" name="cod" value="<?php echo $_GET['cod']?>" >
				                    <div class="form-group">
    				                    <div class="form-check">
                                             <label class="form-check-label col-md-4" for="status">HABILITAR
                                            <input class="form-check-input" type="radio" name="rematado" id="rematado" value="1"  <?php if ($consulta[9]=="1") echo "checked" ?> ></label>
                                           
                                          </div>
                                          <div class="form-check">
                                            <label class="form-check-label col-md-4" for="status">DESHABILITAR
                                            <input class="form-check-input" type="radio" name="rematado" id="rematado" value="0" <?php if ($consulta[9]=="0") echo "checked" ?> ></label>
                                            
                                         </div>
				                    </div>
				                    <button type="submit"   class="btn btn-info">ACTUALIZAR</button>
				                    </form>
				                </div>
			</div>
		</div>
			</div>
				</div>
			<div class="container">
	<table class="table table-striped">
       <thead class="bg-warning">
        <th>LOTE</th>
        <th>PRODUCTO</th>
        <th>CANTIDAD</th>
        <th>DESCRIPCION</th>
        <th></th>
        <th>OFERTA MAYOR</th>
        <th>PERSONA</th>
        <th></th>
        <th> PROPIEDAD </th>
        <th> </th>
      </thead>
       <?php
      include "conexion.php";
      $sentencia="SELECT * FROM propiedades where hora=$consulta[8] and rematado=1 and lote=$consulta[10]+1 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['producto']; echo "</td>";
          echo "<td>"; echo $filas['cantidad']; echo "</td>";
          echo "<td>"; echo $filas['descripcion']; echo "</td>";
          echo "<td>"; echo "</td>";
          Echo "<td>";echo"$ "; echo $filas['precio']; echo "</td>";
          echo "<td>"; echo $filas['nombre']; echo "</td>";
          echo "<td>";  echo "</td>";
          echo "<td>"; echo "<img src='".$filas['imagen']."' width='100'>"; echo "</td>";
          if ($filas['rematado']==1){
          echo "<td>  <a href='admoferta2.php?cod=".$filas['cod']."'> <button type='button' class='btn btn-success'>OFERTAR</button> </a> </td>";
      } else if($filas['rematado']==0){
          echo "<td>  <p>REMATADO</p> </td>";
          }
        echo "</tr>";
      }
      ?>
    </table>
		</div>
	</section>
	

	<?php include ('pieadm.php') ?>


	

