<html dir="rtl">
<style>
td
{
  padding-top:5px
}

</style>
<body>
<?php
include ('dbf.php');
$mode=$_GET["mode"];
if($mode=="update")
{
    $q=$_GET[q2];
	$fg=mysql_query("select * from `majale` where (majale.id='$q')");
	$v=mysql_fetch_assoc($fg);
	?>
   <div class="divfieldset">
	<fieldset style="width:400px"><legend align="right" >ويرايش مشخصات مجلات </legend>
	<table align="center" border="0" dir="rtl" class="table" style="width:400px">
	<form name="uy" method="post" action="" enctype="multipart/form-data">
	<input type="hidden" name="city" value="<?php echo $_SESSION[city];?>">
	<input type="hidden" name="id" value="<?php echo $v['id'];?>">
		<tr>
			<td class="label">
				<span>	شماره ثبت مجله          :</span>
			</td>
			<td>
				<input tabindex="1" type="text" size="10" name="ip" id="ip" value="<?php echo $v['ip'];?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
			</td>
		</tr>
		<tr>
			<td align="right" class="label">
				<span>	نـــــــــــوع :</span>
			</td>
			<td>
				<select tabindex="2" name="kind" id="kind" style="font-size: 9pt;font-family:tahoma">
					<option value="<?php echo $v['kind'];?>" style="font-size: 9pt;font-family:tahoma"><?php echo $v['kind'];?></option>
					<option value="مجله" style="font-size: 9pt;font-family:tahoma">مجله</option>
					<option value="روزنامه" style="font-size: 9pt;font-family:tahoma">روزنامه</option>
					<option value="هفته نامه" style="font-size: 9pt;font-family:tahoma">هفته نامه</option>
					<option value="ماهنامه" style="font-size: 9pt;font-family:tahoma">ماهنامه</option>
					<option value="فصل نامه" style="font-size: 9pt;font-family:tahoma">فصل نامه</option>
					<option value="سالنامه" style="font-size: 9pt;font-family:tahoma">سالنامه</option>
					<option value="مقاله" style="font-size: 9pt;font-family:tahoma">مقاله</option>
					<option value="غیره" style="font-size: 9pt;font-family:tahoma">غیره</option>
				</select>
			</td>
		</tr>
		<tr>
			<td align="right" class="label">
				<span>	نــــــــــــام         :</span>
			</td>
			<td>
				<input tabindex="3" type="text" size="20" name="name" id="name" value="<?php echo $v['name'];?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>تاریخ انتشار :</span>
			</td>
			<td>
				<input tabindex="4" type="text" size="10" name="date_nashr" id="date_nashr" value="<?php echo $v['date_nashr'];?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
			</td>
		</tr>
		<tr>
			<td class="label">
				<span >	شماره مجله:</span>
			</td>
			<td>
				<input tabindex="5" type="text" size="10" name="number" id="number" value="<?php echo $v['number'];?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
			</td>
		</tr>
		<tr>
			<td class="label">
				<span >	شماره پیاپی :</span>
			</td>
			<td>
				<input tabindex="6" type="text" size="10" name="p_number" id="p_number" value="<?php echo $v['p_number'];?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>	تعداد صفحات :</span>
			</td>
			<td>
				<input tabindex="7" type="text" size="10" name="page_number" id="page_number" value="<?php echo $v['page_number'];?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>	مـــــوضــــوع :</span>
			</td>
			<td>
				<input tabindex="8" type="text" size="10" name="topic" id="topic"  value="<?php echo $v['topic'];?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>	شماره سریال :</span>
			</td>
			<td>
				<input tabindex="9" type="text" size="10" name="seryal" id="seryal" value="<?php echo $v['seryal'];?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
			</td>
		</tr>
		<tr>
			<td class="label">
				<span >	سردبیـــــــر :</span>
			</td>
			<td>
				<input tabindex="10" type="text" size="15" name="sardabir" id="sardabir"  value="<?php echo $v['sardabir'];?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>	صاحب امتیاز :</span>
			</td>
			<td>
				<input tabindex="11" type="text" size="15" name="s_emtiaz" id="s_emtiaz" value="<?php echo $v['s_emtiaz'];?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>	قيمــــت :</span>
			</td>
			<td>
				<input tabindex="12" type="text" size="5" name="price1" id="price1" value="<?php echo $v['price1'];?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
				<input tabindex="13" type="text" size="5" name="price2" id="price2" value="<?php echo $v['price2'];?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
			</td>
		</tr>
		<tr>
			<td class="label">
				<span> محل نگهداري :</span>
			</td>
			<td>
				<input tabindex="14" type="text" size="10" name="place1" id="place1" value="<?php echo $v['place1'];?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
				<input tabindex="15" type="text" size="10" name="place2" id="place2" value="<?php echo $v['place2'];?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>	تعداد موجودی:</span>
			</td>
			<td>
				<input tabindex="16" type="text" size="10" name="mojodi" id="mojodi" value="<?php echo $v['mojodi'];?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>	توضيــــحات :</span>
			</td>
			<td>
				<input tabindex="17" type="text" size="30" name="tou" id="tou" value="<?php echo $v['tou'];?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
			</td>
		</tr>
		<input type="hidden"  id="val" name="val" value="" >
		<tr>
			<td colspan="2" align="center">
				<table>
					<tr>
						<td>
							<button tabindex="19" title="اصلاح" name="esla" type="button" onClick="param('ip,kind,name,date_nashr,number,p_number,page_number,topic,seryal,sardabir,s_emtiaz,price1,price2,place1,place2,mojodi,tou'),update(document.getElementById('val').value,'a_majale.php','<?php echo $q;?>',ajaxload('majale.php'))"><img src="images/b_edit.png"  name="eslah"  border="0" width="20" height="20" ></button>
						</td>
						</form>
						<form method="post" action="index1.php?page=thertyone">
						<td>
							<button tabindex="20" title="بازگشت" name="cancel" type="button" onClick="ajaxload('majale.php')"><img src="images/r1.png"  name="eslah"  border="0" width="20" height="20" ></button>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		</tr>
	</form>
	</table>
</fieldset>
</div>
<?php
}
elseif($mode=="delete")
{
    $q=$_GET[q2];
	//include ('header.php');
	$fg=mysql_query("select * from `majale` where (majale.id='$q')");
	$v=mysql_fetch_assoc($fg);
	?>
	<div class="divfieldset">
	<fieldset style="width:400px"><legend align="right" >حذف مشخصات مجلات </legend>
	<table align="center" border="0" dir="rtl" class="table" style="width:400px">
	<form name="uy" method="post" action="index1.php?page=thertyone">
		<tr>
			<td class="label">
				<span>	شماره ثبت مجله          :</span>
			</td>
			<td>
				<span class="blacktext"><?php echo $v['ip'];?></span><input readonly type="hidden" size="10" name="ip" value="<?php echo $v['ip'];?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
			</td>
		</tr>
		<tr>
			<td align="right" class="label">
				<span>	نـــــــــــوع :</span>
			</td>
			<td >
			     <span class="blacktext"><?php echo $v['kind'];?></span>
			</td>
		</tr>
		<tr>
			<td align="right" class="label">
				<span >	نــــــــــــام         :</span>
			</td>
			<td >
				<span class="blacktext"><?php echo $v['name'];?></span>
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>تاریخ انتشار :</span>
			</td>
			<td>
				<span ><?php echo $v['date_nashr'];?></span>
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>	شماره مجله:</span>
			</td>
			<td>
				<span class="blacktext"><?php echo $v['number'];?></span>
			</td>
		</tr>
		<tr>
			<td class="label">
				<span >	شماره پیاپی :</span>
			</td>
			<td>
				<span class="blacktext"><?php echo $v['p_number'];?></span>
			</td>
		</tr>
		<tr>
			<td class="label">
				<span >	تعداد صفحات :</span>
			</td>
			<td>
				<span class="blacktext"><?php echo $v['page_number'];?></span>
			</td>
		</tr>
		<tr>
			<td class="label">
				<span >	مـــــوضــــوع :</span>
			</td>
			<td>
				<span class="blacktext"><?php echo $v['topic'];?></span>
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>	شماره سریال :</span>
			</td>
			<td>
				<span class="blacktext"><?php echo $v['seryal'];?></span>
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>	سردبیـــــــر :</span>
			</td>
			<td>
				<span class="blacktext"><?php echo $v['sardabir'];?></span>
			</td>
		</tr>
		<tr>
			<td class="label">
				<span >	صاحب امتیاز :</span>
			</td>
			<td>
				<span class="blacktext"><?php echo $v['s_emtiaz'];?></span>
			</td>
		</tr>
		<tr>
			<td class="label">
				<span >	قيمــــت :</span>
			</td>
			<td>
				<span class="blacktext"><?php echo $v['price1'];?>
				<?php echo $v['price2'];?></span>
			</td>
		</tr>
		<tr>
			<td class="label">
				<span > محل نگهداري :</span>
			</td>
			<td>
				<span class="blacktext"><?php echo $v['place1'];?>
				<?php echo $v['place2'];?></span>
			</td>
		</tr>
		<tr>
			<td class="label">
				<span >	تعداد موجودی:</span>
			</td>
			<td>
				<span ><?php echo $v['mojodi'];?></span>
			</td>
		</tr>
		<tr>
			<td class="label">
				<span >	توضيــــحات :</span>
			</td>
			<td>
				<span class="blacktext"><?php echo $v['tou'];?></span>
			</td>
		</tr>
		<tr>
			<td colspan="2" align="right" class="label">
				<span class="blacktext"><?php echo $v['magh_number'];?></span>
				<span >ثبت مشخصات مقالات مجلات و روزنامه ها</span>
			</td>
		</tr>
		<tr>
			<td colspan="2" align="center" >
				<table>
					<tr>
						<td>
							<button tabindex="1" title="حذف" name="dell" type="button" onClick="dele('a_majale.php','<?php echo $q;?>',ajaxload('majale.php'))"><img src="images/b_drop.png"  name="del"  border="0" width="20" height="20" ></button>
						</td>
						</form>
						<form method="post" action="index1.php?page=thertyone">
						<td>
							<button tabindex="2" title="بازگشت" name="cancel" type="button" onClick="ajaxload('majale.php')"><img src="images/r1.png"  name="eslah"  border="0" width="20" height="20" ></button>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		</tr>
	</form>
	</table>
	</fieldset>
</div>
	<?php

}
elseif ($_GET['new'] )
{

//include ('header.php');
?>
	<div class="divfieldset">
	<fieldset style="width:400px"><legend align="right" >ثبت مشخصات مجلات </legend>
					<table align="center" border="0" dir="rtl" class="table" style="width:400px">
							<input name="city" type="hidden" value="<?php echo $_SESSION[city];?>">
								<tr>
									<td class="label">
										<span>	شماره ثبت مجله          :</span>
									</td>
									<td>
										<input tabindex="1" type="text" size="10" name="ip" id="ip" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<tr>
									<td align="right" class="label">
									<span >	نـــــــــــوع :</span>
									</td>
									<td>
										<select tabindex="2" name="kind" id="kind" style="font-size: 9pt;font-family:tahoma">
											<option value="" style="font-size: 9pt;font-family:tahoma">انتخاب نماييد</option>
											<option value="مجله" style="font-size: 9pt;font-family:tahoma">مجله</option>
											<option value="روزنامه" style="font-size: 9pt;font-family:tahoma">روزنامه</option>
											<option value="هفته نامه" style="font-size: 9pt;font-family:tahoma">هفته نامه</option>
											<option value="ماهنامه" style="font-size: 9pt;font-family:tahoma">ماهنامه</option>
											<option value="فصل نامه" style="font-size: 9pt;font-family:tahoma">فصل نامه</option>
											<option value="سالنامه" style="font-size: 9pt;font-family:tahoma">سالنامه</option>
											<option value="مقاله" style="font-size: 9pt;font-family:tahoma">مقاله</option>
											<option value="غیره" style="font-size: 9pt;font-family:tahoma">غیره</option>
										</select>
									</td>
								</tr>
								<tr>
									<td align="right" class="label">
										<span >	نــــــــــــام         :</span>
									</td>
									<td>
										<input tabindex="3" type="text" size="20" name="name" id="name" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<tr>
									<td class="label">
										<span >تاریخ انتشار :</span>
									</td>
									<td>
										<input tabindex="4" type="text" size="10" name="date_nashr" id="date_nashr" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<tr>
									<td class="label">
										<span >	شماره مجله:</span>
									</td>
									<td>
										<input tabindex="5" type="text" size="10" name="number" id="number" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>

								<tr>
									<td class="label">
									<span >	شماره پیاپی :</span>
									</td>
									<td>
										<input tabindex="6" type="text" size="10" name="p_number" id="p_number" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<tr>
									<td class="label">
									<span >	تعداد صفحات :</span>
									</td>
									<td>
										<input tabindex="7" type="text" size="10" name="page_number" id="page_number" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<tr>
									<td class="label">
									<span >	مـــــوضــــوع :</span>
									</td>
									<td>
										<input tabindex="8" type="text" size="10" name="topic" id="topic" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<tr>
									<td class="label">
									<span>	شماره سریال :</span>
									</td>
									<td>
										<input tabindex="9" type="text" size="10" name="seryal" id="seryal" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<tr>
									<td class="label">
									<span>	سردبیـــــــر :</span>
									</td>
									<td>
										<input tabindex="10" type="text" size="15" name="sardabir" id="sardabir" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<tr>
									<td class="label">
									<span>	صاحب امتیاز :</span>
									</td>
									<td>
										<input tabindex="11" type="text" size="15" name="s_emtiaz"  id="s_emtiaz" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<tr>
									<td class="label">
									<span>	قيمــــت :</span>
									</td>
									<td>
										<input tabindex="12" type="text" size="5" name="price1" id="price1" style="cursor:hand;font-size: 10pt;font-family:tahoma">
										<input tabindex="13" type="text" size="5" name="price2" id="price2" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>

								<tr>
									<td class="label">
									<span> محل نگهداري :</span>
									</td>
									<td>
										<input tabindex="14" type="text" size="10" name="place1" id="place1" style="cursor:hand;font-size: 10pt;font-family:tahoma">
										<input tabindex="15" type="text" size="10" name="place2" id="place2"  style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<tr>
									<td class="label">
									<span>	تعداد موجودی:</span>
									</td>
									<td>
										<input tabindex="16" type="text" size="10" name="mojodi" id="mojodi"  style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<tr>
									<td class="label">
									<span>	توضيــــحات :</span>
									</td>
									<td>
										<input tabindex="17" type="text" size="30" name="tou" id="tou" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>

								<input type="hidden"  id="val" name="val"  >
								<div id="d1"></div>
                                  <input type="hidden"  id="dval" name="dval" value="" >

								<tr>
									<td colspan="2" align="center">
										<table>
											<tr>
												<td>

													<button tabindex="19" name="ffg" type="button" onClick="param('ip,kind,name,date_nashr,number,p_number,page_number,topic,seryal,sardabir,s_emtiaz,price1,price2,place1,place2,mojodi,tou'),insert(document.getElementById('val').value,'<?php echo 'a_majale.php' ; ?>','ip,kind,name,date_nashr,number,p_number,page_number,topic,seryal,sardabir,s_emtiaz,price1,price2,place1,place2,mojodi,tou')" ><img src="images/sabtf2.png"  name="neew"  border="0" width="20" height="20" ></button>
												</td>

												<td>
	          										<button tabindex="20" title="بازگشت" name="cancel" type="button"  onClick="ajaxload('majale.php')"><img src="images/r1.png"  name="eslah"  border="0" width="20" height="20" ></button>
	          									</td>
											</tr>
										</table>
									</td>
								</tr>

					</table>
				</fieldset>
</div>
<?php
}
?>
</body>
</html>