<?php
if($_SESSION[id]!=""){
 $tab1='2'; ?>
<script src="AjaxFunctionozv_aj.js"></script>
<html dir="rtl">
<head>
<style>
td
{
  padding-top:10px;
  padding-bottom:10px;
}

</style>
</head>
<body >
<?php
include('dbf.php');


if($_GET['p']!=""){
//include ('header.php');
$s=mysql_query("select * from amanat where id='{$_GET['p']}'");
$sf=mysql_fetch_assoc($s);
$r=mysql_query("select * from `rezerv` where id_b='{$sf['id_b']}'");
$rf=mysql_fetch_assoc($r);
$s1=mysql_query("select * from `ketab` where id='{$sf['id_b']}'");
$s1f=mysql_fetch_assoc($s1);
?>
<br>
<table dir="rtl" border="0" align="center">
	<tr>
		<td valign="top">
		<form action="" name="f5" method="post">
			<table border="0" width="750" align="center">
				<tr>
					<td align="center" >
						<span>&nbsp;</span>
						<span class="blacktext"><b> درخواست رزرو کتاب<b/></span></br>
						<span>&nbsp;</span>
						<table border="1" width="750" align="center">
							<tr>
								<td>
									<table border="0">
										<tr>
											<td>
											<span class="blacktext">نام </span>
											</td>
											<td width="120">
												<input type="text" size="10" readonly name="fname_ozv" title="نام عضو" value="<?php echo $sf['fname_ozv']; ?>">
											</td>
											<td>
											<span class="blacktext">  نام خانوادگی </span>
											</td>
											<td width="150">
												<input type="text" size="15" readonly name="lname_ozv" title="نام خانوادگی عضو" value="<?php echo $sf['lname_ozv']; ?>">
											</td>
											<td>
											<span class="blacktext">شماره عضویت </span>
											</td>
											<td width="100">
												<input type="text" size="7" readonly name="id_ozv1" title="شماره عضویت" value="<?php echo $sf['id_ozv']; ?>">
											</td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<td>
									<table border="0" width="800">
										<tr>
											<td  >
											<span><b>شماره ثبت کتاب :</b></span>
											</td>
											<td width="80" align="right">
												<span class="blacktext"><?php echo $s1f['id']; ?></span>
											</td>
											<td  >
											<span class="blacktext"><b>عنوان کتاب :</b></span>
											</td>
											<td width="80" align="right">
												<span class="blacktext"><?php echo $s1f['name'];  ?></span>
											</td>
											<td >
											<span class="blacktext"><b>موضوع :</b></span>
											</td>
											<td width="80" align="right">
												<span class="blacktext"><?php echo $s1f['topic']; ?></span>
											</td>
											<td >
											<span class="blacktext"><b>نویسنده :</b></span>
											</td>
											<td width="80" align="right">
												<span class="blacktext"><?php echo $s1f['writer']; ?></span>
											</td>
										</tr>
										<tr>
											<td  >
											<span class="blacktext"><b>مترجم :</b></span>
											</td>
											<td width="80" align="right">
												<span class="blacktext"><?php echo $s1f['motarjem']; ?></span>
											</td>
											<td >
											<span class="blacktext"><b>ناشر :</b></span>
											</td>
											<td width="80" align="right">
												<span class="blacktext"><?php echo $s1f['nasher']; ?></span>
											</td>
											<td align="left">
											<span class="blacktext" align="right"><b>شماره دیویی :</b></span>
											</td>
											<td width="80" align="right">
												<span class="blacktext"><?php echo $s1f['dio_ip']; ?></span>
											</td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<td align="right">
									<table border="0" width="600">
										<tr>
											<td align="left">
											<span class="blacktext"><b>تاریخ رفت :</b></span>
											</td>
											<td width="80" align="right">
												<span class="blacktext"><?php echo $sf['date_out']; ?></span>
											<td align="left">
											<span class="blacktext"><b>تاریخ سررسید کتاب :</b></span>
											</td>
											<td width="80" align="right">
												<span class="blacktext"><?php echo $sf['date_sar'];  ?></span>
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
						</br>
						<span class="blacktext"><b>مشخصات کاربر رزرو<b/></span></br>
						<span>&nbsp;</span>
						<table border="0">
							<tr><?php $tab1='2'; $gh=mysql_query("select * from rezerv where (id_b='{$s1f['id']}') order by date desc limit 1 ");
										$fgh=mysql_fetch_assoc($gh);  ?>
								<td  align="right"><span class="blacktext">نام عضو : </td>
								<td align="center" width="100">
               						<input type="text" tabindex="1" size="10" id="ozvename" name="ozvename" onKeyUp="getozve(this.value)">
								</td>
								<td align="right" width="120">
									<div id="ozvo" >
									<select name="id_ozv" id="id_ozv" tabindex="<?php echo $tab1; ?>" >
									<?php if ($fgh['id_b']==$s1f['id'])
									{

									?><option value='<?php echo $fgh['id_ozv']; ?>'><?php echo $fgh['fname_ozv']." ".$fgh['lname_ozv']." - ".$fgh['id_ozv'];  ?></option>
									<?php
									}
									else
									{ ?>
									<option value=''>انتخاب نماييد</option>
									<?php
									}
										$q1=mysql_query("select * from ozv ");
										while($n1=mysql_fetch_array($q1)){
										 		echo "<option value=$n1[id]>".$n1[fname]." ".$n1[lname]." - ".$n1[id]."</option>";
											}
									?>
									</select></div>
								</td>
								<td align="center" width="100">
               						<input type="text" tabindex="3" size="10" name="ozvid" id="ozvid" title="بارکد عضو">
								</td>
							</tr>
							<input type="hidden"  id="val" name="val" value="" >
							<tr>
								<td align="center" colspan="4"></br>
									<input type="hidden" name="re" id="re" value="<?php echo $s1f['id']; ?>" >
									<button  tabindex="4" name="sabt" value="1" title="تایید رزرو" type="button" onClick="param('ozvid,id_ozv,re'),insert2(document.getElementById('val').value,'<?php echo 'a_requirpage.php' ; ?>','id_ozv','کد عضویت را وارد کنید')" ><img src="images/b_edit.png"
									 height="20" width="20"></button>
									<button  tabindex="6" name="ret" type="button"  onClick="ajaxload('requirpage.php')" title="بازگشت"><img src="images/r1.png" height="20" width="20"></button>
								</td>
							</tr>
						</table></br></br></br>
					</td>
				</tr>
			</table></form>
		</td>
		<td valign="top">
		<?php
		//include ('menu.html');
	//	include ('back.htm');
		?>
		</td>
	</tr>
</table>
<?php
//include ('foteer.php');
}
}
else
include('index.php');
?>
</body>
</html>
