Viewing file: addHrPerUnit.php (10.45 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include_once "template.php";
showHeader();
include_once "../class/clsOfficer.php";
include_once "../class/clsSysSemesterDes.php";
include_once "../class/clsAcadYearConfig.php";
include_once "../class/clsrg_LoadType.php";
include_once "../class/clsrg_CopyTimeTable.php";
include_once "../class/clsrg_OFSetTT.php";
include_once "../class/clsrg_HrPerUnit.php";
$huTmId = (! isset($_GET['huTmId'])? "" : $_GET['huTmId']);
$huAcY = (! isset($_GET['huAcY'])? "" : $_GET['huAcY']);
$page_id = (! isset($_GET['page_id'])? "1" : $_GET['page_id']);
confirmSubmit();
$conn = new Connection();
$oOf = new Officer();
$oSse = new SysSemesterDes();
$oAy = new AcadYearConfig();
$oLt = new rg_LoadType();
$oCt = new rg_CopyTimeTable();
$oOst = new rg_OFSetTT();
$oHu = new rg_HrPerUnit();
if(!$huTmId)
$huTmId = $GLOBALS["SEMESTER"];
if(!$huAcY)
$huAcY = $GLOBALS["ACADYEAR"];
$oOf->SearchByOfficerCode($oU->userPsCodeReg);
$oOf->GetRecord();
?>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<script>
function checkFormat() {
f = document.pc;
if(f.huLtId.value == "") {
alert("กรุณาเลือกประเภทย่อยการสอน !");
f.huLtId.focus();
return false;
}
if(f.huHr.value == "") {
alert("กรุณากรอกจำนวนชั่วโมง !");
f.huHr.focus();
return false;
}
if(f.huUnit.value == "") {
alert("กรุณากรอกจำนวนหน่วยภาระงานสอน !");
f.huUnit.focus();
return false;
}
}
function doChange() {
f = document.pc;
var huTmId = f.huTmId.value;
var huAcY = f.huAcY.value;
location.href = "addHrPerUnit.php?huTmId="+huTmId+"&huAcY="+huAcY;
}
</script>
<table width="740" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><br><fieldset>
<legend><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><a href="adminIndex.php?mm=1">ข้อมูลพื้นฐานของระบบ</a> <img src="../picture/ico3.gif" align="absmiddle" border="0"> ข้อมูลเกณฑ์การคิดภาระงานสอน</font></legend>
<div align="center"><br><table width="700" align="center" border="0" cellpadding="0" cellspacing="1">
<tr>
<td align="center" colspan="2"><font size="3" color="<?php echo $GLOBALS['COLOR_FONT_3'];?>"><b>ข้อมูลเกณฑ์การคิดภาระงานสอน</b></font><br><br></td>
</tr>
<tr>
<td colspan="2"><table width="700" border="1" cellspacing="0" cellpadding="0" bordercolor="<?php echo $GLOBALS["COLOR_BORDER_TABLE_1"];?>">
<tr>
<td colspan="7" align="center"><form name="pc" method="post" action="processHrPerUnit.php"><table width="500" align="center" border="0" cellpadding="0" cellspacing="1">
<tr>
<td><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4'];?>"><b>ภาค/ปีการศึกษา</b></font></td>
<td colspan="3"><select name="huTmId" onChange="doChange()">
<?php
$oSse->RSSysSemesterDes();
while($oSse->GetRecord()) {
?>
<option value="<?php echo $oSse->semester;?>" <?php echo ($oSse->semester==$huTmId) ? 'selected' : '';?>><?php echo $oSse->semester;?></option>
<?php
}
?>
</select>
/
<select name="huAcY" onChange="doChange()">
<?php
$oAy->RSAcadYearConfigGroupAcY();
while($oAy->GetRecord()) {
?>
<option value="<?php echo $oAy->acadYear;?>" <?php echo ($oAy->acadYear==$huAcY) ? 'selected' : '';?>><?php echo $oAy->acadYear;?></option>
<?php
}
?>
</select>
<font size="2" color="<?php echo $GLOBALS['COLOR_FONT_3'];?>">*</font></td>
</tr>
<tr bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_4"];?>">
<td><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4'];?>"><b>ประเภทย่อยการสอน</b></font></td>
<td colspan="3"><select name="huLtId">
<option value="">---เลือกประเภทย่อยการสอน---</option>
<?php
$oLt->RSrg_LoadType();
while($oLt->GetRecord()) {
?>
<option value="<?php echo $oLt->ltId;?>"><?php echo $oLt->ltName;?></option>
<?php
}
?>
</select>
<font size="2" color="<?php echo $GLOBALS['COLOR_FONT_3'];?>">*</font></td>
</tr>
<tr>
<td width="25%"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4'];?>"><b>จำนวนชั่วโมง</b></font></td>
<td width="20%"><input type="text" name="huHr" size="1" onKeyPress="if(event.keyCode < 46 || event.keyCode > 57 || event.keyCode == 47) return false;">
<font size="2" color="<?php echo $GLOBALS['COLOR_FONT_3'];?>">*</font></td>
<td width="40%"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4'];?>"><b>คิดเป็นจำนวนหน่วยภาระงานสอน</b></font></td>
<td width="15%"><input type="text" name="huUnit" size="1" onKeyPress="if(event.keyCode < 46 || event.keyCode > 57 || event.keyCode == 47) return false;">
<font size="2" color="<?php echo $GLOBALS['COLOR_FONT_3'];?>">*</font></td>
</tr>
<tr bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_4"];?>">
<td height="22"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4'];?>"><b>ค่าโดยปริยาย</b></font></td>
<td colspan="3"><input type="checkbox" name="huDefault" value="Y">
<font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4'];?>">ตั้งเป็นค่าโดยปริยาย</font></td>
</tr>
<tr>
<td colspan="5" align="center"><br>
<?php
$oCt->RSrg_CopyTimeTableByAcYAndSeAndConfirmIsY($huAcY, $huTmId);
$oOst->RSrg_OFSetTTByOfIdAndAcYAndTmIdAndWLIsY($oOf->officerId, $huAcY, $huTmId);
$res = (!$oCt->GetRecord() && $oOst->GetRecord()) ? '' : 'disabled';
$lnk = '<input type="submit" name="add" value="บันทึก" onClick="return checkFormat()" '.$res.'>';
echo $oU->CRUD($lnk, 'C');
?>
<input type="reset" name="clear" value="เคลียร์ข้อมูล">
<input type="hidden" name="method" value="add"></td>
</tr>
</table></form><br><br></td>
</tr>
<tr bgcolor="<?php echo $GLOBALS["COLOR_BG_TABLE_2"];?>">
<td width="100" height="22" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>ภาค/ปีการศึกษา</b></font></td>
<td width="250" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_1"];?>" size="2"><b>ประเภทย่อยการสอน</b></font></td>
<td width="80" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>จำนวนชั่วโมง</b></font></td>
<td width="90" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>จำนวนหน่วย<br>ภาระงานสอน</b></font></td>
<td width="80" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>ค่าโดยปริยาย</b></font></td>
<td width="50" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_1"];?>" size="2"><b>แก้ไข</b></font></td>
<td width="50" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_1"];?>" size="2"><b>ลบ</b></font></td>
</tr>
<?php
$oHu->RSrg_HrPerUnitOrderAcYDescTmIdDescSstId();
$numRow = $oHu->NumRow();
$page_size = 10;
$total_page = (int)($numRow/$page_size);
if(($numRow%$page_size) != 0)
$total_page++;
if(isset($page_id))
$start = $page_size*($page_id-1);
else {
$page_id = 1;
$start = 0;
}
$i = 0;
$oHu->RSrg_HrPerUnitOrderAcYDescTmIdDescSstIdLimit($start, $page_size);
while($oHu->GetRecord()) {
$oLt->SearchByKey($oHu->huLtId);
$oLt->GetRecord();
if(($i%2) == 0)
echo "<tr>";
else
echo "<tr bgcolor=\"".$GLOBALS["COLOR_BG_TABLE_3"]."\">";
?>
<td align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>"><?php echo $oHu->huTmId.'/'.$oHu->huAcY;?></font></td>
<td><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>"><?php echo $oLt->ltName;?></font></td>
<td align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>"><?php echo $oHu->huHr;?></font></td>
<td align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>"><?php echo $oHu->huUnit;?></font></td>
<td align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>"><?php echo $oHu->huDefault;?></font></td>
<td align="center">
<?php
$lnk = '<a href="editHrPerUnit.php?huAcY='.$oHu->huAcY.'&huTmId='.$oHu->huTmId.'&huLtId='.$oHu->huLtId.'"><img src="../picture/editnew.gif" width="23" height="19" align="absmiddle" border="0"></a>';
echo $oU->CRUD($lnk, 'U');
?>
</td>
<td align="center">
<?php
$oCt->RSrg_CopyTimeTableByAcYAndSeAndConfirmIsY($oHu->huAcY, $oHu->huTmId);
$oOst->RSrg_OFSetTTByOfIdAndAcYAndTmIdAndWLIsY($oOf->officerId, $oHu->huAcY, $oHu->huTmId);
if(!$oCt->GetRecord() && $oOst->GetRecord()) {
$lnk = '<a href="processHrPerUnit.php?huAcY='.$oHu->huAcY.'&huTmId='.$oHu->huTmId.'&huLtId='.$oHu->huLtId.'&method=delete" onClick=\'return confirmSubmit("คุณต้องการลบข้อมูลแน่นอนใช่หรือไม่")\'><img src="../picture/deletenew.gif" width="16" height="19" align="absmiddle" border="0"></a>';
echo $oU->CRUD($lnk, 'D');
}
else
echo '-';
?>
</td>
</tr>
<?php
$i++;
}
if($i == 0){
?>
<tr>
<td colspan="7" height="22" align="center"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_3'];?>">** ไม่ปรากฏรายการในฐานข้อมูล **</font></td>
</tr>
<?php
}
?>
</table></td>
</tr>
<tr>
<td><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4'];?>">หน้า->
<?php
for ($num=1; $num<=$total_page; $num++) {
if($num == $page_id)
echo $num." ";
else {
?>
<a href="addHrPerUnit.php?page_id=<?php echo $num;?>"><?php echo '[ '.$num.' ]';?></a>
<?php
}
}
?>
</font></td>
<td align="right"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>">รวม <?php echo $numRow;?> รายการ</font></td>
</tr>
<tr>
<td colspan="2"><input type="button" name="back" value="กลับเมนูหลัก" onClick="location.href = 'adminIndex.php?mm=1'"></td>
</tr>
</table></div>
</fieldset><br><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"];?>"><b>หมายเหตุ : </b>* หมายถึง ต้องกรอกข้อมูลให้สมบูรณ์</font></td>
</tr>
</table>
<?php
$oOf->Destroy();
$oSse->Destroy();
$oAy->Destroy();
$oLt->Destroy();
$oCt->Destroy();
$oOst->Destroy();
$oHu->Destroy();
$conn->Disconnect();
showFooter();
?>
|