Viewing file: ExcelSumPesonal.php (11.65 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 */
header('Content-type: application/xls');
header('Content-Disposition: attachment; filename="testing.xls"');
require_once( "../configuration.php" );
require_once( $_Config_absolute_path . "/includes/framework.php" );
require_once( "../include/Function.php" );
/** Create Database Object */
$dbObj = new DBConn;
$myTable = "personal_tb";
//=== salary_repot_tb
$query = " SELECT * FROM $myTable ORDER BY Teacher_name ASC ";
$result = $dbObj->execQuery($query);
//$rs = $dbObj->fetchArray($result);
$total = $dbObj->_numrows;
} # 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>ข้อมูลแผนดำเนินงานและรายงาน : รายงานอื่นๆ - <?=urldecode($topic);?></title>
<style type="text/css">
<!--
.style1 {font-weight: bold}
.style2 {font-weight: bold}
-->
</style>
</head>
<body topmargin="0" rightmargin="0" bottommargin="0" leftmargin="0">
<table width="59%" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td width="4%" height="20" align="center"> </td>
<td class="TEXT-DARK-BLUE10"><strong>จำนวนระดับการศึกษาของบุคลากรทุกสายงานทั้งหมด</strong></td>
<td align="center" class="TEXT-DARK-BLUE10">จำนวน</td>
<td align="center" class="TEXT-DARK-BLUE10">ร้อยละ</td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td colspan="3"><table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="3%" height="20" align="center"> </td>
<td width="72%" height="20">ปริญญาตรี</a></td>
<td width="13%" align="center"><?php
$sql = " SELECT COUNT(Degree_code) AS num1 FROM personal_tb WHERE StatusId='1' AND Degree_code=1 ";
$result1 = $dbObj->execQuery($sql);
$rs1 = $dbObj->fetchArray($result1);
$dbObj->freeresult($result1);
echo $rs1['num1'];
?></td>
<td width="12%" align="center"><?php
$per1 = ( $rs1['num1'] * 100 ) / $total;
echo number_format($per1,2,'.','.');
?></td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td height="20">ปริญญาโท</a></td>
<td height="20" align="center"><?php
$sql = " SELECT COUNT(Degree_code) AS num2 FROM personal_tb WHERE StatusId='1' AND Degree_code=2 ";
$result2 = $dbObj->execQuery($sql);
$rs2 = $dbObj->fetchArray($result2);
$dbObj->freeresult($result2);
echo $rs2['num2'];
?></td>
<td height="20" align="center"><?php
$per2 = ( $rs2['num2'] * 100 ) / $total;
echo number_format($per2,2,'.','.');
?></td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td height="20">ปริญญาเอก</a></td>
<td height="20" align="center"><?php
$sql = " SELECT COUNT(Degree_code) AS num3 FROM personal_tb WHERE StatusId='1' AND Degree_code=3 ";
$result3 = $dbObj->execQuery($sql);
$rs3 = $dbObj->fetchArray($result3);
$dbObj->freeresult($result3);
echo $rs3['num3'];
?></td>
<td height="20" align="center"><?php
$per3 = ( $rs3['num3'] * 100 ) / $total;
echo number_format($per3,2,'.','.');
?></td>
</tr>
</table></td>
</tr>
<tr>
<td height="10"></td>
<td height="10"></td>
<td height="10"></td>
<td height="10" align="center"> </td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td class="TEXT-DARK-BLUE10"><strong>จำนวนบุคลากรตามประเภทสายงาน</strong></td>
<td align="center" class="TEXT-DARK-BLUE10">จำนวน</td>
<td align="center" class="TEXT-DARK-BLUE10">ร้อยละ</td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td colspan="3"><table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="3%" height="20" align="center"> </td>
<td width="72%" height="20">ทันตแพทย์</a></td>
<td width="13%" align="center"><?php
$sql = " SELECT COUNT(Teacher_type) AS num4 FROM personal_tb WHERE StatusId='1' AND Teacher_type=1 ";
$result4 = $dbObj->execQuery($sql);
$rs4 = $dbObj->fetchArray($result4);
$dbObj->freeresult($result4);
echo $rs4['num4'];
?></td>
<td width="12%" align="center"><?php
$per4 = ( $rs4['num4'] * 100 ) / $total;
echo number_format($per4,2,'.','.');
?></td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td height="20">เภสัชกร</a></td>
<td height="20" align="center"><?php
$sql = " SELECT COUNT(Teacher_type) AS num5 FROM personal_tb WHERE StatusId='1' AND Teacher_type=4 ";
$result5 = $dbObj->execQuery($sql);
$rs5 = $dbObj->fetchArray($result5);
$dbObj->freeresult($result5);
echo $rs5['num5'];
?></td>
<td height="20" align="center"><?php
$per5 = ( $rs5['num5'] * 100 ) / $total;
echo number_format($per5,2,'.','.');
?></td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td height="20">วิทยาจารย์</a></td>
<td height="20" align="center"><?php
$sql = " SELECT COUNT(Teacher_type) AS num6 FROM personal_tb WHERE StatusId='1' AND Teacher_type=2 ";
$result6 = $dbObj->execQuery($sql);
$rs6 = $dbObj->fetchArray($result6);
$dbObj->freeresult($result6);
echo $rs6['num6'];
?></td>
<td height="20" align="center"><?php
$per6 = ( $rs6['num6'] * 100 ) / $total;
echo number_format($per6,2,'.','.');
?></td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td height="20">พยาบาลวิชาชีพ</a></td>
<td height="20" align="center"><?php
$sql = " SELECT COUNT(Teacher_type) AS num7 FROM personal_tb WHERE StatusId='1' AND Teacher_type=5 ";
$result7 = $dbObj->execQuery($sql);
$rs7 = $dbObj->fetchArray($result7);
$dbObj->freeresult($result7);
echo $rs7['num7'];
?></td>
<td height="20" align="center"><?php
$per7 = ( $rs7['num7'] * 100 ) / $total;
echo number_format($per7,2,'.','.');
?></td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td height="20">สายสนับสนุน</a></td>
<td height="20" align="center"><?php
$sql = " SELECT COUNT(Teacher_type) AS num8 FROM personal_tb WHERE StatusId='1' AND Teacher_type=6 ";
$result8 = $dbObj->execQuery($sql);
$rs8 = $dbObj->fetchArray($result8);
$dbObj->freeresult($result8);
echo $rs8['num8'];
?></td>
<td height="20" align="center"><?php
$per8 = ( $rs8['num8'] * 100 ) / $total;
echo number_format($per8,2,'.','.');
?></td>
</tr>
</table></td>
</tr>
<tr>
<td height="10"></td>
<td height="10"></td>
<td height="10"></td>
<td height="10" align="center"> </td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td width="72%" class="TEXT-DARK-BLUE10"><strong>จำนวนบุคลากรตามสถานะ</strong></td>
<td width="12%" align="center" class="TEXT-DARK-BLUE10">จำนวน</td>
<td width="12%" align="center" class="TEXT-DARK-BLUE10">ร้อยละ</td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td colspan="3"><table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="3%" height="20" align="center"> </td>
<td width="72%" height="20">ข้าราชการ</a></td>
<td width="13%" align="center"><?php
$sql = " SELECT COUNT(Person_type) AS num9 FROM personal_tb WHERE StatusId='1' AND Person_type=1 ";
$result9 = $dbObj->execQuery($sql);
$rs9 = $dbObj->fetchArray($result9);
$dbObj->freeresult($result9);
echo $rs9['num9'];
?></td>
<td width="12%" align="center"><?php
$per9 = ( $rs9['num9'] * 100 ) / $total;
echo number_format($per9,2,'.','.');
?></td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td height="20">ลูกจ้างประจำ</a></td>
<td height="20" align="center"><?php
$sql = " SELECT COUNT(Person_type) AS num10 FROM personal_tb WHERE StatusId='1' AND Person_type=3 ";
$result10 = $dbObj->execQuery($sql);
$rs10 = $dbObj->fetchArray($result10);
$dbObj->freeresult($result10);
echo $rs10['num10'];
?></td>
<td height="20" align="center"><?php
$per10 = ( $rs10['num10'] * 100 ) / $total;
echo number_format($per10,2,'.','.');
?></td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td height="20">ลูกจ้างชั่วคราว</a></td>
<td height="20" align="center"><?php
$sql = " SELECT COUNT(Person_type) AS num11 FROM personal_tb WHERE StatusId='1' AND Person_type=4 ";
$result11 = $dbObj->execQuery($sql);
$rs11 = $dbObj->fetchArray($result11);
$dbObj->freeresult($result11);
echo $rs11['num11'];
?></td>
<td height="20" align="center"><?php
$per11 = ( $rs11['num11'] * 100 ) / $total;
echo number_format($per11,2,'.','.');
?></td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td height="20">ลูกจ้างชั่วคราว ( เหมาจ่าย)</a></td>
<td height="20" align="center"><?php
$sql = " SELECT COUNT(Person_type) AS num12 FROM personal_tb WHERE StatusId='1' AND Person_type=5 ";
$result12 = $dbObj->execQuery($sql);
$rs12 = $dbObj->fetchArray($result12);
$dbObj->freeresult($result12);
echo $rs12['num12'];
?></td>
<td height="20" align="center"><?php
$per12 = ( $rs12['num12'] * 100 ) / $total;
echo number_format($per12,2,'.','.');
?></td>
</tr>
</table></td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td colspan="3" class="TEXT-DARK-BLUE10"> </td>
</tr>
<tr>
<td height="20" align="center"> </td>
<td align="right" class="TEXT-DARK-BLUE10"><strong>รวมจำนวนบุคลากรทั้งหมด</strong></td>
<td colspan="2" align="left" class="TEXT-DARK-BLUE10 PADDING-LEFT-30"><strong> <span class="TEXT-RED10">
<?php
$sql = " SELECT * FROM personal_tb WHERE StatusId='1' ";
$result99 = $dbObj->execQuery($sql);
$num99 = $dbObj->_numrows;
$dbObj->freeresult($result99);
echo $num99;
?>
</span> คน</strong></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<?php
/** Free Resource */
//$dbObj->freeresult($result);
/** Close the Database */
$dbObj->disconn();
/** Unset Class */
unset($dbObj);
?>
|