Viewing file: showPsInDept.php (6.51 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include_once "template.php";
include_once "../class/clsTable.php";
include_once "../class/clsDepartment.php";
include_once "../class/clsPerson.php";
include_once "../link/function.php";
include_once "../class/clsUmuser.php";
include_once "../class/clsadmin.php";
include_once "../class/clshire.php";
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EPERSON'], $GLOBALS['DBUSER_EPERSON'], $GLOBALS['DBPASS_EPERSON']);
$oUs = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_UMS'], $GLOBALS['DBUSER_UMS'], $GLOBALS['DBPASS_UMS']);
$oDP = new Department($oC);
$oPS = new Person($oC);
$oUms= new umuser($oUs);
$oAd = new admin($oC);
$oHr = new hire($oC);
include_once "getPrefix.php";
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<link href="../source/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<iframe id="addConfig" name="addConfig" src="" style="width:0px;height:0px;border:0"></iframe>
<br>
<table width=730 align="center">
<tr><td height="150">
<fieldset>
<legend><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><a href="?mm=1">ข้อมูลบุคลากร</a>
<img src="../picture/ico3.gif" width="10" height="10" border="0" align="absmiddle">ข้อมูลบุคลากรจำแนกตามหน่วยงาน
</font></legend>
<form name="ff" METHOD="POST" action="showPsInDept.php">
<table border="0" align="center" width="100%"><tr><td align="center">
<table width="87%" height="21" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#DADADA" style="border-collapse:collapse">
<tr><td width="13%" align="left"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_2"];?>"><strong>หน่วยงาน :: </strong>
</font></td>
<td width="87%" align="left">
<select name="deptId" onChange='return showdept2();' >
<option value="0">- เลือกหน่วยงาน -</option>
<? $oDP->RSDeptByMaxdeptDate2();
while($oDP->GetRecord()){?>
<option value="<? echo $oDP->deptId;?>" <? if($oDP->deptId==$deptId){ echo "selected"; }?>><? echo $oDP->deptName; ?></option>
<? } ?>
<option value="nodept" <? if($deptId=="nodept"){ echo "selected"; }?>>ไม่มีหน่วยงานที่สังกัด</option>
</select>
<input type="hidden" name="method" value="pp">
<input type="hidden" name="showdeptId">
</td>
</tr>
</table><br>
<? if($deptId!="" && $deptId!="0"){ ?>
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="silver">
<tr><td colspan="8" align="center" bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_9"];?>" height="24"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>ข้อมูลบุคลากรในหน่วยงาน</b></font></td></tr>
<tr align="center" bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_9"];?>">
<td width="6%" height="35" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>#</b></font></td>
<td width="7%" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>
คำนำหน้า<br>ชื่อ</b></font></td>
<td width="16%" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>ชื่อ</b></font></td>
<td width="18%" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>นามสกุล</b></font></td>
<td width="21%" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>ตำแหน่งในการเรียงลำดับ</b></font></td>
<td width="13%" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>ประเภทบุคลากร</b></font></td>
<td width="14%" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>ชื่อผู้ใช้<br>
(Username)</b></font></td>
<td width="5%" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>แก้ไข<br>ข้อมูล</b></font></td>
</tr>
<?
$j=0;
if($deptId=="nodept"){
$oPS->SearchByNodeptNamedocGroup($oDP->MaxDate());
}else{
$oPS->RSPersonf1dept($deptId);
}
while($oPS->GetRecord()){
$oUms->SearchByUsPsCode($oPS->personId);
$oUms->GetRecord();
if(($j%2) == 0)
echo "<tr bgcolor=\"".$GLOBALS["COLOR_BG_TD_5"]."\">";
else
echo "<tr bgcolor=\"".$GLOBALS["COLOR_BG_TD_11"]."\">";
?>
<td align="center"><? echo $j+1; ?></td>
<td align="left"> <? echo GetPrefixshow($oPS->prefixId); ?></td>
<td align="left"> <? echo $oPS->fName; ?></td>
<td align="left"> <? echo $oPS->lName; ?></td>
<td align="left"> <? $oAd->SearchByKey($oPS->adminId); if($oAd->GetRecord()==1){ echo $oAd->adminName; }?></td>
<td align="left"> <? $oHr->SearchByKey($oPS->hireId); if($oHr->GetRecord()==1){ echo $oHr->hireName; }?></td>
<td align="left"> <? echo $oUms->UsLogin; ?></td>
<td align="center"><a href="editPsInfo.php?ps=<? echo $oPS->personId; ?>&name=<? echo $name; ?>&showrep=1"><img src="../picture/textedit3.gif" alt="แก้ไขข้อมูลบุคลากร" border="0"></a></td>
</tr>
<? $j++; }
if($j==0){
?>
<tr><td colspan="8" align="center" bgcolor="#FFFFFF"><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2">** ไม่มีข้อมูลบุคลากรของหน่วยงานนี้ **</font></td></tr>
<? } ?>
</table>
<? } //if $deptId!="" && $deptId!="0" ?>
</td></tr>
<tr><td> </td></tr>
<tr><td align="center"><input type="button" name="cancel" value="กลับสู่เมนูหลัก" onClick="location.href = '?mm=1'"></td></tr>
</table>
</form><br>
</fieldset>
<table width="704" border="0" align="center">
<tr>
<td width="76" align="left"><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2"> <strong>หมายเหตุ
: </strong> </font></td>
<td width="618" align="left"><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2">
คลิกที่ <img src="../picture/textedit3.gif" alt="แก้ไขข้อมูลบุคลากร" border="0"> เพื่อแก้ไขข้อมูลบุคลากร</font></td>
</tr>
</table>
<br>
<br>
<br><br> <br><br>
</td>
</tr>
</table>
</body>
</html>
<script language="javascript">
function showdept2(){
document.ff.showdeptId.value="1";
document.ff.submit();
}
</script>
|