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

  function ConsultarProducto($cod)
  {
    include 'conexion.php';
    $sentencia="SELECT * FROM buttom WHERE cod='".$cod."' ";
    $resultado=$conexion->query($sentencia) or die ("Error consultar buttom".mysqli_error($conexion));
    $filas=$resultado->fetch_assoc();
    return [
      $filas['cod'],
      $filas['boton'],
      $filas['status'],
      $filas['monto'],
      



    ];

  }
  
  
    
    
    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="boton2.php" method="POST" enctype= "multipart/form-data" novalidate="novalidate">
			                  <input type="hidden" name="cod" value="<?php echo $_GET['cod']?> ">
			                <div class="messages"></div>
							<div class="row">
				                <div class="col-sm-12">
				                	<h3>Modificar Boton.</h3>
				                </div>
				                <div class="col-sm-12">
				                    <div class="form-group">
				                        <label>Nombre</label>
										<input id="boton" name="boton" 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>Monto (Ingrese solo numeros)</label>
										<input type="text" maxlength="10" name="monto" id="monto" placeholder="Solo caracteres Numericos"   class="form-control"
              required autocomplete="off" onkeypress="return (event.charCode >= 48 && event.charCode <= 57)" min="1" value="<?php echo $consulta[3] ?>" />
										
										<div class="help-block with-errors"></div>
									</div>
				                </div>
				                <div class="col-sm-12">
				                    <div class="form-label-group">
                                          <div class="form-check">
                                             <label class="form-check-label col-md-2 for="status">ACTIVO</label>
                                            <input class="form-check-input" type="radio" name="status" id="status" value="1"  <?php if ($consulta[2]=="1") echo "checked" ?> >
                                           
                                          </div>
                                          <div class="form-check">
                                            <label class="form-check-label col-md-2" for="status">INACTIVO</label>
                                            <input class="form-check-input" type="radio" name="status" id="status" value="0"  <?php if ($consulta[2]=="0") echo "checked" ?>>
                                            
                                          </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='listabtm.php'class="btn btn-danger ">CANCELAR</a>
                                    </div>
				                </div>
			                </div>
			            </form>
					</div>
				</div>
			</div>
		</div>
	</section>

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


	
