<?php
$mode=$_GET["mode"];
include ('dbf.php');
?>
<style>
td
{
  padding-top:10px;

}

</style>
<?php
if($mode=="update")
{
 $q=$_GET[q2];
 $fg=mysql_query("select * from `majale_et` where (ip='$q')");
 $v=mysql_fetch_assoc($fg);
 ?>

 <div class="divfieldset">
	<fieldset style="width:250px;"><legend align="right" >ويرايش مقالات</legend>
	<table border="0"  width="400" align="center" dir="rtl">
				<tr>
					<td class="label" >
						<span>شماره صفحه:</span>
					</td>
					<td >
						<input type=text 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 type=text name="onvan" id="onvan" value="<?php echo $v[onvan]; ?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
				 </td>
				</tr>
				<tr>
				<td class="label">
					 <span>نويسنــــــــده :</span>
				</td>
				<td>
					<input type=text name="writer" id="writer" value="<?php echo $v[writer]; ?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
				</td>
				</tr>

			<div id="m"></div>
			<input type=hidden name="ip_majale" id="ip_majale"  value="<?php echo $v[ip_majale]; ?>" >
			<input type="hidden"  id="val" name="val" value="" >
			<tr>
				<td align="center" colspan="2" >
				<table border="0" dir="rtl">
				<tr>
				<td align="center" valign="middle">
				  <button  name="dio_es" type="button" onClick="param('page_number,onvan,writer,ip_majale'),update(document.getElementById('val').value,'a_majale_et.php','<?php echo $q;?>',ajaxload('majale_et.php'))"><img src="images/sabtf2.png"  name="neew"  border="0" width="20" height="20" ></button>
				</td>
				<td>
	          	 <button tabindex="5" title="بازگشت" type="button"  onClick="ajaxload('majale_et.php')"><img src="images/r1.png"  name="eslah"  border="0" width="20" height="20" ></button><td align="center" title="بازگشت">
	          	</td>
				</tr>
				</table>
				</td>
			</tr>
		</table>
		</fieldset>
     </div>
<?php
}
elseif($mode=="delete")
{
 $q=$_GET[q2];
 $fg=mysql_query("select * from `majale_et` where (ip='$q')");
 $v=mysql_fetch_assoc($fg);
 ?>
   <div class="divfieldset">
	<fieldset style="width:250px;"><legend align="right" >حذف مقالات</legend>
	<table border="0"  width="400"  align="center" dir="rtl">
				<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[onvan]; ?></span>

				 </td>
				</tr>
				<tr>
				<td class="label">
					 <span>نويسنــــــــده :</span>
				</td>
				<td>
				    <span class="blacktext"><?php echo $v[writer]; ?></span>

				</td>
				</tr>

			<tr>
				<td align="center" colspan="2" >
				<table border="0" dir="rtl">
				<tr>
				<td align="center" valign="middle">
				  <button  name="dio_es" type="button" onClick="dele('a_majale_et.php','<?php echo $q;?>',ajaxload('majale_et.php'))"><img src="images/sabtf2.png"  name="neew"  border="0" width="20" height="20" ></button>
				</td>
				<td>
	          	 <button tabindex="5" title="بازگشت" type="button"  onClick="ajaxload('majale_et.php')"><img src="images/r1.png"  name="eslah"  border="0" width="20" height="20" ></button><td align="center" title="بازگشت">
	          	</td>
				</tr>
				</table>
				</td>
			</tr>
		</table>
		</fieldset>
       </div>
<?php
}
elseif ($_GET['new'] )
{

?>
 <div class="divfieldset">
	<fieldset style="width:250px;"><legend align="right" >ثبت مقالات</legend>
	<table border="0"  width="400" align="center" dir="rtl">
				<tr>
					<td class="label">
						<span>شماره صفحه:</span>
					</td>
					<td >

						<input type=text 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 type=text name="onvan" id="onvan" style="cursor:hand;font-size: 10pt;font-family:tahoma">
				 </td>
				</tr>
				<tr>
				<td class="label">
					 <span>نويسنــــــــده :</span>
				</td>
				<td>
					<input type=text name="writer" id="writer" style="cursor:hand;font-size: 10pt;font-family:tahoma">
				</td>
				</tr>

			<div id="d1"></div>
			<input type=hidden name="ip_majale" id="ip_majale"  value="<?php echo $_SESSION[mjid]; ?>" >
			<input type="hidden"  id="val" name="val" value="" >
			<div id="d1"></div>
             <input type="hidden"  id="dval" name="dval" value="" >
			<tr>
				<td align="center"  colspan="2">
				<table border="0" dir="rtl">
				<tr>
				<td align="center" valign="middle">
				  <button  name="dio_es" type="button" onClick="param('page_number,onvan,writer,ip_majale'),insert(document.getElementById('val').value,'<?php echo 'a_majale_et.php' ; ?>','page_number,onvan,writer')" ><img src="images/sabtf2.png"  name="neew"  border="0" width="20" height="20" ></button>
				</td>
				<td>
	          	 <button tabindex="5" title="بازگشت" type="button"  onClick="ajaxload('majale_et.php')"><img src="images/r1.png"  name="eslah"  border="0" width="20" height="20" ></button><td align="center" title="بازگشت">
	          	</td>
				</tr>
				</table>
				</td>
			</tr>
		</table>
		</fieldset>
       </div>
<?php
}
?>