<?php
session_start();
if($_SESSION[id]!="")
{
include ('dbf.php');
if(isset($_POST['ok_group']))
{
 	mysql_query("insert into `book_group` (id,sath,name,user,city)
	VALUES ('{$_POST['id']}','{$_POST['sath']}','{$_POST['name']}','{$_SESSION['user']}','{$_SESSION['city']}')");
	?>
	<script>
		window.alert("                 .مشخصات گروه کتاب جدید ، ذخیره شد");
	</script>
	<?php
}
?>
<html dir="rtl">
<head>
<link rel="stylesheet" type="text/css" href="css/style.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>نرم افزار کتابداری نوین</title>

</head>
<body bgcolor="#FDE2C5">

<?php include ('header.php'); ?>
<table width="90%" align="center" border="0">
	<tr>
		<td align="center" valign="bottom" height="70">
			<?php  include ('menu.php'); ?>
		</td>
	</tr>
</table>
<script src="ajax1.js"></script>
<br/>

<form name="jk" id="jk" method="post" action="">

<table width="90%" align="center" border="2" style="border-color:blue">
	<tr>
		<td align="center" height="350">
			<table width="40%" align="center">
				<tr>
					<td align="right" style="font-family:tahoma">
						<b>ایجاد گروه جدید:</b>
					</td>
				</tr>
				<?php
				$fg16=mysql_query("select id from book_group where (city='{$_SESSION['city']}') order by id  DESC ");
				$v16=mysql_fetch_assoc($fg16);
				$vall=$v16['id']+1;
				?>
				<tr>
					<td align="center" style="font-family:tahoma">
						<table width="90%" align="center"  bgcolor="#BBD9EE" border="1">
							<tr>
								<td>
									کد گروه:
								</td>
								<td align="center">
									<input name="id"  type="text" tabindex="1" value="<?php echo $vall; ?>">
								</td>
							</tr>
							<?php
							$fg10=mysql_query("select * from book_group1 where (city='{$_SESSION['city']}')   ");
							$v10=mysql_fetch_assoc($fg10);
							?>
							<tr>
								<td>
									تعیین سطح:
								</td>
								<td align="center">
									<select tabindex="2" name="sath" id="sath"  style="font-size: 9pt;font-family:tahoma">
										<option value="1" style="font-size: 9pt;font-family:tahoma"><?php echo $v10['name1']; ?></option>
										<option value="2" style="font-size: 9pt;font-family:tahoma"><?php echo $v10['name2']; ?></option>
										<option value="3" style="font-size: 9pt;font-family:tahoma"><?php echo $v10['name3']; ?></option>
									</select>
								</td>
							</tr>

							<tr>
								<td>
									نام گروه:
								</td>
								<td align="center">
									<input name="name" type="text" tabindex="3" size="45">
								</td>
							</tr>
							<tr>
								<td colspan="2" align="center">
									<table align="center" >
										<tr>
											<td align="left">
												<button tabindex="3" name="ok_group" title="ذخیره اطلاعات" type="submit" ><img src="images/sabtf2.png"  name="neew"  border="0" width="30" height="30" ></button>
											</td>
											</form>
											<form action="book_group.php">
											<td align="right">
												<button tabindex="3" name="back" title="بازگشت" type="submit" ><img src="images/r1.png"  name="neew"  border="0" width="30" height="30" ></button>
											</td>
											</form>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</form>
<?php
}
else
include('index.php');
?>
</body>