Viewing file: AddFormCar.php (19.87 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( "../includes/Function.php" );
require_once( "../includes/FunctionDB.php" );
/** Create Database Object */
$dbObj = new DBConn;
/** Config Table for This Page */
$myTable = "personal_tb";
$myTable1 = "budget_year_tb";
$myTable2 = "formcaroffice";
///////////////////
$query = " SELECT *, prefixName as First_name FROM personal_tb LEFT JOIN prefix ON personal_tb.First_name = prefix.prefixId WHERE Teacher_code='$Teacher_code' ";
$result = $dbObj->execQuery($query);
$rss = $dbObj->fetchArray($result);
/////-----------///
$query1 = " SELECT * FROM $myTable1 ";
$result1 = $dbObj->execQuery($query1);
$rs = $dbObj->fetchObject($result1);
///////--------//
$query2 = " SELECT * FROM $myTable2 ";
$result2 = $dbObj->execQuery($query2);
$rs2 = $dbObj->fetchObject($result2);
} # 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>ใบขออนุมัติใช้รถยนต์ของทางราชการ</title>
<link href="../css/default.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../js/utilities.js"></script>
<script type="text/javascript" src="../js/calendarDateInput2.js"></script>
<script language="javascript">
function checkData() {
var formObj = document.form1;
if( (formObj.makeWord.value == "" ) && (formObj.Training_name.value == "" ) ) { alert("กรุณากรอกข้อมูลให้ครบด้วยค่ะ" ); formObj.makeWord.style.backgroundColor='#F1F9FC'; formObj.Training_name.focus(); return false; }
if(formObj.makeWord.value == "" ) { alert("กรุณากรอก สถานที่"); formObj.makeWord.style.backgroundColor='#F1F9FC'; formObj.makeWord.focus(); return false;}
if(formObj.Training_name.value == "" ) { alert("กรุณากรอก ชื่อเรื่อง"); formObj.Training_name.style.backgroundColor='#F1F9FC'; formObj.Training_name.focus(); return false;}
if(formObj.Make.value == "" ) { alert("กรุณากรอก จำนวคน"); formObj.Make.style.backgroundColor='#F1F9FC'; formObj.Make.focus(); return false;}
if(formObj.Time_start.value == "" ) { alert("กรุณากรอก เวลาเริ่มต้น"); formObj.Time_start.style.backgroundColor='#F1F9FC'; formObj.Time_start.focus(); return false;}
if(formObj.Time_finish.value == "" ) { alert("กรุณากรอก เวลาสิ้นสุด"); formObj.Time_finish.style.backgroundColor='#F1F9FC'; formObj.Time_finish.focus(); return false;}
else return true ;
}
</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="left" valign="top" style="padding:10px 0px 5px 10px"><fieldset><legend><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><a href="index.php">หน้าหลัก</a></font><img src="../picture/ico3.gif" width="10" height="10" align="absmiddle" border="0" /></font><a href="FormCarList.php?Teacher_code=<?=$Teacher_code;?>">ข้อมูลขอใช้รถยนต์</a></font><img src="../picture/ico3.gif" width="10" height="10" align="absmiddle" border="0" /></font></font><strong><span class="NOTE">ใบขออนญาตใช้รถยนต์ทางราชการ</span></strong></legend>
<form id="form1" name="form1" method="post" action="InsertFormCar.php" onsubmit="return checkData();">
<table width="765" border="0" cellspacing="0" cellpadding="0">
<tr>
</tr>
<tr>
<td><table width="760" align="center" cellpadding="0" cellspacing="0">
<tr height="31">
<td height="17" colspan="6" align="center" class="PATRON11"><hr /></td>
</tr>
<tr height="31">
<td height="27" colspan="6" align="center" class="PATRON11">ใบขออนุญาตใช้รถยนต์ของทางราชการ</td>
</tr>
<tr>
<td height="15" colspan="6" align="center" class="PATRON11"> </td>
</tr>
<tr height="29">
<td height="18" colspan="6">
<?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);
?>
<input name="Teacher_code" type="hidden" id="Teacher_code" value="<? echo $rss["Teacher_code"]?>" />
</td>
</tr>
<tr height="29">
<td height="24" colspan="3" align="left">ส่วนราชการ <?=$rs2["collegeName"];?></td>
<td height="24" colspan="3" align="center">
<script>DateInput('mDate', true,'DD/MM/YYYY','<?=date("d/m/Y");?>');</script>
</td>
</tr>
<tr height="29">
<td height="29" colspan="3" align="left">เรื่อง </a><input name="Da" type="text" id="Da" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="ขอใช้รถยนต์ราชการ" size="20" />
</font></td>
<td width="35"></td>
<td width="258"></td>
<td width="71"></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="112" height="25"></td>
<td colspan="5" align="left">ข้าพเจ้า</a>
<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]?> " readonly/>
ตำแหน่ง</a>
<input name="Name2" type="text" id="Name2" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="25" 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] ";?>
" readonly/>
</font></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left"><label>ขออนุญาตใช้รถยนต์ไปราชการที่<a>
<input name="makeWord" type="text" id="makeWord" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="60" />
</a>
<input name="code" type="hidden" id="code" />
<a>จังหวัด</a>
<select name="provinceId" id="provinceId" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" >
<?php
$strSQL3 = " SELECT * FROM province Order By provinceName ASC ";
$result3 = mysql_query($strSQL3);
while( $rs3 = mysql_fetch_array($result3) ) {
?>
<option value="<?=$rs3['provinceId'];?>" <?php if( $rs3['provinceId']==$rs2['provinceId'] ) echo 'selected'; ?>>
<?=$rs3['provinceName'];?>
</option>
<?php
} # while
?>
</select>
</font></font></font></label></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left">เพื่อ<a>
<input name="Training_name" type="text" id="Training_name" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="80" />
จำนวนผู้ร่วมเดินทาง</a>
<input name="Make" type="text" id="Make" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" onkeypress="return checkNumeric();" size="3" maxlength="4" /> </font><font face="Tahoma">คน</font></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left">หมายเหตุ
<input name="Detail" type="text" id="Detail" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="100" />
</td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left">ประเภทการขอใช้รถยนต์
<input type="radio" name="Training_type" value="1" />
การอบรม
<input type="radio" name="Training_type" value="2" />
การศึกษาดูงาน
<input type="radio" name="Training_type" value="3" checked="checked" />
ประชุม
<input type="radio" name="Training_type" value="4" />
สัมมนา
<input type="radio" name="Training_type" value="5" />
วิทยากร
<input type="radio" name="Training_type" value="6" />
นิเทศงาน
<input type="radio" name="Training_type" value="7" />
อื่นๆ</td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left"><label> สถานะการเดินทาง
<input name="object" type="radio" id="object" value="1" />
ค้างคืน
<input name="object" type="radio" id="object" value="2" checked/>
ไปกลับ
<input name="object" type="radio" id="object" value="3" />
ส่งอย่างเดียว
<input name="object" type="radio" id="object" value="4" />
รับอย่างเดียว
<input name="object" type="radio" id="object" value="5" />
รับส่ง
ปีงบประมาณ*
<input name="Budget_year" type="text" id="Budget_year" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?=$rs->Budget_year;?>" size="3" />
</font></label></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left">สถานะของพนักงานขับรถยนต์
<input type="radio" name="usecar" value="1" checked="checked" />
ใช้ พขร
<input type="radio" name="usecar" value="0" />
ไม่ใช้ พขร </td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left">
<table width="468">
<tr>
<td width="126">อ้างการขอใช้ในวันที่</td>
<td width="140"><script>DateInput('mDate2', true,'DD/MM/YYYY','<?=date("d/m/Y");?>');</script>
</td>
<td width="186">
เวลา
<input name="Time_start" type="text" id="Time_start" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="5" maxlength="5" onkeypress="return checkNumeric();" />
น.
</td>
</tr>
</table>
</td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left" nowrap>
<table width="469">
<tr>
<td width="126">สิ้นสุดการขอใช้วันที่</td>
<td width="139"><script>DateInput('mDate3', true,'DD/MM/YYYY','<?=date("d/m/Y");?>');</script></td>
<td width="188">
เวลา
<input name="Time_finish" type="text" id="Time_finish" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="5" maxlength="5" onkeypress="return checkNumeric();" />น. </td>
</tr>
</table>
</td>
</tr>
<tr height="29">
<td height="16" colspan="6" align="left"><p> </p></td>
</tr>
<tr height="31">
<td height="23" colspan="3" align="left"></td>
<td> </td>
<td align="center">ลงชื่อ.................................</td>
<td></td>
</tr>
<tr height="29">
<td height="29" colspan="3"> </td>
<td></td>
<td align="center">( <? echo $rss[First_name]?> <? echo $rss[Teacher_name]?> <? echo $rss[Teacher_lastname]?> )
<input name="Teacher_code" type="hidden" id="Teacher_code" value="<? echo $rss[Teacher_code];?>" /></td>
<td></td>
</tr>
<tr height="31">
<td height="31"> </td>
<td> </td>
<td> </td>
<td colspan="3" align="center">ตำแหน่ง<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="<? //$PositionId = $rss["PositionId"];
$sql = "Select * From position_tb Where PositionId ='$rss[PositionId]' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs2 = mysql_fetch_array($result1);
echo "$rs2[Position_name] ";?>
" />
</font></td>
</tr>
<tr height="31">
<td height="31"> </td>
<td width="105"> </td>
<td width="166"> </td>
<td colspan="3" align="left"><span class="style13">ความเห็นหัวหน้างาน</span></td>
</tr>
<tr height="29">
<td height="28" colspan="3" align="left"><strong> </strong>ความเห็นของผู้ควบคุมการใช้รถยนต์</td>
<td colspan="3">
<input name="Info_name" type="text" id="Info_name" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="40" />
</td>
</tr>
<tr height="29">
<td height="23" colspan="3" align="left"> </td>
<td></td>
<td align="center">ลงชื่อ................................</td>
<td></td>
</tr>
<tr height="29">
<td height="29" colspan="3" align="left">ลงชื่อ....................................ผู้จัดยานพาหนะ </td>
<td></td>
<td align="center"> <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="TeacherId2" type="hidden" id="TeacherId2" value="<? echo $rs2["Teacher_code"]?>" /></td>
<td></td>
</tr>
<tr height="29">
<td height="29" colspan="2" align="center">(........................................) </td>
<td align="left"> </td>
<td colspan="3" align="center">ตำแหน่ง<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" colspan="3" align="left"> </td>
<td colspan="3" align="center">วันที่.......เดือน..............พ.ศ..........….</td>
</tr>
<tr height="29">
<td height="16" colspan="2" align="center"> </td>
<td></td>
<td colspan="3" align="left"> </td>
</tr>
<tr height="31">
<td height="16"></td>
<td></td>
<td></td>
<td align="left">คำสั่ง</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"><label>
<input type="radio" name="radio" value="Y" />
</label>
อนุญาต
<input type="radio" name="radio" value="N" />
ไม่อนุญาต</td>
</tr>
<tr height="29">
<td height="29"></td>
<td></td>
<td></td>
<td colspan="3" align="center"> ลงชื่อ........................................……..</td>
</tr>
<tr height="29">
<td height="29"></td>
<td></td>
<td></td>
<td colspan="3" align="center">ตำแหน่ง..........................................….</td>
</tr>
<tr height="29">
<td height="29"></td>
<td></td>
<td></td>
<td colspan="3" align="center">วันที่.......เดือน...........พ.ศ.........….</td>
</tr>
<tr height="31">
<td height="10" colspan="6" align="center"><hr /></td>
</tr>
<tr height="31">
<td height="24" colspan="6" align="center"><input type="submit" name="Submit" value="บันทึก" class="WIDTH60 CURSOR-HAND" />
<input type="reset" name="Reset" value="รีเซ็ต" class="WIDTH60 CURSOR-HAND" />
<input type="button" name="Button" value="ยกเลิก" class="WIDTH60 CURSOR-HAND" onclick="location.href=FormCarList.php?Teacher_code=<?=$Teacher_code;?>'" /></td>
</tr>
</table></td>
</tr>
<tr>
<td><span class="NOTE">หมายเหตุ : </span></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);
?>
|