<?
include 'concha.php';

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

mysql_select_db ("$basedatos");


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

$consulta = mysql_query ($sql);

while ($row = mysql_fetch_array($consulta))

{


$nombre_kiosco = $row["nombre_kiosco"];

}

mysql_free_result($consulta); ?><!DOCTYPE html>
<html>

    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>Imprimir una Mesa</title>
        <meta name="description" content="Una guía interactiva de primeros pasos para Brackets.">
        <link rel="stylesheet" href="main.css">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <style type="text/css">

.Estilo2 {
	font-size: 19px;
	font-weight: bold;
	font-style: italic;
	font-family: Arial, Helvetica, sans-serif;
}
.Estilo3 {font-family: Arial, Helvetica, sans-serif; font-size: 19px;}


@media print{

  .oculto-impresion, .oculto-impresion *{

    display: none !important;

  }

}




        </style>
</head>
    <body>


<?




$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);




$barcode = (int)$_GET['barcode'];


$precio_varios = $_POST['precio_varios'];
include 'concha.php';

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

mysql_select_db ("$basedatos");


$sql = "SELECT * FROM `articulos` WHERE `barcode` = '$barcode' LIMIT 1";




$consulta = mysql_query ($sql);

while ($row = mysql_fetch_array($consulta))

{

$ID_producto = $row["ID"];
$titulo = $row["titulo"];
$foto = $row["foto"];
$precio = $row["precio"];
$stock = $row["stock"];
$barcode = $row["barcode"];

}

mysql_free_result($consulta);




?>
<div style="display: none">
<?php
/*
 *  Script que genera un codigo de barras con
 *  la libreria barcode.php
 */

include 'barcode.php';

$codigo = $barcode;

barcode($codigo . '.png', $codigo, 50, 'horizontal', 'code128', true);

?></div>


<div style="text-align:center;">
<img src="<?php echo $codigo . '.png'; ?>">
</div>

<div style="text-align:center;">
<span style="font-family: Arial;
font-size: 11px; position: relative;
top: -21px;"><b>$<? echo $precio ?></b><br><? echo $titulo ?></span>
</div>



<hr>




<button onClick="javascript:imprimir()" class="oculto-impresion" style="font-size:19px;">Imprimir Ahora</button>



        <script>

        $(document).on('click', '.panel-heading span.clickable', function(e){
    var $this = $(this);
	if(!$this.hasClass('panel-collapsed')) {
		$this.parents('.panel').find('.panel-body').slideUp();
		$this.addClass('panel-collapsed');
		$this.find('i').removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up');

	} else {
		$this.parents('.panel').find('.panel-body').slideDown();
		$this.removeClass('panel-collapsed');
		$this.find('i').removeClass('glyphicon-chevron-up').addClass('glyphicon-chevron-down');

	}
})


function imprimir(){
    window.print();
}

        </script>
    </body>
</html>
