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

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

// $col = "";
	// include "../op/wanted.php";
?>
<!DOCTYPE html>
<html lang="ar" dir="rtl">
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
        	<title>كشف حصر</title>
					<link rel="icon" href="../perfect.ico">
         <link rel="stylesheet" href="../dist/css/bootstrap.min.css"/>
      	 <link rel="stylesheet" href="../dist/css/day.css" />
	 </head>
	 <!-- onload="javascript: window.print(); setTimeout(window.close, 1000);" -->
    <body >
			<div class="container-fluid">
			<div class="row" style="padding:5 ;">
				<div class="col-xs-10"style="float:right;">
					<h6 style="font-weight:bold;padding:3px;">كشف حصر القوة التأجير </h6>
				</div>
				<div class="col-xs-2"style="float:right;">
				</div>
			</div>
			<br />
							<div class="table-responsive">
									 <table class="table table-bordered">
										 <thead>
												<tr>
														 <th class="align-middle text-center" width="8%">م</th>
														 <th class="align-middle text-center" width="15%">ماركة</th>
														 <th class="align-middle text-center" width="15%">نوع</th>
														 <th class="align-middle text-center" width="15%">لوحة</th>
														 <th class="align-middle text-center" width="10%">موديل</th>
														 <th class="align-middle text-center" width="10%">اللون</th>
														 <th class="align-middle text-center" width="15%">الفرع</th>
												</tr>
											</thead>
											<tbody >
			<?php
			$output ="";
			// if(empty($col)){
		$dsd =$db->prepare("SELECT carid , brand ,kind , model ,concat(letters,' ' ,numbers) as PL , color , branches.b_name
					from cars , branches WHERE cars.branch = branches.branchID AND cars.branch > 1 ORDER BY brand , kind , model , numbers");
					// }
					// // else{
					// 	$dsd =$db->prepare("SELECT carid , brand ,kind , model ,concat(letters,' ' ,numbers) as PL , color , branches.b_name
					// 	from cars , branches WHERE cars.branch = branches.branchID AND carstatus < 6 AND ".$col."= ? ORDER BY brand , kind , model , numbers ");
					// 	$dsd->bindParam(1,$val);
					// }
					$dsd->execute();
				 if($dsd->rowCount()>0)
							{
								 $sr = 1 ;
						 while($row = $dsd->fetch())
								 {
				$output .= '<tr>
						<td>' . $sr. '</td>
						<td>' . $row['brand'] . '</td>
						<td>' . $row["kind"] . '</td>
						<td>' . $row['PL'] . '</td>
						<td>' . $row['model'] . '</td>
						<td>' . $row['color'] . '</td>
						<td>' . $row['b_name'] . '</td>
					</tr>  ';
					$sr = $sr + 1 ;
						}
				}
			echo $output ;
		?>
	</tbody>
</table>
</div>
</div>
	<script src="../js/jquery.js"></script>
	<script src="../dist/js/umd/popper.min.js"></script>
	<script src="../dist/js/bootstrap.min.js"></script>
    </body>
</html>
