Viewing file: v_addPerson.php (11.08 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<script>
jQuery(document).ready(function(){
doDisable(jQuery("#prsItId").val());
chkDebtUDAuthority(jQuery("#prsOrgId").val());
});
function doDisable(val) {
var personCode = jQuery("#personCode");
var fName2 = jQuery("#fName2");
var lName2 = jQuery("#lName2");
var emailAddr = jQuery("#emailAddr");
var pic = jQuery("#pic");
if (val == 1) {
personCode.attr("disabled",false);
fName2.attr("disabled",false);
lName2.attr("disabled",false);
emailAddr.attr("disabled",false);
pic.attr("disabled",false);
} else {
personCode.attr("disabled",true);
fName2.attr("disabled",true);
lName2.attr("disabled",true);
emailAddr.attr("disabled",true);
pic.attr("disabled",true);
}
}
function chkDebtUDAuthority (val) {
var target = jQuery("#prsDebtUDAuthority");
if (val == '') {
target.attr("disabled",true);
} else {
target.attr("disabled",false);
}
}
</script>
<?php
$row_cfg = isset($qu_cfg) ? $qu_cfg->row() : NULL;
$row_prs = isset($qu_prs) ? $qu_prs->row() : NULL;
$row_ps = isset($qu_ps) ? $qu_ps->row() : NULL;
?>
<table width="100%" align="center">
<tr>
<td>
<div align="center"><span class="h" style="color:<?php echo $font_color_err;?>">เพิ่มบุคลากรใหม่</span>
<?php echo form_open_multipart($this->config->item("rg_folder")."officer/prs_insert_update", array("name" => "myform", "id" => "myform"));?>
<table class="szone">
<tr>
<td><br /></td>
</tr>
<tr bgcolor="<?php echo $this->config->item('rg_head_tb_headCol');?>">
<td colspan="4" height="25px"><span><b> ข้อมูลทั่วไปบุคลากร</b></span></td>
</tr>
<tr bgcolor="<?php echo $tr_color_even;?>">
<td class="coltd_szone"><span><b>รหัสประจำตัว</b></span></td>
<td>
<?php
if ($tc || $row_cfg->cfgCheckPP == 'Y') {
echo (getval('prsItId', $row_prs) == 1) ? getval('personCode', $row_prs) : '';
} else {
?>
<input type="text" id="personCode" name="personCode" size="15" maxlength="13" value="<?php echo (getval('prsItId', $row_prs) == 1) ? getval('personCode', $row_prs) : '';?>" class="required-int" />
<span class="error">* <?php echo form_error('personCode');?></span>
<?php
}
?>
</td>
<?php
$tmp_pic = (setValue('pic',$row_prs)==NULL) ? 'photo.jpg' : setValue('pic',$row_prs);
?>
<td width="15%" rowspan="5" align="center">
<img src="<?php echo base_url().$this->config->item("rg_pictureT").$tmp_pic;?>" width="100" height="115" align="absmiddle" border="0" /></td>
</tr>
<tr bgcolor="<?php echo $tr_color_even;?>">
<td class="coltd_szone"><span><b>ประเภทบุคลากร</b></span></td>
<td>
<?php
if ($tc) {
echo getval('ptName', $row_prs);
} else {
echo form_dropdown('prsPtId', $rs_pt, getval('prsPtId', $row_prs));
?>
<span class="error">* <?php echo form_error('prsPtId');?></span>
<?php
}
?>
</td>
</tr>
<tr bgcolor="<?php echo $tr_color_even;?>">
<td class="coltd_szone"><span><b>ประเภทอาจารย์</b></span></td>
<td>
<?php
if ($tc || getval('prsId', $row_prs)) {
echo getval('itName', $row_prs);
?>
<input type="hidden" id="prsItId" name="prsItId" value="<?php echo getval('prsItId', $row_prs);?>" />
<?php
} else {
$js = "id=\"prsItId\" onChange=\"doDisable(this.value)\"";
echo form_dropdown('prsItId', $rs_it, getval('prsItId', $row_prs), $js);
?>
<span class="error">* <?php echo form_error('prsItId');?></span>
<?php
}
?>
</td>
</tr>
<tr bgcolor="<?php echo $tr_color_even;?>">
<td class="coltd_szone"><span><b>ชื่อ-นามสกุลไทย</b></span></td>
<td>
<?php
if ($tc || $row_cfg->cfgCheckPP == 'Y') {
echo getval('prefixName', $row_prs).getval('fName', $row_prs).' '.getval('lName', $row_prs);
} else {
?>
<?php echo form_dropdown("prefixId", $rs_pf, getval('prefixId', $row_prs));?>
<input type="text" id="fName" name="fName" size="10" value="<?php echo getval('fName', $row_prs);?>" />
<input type="text" id="lName" name="lName" size="10" value="<?php echo getval('lName', $row_prs);?>" />
<span class="error">*<?php echo form_error('prefixId') ? form_error('prefixId') : (form_error('fName') ? form_error('fName') : form_error('lName'));?></span>
<?php
}
?>
</td>
</tr>
<tr bgcolor="<?php echo $tr_color_even;?>">
<td class="coltd_szone"><span>ชื่อ-นามสกุลอังกฤษ</b></span></td>
<td>
<?php
if ($row_cfg->cfgCheckPP == 'Y') {
echo (getval('prsItId', $row_prs) == 1) ? getval('prefixNameEng', $row_prs).getval('fName2', $row_prs).' '.getval('lName2', $row_prs) : '';
} else {
?>
<input type="text" id="fName2" name="fName2" size="10" value="<?php echo (getval('prsItId', $row_prs) == 1) ? getval('fName2', $row_prs) : '';?>" />
<input type="text" id="lName2" name="lName2" size="10" value="<?php echo (getval('prsItId', $row_prs) == 1) ? getval('lName2', $row_prs) : '';?>" />
<span class="error">*<?php echo form_error('fName2') ? form_error('fName2') : form_error('lName2');?></span>
<?php
}
?>
</td>
</tr>
<tr bgcolor="<?php echo $tr_color_even;?>">
<td class="coltd_szone"><span><b>อีเมล์</b></span></td>
<td colspan="2">
<?php
if ($row_cfg->cfgCheckPP == 'Y') {
echo (getval('prsItId', $row_prs) == 1) ? getval('emailAddr',$row_prs) : '';
} else {
?>
<input type="text" id="emailAddr" name="emailAddr" value="<?php echo (getval('prsItId', $row_prs) == 1) ? getval('emailAddr', $row_prs) : '';?>" />
<span class="error">*<?php echo form_error('emailAddr');?></span>
<?php
}
?>
</td>
</tr>
<tr bgcolor="<?php echo $tr_color_even;?>">
<td class="coltd_szone"><span><b>สถานะบุคลากร</b></span></td>
<td colspan="2">
<?php
if ($tc || $row_cfg->cfgCheckPP == 'Y') {
echo getval('psName', $row_ps);
echo form_hidden('prsPsId', getval('prsPsId', $row_prs));
} else {
echo form_dropdown('prsPsId', $rs_fip, getval('prsPsId', $row_prs, 1));
?>
<span class="error">* <?php echo form_error('prsPsId');?></span>
<?php
}
?>
</td>
</tr>
<tr bgcolor="<?php echo $tr_color_even;?>">
<td class="coltd_szone"><span><b>สถานที่ติดต่อ</b></span></td>
<td colspan="2"><input type="text" id="prsAddr" name="prsAddr" size="30" value="<?php echo getval('prsAddr', $row_prs);?>" />
<span class="error">*<?php echo form_error('prsAddr');?></span></td>
</tr>
<tr bgcolor="<?php echo $tr_color_even;?>">
<td class="coltd_szone"><span><b>เบอร์โทรศัพท์ติดต่อ</b></span></td>
<td colspan="2"><input type="text" id="prsPhoneNo" name="prsPhoneNo" size="20" value="<?php echo getval('prsPhoneNo', $row_prs);?>" />
<span class="error">*<?php echo form_error('prsPhoneNo');?></font></td>
</tr>
<tr bgcolor="<?php echo $tr_color_even;?>">
<td class="coltd_szone"><span><b>สังกัดหน่วยแจ้งหนี้นักศึกษา</b></span></td>
<td colspan="2">
<?php
if ($tc) {
echo getval('orgName', $row_prs);
} else {
$js = "id=\"prsOrgId\" onChange=\"chkDebtUDAuthority(this.value)\"";
echo form_dropdown('prsOrgId', $rs_org, getval('prsOrgId', $row_prs), $js);
}
?>
</td>
</tr>
<tr bgcolor="<?php echo $tr_color_even;?>">
<td class="coltd_szone"><span><b>สิทธิ์ในการลบหรือแก้ไข</b></span></td>
<td colspan="2">
<?php
if ($tc) {
echo getval('prsDebtUDAuthority', $row_prs);
} else {
?>
<input type="checkbox" id="prsDebtUDAuthority" name="prsDebtUDAuthority" value="Y" <?php echo (getval('prsDebtUDAuthority', $row_prs) == 'Y') ? 'checked' : '';?> disabled />
<span><label>มีสิทธิ์ลบหรือแก้ไขข้อมูลหนี้สินนักศึกษาได้</label></span>
<?php
}
?>
</td>
</tr>
<tr bgcolor="<?php echo $tr_color_even;?>">
<td class="coltd_szone"><span><b>ตำแหน่ง</b></span></td>
<td colspan="2">
<?php
if ($tc) {
echo getval('prsPosition', $row_prs);
} else {
?>
<input id="prsPosition" name="prsPosition" type="text" size="30" value="<?php echo getval('prsPosition', $row_prs);?>" />
<?php
}
?>
</td>
</tr>
<tr bgcolor="<?php echo $tr_color_even;?>">
<td class="coltd_szone"><span><b>หมายเหตุ</b></span></td>
<td colspan="2"><input id="prsRemark" name="prsRemark" type="text" size="30" value="<?php echo getval('prsRemark', $row_prs);?>" /></td>
</tr>
<?php
if (!$tc && ($row_cfg->cfgCheckPP == 'N')) {
?>
<tr bgcolor="<?php echo $tr_color_even;?>">
<td class="coltd_szone"><span><b>รูปภาพบุคลากร</b></span></td>
<td colspan="2"><input type="file" id="pic" name="pic" value="<?php echo (getval('prsItId', $row_prs) == 1) ? getval('pic', $row_prs) : '';?>" />
<span class="error">(รูปควรมีขนาด 100x115 pixels เป็น .jpg เท่านั้น และขนาดไฟล์ไม่เกิน 2 MB)<?php echo form_error('pic');?></span></td>
</tr>
<?php
}
?>
<tr bgcolor="<?php echo $tr_color_even;?>">
<td colspan="3" align="center">
<input type="submit" name="add" value="บันทึก" />
<input type="reset" name="clear" value="เคลียร์ข้อมูล">
<input type="hidden" id="prsId" name="prsId" value="<?php echo getval('prsId', $row_prs);?>" />
<input type="hidden" id="personId" name="personId" value="<?php echo (getval('prsItId', $row_prs) == 1) ? getval('personId', $row_prs) : '';?>" />
<input type="hidden" id="psoutId" name="psoutId" value="<?php echo (getval('prsItId', $row_prs) == 1) ? '' : getval('psoutId', $row_prs);?>" />
<input type="hidden" id="cfgCheckPP" name="cfgCheckPP" value="<?php echo getval('cfgCheckPP', $row_cfg);?>" />
<input type="hidden" id="tc" name="tc" value="<?php echo $tc;?>" /></td>
</tr>
</table><?php echo form_close();?></div>
<br></td>
</tr>
</table>
<table width="100%">
<tr>
<td width="8%"><span style="color:<?php echo $font_color_err;?>"><b>หมายเหตุ :</b></span></td>
<td><span style="color:<?php echo $font_color_err;?>">* หมายถึง ต้องกรอกข้อมูลให้สมบูรณ์</span></td>
</tr>
<tr>
<td></td>
<td><span style="color:<?php echo $font_color_err;?>">Y = มีสิทธิ์ลบหรือแก้ไขข้อมูลหนี้สินนักศึกษาได้, N = ไม่มีสิทธิ์ลบหรือแก้ไขข้อมูลหนี้สินนักศึกษาได้</span></td>
</tr>
</table>
|