<?php session_start();
//if($_SESSION[id]!=""){
?>
<html dir="rtl">
<style>
td
{
  padding-top:10px
}

</style>
<body>
<?php
include ('dbf.php');
$mode=$_GET["mode"];
if($mode=="update")
{
    $q=$_GET[q2];
	$fg=mysql_query("select * from `dio` where (ip='$q')");
	$v=mysql_fetch_assoc($fg);
	?>
  <div class="divfieldset">
	<fieldset style="width:300px"><legend align="right" >ويرايش مشخصات كد كنگره </legend>
	<table align="center" border="0" dir="rtl" class="table">
	<form name="uy" method="post" action="index1.php?page=twoentyone">
		<tr>
			<td class="label">
				<input type="hidden" name="ip" value="<?php echo $v['ip']; ?>">
				<span>موضوع        :</span>
			</td>
			<td>
			   <select tabindex="5" name="topic" id="topic" style="font-size: 9pt;font-family:tahoma">
				<?php
				    $f1=mysql_query("select * from mozo ");
				      while($ff1=mysql_fetch_assoc($f1)){
				?>
				<option <?php if($ff1['moz']==$v['sarfasl']){ ?> selected <?php }?>  value="<?php echo $ff1['moz']; ?>" style="font-size: 9pt;font-family:tahoma"><?php echo $ff1['moz']; ?></option>
				<?php } ?>
			 </select>
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>  كد كنگره:</span>
			</td>
			<td>
				<input type="text" name="code" id="code" value="<?php echo $v['code']; ?>" style="font-size: 10pt;font-family:tahoma">
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>  نـــــــام :</span>
			</td>
			<td>
				<input type="text" size="25" name="name" id="name" value="<?php echo $v['name']; ?>" 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="13" title="اصلاح" name="esla" type="button" onClick="param('topic,code,name'),update(document.getElementById('val').value,'a_dio.php','<?php echo $q;?>' ,'topic,code,name')"><img src="images/b_edit.png"  name="eslah"  border="0" width="20" height="20" ></button>
						</td>
						</form>
						<form method="post" action="index1.php?page=twoentyone">
						<td>
							<button tabindex="2" title="بازگشت" name="cancel" type="button" onClick="ajaxload('dio.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 `dio` where (ip='$q')");
	$v=mysql_fetch_assoc($fg);
	?>
	<div class="divfieldset">
	<fieldset style="width:300px"><legend align="right" >	حذف مشخصات كد كنگره </legend>
	<table align="center" border="0" dir="rtl" class="table" style="width:300px">
	<form name="uy" method="post" action="index1.php?page=twoentyone">
	<input type="hidden" name="ip" value="<?php echo $v['ip']; ?>">
		<tr>
			<td class="label">
				<span >موضوع        :</span>
			</td>
			<td>
				<span>
				<?php
				echo $v['sarfasl'];
				?>
				</span>
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>كد كنگره :</span>
			</td>
			<td>
				<span>
				<?php
				echo $v['code'];
				?>
				</span>
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>نـــــــام :</span>
			</td>
			<td>
				<span>
				<?php
				echo $v['name'];
				?>
				</span>
			</td>
		</tr>
		<tr>
			<td colspan="2" align="center">
				<table>
					<tr>
						<td>
							<button tabindex="1" title="حذف" name="dell" type="button" onClick="dele('a_dio.php','<?php echo $q;?>',ajaxload('dio.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=twoentyone">
						<td>
							<button tabindex="2" title="بازگشت" name="cancel" type="button" onClick="ajaxload('dio.php')"><img src="images/r1.png"  name="eslah"  border="0" width="20" height="20" ></button>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</form>
	</table>
</fieldset>
</div>
	<?php
}
elseif ($_GET['new'])
{
?>
             <div class="divfieldset">
				  <fieldset style="width:300px"><legend align="right" >ثبت مشخصات كد كنگره </legend>
							<table align="center" border="0" bordercolor="#003366" dir="rtl" class="table"  >
								<tr>
									<td width="140" class="label" >
										<span>  	موضوع         :</span>
									</td>
									<td>
									<select tabindex="5" name="topic" id="topic" style="font-size: 9pt;font-family:tahoma">
				                        <?php
				                          $f1=mysql_query("select * from mozo ");
				                          while($ff1=mysql_fetch_assoc($f1)){
				                         ?>
					                    <option  value="<?php echo $ff1['moz']; ?>" style="font-size: 9pt;font-family:tahoma"><?php echo $ff1['moz']; ?></option>
				                       <?php } ?>
				                      </select>

									</td>
								</tr>
								<tr>
									<td align="right" class="label">
										<span>  	كد كنگره       :</span>
									</td>
									<td>
										<input tabindex="2" type="text" size="20" name="code" id="code" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<tr>
									<td class="label">
										<span>   	نـــــــام:</span>
									</td>
									<td>
										<input tabindex="3" type="text" size="25" name="name" id="name" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<input type="hidden"  id="val" name="val" value="" >
								<div id="d1"></div>
                                  <input type="hidden"  id="dval" name="dval" value="" >
								<tr>
									<td colspan="2" align="center">
										<table>
											<tr>
												<td>
													<button tabindex="4" name="ffg" type="button" onClick="param('topic,code,name'),insert(document.getElementById('val').value,'<?php echo 'a_dio.php' ; ?>','topic,code,name')"><img src="images/sabtf2.png"  name="ffg"  border="0" width="20" height="20" ></button>
												</td>
												<td>
	          										<button tabindex="5" title="بازگشت" type="button"  onClick="ajaxload('dio.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 }?>
</body>
</html>