Viewing file: FrmAbsent_011.php (25.88 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
session_start();
/** Define Validate Access */
define( '_VALID_ACCESS', 1 );
/** Check Session User Login */
if( !session_is_registered("valid_user") && !session_is_registered("Priority") ) {
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-874\" />";
echo "<p style=padding-top:115px><p align=center><br /><font color=red><strong>กรุณาทำการ Login ก่อน</strong></font></p></p>";
echo "<meta http-equiv=\"refresh\" content=\"1; URL=../login.php\" />";
exit();
}
else {
/** Configuration */
require_once( "../configuration.php" );
require_once( $_Config_absolute_path . "/includes/framework.php" );
require_once( "../include/Function.php" );
/** Create Database Object */
$dbObj = new DBConn;
/** Config Table for This Page */
$myTable = "personal_tb";
$myTable2 = "history_absent_tb";
$myTable1 = "budget_year_tb";
$query = "SELECT *, prefixName as First_name FROM personal_tb
LEFT JOIN prefix ON personal_tb.First_name = prefix.prefixId
LEFT JOIN position_tb ON personal_tb.PositionId = position_tb.PositionId
LEFT JOIN faculty_tb ON personal_tb.Faculty_code = faculty_tb.Faculty_code
LEFT JOIN district ON personal_tb.districtId = district.districtId
LEFT JOIN amphur ON personal_tb.amphurId = amphur.amphurId
LEFT JOIN province ON personal_tb.provinceId = province.provinceId
WHERE personal_tb.Teacher_code='".$_REQUEST['Teacher_code']."'";
$result = $dbObj->execQuery($query);
$rss = $dbObj->fetchArray($result);
$query1 = " SELECT * FROM $myTable1 ";
$result1 = $dbObj->execQuery($query1);
$rs4 = $dbObj->fetchObject($result1);
$query2 = " SELECT * FROM $myTable2 WHERE code='$code' ";
$result2 = $dbObj->execQuery($query2);
$rs1 = $dbObj->fetchArray($result2);
$query2 = " SELECT * FROM $myTable2 Where Teacher_code='$rss[Teacher_code]' and Year='$Year' ";
$result2 = $dbObj->execQuery($query2);
$rs2 = $dbObj->fetchObject($result2);
$query2 = " SELECT * FROM $myTable2 WHERE Teacher_code='$Teacher_code' ORDER BY Date_finish DESC ";
$result2 = $dbObj->execQuery($query2);
$rs3 = $dbObj->fetchArray($result2);
/** โฟลเดอร์ไฟล์เอกสาร */
$doc_path = $_Config_live_site."/Absent_pic";
} # else
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title>MIS -- Teacher</title>
<link href="../css/default.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../js/utilities.js"></script>
<script language="javascript" src="../js/calendarDateInput2.js"></script>
<script language="javascript" src="../js/ajaxScript.js"></script>
<script language="javascript">
function checkData() {
var formObj = document.myForm;
if( (formObj.No_in.value == "" ) && (formObj.Day.value == "" ) ) { alert("กรุณากรอกข้อมูลให้ครบด้วยค่ะ" ); formObj.No_in.style.backgroundColor='#F1F9FC'; formObj.No_in.focus(); return false; }
else if(formObj.No_in.value == "" ) { alert("กรุณากรอก เลขที่หนังสือ"); formObj.No_in.style.backgroundColor='#F1F9FC'; formObj.No_in.focus(); return false;}
else if(formObj.Day.value == "" ) { alert("กรุณากรอก จำนวนวัน"); formObj.Day.style.backgroundColor='#F1F9FC'; formObj.Day.focus(); return false;}
else if(formObj.Year_std.value == "" ) { alert("กรุณากรอก ปีงบประมาณ"); formObj.Year_std.style.backgroundColor='#F1F9FC'; formObj.Year_std.focus(); return false;}
else return true ;
}
</script>
<script language="JavaScript">
extArray = new Array(".gif", ".jpg", ".jpeg");
function LimitAttach(form, file) {
allowSubmit = false;
if (!file) return;
while (file.indexOf("\\") != -1)
file = file.slice(file.indexOf("\\") + 1);
ext = file.slice(file.indexOf(".")).toLowerCase();
for (var i = 0; i < extArray.length; i++) {
if (extArray[i] == ext) {
allowSubmit = true; break;
}
}
if (allowSubmit)
fileClick();
else
alert("JPG/JPEG or GIF file Only!");
}
function browse()
{
myForm.Filetext.src = myForm.Filetext.value;
}
</script>
</head>
<body topmargin="0" rightmargin="0" bottommargin="0" leftmargin="0">
<?php
include("../templates/incHeader.php");
?>
<table width="1003" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="203" align="left" valign="top" style="padding:10px 0px 0px 5px"><?php include("./_incMainMenu.php");?></td>
<td width="800" height="440" align="center" valign="top" style="padding:10px 0px 5px 10px"><fieldset>
<table width="780" border="0" cellspacing="0" cellpadding="0">
<form id="myForm" name="myForm" enctype="multipart/form-data" method="post" action="EditAbsent.php" onSubmit="return checkData();">
<tr>
<td> </td>
</tr>
<tr>
<td height="30" background="../images/background/bg-head-topic-w780.gif" class="PADDING-LEFT-10"><strong><a href="index.php">หน้าหลัก</a> » <a href="Menu_Form.php?Teacher_code=<?=$Teacher_code;?>">แบบฟอร์มราชการ</a> » <a href="AbsentByYear.php?Teacher_code=<?=$Teacher_code;?>">ข้อมูลประวัติการลา</a> » <span class="NOTE">แบบใบลา ลาคลอดบุตร ลากิจส่วนตัว</span></strong></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td align="center">
<table width="750" cellpadding="0" cellspacing="0">
<tr height="31">
<td height="31" width="133"> </td>
<td width="79"> </td>
<td colspan="3">แบบใบลาป่วย ลาคลอดบุตร ลากิจส่วนตัว</td>
<td width="85"> </td>
</tr>
<tr height="31">
<td height="31"> </td>
<td> </td>
<td colspan="3"> </td>
<td> </td>
</tr>
<!-- <tr height="29">
<td height="29" colspan="6">ส่วนราชการ<font size="2" face="Tahoma">
<?php
$collegeCode = $rss["collegeCode"];
$sql = "Select * From college Where collegeStatus ='1'";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs2 = mysql_fetch_array($result1);
echo "$rs2[collegeName] ";
?>
</font></td>
</tr> -->
<tr height="29">
<td colspan="3" align="left">ส่วนราชการ <?=$rs2["collegeName"];?></td>
<td colspan="3" align="center">
<script>DateInput('mDate', true, 'DD/MM/YYYY','<?=(isset($rs1["Date"]))?ymdT2dmyE($rs1["Date"]):date("d/m/Y");?>');</script>
</td>
</tr>
<tr height="29">
<td height="29" colspan="3" align="left">เรื่อง
<select name="Absent_code" id="Absent_code">
<option value="0">--- เลือก ---</option>
<?php
$strSQL3 = " SELECT * FROM history_absent WHERE Absent_code != '3' ";
$result3 = mysql_query($strSQL3);
while( $rss3 = mysql_fetch_array($result3) ) {
echo"<option value=\"$rss3[Absent_code]\" ".(($rss3['Absent_code']==$rs1['Absent_code'])?"selected":"").">$rss3[Absent_type]</option>\n";
}
?>
</select></td>
<td width="42"> </td>
<td width="248"> </td>
<td> </td>
</tr>
<tr height="29">
<td height="29" colspan="5" align="left">เรียน ผู้อำนวยการ <font size="2" face="Tahoma">
<?php
$collegeCode = $rss["collegeCode"];
$sql = "Select * From college Where collegeStatus ='1'";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs2 = mysql_fetch_array($result1);
echo "$rs2[collegeName] ";
?>
</font></td>
<td> </td>
</tr>
<tr height="29">
<td height="25"> </td>
<td colspan="5" align="left">
ข้าพเจ้า.
<input name="Name" type="text" id="Name" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="25" value="<? echo $rss[First_name]?> <? echo $rss[Teacher_name]?> <? echo $rss[Teacher_lastname]?>" readonly/>
ตำแหน่ง.
<input name="Name2" type="text" id="Name2" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="30" value="<?=$rss["Position_name"];?>" readonly/>
</td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left">สังกัด<font color="#0000FF" size="2" face="Tahoma">
<input name="Name3" type="text" id="Name3" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="20" value="<?=$rss["Faculty_name"];?>" readonly/>
</font><font color="#0000FF" size="2" face="Tahoma">
<input name="Name3" type="text" id="Name4" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="40" value="<?php
$collegeCode = $rss["collegeCode"];
$sql = "Select * From college Where collegeStatus ='1'";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs2 = mysql_fetch_array($result1);
echo "$rs2[collegeName] "; ?> " readonly/>
</font><span class="style11">สถาบันพระบรมราชชนก</span></td>
</tr>
<tr>
<td height="29" colspan="6" align="left">ขอลา เนื่องจาก
<input name="Absent_type" type="text" id="Absent_type" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="85" value="<?=$rs1["Absent_type"];?>"/>
</td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left">
<table>
<tr>
<td>ขอลา ตั้งแต่วันที่</td>
<td><script>DateInput('mDate1', true, 'DD/MM/YYYY','<?=(isset($rs1["Date_start"]))?ymdT2dmyE($rs1["Date_start"]):date("d/m/Y");?>');</script></td>
<td>ถึงวันที่</td>
<td><script>DateInput('mDate2', true, 'DD/MM/YYYY','<?=(isset($rs1["Date_finish"]))?ymdT2dmyE($rs1["Date_finish"]):date("d/m/Y");?>');</script></td>
<td>
มีกำหนด
<input name="Absent_times" type="text" id="Absent_times" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed; text-align:center" size="3" maxlength="4" value="<?=$rs1["Absent_times"]?>" onkeypress="checkNumeric()"/>
วัน
</td>
</tr>
</table>
</td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left">
ข้าพเจ้าได้ลา
<input name="Absent_code2" type="checkbox" id="Absent_code" value="2" <?=($rs1["Absent_code"]=="2")?"checked":"";?>/>
ป่วย
<input name="Absent_code1" type="checkbox" id="Absent_code" value="1" <?=($rs1["Absent_code"]=="1")?"checked":"";?>/>
กิจส่วนตัว
<input name="Absent_code4" type="checkbox" id="Absent_code" value="4" <?=($rs1["Absent_code"]=="4")?"checked":"";?>/>
คลอดบุตร ครั้งสุดท้ายตั้งแต่วันที่ <font color="#0000FF" size="2" face="Tahoma">
<input name="Date_finish" type="text" id="Date_finish" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="10" value=" <?php
$sday = $rs1[Date_finish];
$yearthai = explode("-",$sday);
$day = intval($yearthai[2]);
$month = intval($yearthai[1]);
$year = intval($yearthai[0]);
//////////////////
// $yearthai = $day ;
$m = getThaiSubMonth($month);
echo"$day"." "."$m"." "."$year";
?>" />
<tr height="29">
<td height="29" colspan="6" align="left">ในระหว่างลาจะติดต่อข้าพเจ้าได้ที่<font color="#0000FF" size="2" face="Tahoma">
<input name="Address" type="text" id="Address" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?=$rss["Address"]." ต.".$rss["districtName"]." อ.".$rss["amphurName"]." จ.".$rss['provinceName'];?>" size="60" />
</font></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left"> </td>
</tr>
<tr height="29">
<td height="29"> </td>
<td> </td>
<td width="120"> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr height="31">
<td height="31"> </td>
<td> </td>
<td> </td>
<td colspan="3" align="left"> <span class="style1">ขอแสดงความนับถือ</span></td>
</tr>
<tr height="29">
<td height="29" colspan="3" align="center">สถิติการลาในปีงบประมาณนี้ <font color="#0000FF" size="2" face="Tahoma">
<input name="Year" type="text" id="Year" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<? echo $rs1[Year] ?>" size="3" maxlength="4" />
</font></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr height="31">
<td colspan="3" rowspan="2" align="left"><table width="296" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<th width="82" height="27" scope="col">ประเภทการลา</th>
<th width="83" align="center" scope="col">ลามาแล้ว</th>
<th width="62" align="center" scope="col">ลาครั้งนี้</th>
<th width="59" align="center" scope="col">รวมเป็น</th>
</tr>
<tr>
<td>ป่วย</td>
<td align="center"><?php
$Teacher_code = $rss["Teacher_code"];
$sql1 = "Select Sum(Absent_times) as SumB1 From history_absent_tb Where Teacher_code='$Teacher_code' and Year='$Year' and Absent_code='2' and code != '$code' " ;
$result1 = mysql_query($sql1) or die("Erro".mysql_error());
$rss1 = mysql_fetch_array($result1);
echo number_format($rss1[SumB1],1,'.',',');
//echo"$rss1[SumC1]";
?>
</a></td>
<td align="center"><?=$rs1[Absent_code]==2?number_format($rs1['Absent_times'],1,'.',','):"0.0";?></td>
<td align="center"><?=$rs1[Absent_code]==2?number_format(($rss1[SumB1]+$rs1['Absent_times']),1,'.',','):number_format($rss1[SumB1],1,'.',',');?></td>
</tr>
<tr>
<td>กิจส่วนตัว</td>
<td align="center"><?php
$Teacher_code = $rss["Teacher_code"];
$sql1 = "Select Sum(Absent_times) as SumB1 From history_absent_tb Where Teacher_code='$Teacher_code' and Year='$Year' and Absent_code='1' and code != '$code' " ;
$result1 = mysql_query($sql1) or die("Erro".mysql_error());
$rss1 = mysql_fetch_array($result1);
echo number_format($rss1[SumB1],1,'.',',');
//echo"$rss1[SumC1]";
?>
</a></td>
<td align="center"><?=$rs1[Absent_code]==1?number_format($rs1['Absent_times'],1,'.',','):"0.0";?></td>
<td align="center"><?=$rs1[Absent_code]==1?number_format(($rss1[SumB1]+$rs1['Absent_times']),1,'.',','):number_format($rss1[SumB1],1,'.',',');?></td>
</tr>
<tr>
<td>คลอดบุตร</td>
<td align="center"><?php
$Teacher_code = $rss["Teacher_code"];
$sql1 = "Select Sum(Absent_times) as SumB1 From history_absent_tb Where Teacher_code='$Teacher_code' and Year='$Year' and Absent_code='4' and code != '$code' " ;
$result1 = mysql_query($sql1) or die("Erro".mysql_error());
$rss1 = mysql_fetch_array($result1);
echo number_format($rss1[SumB1],1,'.',',');
//echo"$rss1[SumC1]";
?>
</a></td>
<td align="center"><?=$rs1[Absent_code]==4?number_format($rs1['Absent_times'],1,'.',','):"0.0";?></td>
<td align="center"><?=$rs1[Absent_code]==4?number_format(($rss1[SumB1]+$rs1['Absent_times']),1,'.',','):number_format($rss1[SumB1],1,'.',',');?></td>
</tr>
</table></td>
<td height="31"> </td>
<td>(ลงชื่อ).......................................</td>
<td> </td>
</tr>
<tr height="29">
<td height="29"> </td>
<td><div align="center">(<font color="#003366" size="2" face="Tahoma">..<? echo $rss[First_name]?> <? echo $rss[Teacher_name]?> <? echo $rss[Teacher_lastname]?></font>..)
<input type="hidden" name="Teacher_code" value="<? echo $Teacher_code; ?>" />
</div></td>
<td> </td>
</tr>
<tr height="31">
<td height="31"> </td>
<td> </td>
<td> </td>
<td colspan="3" align="left"><div align="left" class="style2">ความเห็นผู้บังคับบัญชา</div></td>
</tr>
<tr height="29">
<td height="29"></td>
<td></td>
<td> </td>
<td colspan="3"><div align="center">.<font color="#0000FF" size="2" face="Tahoma">
<input name="Info_name3" type="text" id="Info_name3" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="25" />
</font></div></td>
</tr>
<tr height="29">
<td height="29" colspan="3" align="left">ลงชื่อ...................................ผู้ตรวจสอบ </td>
<td colspan="2">...................................</td>
<td> </td>
</tr>
<tr height="29">
<td height="29" colspan="2" align="left">ตำแหน่ง................................. </td>
<td align="left"> </td>
<td colspan="3" align="left"> (<font size="2" face="Tahoma">
<?php
//$Teacher_code = $rss["TeacherId"];
$sql = "Select *, prefixName as First_name FROM personal_tb LEFT JOIN prefix ON personal_tb.First_name = prefix.prefixId Where Faculty_code ='$rss[Faculty_code]' and TeacherId='1' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs2 = mysql_fetch_array($result1);
echo "$rs2[First_name]$rs2[Teacher_name] $rs2[Teacher_lastname]";
?>
</font>)
<input name="TeacherId" type="hidden" id="TeacherId" value="<? echo $rs2["Teacher_code"]?>" /></td>
</tr>
<tr height="29">
<td height="29" colspan="3" align="left"> วันที่......../................/............... </td>
<td colspan="3" align="left">ตำแหน่ง.<font color="#0000FF" size="2" face="Tahoma">
<input name="Name4" type="text" id="Name5" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="25" value=" <? $PositionId = $rs2["PositionId"];
$sql = "Select * From position_tb Where PositionId ='$PositionId' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs2 = mysql_fetch_array($result1);
echo "$rs2[Position_name] ";?>
" />
</font></td>
</tr>
<tr height="29">
<td height="29"> </td>
<td> </td>
<td> </td>
<td colspan="3" align="left"> วันที่.......เดือน.............พ.ศ......</td>
</tr>
<tr height="29">
<td height="29"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr height="31">
<td height="31"> </td>
<td> </td>
<td> </td>
<td align="left"><div align="center">คำสั่ง</div></td>
<td> </td>
<td> </td>
</tr>
<!-- <tr height="29">
<td height="29"> </td>
<td> </td>
<td> </td>
<td align="left"> </td>
<td colspan="2" align="left">
<input name="Status" type="radio" id="Status" <?php if ( !strcmp($rs1["Status"],"อนุญาต") ) { echo "checked"; } ?> value="อนุญาต" />
อนุญาต </a>
<input name="Status" type="radio" id="Status" <?php if ( !strcmp($rs1["Status"],"รออนุมัติ") ) { echo "checked"; } ?> value="รออนุมัติ" />
รออนุมัติ </a>
<input name="Status" type="radio" id="Status" <?php if ( !strcmp($rs1["Status"],"ไม่อนุญาต") ) { echo "checked"; } ?> value="ไม่อนุญาต" />
ไม่อนุญาต</a></td>
</tr> -->
<tr height="29">
<td height="29"> </td>
<td> </td>
<td> </td>
<td></td>
<td colspan="2" align="left">.......................................</td>
</tr>
<tr height="29">
<td height="29"> </td>
<td> </td>
<td> </td>
<td colspan="3" align="left">.......................................</td>
</tr>
<tr height="29">
<td height="29"> </td>
<td> </td>
<td> </td>
<td colspan="3" align="left"> (ลงชื่อ)................................</td>
</tr>
<tr height="29">
<td height="29"> </td>
<td> </td>
<td> </td>
<td colspan="3" align="left">(ตำแหน่ง)...................................
.</td>
</tr>
<tr height="29">
<td height="29"> </td>
<td> </td>
<td> </td>
<td colspan="3" align="left"> วันที่........เดือน..............พ.ศ......
.</td>
</tr>
<tr height="31">
<td colspan="6" align="center"> </td>
</tr>
<tr height="31">
<td colspan="6" align="center"><table width="647" border="0">
<tr>
<td colspan="3" align="center" >โหลดใบลาที่อนุมัติแล้ว</td>
<th width="230" scope="col"><input name="Filetext" type="file" id="Filetext" size="20" /></th>
<td width="80" align="right" scope="col">ดาวน์โหลด</td>
<th width="130" scope="col"><?php if( $rs1['Filetext'] != "" ) { ?>
<a href="download.php?filename=<?=$rs1['Filetext'];?>&path=absent" target="_parent"><img src="../images/icons/download.png" alt=" ดาวน์โหลดไฟล์ <?=$rss['Project_name'];?>" border="0" /></a>
<?php } else { ?>
<img src="../images/icons/download_off.png" />
<?php } ?>
</span></th>
</tr>
</table></td>
</tr>
<tr height="31">
<td colspan="6" align="center"> </td>
</tr>
<tr height="31">
<td height="31" colspan="6" align="center">
<input type="submit" name="Submit" value=" บันทึก " />
<input name="Submit" type="reset" id="Submit" value=" ยกเลิก " />
<input name="code" type="hidden" id="code" value="<? echo $code; ?>" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr></form>
</table>
</fieldset></td>
</tr>
</table>
<?php include("../templates/incFooter.php"); ?>
</body>
</html>
<?php
/** Free Resource */
$dbObj->freeresult($result);
/** Close the Database */
$dbObj->disconn();
/** Unset Class */
unset($dbObj);
?>
|