| Server IP : 182.53.201.61 / Your IP : 216.73.217.175 Web Server : Apache/2.2.15 (Fedora) System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686 User : apache ( 48) PHP Version : 5.3.3 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/CAR/ |
Upload File : |
<?php
$ebits = ini_get('error_reporting');
error_reporting($ebits ^ E_NOTICE);
?>
<?php
ob_start() ;
include( "function.php" );
include( "dbconfig.php" );
?>
<?php
//global $HTTP_POST_VARS;
if ( $cmdSubmit == "บันทึกการขอรถ" ) {
if ( empty( $user_id ) ) {
echo"<script>alert('กรุณาใส่ชื่อผู้ขอรถด้วยครับ!!');window.location='javascript:history.back()';</script>";
break;
}
if ( empty( $target ) ) {
echo"<script>alert('กรุณาใส่สถานที่ไปด้วยครับ!!');window.location='javascript:history.back()';</script>";
break;
}
if ( empty( $res_id ) ) {
echo"<script>alert('กรุณาเลือกความประสงค์ในการขอรถ (เพื่อ)!!');window.location='javascript:history.back()';</script>";
break;
}
if ( empty( $reason ) ) {
echo"<script>alert('กรุณาระบุรายละเอียดเพิ่มเติม!!');window.location='javascript:history.back()';</script>";
break;
}
if ( empty( $time2 ) ) {
echo"<script>alert('กรุณาระบุเวลากลับ!!');window.location='javascript:history.back()';</script>";
break;
}
/*if ( $date1 == $date+1 && $time >'15.45') {
echo"<script>alert('เกินเวลาขอรถแล้วครับ ต้องการใช้รถให้ติดต่อ หัวหน้าบริหาร หลังบันทึกเสร็จแล้ว !!');window.location='javascript:history.back()';</script>";
}*/
setcookie ("cookie_id", $user_id);
//@$link = mysql_connect("localhost","root","") or die("can't connect");
mysql_select_db($__dbwp__);
mysql_query(" SET NAMES 'tis620'; ");
$query = "select kn_car_department_nameTH from kn_car_department where kn_car_department_id='".$kn_car_department."' " ;
$res = mysql_query($query ) or die(mysql_error());
$row = mysql_fetch_object($res);
$dept_name_thai = $row->kn_car_department_nameTH;
mysql_select_db($__db__);
mysql_query(" SET NAMES 'tis620'; ");
$maxsql = "select no from tran " ;
$maxqury = mysql_query($maxsql ) or die(mysql_error());
while (@$maxobject = mysql_fetch_array($maxqury)) {
$max = $maxobject["no"]+1 ;
}
//echo if(formatDateDB($date1);
$datedb = formatDateDB($date);
$datedb1 = formatDateDB($date1);
$datedb2 = formatDateDB($date2);
if ($con == "CON" )
{
$dd = substr($date1,0,2);
$mm = substr($date1,3,2);
$yy = substr($date1,6,4) -543 ;
$dd2 = substr($date2,0,2);
$mm2 = substr($date2,3,2);
$yy2 = substr($date2,6,4) -543 ;
echo "$dd/$mm/$yy ถึงวันที่ $dd2/ $mm2/$yy2<br><hr>" ;
for ($i=0;$i<=31;$i++)
{
echo $i. "<br>" ;
// your command here
$day_con = ($yy+543)."-".$mm."-".$dd ;
//$sql = "insert into tran (no,target,user_id, person,u1,u2,u3,u4,u5,reason,date,date1,time1,date2,time2,time ) values //('$max','$target','$user_id','$person','$u1','$u2','$u3','$u4','$u5','$reason','$datedb','$day_con','$time1','$day_con','$time2','$time')";
/*$sql = "insert into tran (no,target,user_id, person,u1,u2,u3,u4,u5,reason,date,date1,time1,date2,time2,time,";
$sql .= "dept_h_full_name, dept_id, dept_name) values ('$max','$target','$user_id','$person','$u1','$u2','$u3',";
$sql .= "'$u4','$u5','$reason','$datedb','$datedb1','$time1','$datedb2','$time2','$time',";
$sql .= "'$dept_header_name_thai', '$kn_car_department', '$dept_name_thai' )";
$result = mysql_query($sql ) or die(mysql_error());
//end;
if ($i<=31)
{
$dd=$dd+1 ;
if (!checkdate($mm,$dd,$yy))
{
$dd=1;
$mm=$mm+1;
if ($mm==13)
{
$yy=$yy+1;
$mm=1;
}
}
$max = $max+1 ;
//if ($dd == $dd2 and $mm == $mm2 and $yy == $yy2 ) $i = 30;
if (($dd == $dd2) and ($mm == $mm2) and ($yy == $yy2 )) { $i = 30 ; }
}
} // end for
} // end if(continue)
else
{
$sql = "insert into tran (no,target,user_id, person,u1,u2,u3,u4,u5,reason,res_id,date,date1,time1,date2,time2,time,";
$sql .= "dept_h_full_name, dept_id, dept_name) values ('$max','$target','$user_id','$person','$u1','$u2','$u3',";
$sql .= "'$u4','$u5','$reason','$res_id','$datedb','$datedb1','$time1','$datedb2','$time2','$time',";
$sql .= "'$dept_header_name_thai', '$kn_car_department', '$dept_name_thai' )";
$result = mysql_query($sql ) or die(mysql_error());
}*/
echo "<script language='JavaScript'>";
echo "alert('บันทึกข้อมูลเรียบร้อยแล้ว รอการอนุมัติ ถ้าอนุมัติและจัดรถแล้วจะปรากฏ ในหน้าแรก');";
//echo "location='index.php';";
echo "</script>" ;
setcookie ("cookie", $user_id);
} else {
?>
<html>
<head>
<title>ใบขออนุญาตใช่รถส่วนกลาง</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<LINK href="style.css" rel=stylesheet>
<STYLE type=text/css>
a:link{color:white;text-decoration:none;font-family:ms sans serif;}
a:visited{color:white;text-decoration:none;font-family:ms sans serif;}
a:hover{color:yellow;text-decoration:none;font-family:ms sans serif;}
td{font-size:10pt;font-family:ms sans serif;}
.style1 {
font-size: 18;
color: #FF0000;
}
.style2 {
color: #FF0000;
font-weight: bold;
}
.style3 {color: #FF0000}
</STYLE>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js'></script>
<script>
$(document).ready(function(){
$("#other").click(function(){
$("#reason").css("display","inline");
});
});
</script>
<script language="JavaScript1.2">
<!--
/*
Auto Maximize Window Script- By Nick Lowe (nicklowe@ukonline.co.uk)
*/
/*top.window.moveTo(0,0);
if (document.all) {
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layersdocument.getElementById) {
if (top.window.outerHeight<screen.availHeighttop.window.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}*/
//-->
</script>
</head>
<body>
<STYLE type=text/css>A.no_de:hover {
TEXT-DECORATION: none
}
</STYLE>
<TABLE height=47 cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD style="BACKGROUND-COLOR: #f0f7ff" colSpan=2></TD>
</TR>
<TR bgColor=#c7d2e7>
<TD class=thwbold width="8%" height=21><div align="center"><img src="../images/wait.gif" width="15" height="15">
</div></TD>
<TD width="92%" height=21 align=right vAlign=center bgColor=#c7d1e7 class=thsans>
<A
href=""></A> <table width="41%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>บันทึกการขอใช้รถยนต์ส่วนกลาง</td>
</tr>
</table>
<img src="../images/freeshipping_small.gif" width="19" height="12"> <img src="../images/q.gif" width="18" height="18"><img src="../images/youraccount.gif" width="18" height="18"><img src="../images/cart.gif" width="18" height="18">
<A href=""></A> <A
href=""></A> </TD>
</TR>
<TR>
<TD style="BACKGROUND-COLOR: black" colSpan=2></TD>
</TR>
<TR>
<TD style="BACKGROUND-COLOR: #f0f8ff" colSpan=2></TD>
</TR>
<TR vAlign=center bgColor=#216289>
<TD class=thwbold colSpan=2 height=20> </TD>
</TR>
<TR>
<TD style="BACKGROUND-COLOR: black; heigth: 1"
colSpan=2></TD>
</TR>
</TBODY>
</TABLE>
<form name="form1" method="post" action="car_request22.php">
<TABLE cellSpacing=0 cellPadding=3 width="100%" align=center border=0>
<TBODY>
<TR>
<TD height="126" vAlign=top> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD width="100%" colSpan=2> <TABLE width="100%" border=0>
<TBODY>
<TR>
<TD
style="BACKGROUND-IMAGE: url(pointsmall.gif); BACKGROUND-REPEAT: repeat-x"></TD>
</TR>
</TBODY>
</TABLE>
<DIV class=thtahomasmall
style="PADDING-RIGHT: 2px; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; PADDING-TOP: 2px"
align=right> </DIV>
<DIV id=news_newyear
style="BORDER-RIGHT: #c7d2e7 1px solid; PADDING-RIGHT: 3px; BORDER-TOP: #c7d2e7 1px solid; PADDING-LEFT: 3px; MARGIN-BOTTOM: 3px; PADDING-BOTTOM: 3px; BORDER-LEFT: #c7d2e7 1px solid; PADDING-TOP: 3px; BORDER-BOTTOM: #c7d2e7 1px solid; BACKGROUND-COLOR: #f0f8ff">
<table width="95%" border="0" cellpadding="0" cellspacing="2">
<tr>
<td width="6%" height="25"><br></td>
<td width="94%"> <div align="right">
<p>วันที่ขอรถ
<input name="date" type="text" id="date" value="<? echo date("d/m/").(date("Y")+543); ?>" size="12" maxlength="12" readonly>
<input name="time" type="text" id="date2" value="<? echo date("H:i:s"); ?>" size="8" readonly>
</p>
<p align="left" class="style1"> <br>
*** ก่อนจะขอรถ กรุณาเลือกชื่อผู้ขอให้ถูกต้อง หากไม่เลือกชื่อผู้ขอให้ถูก จะไม่ทำการจัดรถให้ </p>
</div></td>
</tr>
<tr>
<td height="23" colspan="2"><span class="style2"><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">ชื่อผู้ขอ</font></span>
<font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">
<?
$cid = $cookie_id ;
mysql_select_db($__dbwp__);
mysql_query(" SET NAMES 'tis620'; ");
$cquery="select id,name from user where id = '$cid' "; //not sure it's work
$cresult=mysql_query($cquery);
$rs = mysql_fetch_array($cresult);
$cname = $rs["name"];
?>
<select name="user_id" id="select3">
<option value=""></option>
<!--<option value="<? //echo $cid ; ?>"><? //echo $cname ; ?></option> -->
<?
mysql_select_db($__dbwp__);
mysql_query(" SET NAMES 'tis620'; ");
$plquery="select id,name,class from user where status ='1' ORDER BY name ASC, class ASC ";
$plresult=mysql_query($plquery);
while ($plobject = mysql_fetch_object($plresult))
{
echo "<OPTION VALUE =".$plobject ->id.">" .$plobject ->name."</Option>" ;
}
?>
</select>
<? //------------------------------------------------------------------------------ kn_edit------------------------------------------------------------------------------- ?>
<?
#ดึงรายชื่อแผนกมาจาก DB
mysql_select_db($__dbwp__);
mysql_query(" SET NAMES 'tis620'; ");
$sql_select = "SELECT * FROM kn_car_department kcd " ;
$sql_select .= " INNER JOIN kn_car_duser kcu ON kcu.kn_car_duser_id=kcd.kn_car_department_leader_id ";
$kn_result = mysql_query($sql_select) or die(mysql_error());
$akn_result = array();
while($row=mysql_fetch_object($kn_result) ){
$akn_result[] = $row;
}
?>
<script type="text/javascript">
function select_dept_header(id) {
var adept_ihname = new Array();
<?
foreach($akn_result as $rres ){
echo "adept_ihname[".$rres->kn_car_department_id."]=\"".$rres->kn_car_duser_prefix_nameTH." ".$rres->kn_car_duser_fnameTH." ".$rres->kn_car_duser_lnameTH."\";\r\n";//kn_car_duser_fnameTH kn_car_duser_lameTH kn_car_duer_prefix_nameTH
//adept_ihname[1]="นางสาว นิตยา ยวงเดชกล้า";
}
/*while($row=mysql_fetch_array($kn_result)) :
echo "adept_ihname[".$row['kn_car_department_id']."]=\"".$row['kn_car_duser_prefix_nameTH']." ".$row['kn_car_duser_fnameTH']." ".$row['kn_car_duser_lameTH']."\";\r\n";
endwhile;*/
?>
text = adept_ihname[id];
document.getElementById("dept_header_name_thai").value=text;
}
</script>
<strong>งาน/กลุ่มงาน/คณะกรรมการ</strong>
<select name="kn_car_department" id="kn_car_department" onChange="select_dept_header(this.value)" >
<option value=""></option>
<?
foreach($akn_result as $rres ){
echo "<option value=".$rres->kn_car_department_id.">".$rres->kn_car_department_nameTH."</option>\n";
}
/*while ( $row2 = mysql_fetch_array($kn_result2) ) :
echo "<option value=".$row2['kn_car_department_id'].">".$row2['kn_car_department_nameTH']."</option>\n";
endwhile;
mysql_close($kn_link);*/
?>
</select>
<strong>หัวหน้ากลุ่มงาน/เลขาคณะกรรมการ</strong>
<input type="text" name="dept_header_name_thai" id="dept_header_name_thai" value="" />
<? //------------------------------------------------------------------------------ kn_edit------------------------------------------------------------------------------- ?>
</font></td>
</tr>
<tr>
<td height="20" colspan="2"><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif"><strong>ขออนุญาตใช้รถยนต์
( ไปที่ไหน ) </strong></font> <input name="target" type="text" id="target" size="80"></td>
</tr>
<tr>
<td height="31" colspan="2"><strong><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">เพื่อ</font></strong>
<select name="res_id" >
<option value="0"></option>
<option value="1">ประชุม/อบรม</option>
<option value="2">EMS</option>
<option value="3">Refer</option>
<option value="4">ชุมชน</option>
<option value="5">เบิกยา</option>
<option value="6" >ธนาคาร</option>
<option value="7" >ส่งเอกสารราชการ</option>
<option value="8" >อื่นๆ</option>
</select>
<input type="text" name="reason" placeholder="โปรดระบุรายระเอียดเพื่อเติม" size="50"/>
<strong>มีคนนั่ง</strong> <input name="person" type="text" id="person" value="1" size="3" maxlength="3">
<strong> คน </strong></td>
</tr>
<tr>
<td height="31" colspan="2"><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif"><strong>ขอใช้รถในวันที่
</strong></font> <input name="date1" type="text" id="date22" value="<? echo date("d/m/").(date("Y")+543); ?>" size="12" maxlength="12">
<strong>เวลา</strong> <input name="time1" type="text" id="time1" value="08.00" size="6">
<strong> ถึงวันที่ </strong> <input name="date2" type="text" id="date32" value="<? echo date("d/m/").(date("Y")+543); ?>" size="12" maxlength="12">
<strong> เวลา</strong> <input name="time2" type="text" id="time2" value="16.30" size="6">
<span class="style3">*ขอรถได้แค่วันต่อวันเท่านั้น </span> </td>
</tr>
<tr>
<td height="35"><strong>รายชื่อผู้นั่ง</strong></td>
<td> 1.
<input name="u1" type="text" id="u1"> </td>
</tr>
<tr>
<td height="20"> </td>
<td>2.
<input name="u2" type="text" id="u2"> </td>
</tr>
<tr>
<td height="22"> </td>
<td>3.
<input name="u3" type="text" id="u3"> </td>
</tr>
<tr>
<td height="23"> </td>
<td>4.
<input name="u4" type="text" id="u4"></td>
</tr>
<tr>
<td height="20"> </td>
<td>5.
<input name="u5" type="text" id="u5"> กรอกรายละเอียดครบแล้ว
คลิ๊กปุ่มนี้ >> <input name="cmdSubmit" type="submit" id="cmdSubmit2" value="บันทึกการขอรถ">
</td>
</tr>
<tr>
<td height="39"> </td>
<td> <div align="center"> </div></td>
</tr>
</table>
</DIV></TD>
</TR>
</TBODY>
</TABLE>
<BR> </TD>
</TR>
</TBODY>
</TABLE>
</form>
<blockquote>
<p><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">*หมายเหตุ : อนุญาติให้ขอรถได้แค่วันต่อวัน คือไม่สามารถกรอกเป็นช่วงเวลาได้ เช่น 1 กันยายน เวลา 8.00 ถึงวันที่ 7 กันยายน </font>16.30</p>
</blockquote>
</body>
</html>
<? ob_flush() ;?>
<? } ?>