<?php include 'sesion_user.php';?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Panel</title>




<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">


<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>



</head>



<body onload="document.forms['form14']['busqueda'].focus()">





<div class="container-fluid">



<div class="row">



<div class="col-lg-3 col-md-3 col-sm-12" style="background-color: #dfdfdf;">





<?php

include 'nav.php';?>

<label>



</label>

</div>



<div class="col-lg-9 col-md-9 col-sm-12" style="background-color: #ffe5cf;">







<?

include 'concha.php';



mysql_connect("$host","$usuario","$contra");



mysql_select_db ("$basedatos");





$sql = "SELECT * FROM `ID_ventas` LIMIT 1";









$consulta = mysql_query ($sql);



while ($row = mysql_fetch_array($consulta))



{





$ID_venta = $row["ID"];



}



mysql_free_result($consulta);











?>



<h3>VENTA Nº <?php echo $ID_venta ?> - <a href="finalizar_venta.php"><button type="button" class="btn btn-danger">Finalizar Venta</button></a></h3><hr />





<?php





$A = date(Y);

$M = date(m);

$D = date(d);

$HORA = date(H);

$MIN = date(i);







$fecha = "$A$M$D$HORA$MIN";







mysql_db_query("$basedatos","





INSERT INTO `ventas` (`ID`, `fecha`, `hora`, `total`, `usuario`, `forma_pago`) VALUES ('$ID_venta', '$fecha', '0', '', '$user_con', '');



");





?>






<form action="agregar_productos_por_peso.php" method="post">

<? $peso = $_GET['peso']; 
$barcode = $_GET['barcode']; 


?>

<h3><img src="balanza.png" style="width: 35px; filter: invert(100%);"> VENTA POR PESO O MEDIDA </h3>
COLOQUE EL PESO Y ELIJA EL PRODUCTO <br />

EL PESO SE COLOCA EN <B>GRAMOS</B>: <BR>EJEMPLOS:  (1KILO = 1000 G) -  (1,8 KG = 1800 G) - (10 KILOS 10000 G)<BR>
<HR>
EL METRO SE COLOCA EN MILIMETROS: <BR>EJEMPLOS:  (1 METRO = 1000 MILIMETROS) <BR>
<HR>
<input  type="text" id="replyNumber" min="0"  name="peso" placeholder="PESO EN GRAMOS (1K = 1000 G) (1,8 KG = 1800 G) O MEDIDA EN MILIMETROS" class="form-control" value="<? echo $peso ?>" />

<BR><BR>
<select name="barcode">
      <option selected>SELECCIONE PRODUCTO</option>
<?

include 'concha.php';



mysql_connect("$host","$usuario","$contra");



mysql_select_db ("$basedatos");



$sql = "SELECT * FROM `articulos` WHERE `cat` LIKE 'PRODUCTOS POR PESO' ";


$consulta = mysql_query ($sql);



while ($row = mysql_fetch_array($consulta))

{
$titulop  = $row['titulo'];
$barcode2  = $row['barcode'];
?>

 <option value="<? echo $barcode2 ?>" <? if ($barcode2 == $barcode) {?> selected <?} ?>><? echo $titulop ?></option>


<?

}

mysql_free_result($consulta);



?>


</select>



<hr />


<br>
<input type="submit" name="button" id="button" value="PROCESAR" class="h2" />



</form>





</div>

</div>



</div>











  <script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>

  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>







  <script type="text/javascript">window.setInterval(function(){

  $('.grid').isotope({

  itemSelector: '.grid-item'

});

}, 2000);

</script>



<script language=javascript>

function ventanaSecundaria56 (URL){

   window.open(URL,"ventana1","width=960,height=630,scrollbars=NO")

}

  </script>

</body>

</html>
