<?php

    require_once __DIR__ . '/../magic/auth.php';

$auth = bdr_require_privilege(2, '../logout.php');
$user = $auth['user_id'];
$father = $auth['user_id'];
$branch = $auth['branch'];
$conn = $auth['conn'];
$db = $auth['conn'];

//check if accountant of Oprearation manager
?>
    <!DOCTYPE html>
    <html lang="ar" dir="rtl">
    <head>
    	<meta charset="utf-8">
    	<meta name="viewport" content="width=device-width, initial-scale=1.0">
    	<meta name="robots" content="index,follow">
    	<meta name="description" content="تأجير سيارات خصوصي ليموزين دباب ديانا تقسيط سيارات  بيع سيارات ورشة اصلاح متكاملة">
    	<meta name="author" content="سامح دياب">
    	<link rel="icon" href="../images/perfect.ico">
    	<title> تصوير سيارة </title>
    	<link rel="stylesheet" href="../dist/css/bootstrap.css"/>
      <link rel="stylesheet" href="../css/font-awesome.min.css"/>
    	<link rel="stylesheet" href="myCar.css"/>
    	<script src="../js/jquery.js"></script>
      <script src="../dist/js/umd/popper.min.js"></script>
    	<script src="../dist/js/bootstrap.js"></script>
    </head>
<body style="background-color:#270c0c ; color:#cce5ff;">
  <div class="navbar navbar-inverse bg-inverse bg-faded sticky-top">
		<div class="container-fluid">
    <div class="row">
      <div class="col">
      <div class="btn-group btn-group-lg" style="font-weight:bold;padding:5px;" role="group" aria-label="...">
        <button type="button" id="branch" style="font-weight:bold;padding:5px;font-size:2rem;" class="btn btn-success">بحث</button>
        <button type="button" id="br_rent" style="font-weight:bold;padding:5px;font-size:2rem;" class="btn btn-info">ساري</button>
        <button type="button" id="br_debt" style="font-weight:bold;padding:5px;font-size:2rem;" class="btn btn-danger">مديون</button>
        <button type="button" id="check" style="font-weight:bold;padding:5px;font-size:2rem;" class="btn btn-outline-secondary">السيارة</button>
      </div>
    </div>
  </div>
		</div>
	</div>
  <br />
  <form method="post" class="form-horizontal" id="car_form" name="car_form" style="float:center;">
  <div class="row align-items-center">
    <div class="col-6">
      <p style="font-weight:bold;padding:5px;font-size:1.4rem;float:left;">بحث برقم السيارة </p>
    </div>
    <div class="col-3">
      <input type="number" id="car_no" name="car_no" placeholder="ارقام فقط" style="font-weight:bold;padding:5px;font-size:1.7rem;max-width:100px;" />
    </div>
    <div class="col-3">
      <button class="btn btn-success" id="car_sr" style="font-weight:bold;padding:5px;font-size:1.7rem;" >بحث</button>
    </div>
  </div>
</form>
</div>
<br /><br />

<div id="re_car"></div>

  <script>
  $(document).ready(function(){
    $("#br_rent").click(function(event){
      event.preventDefault();
        window.open("br_rent.php", '_self');
    });
    $("#br_debt").click(function(event){
      event.preventDefault();
        window.open("br_debt.php", '_self');
    });

    $("#branch").click(function(event){
      event.preventDefault();
        window.open("branch.php", '_self');
    });

    $("#car_sr").click(function(event){
      event.preventDefault();
      $.ajax({
        url     : "br_car.php",
        method  : "POST",
        data    :$("#car_form").serialize(),
        success : function(data){
        $("#re_car").html(data);
      },
        error   :function(result){
          alert(result.statusText);
          }
      });
    });

  });
  </script>

</body>
</html
