Viewing file: FrmAbsent_03.php (23.44 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' and Times_total != '' ";
$result2 = $dbObj->execQuery($query2);
$rs2 = $dbObj->fetchObject($result2);
$rss2 = $rs2;
$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 -- ใบลาผักผ่อน</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">
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>
<form id="myForm" name="myForm" enctype="multipart/form-data" method="post" action="EditAbsent_03.php" onSubmit="return checkData();">
<table width="780" border="0" cellspacing="0" cellpadding="0">
<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="753" border="0" cellpadding="0" cellspacing="4">
<tr height="31">
<td height="20" colspan="6" class="PATRON11" align="center">แบบใบลาพักผ่อน</td>
</tr>
<tr height="29">
<td height="29" colspan="6"><span class="style1"> ส่วนราชการ <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></span></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="right">
<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">เรื่อง <font color="#0000FF" size="2" face="Tahoma">
<input name="Absent_code" type="text" id="Absent_code" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="ขอลาพักผ่อน" size="10" readonly/>
<input name="Absent_code" type="hidden" id="Absent_code" value="3" />
</font></td>
<td width="40"></td>
<td width="213"></td>
<td width="102"></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 width="106" height="25"></td>
<td colspan="5" align="left">ข้าพเจ้า.<font color="#0000FF" size="2" face="Tahoma">
<input name="Name" type="text" id="Name" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="30" value="<? echo $rss[First_name]?> <? echo $rss[Teacher_name]?> <? echo $rss[Teacher_lastname]?> " />
</font>ตำแหน่ง.<font color="#0000FF" size="2" face="Tahoma">
<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="<? $PositionId = $rss["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" 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="<?php $Faculty_code = $rss["Faculty_code"];
$sql = "Select * From faculty_tb Where Faculty_code='$Faculty_code'";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs2 = mysql_fetch_array($result1);
echo "$rs2[Faculty_name] "; ?>" />
</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] "; ?> " />
</font><span class="style11">สถาบันพระบรมราชชนก</span></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left">มีวันลาพักผ่อนสะสม<font color="#0000FF" size="2" face="Tahoma">
<input name="Times_total" type="text" id="Times_total" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" onkeypress="checkNumeric()" value="<?=$rss2->Times_total;?>" size="3" maxlength="4" />
</font>วันทำการ มีสิทธิลาพักผ่อนประจำปีนี้อีก 10 วันทำการ รวมเป็น<font color="#0000FF" size="2" face="Tahoma">
<input name="Times_sum" type="text" id="Times_sum" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?=(($rss2->Times_total +10) > 30)?"30":$rss2->Times_total+10;?>" size="3" maxlength="2" />
</font>วันทำการ</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" onkeypress="checkNumeric()" value="<?=$rs1["Absent_times"];?>"/>
วัน
</td>
</tr>
</table>
</td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left">
ในระหว่างลาจะติดต่อข้าพเจ้าได้ที่
<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" />
</td>
</tr>
<tr height="29">
<td height="13" colspan="3" align="left">ผู้รับมอบหมาย<font color="#0000FF" size="2" face="Tahoma">
<input name="InforName" type="text" id="InforName" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="30" value="<?=$rs1["InforName"];?>"/>
</font></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr height="29">
<td height="29" colspan="2" align="center"> </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='3' 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]==3?number_format($rs1['Absent_times'],1,'.',','):"0.0";?></td>
<td align="center"><?=$rs1[Absent_code]==3?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>(<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; ?>" /></td>
<td> </td>
</tr>
<tr height="31">
<td height="31"> </td>
<td> </td>
<td> </td>
<td colspan="3" align="left"><span class="style2">ความเห็นผู้บังคับบัญชา</span></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 ='$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" <?php if ( !strcmp($rs1["Status"],"อนุญาต") ) { echo "checked"; } ?> value="อนุญาต" /> อนุญาต
<input name="Status" type="radio" <?php if ( !strcmp($rs1["Status"],"รออนุมัติ") ) { echo "checked"; } ?> value="รออนุมัติ" /> รออนมัติ
<input name="Status" type="radio" id="Status" <?php if ( !strcmp($rs1["Status"],"ไม่อนุญาต") ) { echo "checked"; } ?> value="ไม่อนุญาต" /> ไม่อนุญาต
</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"><table width="661" 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="144" 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"> </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>
</table>
</form>
</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);
?>
|