<?php

// ini_set('display_errors', 1);


define("ADMIN", true);
require_once("../../../common/lib.php");
require_once("../../../common/define.php");
require_once("../../includes/functions.php");

if(!isset($_SESSION['user'])){
    header("Location: ../login.php");
    exit();
}
require_once("../../includes/fn_module.php"); ?>

<?
$id_bc = $_GET["id"];

$query_fact = "select * from pm_vehicule where id =".$id_bc ;
			// echo "====>".$query_fact;
			$result_fact = @$db->query($query_fact);
			if($result_fact !== false){
				$row_fact = $result_fact->fetch();
				
				$matricule = $row_fact["matricule"];
				$model  = $row_fact["model"];
				$annee  = $row_fact["annee"];
				$volume  = $row_fact["volume"];
				$assurance  = $row_fact["assurance"];
				$leasing  = $row_fact["leasing"];
				$kilometrage  = $row_fact["kilometrage"];
				$vidange  = $row_fact["vidange"];
				$location_vente  = $row_fact["location_vente"];
				$date_assurance  = date('d-m-Y' ,$row_fact["date_assurance"]);
				$date_taxe  = date('d-m-Y' ,$row_fact["date_taxe"]);
				$date_visite  = date('d-m-Y' ,$row_fact["date_visite"]);
				
				$query_client = "select * from pm_client where id = ".$location_vente;
				$result_client = @$db->query($query_client);
				if($result_client !== false){
					$row_client = $result_client->fetch();
	
					$nom 		= $row_client["name"];
		
				}	
				
				}	

?>


<html>
<body>
<div >

<div  style="text-align: center;"><img src="../../images/logo_pos.png" width="200px" /></div>


	<div style="float:left;font-size:11px;margin-top:40px;">
		<b>Matricule : </b><? echo $matricule; ?><br>		
		<b>Vidange : </b><? echo $vidange; ?><br>		
		<b>Date Assurance : </b><? echo $date_assurance; ?><br>		
		<b>Date taxe : </b><? echo $date_taxe; ?><br>		
		<b>Date visite : </b><? echo $date_visite; ?><br>		
	</div>
<div style="float:left;text-align:left;margin-top:20px;width:100%">Note :</div>
</div>



<div class="tableContent2">
	<div style="float:left;text-align:left;margin-top:200px;width:100%">
	<? 
		echo get_info_table("pm_user","firstname",$_SESSION['user']['id']) ;
		echo " ";
		echo get_info_table("pm_user","lastname",$_SESSION['user']['id']) ;
	 ?>
	 <br>Signature | <? echo $nom;  ?>
	 <br>Réçu le <? echo date('d/m/Y H:i:s'); ?>
	</div>
<div style="float:left;text-align:center;width:80%;border:1px solid;padding:10%;margin-top:20px;">
	</div>
</div>
</body>
</html>


<style>

body{
	font-size:11px !important;
}
table, td, tr{
	font-size:10px !important;
}
</style>


<script>
window.print();
setTimeout(function(){ window.close(); }, 500);

</script>