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

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

$sanad = $_REQUEST['sanad'];
	include "../op/number_text.php";
$sql = $db->prepare('select * from sanad_in where in_id = ? ');
				$sql->bindParam(1,$sanad);
				$sql->execute();
			  if($sql->rowCount()>0){$result = $sql->fetch(PDO::FETCH_ASSOC);}
				$payy =  $result['payMethod'];
				switch ( $payy) {
								case "1":	$pay =  "كاش"; 				 break;
								case "2":	$pay =  "تحويل بنكي";	break;
								case "3":	$pay =  "نقاط بيع";		break;
								case "4":	$pay = "فواتير";			break;
						}
	 ?>
<!DOCTYPE html>
<html lang="ar" dir="rtl">
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
        <title>الوسام المعتمد</title>
         <link rel="stylesheet" href="../css/bootstrap.css"/>
      	 <link rel="stylesheet" href="../css/sanad.css"/>
				 <script src="../js/jquery.js"></script>
			 	<script src="../js/bootstrap.js"></script>
	 </head>
    <body>
			<div class="row" style="padding:0 ;">
							<br style="line-height:162px;"/>
			</div>
			<div class="col-xs-12 col-md-12"style="float:right;">
		<form method="post" class="form-horizontal " style="float:center;">
					<div class="row" style="padding:0 ;">
							<div class="col-xs-3"style="float:right;">
								<input type="text" class="form-control text-center" value="<?php echo $result['in_id']; ?>"/>
							</div>
							<div class="col-xs-6"style="padding:0;float:right;">
									<input type="text" style="font-weight:bold;" class="form-control text-center" value="قبض"/>
								</div>
								<div class="col-xs-3"style="float:left;">
											<input type="text" class="form-control text-left" value="<?php echo $result['contract_id']; ?>"/>
							</div>
					</div>
					<div class="row" style="padding:0 ;">
							<div class="col-xs-3"style="float:right;">
								<input type="text" class="form-control text-center" value="<?php echo $result['sanad_date']; ?>"/>
							</div>
							<div class="col-xs-2"style="padding:0; float:left;">
									<input type="text" class="form-control text-left" value="<?php echo $result['date_out']; ?>"/>
								</div>
					</div>
					<div class="row"style="padding:0 ;" >
							<div class="col-xs-2"style="float:right;">
								<input type="text" class="form-control text-left" style="font-weight:bold;" value="<?php echo $result['money_in']; ?>"/>
							</div>
							<div class="col-xs-8"style="padding:2; float:right;">
									<input type="text" class="form-control text-right"  style="margin-right:10px;font-size:10pt;" value=" <?php echo samTXT($result['money_in']) ?> لا غير "/>
								</div>
							<div class="col-xs-2"style="float:right;">
										<input type="text" class="form-control text-left" style="font-weight:bold;" value="<?php echo $pay ; ?>"/>
							</div>
					</div>
					<div class="row"style="padding:0 ;" >
							<div class="col-xs-6"style="float:right;">
								<input type="text" class="form-control text-left" value="<?php echo $result['cust_name']; ?>"/>
							</div>
							<div class="col-xs-5"style="padding:0; float:left;">
									<input type="text" class="form-control text-right" value="<?php echo $result['comm']; ?>"/>
								</div>
					</div>
					<div class="row" style="padding:0 ;">
							<div class="col-xs-12">
								<input type="text" class="form-control text-center" value="دفعة إيجار سيارة <?php
								 echo $result['kind']. " لوحة رقم " . $result['letters']. " ".$result['numbers']. " موديل ".$result['model'] ;
								 ?>"/>
							</div>
					</div>
				<div class="row" style="padding:0 ;">
							<div class="col-xs-3"style="float:left;">
								<input type="text" class="form-control text-left" value="<?php echo $result['realName']; ?>"/>
							</div>
							<div class="col-xs-6"style="padding:0; float:left;">
									<input type="text" class="form-control text-center" value="<?php echo $result['b_name']; ?>"/>
								</div>
					</div>

				</form>
             </div>
					<script>
					$(document).ready(function(){
								javscript:window.close( window.print()) ;
				});
					</script>
    </body>
</html>
