Viewing file: Menu_reportcar.php (32.64 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" );
require_once( "../calendar/check.php" );
require_once( "../calendar/cal_func.php" );
require_once( "../link/function.php" );
/** Create Database Object */
$dbObj = new DBConn;
/** Config Table for This Page */
$myTable1 = "personal_tb";
$myTable2 = "formcaroffice";
$myTable3 = "project_tb";
$myTable4 = "automobile_tb";
$myTable5 = "autocar_tb";
$myTable2PK = "carId";
} # 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><?=$_Config_sitename;?> - ข้อมูลงานวิจัย</title>
<script type="text/javascript" src="../js/utilities.js"></script>
<link href="../css/default.css" rel="stylesheet" type="text/css" />
<link href="../css/calendar.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<style type="text/css">
<!--
.style22 {font-size: 14px; font-weight: bold; }
-->
</style>
</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="215" align="left" valign="top" style="padding:10px 0px 0px 5px"><?php include("./_incMainMenu.php");?></td>
<td width="788" align="center" valign="top" style="padding:10px 0px 5px 10px"><fieldset>
<table width="766" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="603" height="5"></td>
</tr>
<tr>
<td height="23" background="../images/background/bg-head-topic-w780.gif" class="PADDING-LEFT-10 PATRON11"><strong><a href="index.php">หน้าหลัก</a> » <a href="CarYear.php">แผนภูมิการขอใช้รถยนต์</a> »</strong> ข้อมูลรายงานรถยนต์ ปี งปม<span style="padding-bottom:5px;">
<select name="jumpMenu" id="jumpMenu" onchange="MM_jumpMenu('parent',this,0)">
<option>
<?php
$strSQL = " SELECT * FROM project_year ORDER by Budget_Year asc ";
$result4 = mysql_query($strSQL);
while( $rs4 = mysql_fetch_array($result4) ) {
?>
</option>
<option value="Menu_reportcar.php?Budget_year=<?=$rs4['Budget_Year'];?>" <?php if( $rs4['Budget_Year']==$Budget_year ) echo 'selected'; ?>>
<?=$rs4['Budget_Year'];?>
</option>
<?php
} # while
?>
</select>
</span></td>
</tr>
<tr>
<td align="right"> </td>
</tr>
<tr>
<td><span style="padding-bottom:5px;"><span class="PADDING-TOP-10"><img src="../images/icons/arrow-circle-225-left.png" width="16" height="16" border="0" align="absmiddle" /> <a href="javascript:;" onclick="window.history.back();"><strong>‹ ย้อนกลับ</strong></a></span></span></td>
</tr>
<tr>
<td align="center" valign="top"><table width="93%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td width="4%" height="20" align="center"><img src="../images/icons/folder-open-doc-text.png" width="16" height="16" border="0" align="absmiddle" /></td>
<td width="96%" class="TEXT-DARK-BLUE10">ข้อมูลรายงานทั่วไปปีงบประมาณ
<?=$Budget_year ;?>
</td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td><table width="92%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td height="20" colspan="2" align="center" bgcolor="#FFCCCC">รายการ </td>
<td align="center" bgcolor="#FFCCCC">จำนวนครั้ง</td>
<td align="center" bgcolor="#FFCCCC">สัดส่วน %</td>
</tr>
<tr>
<td width="3%" height="20" align="center"><img src="../images/icons/arrow2.gif" width="12" height="12" /></td>
<td width="59%" height="20" class="PADDING-LEFT-5"><a href="CarDetail.php?Budget_year=<?=$Budget_year;?>">รายละเอียดการใช้รถยนต์</a></td>
<td width="19%" align="center">
<?php
$sql = " SELECT COUNT(DateCar) AS num1 FROM formcaroffice WHERE Budget_year='$Budget_year' " ;
$result6 = mysql_query($sql);
$rs6 = $dbObj->fetchArray($result6);
echo $rs6['num1'] ;
?>
</td>
<td width="19%" align="center">
<?php
$sql = " SELECT COUNT(DateCar) AS num FROM formcaroffice WHERE Budget_year='$Budget_year' " ;
$result1 = mysql_query($sql);
$rs1 = $dbObj->fetchArray($result1);
// echo $num1;
$sql = " SELECT COUNT(DateCar) AS sum FROM formcaroffice WHERE Budget_year !='0' " ;
$result2 = mysql_query($sql);
$rs2 = $dbObj->fetchArray($result2);
$per2= ( $rs1['num'] * 100 ) / $rs2['sum'] ;
echo number_format($per2,2,'.','.');
?>
</td>
</tr>
<tr>
<td height="20" align="center"><img src="../images/icons/arrow2.gif" width="12" height="12" /></td>
<td height="20" class="PADDING-LEFT-5">ข้อมูลการขอใช้รถยนต์</a></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td height="20" colspan="4" align="center"> </td>
</tr>
<tr>
<td height="20" colspan="2" align="center" bgcolor="#FFFFCC">รายชื่อผู้ที่ขอใช้รถยนต์ วันที่ </a>
<?php
$yearthai = explode("-",$sday);
$day = intval($yearthai[2]);
$month = intval($yearthai[1]);
$year = intval($yearthai[0]);
$m = getThaiSubMonth($month);
echo abbreDate(date("d-m-Y"));
?>
</td>
<td align="center" bgcolor="#FFFFCC">จังหวัด</td>
<td align="center" bgcolor="#FFFFCC">พนักงานขับรถ</td>
</tr>
<tr> <?php
$query = " SELECT * FROM formcaroffice WHERE DateCar = ' ".date("Y-m-d")." ' Order By Date_start ASC ";
$result12 = $dbObj->execQuery($query);
$numrows = $dbObj->_numrows;
$no = 1+($display-1)*$limit;
while( $row = $dbObj->fetchArray($result12) ) {
$bgColor = ( $bgColor == "#FFFFFF" ) ? "#F9FBFB" : "#FFFFFF";
?>
<td height="20" align="center"><img src="../images/icons/arrow2.gif" width="12" height="12" /></td>
<td height="20">
<?php
$Teacher_code = $row['Teacher_code'] ;
$sql11 = " SELECT * ,prefixName as First_name FROM personal_tb LEFT JOIN prefix ON personal_tb.First_name = prefix.prefixId WHERE Teacher_code='$Teacher_code' ";
$result11 = mysql_query($sql11);
$rs11 = mysql_fetch_array($result11);
echo"$rs11[First_name] $rs11[Teacher_name] $rs11[Teacher_lastname]";
?>
</td>
<td align="center">
<?php
$query2 = " SELECT * FROM province WHERE provinceId='$row[provinceId]' ";
$result2 = $dbObj->execQuery($query2);
$rs2 = $dbObj->fetchArray($result2);
echo $rs2[provinceName];
?>
</td>
<td><?php
$sql = " SELECT * ,prefixName as First_name FROM personal_tb LEFT JOIN prefix ON personal_tb.First_name = prefix.prefixId , formcaroffice fc WHERE Teacher_code ='$row[name1]' ";
$result13 = mysql_query($sql);
$rs13 = mysql_fetch_array($result13);
echo"$rs13[First_name] $rs13[Teacher_name] $rs13[Teacher_lastname]";
?>
</td>
</tr>
<?php
$no++;
} # while
?>
</table></td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td class="TEXT-DARK-BLUE10"> </td>
</tr>
<tr>
<td height="20" align="center"><img src="../images/icons/folder-open-doc-text.png" width="16" height="16" border="0" align="absmiddle" /></td>
<td class="TEXT-DARK-BLUE10"> สรุปการดำเนินการแยกตามพนักงานขับรถยนต์ ปีงบประมาณ
<?=$Budget_year ;?></td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td class="TEXT-DARK-BLUE10"><table width="93%" border="0" align="left" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF" style="background-color:#eeeeee; border:0px solid gray">
<tr bgcolor="<?=$bgColor;?>">
<td height="20" align="right" bgcolor="#FFCCCC"> </td>
<td align="center" bgcolor="#FFCCCC" class="PADDING-LEFT-5">พนักงานขับรถ</td>
<td align="center" bgcolor="#FFCCCC" class="PADDING-LEFT-5">ครั้ง</td>
<td align="center" bgcolor="#FFCCCC" class="PADDING-LEFT-5">สัดส่วน %</td>
</tr>
<?php
$query1 = " SELECT * FROM personal_tb pt , formcaroffice fc Where fc.Budget_year='$Budget_year' and pt.StatusId='1' and pt.Teacher_code=fc.name1 GROUP BY fc.name1 ";
$result3 = $dbObj->execQuery($query1);
$numrows = $dbObj->_numrows;
$Budget_year = $rs->Budget_year;
$no = 1+($display-1)*$limit;
while( $rs3 = $dbObj->fetchArray($result3) ) {
$Budget_year = $rs3['Budget_year'];
$bgColor = ( $bgColor == "#FFFFFF" ) ? "#F9FBFB" : "#FFFFFF";
?>
<tr bgcolor="<?=$bgColor;?>">
<td width="4%" height="20" align="right"><img src="../images/icons/linesub.gif" width="16" height="16" border="0" align="absmiddle" /></td>
<td width="63%" align="left" class="PADDING-LEFT-5"><?php
$Teacher_code= $rs3['name1'] ;
$sql11 = " Select *, prefixName as First_name FROM personal_tb LEFT JOIN prefix ON personal_tb.First_name = prefix.prefixId Where Teacher_code='$Teacher_code' ";
$result11 = mysql_query($sql11);
$rs11 = mysql_fetch_array($result11);
echo"$rs11[First_name] $rs11[Teacher_name] $rs11[Teacher_lastname]";
?>
</a></td>
<td width="14%" align="center" class="PADDING-LEFT-5"><?php
$sql = " SELECT COUNT(DateCar) AS num1 FROM formcaroffice WHERE name1='$rs3[name1]' and Budget_year='$Budget_year' " ;
$result6 = mysql_query($sql);
$rs6 = $dbObj->fetchArray($result6);
echo $rs6['num1'] ;
?></td>
<td width="19%" align="center" class="PADDING-LEFT-5"><?php
$sql = " SELECT COUNT(DateCar) AS num FROM formcaroffice WHERE name1='$rs3[name1]' and Budget_year='$Budget_year' " ;
$result1 = mysql_query($sql);
$rs1 = $dbObj->fetchArray($result1);
// echo $num1;
$sql = " SELECT COUNT(DateCar) AS sum FROM formcaroffice WHERE name1 !='0' and Budget_year='$Budget_year' " ;
$result2 = mysql_query($sql);
$rs2 = $dbObj->fetchArray($result2);
$per2= ( $rs1['num'] * 100 ) / $rs2['sum'] ;
echo number_format($per2,2,'.','.');
?></td>
</tr>
<?php
//$no++;
} # while
?>
</table></td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td class="TEXT-DARK-BLUE10"> </td>
</tr>
<tr>
<td height="20" align="center"><img src="../images/icons/folder-open-doc-text.png" width="16" height="16" border="0" align="absmiddle" /></td>
<td class="TEXT-DARK-BLUE10"> สรุปการดำเนินการแยกตามประเภทรถยนต์ ปีงบประมาณ
<?=$Budget_year ;?></td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td class="TEXT-DARK-BLUE10"><table width="92%" border="0" align="left" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF" style="background-color:#eeeeee; border:0px solid gray">
<tr bgcolor="<?=$bgColor;?>">
<td height="20" align="right" bgcolor="#FFCC66"> </td>
<td align="center" bgcolor="#FFCC66" class="PADDING-LEFT-5">ประเภทรถยนต์</td>
<td align="center" bgcolor="#FFCC66" class="PADDING-LEFT-5">เที่ยว</td>
<td align="center" bgcolor="#FFCC66" class="PADDING-LEFT-5">สัดส่วน %</td>
</tr>
<?php
$query = " SELECT * FROM $myTable2 WHERE Budget_year='$Budget_year' and CarmoId !='0' Group By CarmoId ";
$result5 = $dbObj->execQuery($query);
$numrows = $dbObj->_numrows;
$Budget_year = $rs->Budget_year;
$no = 1+($display-1)*$limit;
while( $rss = $dbObj->fetchArray($result5) ) {
$Budget_year = $rss['Budget_year'];
$bgColor = ( $bgColor == "#FFFFFF" ) ? "#F9FBFB" : "#FFFFFF";
?>
<tr bgcolor="<?=$bgColor;?>">
<td width="3%" height="20" align="right"><img src="../images/icons/linesub.gif" width="16" height="16" border="0" align="absmiddle" /></td>
<td width="72%" align="left" class="PADDING-LEFT-5"><a href="printexcel_Type.php?CarmoId=<?=$rss['CarmoId'];?>&Budget_year=<?=$Budget_year ;?>"><?php
//$CarmoId = $rss['CarmoId'] ;
$sql11 = " Select Acc_name , Kind , CodeNo From $myTable4 Where CarmoId ='$rss[CarmoId]' ";
$result11 = mysql_query($sql11);
$rs11 = mysql_fetch_array($result11);
//echo "$rs11[Acc_name] " ;
echo "$rs11[Acc_name] $rs11[Kind] $rs11[CodeNo]";
?>
</a></td>
<td width="11%" align="center" class="PADDING-LEFT-5"><?php
$sql3 = "Select * From formcaroffice WHERE Budget_year='$Budget_year' AND CarmoId='$rss[CarmoId]' ";
$result3 = mysql_query($sql3);
$rs3 = mysql_num_rows($result3);
echo"$rs3";
?></td>
<td width="14%" align="center" class="PADDING-LEFT-5"><?php
$sql = " SELECT COUNT(DateCar) AS num FROM formcaroffice WHERE CarmoId='$rss[CarmoId]' and Budget_year='$Budget_year' " ;
$result1 = mysql_query($sql);
$rs1 = $dbObj->fetchArray($result1);
// echo $num1;
$sql = " SELECT COUNT(DateCar) AS sum FROM formcaroffice WHERE CarmoId !='0' and Budget_year='$Budget_year' " ;
$result2 = mysql_query($sql);
$rs2 = $dbObj->fetchArray($result2);
$per2= ( $rs1['num'] * 100 ) / $rs2['sum'] ;
echo number_format($per2,2,'.','.');
?></td>
</tr>
<?php
//$no++;
} # while
?>
</table></td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td class="TEXT-DARK-BLUE10"> </td>
</tr>
<tr>
<td height="20" align="center"><img src="../images/icons/folder-open-doc-text.png" width="16" height="16" border="0" align="absmiddle" /></td>
<td class="TEXT-DARK-BLUE10">ประเภทการขอใช้รถยนต์ ปีงบประมาณ
<?=$Budget_year ;?></td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td><table width="92%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td height="20" colspan="2" align="center" bgcolor="#FFCCCC">รายการ</td>
<td align="center" bgcolor="#FFCCCC">จำนวนครั้ง</td>
<td align="center" bgcolor="#FFCCCC">สัดส่วน %</td>
</tr>
<tr>
<td height="20" align="center"><img src="../images/icons/arrow2.gif" width="12" height="12" /></td>
<td height="20" class="PADDING-LEFT-5">ประเภทการอบรม</a></td>
<td align="center"><?php
$sql = " SELECT * FROM formcaroffice WHERE Training_type='1' and Budget_year='$Budget_year' " ;
$result1 = mysql_query($sql);
$num1= mysql_num_rows($result1);
mysql_free_result($result1);
echo $num1;
?></td>
<td align="center"><?php
$sql = " SELECT COUNT(DateCar) AS num FROM formcaroffice WHERE Training_type='1' and Budget_year='$Budget_year' " ;
$result1 = mysql_query($sql);
$rs1 = $dbObj->fetchArray($result1);
// echo $num1;
$sql = " SELECT COUNT(DateCar) AS sum FROM formcaroffice WHERE Budget_year='$Budget_year' " ;
$result2 = mysql_query($sql);
$rs2 = $dbObj->fetchArray($result2);
$per2= ( $rs1['num'] * 100 ) / $rs2['sum'] ;
echo number_format($per2,2,'.','.');
?></td>
</tr>
<tr>
<td height="20" align="center"><img src="../images/icons/arrow2.gif" width="12" height="12" /></td>
<td height="20" class="PADDING-LEFT-5">ประเภทการศึกษาดูงาน</a></td>
<td align="center"><?php
$sql = " SELECT * FROM formcaroffice WHERE Training_type='2' and Budget_year='$Budget_year' " ;
$result1 = mysql_query($sql);
$num1= mysql_num_rows($result1);
mysql_free_result($result1);
echo $num1;
?></td>
<td align="center"><?php
$sql = " SELECT COUNT(DateCar) AS num FROM formcaroffice WHERE Training_type='2' and Budget_year='$Budget_year' " ;
$result1 = mysql_query($sql);
$rs1 = $dbObj->fetchArray($result1);
// echo $num1;
$sql = " SELECT COUNT(DateCar) AS sum FROM formcaroffice WHERE Budget_year='$Budget_year' " ;
$result2 = mysql_query($sql);
$rs2 = $dbObj->fetchArray($result2);
$per2= ( $rs1['num'] * 100 ) / $rs2['sum'] ;
echo number_format($per2,2,'.','.');
?></td>
</tr>
<tr>
<td height="20" align="center"><img src="../images/icons/arrow2.gif" width="12" height="12" /></td>
<td height="20" class="PADDING-LEFT-5">ประเภทการประชุม</a></td>
<td align="center"><?php
$sql = " SELECT * FROM formcaroffice WHERE Training_type='3' and Budget_year='$Budget_year' " ;
$result1 = mysql_query($sql);
$num1= mysql_num_rows($result1);
mysql_free_result($result1);
echo $num1;
?></td>
<td align="center"><?php
$sql = " SELECT COUNT(DateCar) AS num FROM formcaroffice WHERE Training_type='3' and Budget_year='$Budget_year' " ;
$result1 = mysql_query($sql);
$rs1 = $dbObj->fetchArray($result1);
// echo $num1;
$sql = " SELECT COUNT(DateCar) AS sum FROM formcaroffice WHERE Budget_year='$Budget_year' " ;
$result2 = mysql_query($sql);
$rs2 = $dbObj->fetchArray($result2);
$per2= ( $rs1['num'] * 100 ) / $rs2['sum'] ;
echo number_format($per2,2,'.','.');
?></td>
</tr>
<tr>
<td height="21" align="center"><img src="../images/icons/arrow2.gif" width="12" height="12" /></td>
<td height="21" class="PADDING-LEFT-5">ประเภทการสัมนา</a></td>
<td align="center"><?php
$sql = " SELECT * FROM formcaroffice WHERE Training_type='4' and Budget_year='$Budget_year' " ;
$result1 = mysql_query($sql);
$num1= mysql_num_rows($result1);
mysql_free_result($result1);
echo $num1;
?></td>
<td align="center"><?php
$sql = " SELECT COUNT(DateCar) AS num FROM formcaroffice WHERE Training_type='4' and Budget_year='$Budget_year' " ;
$result1 = mysql_query($sql);
$rs1 = $dbObj->fetchArray($result1);
// echo $num1;
$sql = " SELECT COUNT(DateCar) AS sum FROM formcaroffice WHERE Budget_year='$Budget_year' " ;
$result2 = mysql_query($sql);
$rs2 = $dbObj->fetchArray($result2);
$per2= ( $rs1['num'] * 100 ) / $rs2['sum'] ;
echo number_format($per2,2,'.','.');
?></td>
</tr>
<tr>
<td height="20" align="center"><img src="../images/icons/arrow2.gif" width="12" height="12" /></td>
<td height="20" class="PADDING-LEFT-5">ประเภทการรับวิทยากร</a></td>
<td align="center"><?php
$sql = " SELECT * FROM formcaroffice WHERE Training_type='5' and Budget_year='$Budget_year' " ;
$result1 = mysql_query($sql);
$num1= mysql_num_rows($result1);
mysql_free_result($result1);
echo $num1;
?></td>
<td align="center"><?php
$sql = " SELECT COUNT(DateCar) AS num FROM formcaroffice WHERE Training_type='5' and Budget_year='$Budget_year' " ;
$result1 = mysql_query($sql);
$rs1 = $dbObj->fetchArray($result1);
// echo $num1;
$sql = " SELECT COUNT(DateCar) AS sum FROM formcaroffice WHERE Budget_year='$Budget_year' " ;
$result2 = mysql_query($sql);
$rs2 = $dbObj->fetchArray($result2);
$per2= ( $rs1['num'] * 100 ) / $rs2['sum'] ;
echo number_format($per2,2,'.','.');
?></td>
</tr>
<tr>
<td height="20" align="center"><img src="../images/icons/arrow2.gif" width="12" height="12" /></td>
<td height="20" class="PADDING-LEFT-5">ประเภทการนิเทศงาน</a></td>
<td align="center"><?php
$sql = " SELECT * FROM formcaroffice WHERE Training_type='6' and Budget_year='$Budget_year' " ;
$result1 = mysql_query($sql);
$num1= mysql_num_rows($result1);
mysql_free_result($result1);
echo $num1;
?></td>
<td align="center"><?php
$sql = " SELECT COUNT(DateCar) AS num FROM formcaroffice WHERE Training_type='6' and Budget_year='$Budget_year' " ;
$result1 = mysql_query($sql);
$rs1 = $dbObj->fetchArray($result1);
// echo $num1;
$sql = " SELECT COUNT(DateCar) AS sum FROM formcaroffice WHERE Budget_year='$Budget_year' " ;
$result2 = mysql_query($sql);
$rs2 = $dbObj->fetchArray($result2);
$per2= ( $rs1['num'] * 100 ) / $rs2['sum'] ;
echo number_format($per2,2,'.','.');
?></td>
</tr>
<tr>
<td width="3%" height="20" align="center"><img src="../images/icons/arrow2.gif" width="12" height="12" /></td>
<td width="62%" height="20" class="PADDING-LEFT-5">อื่นๆ</a></td>
<td width="17%" align="center"><?php
$sql = " SELECT * FROM formcaroffice WHERE Training_type='7' and Budget_year='$Budget_year' " ;
$result1 = mysql_query($sql);
$num1= mysql_num_rows($result1);
mysql_free_result($result1);
echo $num1;
?></td>
<td width="18%" align="center"><?php
$sql = " SELECT COUNT(DateCar) AS num FROM formcaroffice WHERE Training_type='7' and Budget_year='$Budget_year' " ;
$result1 = mysql_query($sql);
$rs1 = $dbObj->fetchArray($result1);
// echo $num1;
$sql = " SELECT COUNT(DateCar) AS sum FROM formcaroffice WHERE Budget_year='$Budget_year' " ;
$result2 = mysql_query($sql);
$rs2 = $dbObj->fetchArray($result2);
$per2= ( $rs1['num'] * 100 ) / $rs2['sum'] ;
echo number_format($per2,2,'.','.');
?></td>
</tr>
</table></td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td class="TEXT-DARK-BLUE10"> </td>
</tr>
<tr>
<td height="20" align="center"><img src="../images/icons/folder-open-doc-text.png" width="16" height="16" border="0" align="absmiddle" /></td>
<td class="TEXT-DARK-BLUE10">สรุปค่าน้ำมันของการใช้รถยนต์ แต่ละคัน ปีงบประมาณ
<?=$Budget_year ;?></td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td class="TEXT-DARK-BLUE10"><table width="99%" border="0" align="left" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF" style="background-color:#eeeeee; border:0px solid gray">
<tr bgcolor="<?=$bgColor;?>">
<td height="20" align="right" bgcolor="#FF9999"> </td>
<td align="center" bgcolor="#FF9999" class="PADDING-LEFT-5">ประเภทรถยนต์</td>
<td align="center" bgcolor="#FF9999" class="PADDING-LEFT-5">น้ำมัน <br />
(ลิตร)</td>
<td align="center" bgcolor="#FF9999" class="PADDING-LEFT-5"> กม.<br />ที่วิ่ง</td>
<td align="center" bgcolor="#FF9999" class="PADDING-LEFT-5">เงินสด<br />
(เติมน้ำมัน)</td>
<td align="center" bgcolor="#FF9999" class="PADDING-LEFT-5">บัตร<br />
(เติมน้ำมัน)</td>
<td align="center" bgcolor="#FF9999" class="PADDING-LEFT-5">จำนวนเงิน</td>
</tr>
<?php
$query = " SELECT * FROM $myTable2 WHERE Budget_year='$Budget_year' and CarmoId !='0' Group By CarmoId ";
$result5 = $dbObj->execQuery($query);
$numrows = $dbObj->_numrows;
$Budget_year = $rs->Budget_year;
$no = 1+($display-1)*$limit;
while( $rss = $dbObj->fetchArray($result5) ) {
$Budget_year = $rss['Budget_year'];
$bgColor = ( $bgColor == "#FFFFFF" ) ? "#F9FBFB" : "#FFFFFF";
?>
<tr bgcolor="<?=$bgColor;?>">
<td width="3%" height="20" align="right"><img src="../images/icons/linesub.gif" width="16" height="16" border="0" align="absmiddle" /></td>
<td width="50%" align="left" class="PADDING-LEFT-5"><?php
//$CarmoId = $rss['CarmoId'] ;
$sql11 = " Select Acc_name , Kind , CodeNo From $myTable4 Where CarmoId ='$rss[CarmoId]' ";
$result11 = mysql_query($sql11);
$rs11 = mysql_fetch_array($result11);
//echo "$rs11[Acc_name] " ;
echo "$rs11[Acc_name] $rs11[Kind] $rs11[CodeNo]";
?>
</a></td>
<td width="7%" align="center" class="PADDING-LEFT-5"><?php
$sql = " SELECT SUM(Num_Lish) AS sum FROM autocar_tb at , formcaroffice fc WHERE at.CarmoId='$rss[CarmoId]' and at.carId=fc.carId and fc.Budget_year='$Budget_year' " ;
$result1 = mysql_query($sql);
$rs1 = $dbObj->fetchArray($result1);
echo $rs1['sum'] ;
?></td>
<td width="8%" align="center" class="PADDING-LEFT-5"><?php
$sql = " SELECT SUM(Num_Mile) AS sum FROM autocar_tb at , formcaroffice fc WHERE at.CarmoId='$rss[CarmoId]' and at.carId=fc.carId and fc.Budget_year='$Budget_year' " ;
$result1 = mysql_query($sql);
$rs1 = $dbObj->fetchArray($result1);
echo $rs1['sum'] ;
?></td>
<td width="10%" align="center" class="PADDING-LEFT-5"><?php
$sql = " SELECT SUM(PriceOill) AS sum FROM autocar_tb at , formcaroffice fc WHERE at.CarmoId='$rss[CarmoId]' and at.carId=fc.carId and fc.Budget_year='$Budget_year' and at.Cadit='Dr' " ;
$result1 = mysql_query($sql);
$rs1 = $dbObj->fetchArray($result1);
echo $rs1['sum'] ;
?></td>
<td width="11%" align="center" class="PADDING-LEFT-5"><?php
$sql = " SELECT SUM(PriceOill) AS sum FROM autocar_tb at , formcaroffice fc WHERE at.CarmoId='$rss[CarmoId]' and at.carId=fc.carId and fc.Budget_year='$Budget_year' and at.Cadit='Cr' " ;
$result1 = mysql_query($sql);
$rs1 = $dbObj->fetchArray($result1);
echo $rs1['sum'] ;
?></td>
<td width="11%" align="center" class="PADDING-LEFT-5"><?php
$sql = " SELECT SUM(PriceOill) AS sum FROM autocar_tb at , formcaroffice fc WHERE at.CarmoId='$rss[CarmoId]' and at.carId=fc.carId and fc.Budget_year='$Budget_year' " ;
$result1 = mysql_query($sql);
$rs1 = $dbObj->fetchArray($result1);
echo $rs1['sum'] ;
?></td>
</tr>
<?php
//$no++;
} # while
?>
</table></td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td> </td>
</tr>
<tr>
<td height="20" align="center"><img src="../images/icons/folder-open-doc-text.png" width="16" height="16" border="0" align="absmiddle" /></td>
<td class="TEXT-DARK-BLUE10">สรุปค่าซ่อมบำรุงรักษารถยนต์ แต่ละคัน ปีงบประมาณ
<?=$Budget_year ;?></td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td class="TEXT-DARK-BLUE10"><table width="99%" border="0" align="left" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF" style="background-color:#eeeeee; border:0px solid gray">
<tr bgcolor="<?=$bgColor;?>">
<td height="20" align="right" bgcolor="#FF99FF"> </td>
<td align="center" bgcolor="#FF99FF" class="PADDING-LEFT-5">ประเภทรถยนต์</td>
<td align="center" bgcolor="#FF99FF" class="PADDING-LEFT-5"> ระยะ กม.<br />
ที่วิ่ง</td>
<td align="center" bgcolor="#FF99FF" class="PADDING-LEFT-5">จำนวนครั้ง<br /></td>
<td align="center" bgcolor="#FF99FF" class="PADDING-LEFT-5">จำนวนเงิน</td>
</tr>
<?php
$query = " SELECT * FROM $myTable2 WHERE Budget_year='$Budget_year' and CarmoId !='0' Group By CarmoId ";
$result5 = $dbObj->execQuery($query);
$numrows = $dbObj->_numrows;
$Budget_year = $rs->Budget_year;
$no = 1+($display-1)*$limit;
while( $rss = $dbObj->fetchArray($result5) ) {
$Budget_year = $rss['Budget_year'];
$bgColor = ( $bgColor == "#FFFFFF" ) ? "#F9FBFB" : "#FFFFFF";
?>
<tr bgcolor="<?=$bgColor;?>">
<td width="3%" height="20" align="right"><img src="../images/icons/linesub.gif" width="16" height="16" border="0" align="absmiddle" /></td>
<td width="58%" align="left" class="PADDING-LEFT-5"><?php
//$CarmoId = $rss['CarmoId'] ;
$sql11 = " Select Acc_name , Kind , CodeNo From $myTable4 Where CarmoId ='$rss[CarmoId]' ";
$result11 = mysql_query($sql11);
$rs11 = mysql_fetch_array($result11);
//echo "$rs11[Acc_name] " ;
echo "$rs11[Acc_name] $rs11[Kind] $rs11[CodeNo]";
?>
</a></td>
<td width="11%" align="center" class="PADDING-LEFT-5"><?php
$sql = " SELECT SUM(Num_Mile) AS sum FROM autocar_tb at , formcaroffice fc WHERE at.CarmoId='$rss[CarmoId]' and at.carId=fc.carId and fc.Budget_year='$Budget_year' " ;
$result1 = mysql_query($sql);
$rs1 = $dbObj->fetchArray($result1);
echo $rs1['sum'] ;
?></td>
<td width="13%" align="center" class="PADDING-LEFT-5"> </td>
<td width="15%" align="center" class="PADDING-LEFT-5"> </td>
</tr>
<?php
//$no++;
} # while
?>
</table></td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td class="TEXT-DARK-BLUE10"> </td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="4%" height="20" align="center"> </td>
<td width="96%" height="20"> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
</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);
?>
|