<?php session_start();
if($_SESSION[id]!=""){
 ?>
<html dir="rtl">
<head>
<title>
صفحه اعضا
</title>
<style>
td
{
  padding-top:10px
}

</style>
<body>
<?php
include ('dbf.php');
include_once('jdf.php');
$date_j=jdate('Y');
$mode=$_GET["mode"];
if($mode=="update")
{
//echo $_GET[q2];
    $q=$_GET[q2];
	$fg=mysql_query("select * from `ozv` where (ozv.ip='$q')");
	$v=mysql_fetch_assoc($fg);
	$pic=$v['pic'];
	//echo $pic;
	?>
<form name="uyhh" method="post" action="a_memberpage.php" enctype="multipart/form-data">
	<table dir="rtl" width="750" border="0" align="center">
	<tr>
	<td>
		<?php if($pic!=''){?><img  width="150" height="150" src="uplowd/<?php echo $pic;?>"><?php }?>
	</td>
	<td align="center">
	<div class="divfieldset">
	<fieldset style="width:420px"><legend align="right" >ويرايش مشخصات عضو </legend>
	<table align="center" border="0" dir="rtl" class="table" style="width:420px" >
	<input type="hidden" name="ip" value="<?php echo $v['ip'];?>">
		<tr>
			<td width="200" class="label" >
				<span>

				* شماره عضويت    :
				</span>

			</td>
			<td width="200"  class="td">
				<span class="blacktext">
				<input tabindex="1" type="text" name="id" id="id" value="<?php echo $v['id']; ?>"  onblur="rep(this.id,'a_memberpage.php','d1')">
				<div id="d1"></div>

				<?php
				//echo $v['id'];
				?>
				</span>
			</td>
		</tr>
		<tr>
			<td class="label">
				<span> * تاریخ عضویت      :</span>
			</td>
			<td >
				<input type="hidden" name="date_gh" value="<?php echo $v['date']; ?>">
				<input tabindex="2" type="text" name="date" id="date" value="<?php echo $v['date']; ?>" style="font-size: 10pt;font-family:tahoma">
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>* نــــــــــام        :</span>
			</td>
			<td >
				<input tabindex="3" type="text" name="fname" id="fname" value="<?php echo $v['fname']; ?>" style="font-size: 10pt;font-family:tahoma">
			</td>
		</tr>
		<tr>
			<td class="label">
				<span> * نام خانوادگی:</span>
			</td>
			<td>
				<input tabindex="4" type="text" name="lname" id="lname" value="<?php echo $v['lname']; ?>" style="font-size: 10pt;font-family:tahoma">
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>  نام پدر :</span>
			</td>
			<td>
				<input tabindex="5" type="text"  name="faname" id="faname" value="<?php echo $v['faname']; ?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>  * جنسیت :</span>
			</td>
			<td >
				<input tabindex="5" type="radio" size="5" name="jen" value="مرد" <?php if ($v['jen']=="مرد") {?> checked	<?php }?> style="cursor:hand;font-size: 10pt;font-family:tahoma"><span class="blacktext">مرد</span>
				<input tabindex="6" type="radio"	size="5" name="jen" value="زن" <?php if ($v['jen']=="زن") {?> checked	<?php }?> style="cursor:hand;font-size: 10pt;font-family:tahoma"><span class="blacktext">زن</span>
			</td>
		</tr>
		<tr>
				<td class="label">
					<span> تاریخ تولد :</span>
				</td>
				<td>
					<input tabindex="6" type="text"  name="bearthdate" id="bearthdate"  value="<?php echo $v['bearthdate']; ?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
				</td>
		</tr>
		<tr>
			<td class="label">
				<span>* شماره تلفن :</span>
			</td>
			<td >
				<input tabindex="7" type="text" name="sh_t" id="sh_t" value="<?php echo $v['sh_t']; ?>" style="font-size: 10pt;font-family:tahoma">
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>کد ملی :</span>
			</td>
			<td >
				<input tabindex="8" type="text" name="code_melli" value="<?php echo $v['code_melli']; ?>" style="font-size: 10pt;font-family:tahoma">
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>محل سکونت :</span>
			</td>
			<td >
				<input  tabindex="9" type="text" size="30" name="address" value="<?php echo $v['address']; ?>" style="font-size: 10pt;font-family:tahoma">
				<input type="hidden" size="11" name="city" value="<?php echo $_SESSION[city];?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
			</td>
		</tr>
		<!--<tr>
			<td class="label">
				<span>* عنوان :</span>
			</td>
			<td >
				<input tabindex="10" type="radio" size="5"  name="onvan" value="مدير" <?php if ($v['onvan']=="مدير") {?> checked	<?php }?> style="cursor:hand;font-size: 10pt;font-family:tahoma"><span class="blacktext">مدير</span>
				<input tabindex="11" type="radio"	size="7" name="onvan" value="عضو" <?php if ($v['onvan']=="عضو") {?> checked	<?php }?> style="cursor:hand;font-size: 10pt;font-family:tahoma"><span class="blacktext">عضو</span>
			</td>
		</tr>-->
		<tr>
			<td class="label">
				<span>	تصویر عضو :</b></span>
			</td>
			<td >
			    <input type="hidden" name="pic1" value="<?php echo $v['pic'];?>">
				<input tabindex="12" type="file" size="5" name="pic"  value="<?php echo $v['pic']; ?>"><?php echo $v['pic']; ?>
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>رمز عبور عضو :</span>
			</td>
			<td>
				<input tabindex="13" type="text" name="pass" value="<?php echo $v['pass']; ?>" style="font-size: 10pt;font-family:tahoma">
			</td>
		</tr>
		<tr>
			<td colspan="2" align="center">
				<table>
					<tr>
						<td>

							<button tabindex="14" title="اصلاح" name="esla" type="submit" onClick="return emptyValidation('id~date~fname~lname~sh_t')"><img src="images/b_edit.png"  name="eslah"  border="0" width="20" height="20" ></button>
						</td>
						</form>
						<form method="post" action="index1.php?page=one">
						<td>
							<button tabindex="15" title="بازگشت" name="cancel" type="button"  onClick="ajaxload('memberpage.php')"><img src="images/r1.png"  name="eslah"  border="0" width="20" height="20" ></button>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		</tr>

	</table>
 </fieldset>
 </div>
	</td>
	</tr>
	</table>

	</form>
	<?php

}
elseif($mode=="delete")
{
	$q=$_GET[q2];
	$fg=mysql_query("select * from `ozv` where (ozv.ip='$q')");
	$v=mysql_fetch_assoc($fg);
	$pic=$v['pic'];
	?>
	<table width="750" border="0" align="center" dir="rtl">
	<tr>
	<td>
		<?php if($pic!=''){?><img  width="150" height="150" src="uplowd/<?php echo $pic;?>"><?php }?>
	</td>
	<td align="center">
	<div class="divfieldset">
	<fieldset style="width:420px"><legend align="right" >حذف مشخصات عضو </legend>
	<table align="center" border="0" dir="rtl"  class="table">
	<form name="uy" method="post" action="index1.php?page=one">
	<input type="hidden" name="ip" value="<?php echo $v['ip'];?>">

		<tr>
			<td width="200" class="label">
				<span>
				<input type="hidden" name="id" value="<?php echo $v['id']; ?>">
				شماره عضويت         :
				</span>
			</td>
			<td width="200">
				<span class="blacktext">
				<?php
				echo $v['id'];
				?>
				</span>
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>
				تاریخ عضویت </span>
			</td>
			<td >
				<span class="blacktext">
				<?php
				echo $v['date'];
				?>
				</span>
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>
				نــــــــــام        :</span>
			</td>
			<td >
				<span class="blacktext">
				<?php
				echo $v['fname'];
				?>
				</span>
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>
				<input type="hidden" name="lname" value="<?php echo $v['lname'];?>">
				نام خانوادگی:
				</span>
			</td>
			<td >
				<span>
				<?php
				echo $v['lname'];
				?>
				</span>
			</td>
		</tr>
		<tr>
			<td class="label">
				<input type="hidden"  name="faname" value="<?php echo $v['faname']; ?>">
				<span>  نام پدر :</span>
			</td>
			<td>
				<?php
				echo $v['faname'];
				?>
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>جنسیت :</span>
			</td>
			<td>
				<span class="blacktext">
				<?php
				echo $v['jen'];
				?>
				</span>
			</td>
		</tr>
		<tr>
				<td class="label">
					<span> تاریخ تولد :</span>
				</td>
				<td>
					<?php echo $v['bearthdate']; ?>
				</td>
		</tr>
		<tr>
			<td class="label">
				<span>شماره تلفن :</span>
			</td>
			<td>
				<span class="blacktext">
				<?php
				echo $v['sh_t'];
				?>
				</span>
			</td>
		</tr>
		<tr>
			<td class="label">
				<span>کد ملی :</span>
			</td>
			<td>
				<span class="blacktext">
				<?php
				echo $v['code_melli'];
				?>
				</span>
			</td>
		</tr><tr>
			<td class="label">
				<span>محل سکونت :</span>
			</td>
			<td>
				<span class="blacktext">
				<?php
				echo $v['address'];
				?>
				</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['pass'];
				?>
				<input type="hidden" name="pass" value="<?php echo $v['pass'];?>">
				</span>
			</td>
		</tr>
		<tr>
			<td colspan="2" align="center">
				<table>
					<tr>
						<td>
							<button tabindex="1" title="حذف" name="dell" type="button" onClick="dele('a_memberpage.php','<?php echo $q;?>',ajaxload('memberpage.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=one">
						<td>
							<button tabindex="2" title="بازگشت" name="cancel" type="button"  onClick="ajaxload('memberpage.php')"><img src="images/r1.png"  name="eslah"  border="0" width="20" height="20" ></button>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</form>
	</table>
	 </fieldset>
 </div>
	</td>
	</tr>
	</table>
	<?php
}
elseif (($_GET['new'])||($_SESSION[m]=='1') )
{
$fg11=mysql_query("select * from `ozv`  order by id  DESC  ");
$v11=mysql_fetch_assoc($fg11);
$iddi=$v11['id']+1;
?>
	<table width="750" border="0" align="center" dir="rtl">
			<tr>
				<td align="center">
				<div class="divfieldset">
	               <fieldset style="width:420px"><legend align="right" >ثبت مشخصات عضو </legend>
						<form name="uy" method="post"  action="a_memberpage.php" enctype="multipart/form-data">
							<table align="center" border="0" dir="rtl"  class="table" >

								<tr>
									<td width="140" class="label">
											<span  > * شماره عضويت :</span>
									</td>
									<td>
										<input tabindex="1" type="text"  name="id" id="id" value="<?php echo $iddi; ?>" style="cursor:hand;font-size: 10pt;font-family:tahoma"  onblur="rep(this.id,'a_memberpage.php','d1')"  >
										<div id="d1"></div>
									</td>
								</tr>
								<tr>
									<td align="right" class="label">
										<span>  *	تاریخ عضویت       :</span>
									</td>
									<td>
									<?php //include('calender.php'); ?>
        								<input type="text" tabindex="2"  name="active1"    id="active1" />
       	 								&nbsp;&nbsp;<img src="images/calendar.jpg" onClick="displayDatePicker('active1', this);" title="انتخاب تاریخ"/>
        							</td>
								</tr>
								<tr>
									<td align="right" class="label">
										<span>  *	نــــــــــام        :</span>
									</td>
									<td>
										<input tabindex="3" type="text"  name="fname" id="fname" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<tr>
									<td class="label">
										<span>  *	نام خانوادگی:</span>
									</td>
									<td>
										<input tabindex="4" type="text"  name="lname" id="lname" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<tr>
									<td class="label">
										<span>  نام پدر :</span>
									</td>
									<td>
										<input tabindex="5" type="text"  name="faname" id="faname" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<tr>
									<td class="label">
										<span>  *	جنسیت :</span>
									</td>
									<td>
										<input tabindex="5" checked type="radio" size="5" name="jen" value="مرد" style="cursor:hand;font-size: 10pt;font-family:tahoma"><span class="blacktext">مرد</span>
										<input tabindex="6" type="radio"	size="5" name="jen" value="زن" style="cursor:hand;font-size: 10pt;font-family:tahoma"><span class="blacktext">زن</span>
									</td>
								</tr>
								<tr>
									<td class="label">
										<span> 	تاریخ تولد :</span>
									</td>
									<td>
										<input tabindex="6" type="text"  name="bearthdate" id="bearthdate" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<tr>
									<td class="label">
										<span>  *	شماره تلفن :</span>
									</td>
									<td>
										<input tabindex="7" type="text"  name="sh_t" id="sh_t" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<tr>
									<td class="label">
									<span>	کد ملی :</span>
									</td>
									<td>
										<input tabindex="8" type="text"  name="code_melli" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<tr>
									<td class="label">
									<span>  	محل سکونت :</span>
									</td>
									<td>
										<input type="text" size="25" name="address"  tabindex="9" style="cursor:hand;font-size: 10pt;font-family:tahoma">
										<input type="hidden" size="11" name="city"  style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<!--<tr>
									<td class="label">
									<span>  *	عنوان :</span>
									</td>
									<td>
										<input tabindex="10" type="radio" size="5" name="onvan" value="مدير" style="cursor:hand;font-size: 10pt;font-family:tahoma"><span class="blacktext">مدير</span>
										<input tabindex="11" checked type="radio"	size="7" name="onvan" value="عضو" style="cursor:hand;font-size: 10pt;font-family:tahoma"><span class="blacktext">عضو</span>
									</td>
								</tr>-->
								<tr>
									<td class="label">
									<span>	تصویر عضو :</span>
									</td>
									<td>
										<input tabindex="12" type="file" size="5" name="pic" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<tr>
									<td class="label">
									<span>	رمز عبور عضو :</span>
									</td>
									<td>
										<input tabindex="13" type="text"  name="pass" id="pass" style="cursor:hand;font-size: 10pt;font-family:tahoma" onBlur="rep(this.id,'a_memberpage.php','d2')">
									    <div id="d2"></div>
									</td>
								</tr>
								<input type="hidden"  id="val" name="val" value="" >
									<div id="m"></div>
								<tr>

									<td colspan="2" align="center">
										<table>
											<tr>
												<td>
													<button tabindex="14" name="ffg" type="submit"  onclick="return emptyValidation('id~active1~fname~lname~sh_t')"><img src="images/sabtf2.png"  name="neew"  border="0" width="20" height="20" ></button>
												</td>
												</form>
												<form method="post" action="index1.php?page=one">
												<td>
	          										<button tabindex="15" title="بازگشت" name="cancel" type="button"  onClick="ajaxload('memberpage.php')"><img src="images/r1.png"  name="eslah"  border="0" width="20" height="20" ></button>
	          									</td>
											</tr>
										</table>
									</td>
								</tr>
						</table>
						 </fieldset>
 </div>
					</form>
				</td>

		</tr>
</table>
<?php

}
}
else
include('index.php');
?>
</body>
</html>