<?php
require_once "../magic/session_config.php";
bdr_start_session();
ob_start();
if (!isset($_SESSION["user_id"])) {
  header("location:../logout.php");
  exit();
}
$user = $_SESSION["user_id"];
$mycar = $_REQUEST['J'];
$myJPG ="";
  require_once "../magic/DataBase.php";
  $database = new DataBase();

  $conn = $database->getConnection();

    $myLic = $conn->prepare('SELECT lic_photo from cars where carid = ? ');
							$myLic->bindParam(1,$mycar);
							$myLic->execute();
        if($myLic->rowCount()>0){$row = $myLic->fetch(PDO::FETCH_ASSOC);
                $myJPG = $row["lic_photo"];}

$myJPG = "../photo/car_lic/".$myJPG;

?>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>print</title>
    <link rel="stylesheet" href="css/print.css">
  </head>
  <body>
      <page size="A4">
        <div class="row">
        <img  src="<?php echo $myJPG; ?>" alt="صورة الرخصة غير متاحة"  >
        </div>
      </page>
       <script> javascript: window.print(); setTimeout(window.close, 1500); </script>
  </body>
</html>
