<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<meta name="mobile-web-app-capable" content="yes">
<link rel="icon" sizes="192x192" href="../../img/cloud3.png">
  <meta name="theme-color" content="#563d7c">
  <title>SantanaSoft - NUBEPOS</title>

  <link rel="icon" sizes="192x192" href="../../imagenes/mon.png">
  <script src="jquery.js"></script>
</header>

<h2 align="center">Imprimir este recibo?</h2>
<center>
	<button onClick="imprimir()" style="font-weight: bolder; font-size:12px; color: blue"> Imprimir</button>
	<button onClick="window.location.href='prestamos.php'" style="font-weight: bolder; font-size:12px; color: red">Volver atras</button>
</center><br>
<font color="blue" id="msg"></font><br>
<div id="recibo" style="display:none">
	<?php
	$id = $_GET['id_prestamo'];
	$pagado = $_GET['total'];
	include_once("../../php/config.php");
	$sql_prestamos = mysql_query("select * from prestamos where id_prestamo='$id'") or die (mysql_error());
	$sql_cuotas = mysql_query("select * from cuotas where id_prestamo='$id' and balance<1 order by id desc limit 1") or die (mysql_error());

	$cliente = @mysql_result($sql_prestamos,0,"cliente");

	$sql_cliente = mysql_query("select * from clientes where nombre='$cliente' limit 1") or die (mysql_error());

	?>

	<?php

	$sql_empresa = mysql_query("SELECT * FROM empresa") or die(mysql_error());
	$enombre= @mysql_result($sql_empresa,0,"nombre");
	$etelefono= @mysql_result($sql_empresa,0,"telefono");	
	$edireccion= @mysql_result($sql_empresa,0,"direccion");	
	$ernc= @mysql_result($sql_empresa,0,"rnc");	
	$eemail= @mysql_result($sql_empresa,0,"email");	
		
	?>
	<h5 align="1"><?php echo $enombre;?></h5>
	<h7 align="1"><?php echo $etelefono;?> </h7>
	<h7 align="1"><?php echo $edireccion;?> </h7>
	<h7 align="1"><?php echo $ernc;?></h7>
	<p></p>
		<h5 align="1"> RECIBO DE INGRESO</h5>
		<p></p>
		<p></p>
	<p>No. prestamo. #:000 <?php echo $id?></p>
	<p>Fecha : <?php echo  $hoy?></p>

	<p></p>
	<p></p>

	<h7>Cliente: <?php echo $cliente?></h7>
	<p>RNC/ Cedula: <?php echo @mysql_result($sql_cliente,0,"cedula");?></p>
	<p><?php echo @mysql_result($sql_cliente,0,"telefono");?></p>
	<p><?php echo @mysql_result($sql_cliente,0,"direccion");?></p>
	<p>Concepto:</p>
	<p>Pago de prestamo No. 000<?php echo $id;?></p>

	<h7>Cuotas:<?php echo @decimal(mysql_result($sql_cuotas,0,"numero"))?> de 
	<?php echo @decimal(mysql_result($sql_prestamos,0,"c_cuotas"))?></h7>


	<p></p>
	<p></p>
	<h7>MONTO PAGADO:<?php echo $pagado?></h7>
	<p align="1">-----------------------</p>
	<h5>Balance: <?php echo @decimal(mysql_result($sql_prestamos,0,"balance"))?></h5>
	<p></p>
	<p align="1">____________________________</p>
	<p align="1">Firma cajero</p>

	
	
</div>
<script>
	/*
	window.print()
	setTimeout(function(){
		window.location.href="prestamos.php";
		
	},2000)
	*/
function imprimir(){
	$("#msg").html("Imprimiendo recibo...");
	window.location='printerplus://send?text='+document.getElementById('recibo').innerHTML;
}
</script>
