<form name = "FormStaff" id="frmstaff" method = "POST" onsubmit="return chkFrmSubmitSt('errErm');" enctype = "multipart/form-data" > <!--- action = "c_staff.php?action=add" -->
<div id = "addstaff">
<center><label id = "msgwar" class = "msgChk"></label></center>
<table border = "0">
	<!--<tr valign = "baseline" ><td colspan = "5" align = "center" ><?php //echo $errMsg = errmsgex();?><br /><label id = "errErm" class = "errChk"></label></td></tr>-->
	<tr>
		<td colspan = "5"></td>
	</tr>
	<tr>
		<td colspan = "5"><h3 class='h1'>ເພີ່ມຂໍ້ມູນພະນັກງານ</h3></td>
	</tr>
	<tr>
		<td colspan = "5"></td>
	</tr>
	<tr>
		<td rowspan="6">
			<img src= "../staff/images/staff/<?php if ($row_ict['staff_pict'] != '') { echo $row_ict['staff_pict']; } else { echo "mini_mem.png"; } ?>" width="130px" height="155px">		</td>
        <td><span>&nbsp;ລະຫັດ:&nbsp;<label id = "erID" class = "chkInp">*</label>&nbsp;&nbsp;</span></td>
		<td><input type = "text" name = "emp_code" class = "autoId" placeholder = "ລະຫັດພະນັກງານ" value = "<?php if (isset($row['emp_code'])) echo $row['emp_code'];?>" maxlength = "4"   required = "required" /></td>
		<td><span>&nbsp;&nbsp;</span></td>
		<td><input type = "hidden" name = "txtid" class = "autoId" value = "<?php// echo $id = maxId();?>" maxlength = "11" disabled = "disabled" /></td>
		<td><input type = "hidden" name = "parent_id" value ="<?=$_GET['parent_id']?>" ></td>
    </tr>
    <tr>
		<td><span>ຊື່:<label id = "erName_l" class = "chkInp">*</label>&nbsp;&nbsp;</span></td>
		<td><input type = "text" name = "name" class = "txtbox" placeholder = "ຊື່ (ພາສາລາວ)" value = "<?php if (isset($row['name'])) echo $row['name'];?>" maxlength = "50" id = "name_l" required = "required" /></td>
		<td><span>ນາມສະກຸນ:<label id = "erLstnm_l" class = "chkInp">*</label>&nbsp;&nbsp;</span></td>
		<td><input type = "text" name = "surname" class = "txtbox" placeholder = "ນາມສະກຸນ (ພາສາລາວ)" id = "lstnm_l" required = "required" value = "<?php if (isset($row['surname'])) echo $row['surname'];?>" maxlength = "50" /></td>
	</tr>
	<tr>
		<td><span>Name:<label id = "erName_e" class = "chkInp">*</label>&nbsp;&nbsp;</span></td>
		<td><input type = "text" name = "name_eng" class = "txtbox" placeholder = "Name English" value = "<?php if (isset($row['name_eng'])) echo $row['name_eng'];?>" maxlength = "50" id = "name_e" required = "required" /></td>
		<td><span>Surname:<label id = "erLstnm_e" class = "chkInp">*</label>&nbsp;&nbsp;</span></td>
		<td><input type = "text" name = "surname_eng" class = "txtbox" placeholder = "Surname English" value = "<?php if (isset($row['surname_eng'])) echo $row['surname_eng'];?>" maxlength = "50" id = "lstnm_e"  required = "required" /></td>
	</tr>
	<tr>
    	<td><span >ສະຖານະ*:</span></td>
		<td>
			<?php
				selListstatus('status');
		 	?>        </td>
		<td><span>ເພດ*:</span></td>
		<td>
			<?php
				selListsex('gender');
			?>
		</td>
	</tr>
	<tr>
    	<td><span >ຊົນເຜົ່າ:</span></td>
		<td><input type = "text" name = "tribe" class = "txtbox" placeholder = "ຊົນເຜົ່າ" value = "<?php if (isset($row['tribe'])) echo $row['tribe'];?>" maxlength = "50" /></td>
		<td><span>ສາສະໜາ:</span></td>
		<td valign = ""><input type = "text" name = "religion" class = "txtbox" placeholder = "ສາສະໜາ" value = "<?php if (isset($row['religion'])) echo $row['religion'];?>" maxlength = "50" /></td><td width="4px"></td>
	</tr>
	<tr>
    	<td valign = ""><span >&nbsp;ລູກ:&nbsp;</span></td>
		<td valign = ""><input type = "text" name = "child_n" class = "txtbox" placeholder = "ຈໍານວນ" value = "<?php if (isset($row['child_n'])) echo $row['child_n'];?>" maxlength = "2" />ຄົນ</td>
		<td valign = "" align="center"><span>   ອັດຕາຄິດໄລ່:&nbsp;</span></td>
		<td valign = ""><input type = "text" name = "cal_code" class = "txtbox" placeholder = "ອັດຕາຄິດໄລ່ເງິນເດືອນ" value = "<?php if (isset($row['cal_code'])) echo $row['cal_code'];?>" maxlength = "5" /></td>
	</tr>
	<tr>
    	<td > ຮູບພະນັກງານ:&nbsp;</td>
	  <td colspan = "4">
            <input type = "file" class = "inputtextpict" name = "stPic" maxlength = "255" />		</td>
	</tr>
	<tr>
		<td valign = "bottom"><span>&nbsp;ວັນຮັບເຂົ້າການ (ຈາກຈັດຕັ້ງ):&nbsp;</span></td>
		<td valign = "bottom" colspan = "2">
			<input class = "date" type = "text"  name = "hire_date" placeholder = "ປີ/ເດືອນ/ວັນ" value = "<?php if (isset($row['hire_date'])) echo $row['hire_date'];?>" maxlength = "10" id = "hire_date" />
            </td>
        <td valign = "bottom" align="center"><span>&nbsp;ວັນເດືອນປີເກີດ: </span></td>
	  <td valign = "bottom">
			<input class = "date" type = "text" placeholder = "ປີ/ເດືອນ/ວັນ" name = "birth_date" value = "<?php if (isset($row['birth_date'])) echo $row['birth_date'];?>" maxlength = "10" id = "birth_date" />
           		</td>
	</tr>
	<tr>
		<td valign = "top"><span >&nbsp;ບ້ານເກີດ:&nbsp;</span></td>
		<td colspan = "4"><textarea name = "born_add" class = "txtarea" placeholder = "ບ້ານເກີດ" maxlength = "255"><?php if (isset($row['born_add'])) echo $row['born_add'];?></textarea></td>
	</tr>
	<tr>
		<td valign = "top"><span >&nbsp;ບ້ານຢູ່ປະຈຸບັນ:&nbsp;</span></td>
		<td colspan = "4"><textarea name = "address" class = "txtarea" placeholder = "ບ້ານຢູ່ປະຈຸບັນ" maxlength = "255"><?php if (isset($row['address'])) echo $row['address'];?></textarea></td>
	</tr>
	<tr>
    	<td valign = "buttom"><span >&nbsp;Description:&nbsp;</span></td>
		<td valign = "buttom" colspan = "4"><input type = "text" name = "description" class = "txtboxB" placeholder = "Description of staff" value = "<?php if (isset($row['description'])) echo $row['description'];?>" maxlength = "200" /></td>
	</tr>
	<tr>
		<td valign = "bottom"><span>&nbsp;ຕໍາແໜ່ງ:&nbsp;<label id = "erPos" class = "chkInp">*</label>&nbsp;&nbsp;</span></td>
		<td valign = "buttom" colspan = "4">
			<select name="position" >
					<option value="" >--- ເລືອກ ---</option>
						<?php $rs_pos = selPosition();
							
						while($rdt = mysql_fetch_array($rs_pos, MYSQL_ASSOC)){ 
							$selected = $rdt['position_id'] == $row['position_id'] ? "selected" : ""; 
							$selected_ = $row['position_id'] == '' ? "selected" : ""; ?>
							<option value="<?=$rdt['position_id'] ?>" <?= $selected ?>><?= $rdt['position_name'] ?></option>
					<?php }?>
					<option value="NULL" <?=$selected_?> >ວິຊາການ ຫຼື ສະມາຊີກ</option>
			</select>
		</td>
	</tr>
	<tr>
		<td valign = "top"><span >&nbsp;ໜ້າທີ່ຮັບຜິດຊອບ:&nbsp;</span></td>
		<td colspan = "4"><textarea name = "respon" class = "txtarea" placeholder = "ໜ້າທີ່ຮັບຜິດຊອບ"><?php if (isset($row['respon'])) echo $row['respon'];?></textarea></td>
	</tr>
	<tr>
		<td valign = "top"><span >&nbsp;ວຸດທິການສຶກສາ:&nbsp;</span></td><!-- the education level -->
		<td colspan = "4"><textarea name = "edu" class = "txtarea" placeholder = "ສາມາດຂຽນໄດ້ຫຼາຍລະດັບ"><?php if (isset($row['edu'])) echo $row['edu'];?></textarea></td>
	</tr>
	<tr>
		<td valign = "top"><span >&nbsp;ຈົບການສຶກສາຈາກ:&nbsp;</span></td>
		<td colspan = "4"><textarea name = "edu_place" class = "txtarea" placeholder = "ສາມາດຂຽນໄດ້ຫຼາຍບ່ອນ"><?php if (isset($row['edu_place'])) echo $row['edu_place'];?></textarea></td>
	</tr>
	<tr>
		<td valign = "top"><span >&nbsp;ສາຂາຊ່ຽວຊານ:&nbsp;</span></td>
		<td colspan = "4"><textarea name = "old_specialist" class = "txtarea" placeholder = "ສາຂາຊ່ຽວຊານທີ່ຜ່ານມາ" maxlength = "255"><?php if (isset($row['old_specialist'])) echo $row['old_specialist'];?></textarea></td>
	</tr>
	<tr>
		<td valign = "bottom"><span >&nbsp;ບັດປະຈໍາຕົວ:&nbsp;</span></td>
		<td colspan = "2" valign = "bottom"><input type="text" name="pe_id" class="txtboxN" placeholder = "ເລກບັດປະຈໍາຕົວ" value="<?php if (isset($row['pe_id'])) echo $row['pe_id'];?>" maxlength="50" /></td>
        <td valign = "bottom" align="center"><span >&nbsp;ໜັງສືຜ່ານແດນ:&nbsp;</span></td>
		<td colspan = "" valign = "bottom"><input type="text" name="pass_id" class="txtbox" placeholder = "ເລກບັດໜັງສືຜ່ານແດນ" value="<?php if (isset($row['pass_id'])) echo $row['pass_id'];?>" maxlength="50" /></td>
	</tr>
	<tr>
		<td ><span>&nbsp;E-mail:&nbsp;<label id = "emailER" class = "chkInp">*</label>&nbsp;&nbsp;</span></td>
		<td colspan = "4"><input type = "text" name = "email_address" class = "txtboxB" placeholder = "ທີ່ຢູ່ E-mail" value = "<?php if (isset($row['email_address'])) echo $row['email_address'];?>" maxlength = "200" id = "erEmail" onkeyup = "checkEmailsEmpStaff('erEmail', 'emailError', 'emailER')" required = "required" /><br /><label id = "emailError" class = "errChk"></label></td>
	</tr>
	<tr>
		<td><span>&nbsp;ເບີໂທລະສັບ:&nbsp;<label id = "phoneER" class = "chkInp">*</label>&nbsp;&nbsp;</span></td>
		<td colspan = "4"><input type = "text" name = "tel" class = "txtboxB" placeholder = "ສາມາດຂຽນໄດ້ຫຼາຍເບີ" value = "<?php if (isset($row['tel'])) echo $row['tel'];?>" maxlength = "26" id = "erPhone" onkeyup = "checkPhoneEmpStaff('erPhone', 'phoneError', 'phoneER')" required = "required" /><br /><label id = "phoneError" class = "errChk"></label></td>
	</tr>    
    <tr>
		<td valign = "top"><span >&nbsp;ອຸປະນິໄສ:</span></td>
		<td colspan = "4"><textarea name = "hobby" class = "txtarea" placeholder = "ລັກສະນະ ອຸປະນິໄສ ສ່ວນຕົວທີ່ບອກຄວາມເປັນຕົວເອງ" value = "<?php if (isset($row['hobby'])) echo $row['hobby'];?>" maxlength = "100"></textarea></td>
	</tr>
	<tr>
		<td valign = "top"><span >&nbsp;ເວລາຫວ່າງ:&nbsp;</span></td>
		<td colspan = "4"><textarea name = "free_t" class = "txtarea" placeholder = "ສິ່ງທີ່ປະຕິບັດເປັນປະຈໍາໃນຍາມຫວ່າງ"><?php if (isset($row['free_t'])) echo $row['free_t'];?></textarea></td>
	</tr>
     
    <tr>
		<td valign = "top"><span >&nbsp;ໝາຍເຫດ:&nbsp;</span></td>
		<td colspan = "4"><textarea name = "remark" class = "txtarea" placeholder = "ໝາຍເຫດ"><?php if (isset($row['remark'])) echo $row['remark'];?></textarea></td>
	</tr>
	<tr>
		<td valign = "bottom"><span>&nbsp;ວັນເຂົ້າພັກ:&nbsp;</span></td>
		<td valign = "bottom" colspan = "2">
			<input class = "date" type = "text" name = "party_date" placeholder = "ປີ/ເດືອນ/ວັນ" value = "<?php if (isset($row['party_date'])) echo $row['party_date'];?>" maxlength = "10" id = "party_date" />		</a>		</td>
		<td valign = "bottom" align="center"><span>&nbsp;ວັນເຂົ້າຊາວໜຸ່ມ:&nbsp;</span></td>
		<td valign = "bottom" colspan = "2">
			<input class = "date" type = "text" name = "young_date" placeholder = "ປີ/ເດືອນ/ວັນ" value = "<?php if (isset($row['young_date'])) echo $row['young_date'];?>" maxlength = "10" id = "young_date" /></td>
	</tr>
	<tr>
		<td valign = "bottom"><span>&nbsp;ວັນເຂົ້າພັກສໍາຮອງ:&nbsp;</span></td>
		<td valign = "bottom" colspan = "2">
			<input class = "date" type = "text" name = "deputy_party_date" placeholder = "ປີ/ເດືອນ/ວັນ" value = "<?php if (isset($row['deputy_party_date'])) echo $row['deputy_party_date'];?>" maxlength = "10" id = "de_party_date" />
           	</td>
		<td valign = "bottom" align="center"><span>&nbsp;ວັນເຂົ້າກໍາມະບານ:&nbsp;</span></td>
		<td valign = "bottom" colspan = "2">
			<input class = "date" type = "text" name = "labor_date" placeholder = "ປີ/ເດືອນ/ວັນ" value = "<?php if (isset($row['labor_date'])) echo $row['labor_date'];?>" maxlength = "10" id = "labor_date" />	</td>
	</tr>
	<tr>
		<td valign = "bottom"><span>&nbsp;ວັນເຂົ້າສະຫະພັນແມ່ຍິງ:&nbsp;</span></td>
<td valign = "bottom" colspan = "2">
			<input class = "date" type = "text" name = "women_date" placeholder = "ປີ/ເດືອນ/ວັນ" value = "<?php if (isset($row['women_date'])) echo $row['women_date'];?>" maxlength = "10" id = "w_date" />	</td>
		<td valign = "bottom" align="center"><span> ວັນທີບັນທຶກຂໍ້ມູນ (ຈາກຈັດຕັ້ງ):&nbsp;</span></td>
  <td valign = "bottom" colspan = "2">
			<input class = "date" type = "text" name = "record_date" placeholder = "ປີ/ເດືອນ/ວັນ" value = "<?php if (isset($row['record_date'])) echo $row['record_date'];?>" maxlength = "10" id = "rec_date" /></td>
	</tr>
	<tr>
		<td colspan = "5">
			<fieldset >
				<legend >ຂໍ້ມູນລາຍລະອຽດຂອງຄູ່ຄອງ:</legend>
				<table border = "0" cellpadding = "0" cellspacing = "0" align="center">
					<tr>
						<td valign = "bottom" width = "124px"><span >&nbsp;ຊື່ເຕັມ:&nbsp;</span></td>
				      <td valign = "bottom" colspan = "3"><input type = "text" name = "status_per" class = "txtboxB" placeholder = "ຊື່ຂອງຄູ່ຄອງ" value = "<?php if (isset($row['status_per'])) echo $row['status_per'];?>" maxlength = "200" /></td>
					</tr>
					<tr>
						<td valign = "bottom"><span >&nbsp;ອາຊີບ:&nbsp;</span></td>
						<td width="144px" colspan = "" valign = "bottom"><input type = "text" name = "status_w" class = "txtboxC" placeholder = "ອາຊີບປະຈຸບັນຂອງຄູ່ຄອງ" value = "<?php if (isset($row['status_w'])) echo $row['status_w'];?>" maxlength = "200" />						</td>
                        <td valign = "bottom" width = "127px"><span>&nbsp;ວັນເດືອນປີເກີດ:&nbsp;</span></td>
						<td valign = "bottom" colspan = "" width = "198px">
							<input class = "date" type = "text" name = "status_birthdate" placeholder = "ປີ/ເດືອນ/ວັນ" value = "<?php if (isset($row['status_birthdate'])) echo $row['status_birthdate'];?>" maxlength = "10" id = "status_birthdate" />			  </td>
					</tr>
                    <tr>
                    	<td valign = "bottom"><span>&nbsp;ສະຖານທີ່ເຮັດວຽກ:&nbsp;</span></td>
					  <td valign = "bottom" colspan = "3"><input type = "text" name = "status_w_place" class = "txtboxB" placeholder = "ບ່ອນເຮັດວຽກຂອງຄູ່ຄອງ&nbsp;" value = "<?php if (isset($row['status_w_place'])) echo $row['status_w_place'];?>" /></td>
                    </tr>
				</table>
		  </fieldset>		</td>
	</tr>
    <!--<tr>
    	<td valign = "bottom"><span>&nbsp;Manager:&nbsp;</span></td>
		<td valign = "bottom" colspan = "4"><input type="text" name="manager" class="" placeholder = "Manager of staff" value="<?php //echo $row_ict['manager_id'];?>" size="85" maxlength="100" /></td>
	</tr>-->
    
	<tr><td rowspan = "" colspan = "5">&nbsp;</td></tr>
	<tr>
    	<td align = "center" valign = "top" colspan = "5">
		<div class="menubox" align="center">
		  <?php if($user_role == 1){ ?>
   	      <input type = "submit" class = "btn2" name = "btAddSt" value = "ສົ່ງຂໍ້ມູນ" />
		  <?php } ?>
      	  <input type='button' onclick="window.location.href='?d=staff/staff&parent_id=<?=$_GET['parent_id']?>'" class = "btn2" type = "reset" name = "btcancel" value = "ຍົກເລີກ" /> 
		</div>
		</td>
    </tr>
	<tr><td rowspan = "" colspan = "5">&nbsp;</td></tr>
	<tr>
		<td colspan = "5" align = "center"><hr /></td>
	</tr>
</table>
</div>
<!---
<input type = "hidden" name = "txtid" value = "<?php// echo $id = maxId();?>" />
<input type = "hidden" name = "FormStaff" value = "FormAddStaff" id = "validated" />
-->
</form>
<?=$err?>
