<?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_cut where de_id = ? ');
				$sql->bindParam(1,$sanad);
				$sql->execute();
			  if($sql->rowCount()>0){$result = $sql->fetch(PDO::FETCH_ASSOC);}
				// return $result;
	 ?>
<!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 onload="javascript: window.print(); setTimeout(window.close, 1000);">
			<div class="row" style="padding:0 ;">
				<br style="line-height:190px;"/>
			</div>
		<form method="post" class="form-horizontal ">
					<div class="row" style="padding:0 ;">
					<div class="col-xs-3"style="float:right;">
						<label class="control-label" style="font-weight:bold;margin-right:40px;"><?php echo $result['de_id']; ?></label>
					</div>
					<div class="col-xs-6"style="padding:0;float:right;">
						<label class="control-label" style="font-weight:bold;font-size:13pt;margin-right:150px;">اشعار خصم</label>
					</div>
					<div class="col-xs-3"style="float:left;">
					   <label class="control-label" style="font-weight:bold;float:left;"><?php echo $result['contract_id']; ?></label>
					</div>
					</div>
					<div class="row" style="padding:0 ;">
							<div class="col-xs-3"style="float:right;">
								<label class="control-label" style="font-weight:bold;margin-right:10px;"><?php echo $result['sanad_date']; ?></label>
							</div>
							<div class="col-xs-3"style="padding:0; float:left;">
									<label class="control-label" style="font-weight:bold;float:left;"><?php echo $result['date_in']; ?></label>
								</div>
					</div>
					<div class="row" style="padding:0 ;">
									<br style="line-height:15px;"/>
					</div>
					<div class="row"style="padding:0 ;" >
							<div class="col-xs-2"style="float:right;">
								<label class="control-label " style="float:left;font-weight:bold;"><?php echo $result['money_de']; ?></label>
							</div>
							<div class="col-xs-9"style="padding:2; float:right;">
								<label class="control-label text-center" style="text-align: center;font-size:10pt;"><?php echo samTXT($result['money_de']) ?> لا غير</label>
								</div>
					</div>
					<div class="row"style="padding:0 ;" >
							<div class="col-xs-5"style="float:right;">
								<label class="control-label" style="float:left;"><?php echo $result['cust_name']; ?></label>
							</div>
							<div class="col-xs-7"style="padding:0; float:left;">
								<label class="control-label" style="font-size:9pt;">خصم من إيجار <?php
								 echo $result['kind']. " لوحة رقم " . $result['letters']. " ".$result['numbers']. " موديل ".$result['model'] ;
								 ?></label>
								</div>
					</div>
					<div class="row" style="padding:10px ;">
							<div class="col-xs-12">
								<label class="control-label" style="float:right;font-size:9pt;margin-right:20px;"><?php echo $result['description']; ?></label>
							</div>
					</div>
				<div class="row" style="padding:5px ;">
						<div class="col-xs-3"style="float:right;">
							<label class="control-label" style="font-size:9px;margin-right:50px;"><?php echo $result['realName']; ?></label>
						</div>
						<div class="col-xs-6"style="padding:0; float:right;">
							<label class="control-label" style="font-size:9px;margin-right:100px;"><?php echo $result['b_name']; ?></label>
						</div>
					</div>
				</form>
    </body>
</html>
