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

  function ConsultarProducto($id)
  {
    include 'conexion.php';
    $sentencia="SELECT * FROM dcontact WHERE iddatos='".$id."' ";
    $resultado=$conexion->query($sentencia) or die ("Error consultar auto".mysqli_error($conexion));
    $filas=$resultado->fetch_assoc();
    return [
      $filas['correo'],
      $filas['telefono'],
      $filas['direccion'],
      $filas['direccion2'],
      $filas['direccion3'],
      $filas['direccion4'],
      $filas['direccion5'],
      $filas['region1'],
      $filas['region2'],
      $filas['region3'],
      $filas['region4'],
      $filas['region5'],
      $filas['telefono2'],

    ];

  }
  
  
    
    
    include ('menuadm.php') ?>
    <!-- Our About -->
	<section class="ulockd-about-one">
		<div class="container">
			<div class="row">
				<div class="col-sm-12 col-md-6 col-md-offset-3">
					<div class="booking_form_style1 text-center">
		                <!-- Booking Form Sart-->
			            <form id="booking_form" class="booking_form text-center" name="booking_form"  action="dcontac2.php" method="POST" enctype= "multipart/form-data" novalidate="novalidate">
			                 <input type="hidden" name="iddatos" value="<?php echo $_GET['iddatos']?> ">
			                <div class="messages"></div>
							<div class="row">
				                <div class="col-sm-12">
				                	<h3>Datos de Contacto.</h3>
				                </div>
				                <div class="col-sm-12">
				                    <div class="form-group">
				                        <label for="correo" class="col-md-1 control-label">Correo:</label>
										<input id="correo" name="correo" class="form-control"  required="required" value="<?php echo $consulta[0] ?>"  type="text">
										<div class="help-block with-errors"></div>
									</div>
				                </div>
				                <div class="col-sm-12">
				                    <div class="form-group">
				                        <label for="telefono" class="col-md-3 control-label">Telefono 1:</label>
										<input id="telefono" name="telefono" class="form-control"  required="required" value="<?php echo $consulta[1] ?>"  type="text">
										<div class="help-block with-errors"></div>
									</div>
				                </div>
				                <div class="col-sm-12">
				                    <div class="form-group">
				                        <label for="telefono2" class="col-md-3 control-label">Telefono 2:</label>
										<input id="telefono2" name="telefono2" class="form-control"  required="required" value="<?php echo $consulta[12] ?>"  type="text">
										<div class="help-block with-errors"></div>
									</div>
				                </div>
				                 <div class="col-sm-12">
				                    <div class="form-group">
				                        <label for="region1" class="col-md-3 control-label">Region 1:</label>
										<input id="region1" name="region1" class="form-control"  required="required" value="<?php echo $consulta[7] ?>"  type="text">
										<div class="help-block with-errors"></div>
									</div>
				                </div>
				                <div class="col-sm-12">
				                    <div class="form-group">
				                        <label for="direccion" class="col-md-3 control-label">Direccion 1:</label>
										<input id="direccion" name="direccion" class="form-control"  required="required" value="<?php echo $consulta[2] ?>"  type="text">
										<div class="help-block with-errors"></div>
									</div>
				                </div>
				                <div class="col-sm-12">
				                    <div class="form-group">
				                        <label for="region2" class="col-md-3 control-label">Region 2:</label>
										<input id="region2" name="region2" class="form-control"  required="required" value="<?php echo $consulta[8] ?>"  type="text">
										<div class="help-block with-errors"></div>
									</div>
				                </div>
				                <div class="col-sm-12">
				                    <div class="form-group">
				                        <label for="direccion2" class="col-md-3 control-label">Direccion 2:</label>
										<input id="direccion2" name="direccion2" class="form-control"  required="required" value="<?php echo $consulta[3] ?>"  type="text">
										<div class="help-block with-errors"></div>
									</div>
				                </div>
				                <div class="col-sm-12">
				                    <div class="form-group">
				                        <label for="region3" class="col-md-3 control-label">Region 3:</label>
										<input id="region3" name="region3" class="form-control"  required="required" value="<?php echo $consulta[9] ?>"  type="text">
										<div class="help-block with-errors"></div>
									</div>
				                </div>
				                <div class="col-sm-12">
				                    <div class="form-group">
				                        <label for="direccion3" class="col-md-3 control-label">Direccion 3:</label>
										<input id="direccion3" name="direccion3" class="form-control"  required="required" value="<?php echo $consulta[4] ?>"  type="text">
										<div class="help-block with-errors"></div>
									</div>
				                </div>
				                <div class="col-sm-12">
				                    <div class="form-group">
				                        <label for="region4" class="col-md-3 control-label">Region 4:</label>
										<input id="region4" name="region4" class="form-control"  required="required" value="<?php echo $consulta[10] ?>"  type="text">
										<div class="help-block with-errors"></div>
									</div>
				                </div>
				                <div class="col-sm-12">
				                    <div class="form-group">
				                        <label for="direccion4" class="col-md-3 control-label">Direccion 4:</label>
										<input id="direccion4" name="direccion4" class="form-control"  required="required" value="<?php echo $consulta[5] ?>"  type="text">
										<div class="help-block with-errors"></div>
									</div>
				                </div>
				                <div class="col-sm-12">
				                    <div class="form-group">
				                        <label for="region5" class="col-md-3 control-label">Region 5:</label>
										<input id="region5" name="region5" class="form-control"  required="required" value="<?php echo $consulta[11] ?>"  type="text">
										<div class="help-block with-errors"></div>
									</div>
				                </div>
				                <div class="col-sm-12">
				                    <div class="form-group">
				                        <label for="direccion5" class="col-md-3 control-label">Direccion 5:</label>
										<input id="direccion5" name="direccion5" class="form-control"  required="required" value="<?php echo $consulta[6] ?>"  type="text">
										<div class="help-block with-errors"></div>
									</div>
				                </div>
                
                
             
				                    <div class="form-group">
                    				<div class="col-md-offset-3 col-md-6">
                                          <button type="submit" class="btn btn-info">GUARDAR</button>
                                          <a href='inic_adm.php'class="btn btn-danger ">CANCELAR</a>
                                    </div>
				                </div>
			                </div>
			            </form>
					</div>
				</div>
			</div>
		</div>
	</section>

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


	
