| Server IP : 104.21.80.248 / Your IP : 172.71.28.155 Web Server : Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30 System : Windows NT WIN-ECQAAA40806 6.2 build 9200 (Windows Server 2012 Standard Edition) i586 User : SYSTEM ( 0) PHP Version : 5.6.30 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : E:/Inetpub/www/myschool/debsirin/modules/tkk6/ |
Upload File : |
<SCRIPT LANGUAGE="JavaScript">
function printPage() {
if (window.print)
window.print()
else
alert("Sorry, your browser doesn't support this feature.");
}
</SCRIPT>
<link href="style_web.css" rel="stylesheet" type="text/css">
<div align="left">
<table cellspacing="0" cellpadding="0" width="1005" height=345 border="0">
<tr>
<td valign="top" width="100%" ><div align="center">
<table width="100%">
<tr>
<td align="left"width="350"></td>
<td align="center""width="400"><font color=red><b>สถิติการลาของบุคลากร </b></font></td>
<td align="right""width="300"><input type="button" name="Button" value=" พิมพ์เอกสาร " onclick="javascript:this.style.display='none';printPage();"> </td>
</tr>
</table>
<table cellspacing="0" cellpadding="0" width="98%" border="0">
<tbody>
<tr>
<td><table width="100%">
<tr>
<td align="center">
<table width="850" align="center" cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="center">
<!-- แสดงผลรายการสมาชิกเว็บ -->
<?
//////////////////////////////////////////// แสดงรายชื่อสมาชิกเว็บ
if($_GET[op] == ""){
$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
$limit = 1000 ;
$SUMPAGE = $db->num_rows(TB_user,"id","");
$page=$_GET[page];
if (empty($page)){
$page=1;
}
$rt = $SUMPAGE%$limit ;
$totalpage = ($rt!=0) ? floor($SUMPAGE/$limit)+1 : floor($SUMPAGE/$limit);
$goto = ($page-1)*$limit ;
?>
<form action="?name=user&file=user_cp&op=user_del&action=multidel" method="post" name="myform" id="myform">
<table width="1000" cellspacing="2" cellpadding="1" >
<tr bgcolor="#99ccff" height="25">
<td rowspan="2"><div align="center"><font color="#000000"><b></b></font></div>
<div align="center"><font color="#000000"><b>ที่</b></font></div></td>
<td rowspan="2"><div align="center"><font color="#000000"><b></b></font></div>
<div align="center"><font color="#000000"><b>ชื่อ - นามสกุล</b></font></div></td>
<td rowspan="2"><div align="center"><font color="#000000"><b></b></font></div>
<div align="center"><font color="#000000"><b>ตำแหน่ง</b></font></div></td>
<td colspan="2"><div align="center"><font color="#000000"><b></b></font></div>
<div align="center"><font color="#000000"><b>ลาป่วย</b></font></div></td>
<td colspan="2"><div align="center"><font color="#000000"><b></b></font></div>
<div align="center"><font color="#000000"><b>ลากิจ</b></font></div></td>
<td colspan="2"><div align="center"><font color="#000000"><b></b></font></div>
<div align="center"><font color="#000000"><b>ลาคลอด</b></font></div></td>
<td colspan="3"><div align="center"><font color="#000000"><b></b></font></div>
<div align="center"><font color="#000000"><b>ลาพักผ่อน</b></font></div></td>
</tr>
<tr bgcolor="#99ccff" height="25">
<td><div align="center"><font color="#000000"><b>ครั้ง</b></font></div></td>
<td><div align="center"><font color="#000000"><b>วัน</b></font></div></td>
<td><div align="center"><font color="#000000"><b>ครั้ง</b></font></div></td>
<td><div align="center"><font color="#000000"><b>วัน</b></font></div></td>
<td><div align="center"><font color="#000000"><b>ครั้ง</b></font></div></td>
<td><div align="center"><font color="#000000"><b>วัน</b></font></div></td>
<td><div align="center"><font color="#000000"><b>ครั้ง</b></font></div></td>
<td><div align="center"><font color="#000000"><b>วัน</b></font></div></td>
<td><div align="center"><font color="#000000"><b>คงเหลือ</b></font></div></td>
<?
$res[user] = $db->select_query("SELECT * FROM ".TB_user." WHERE level>1 and status='1' ORDER BY posit DESC LIMIT $goto, $limit ");
$i=1;
while($arr[user] = $db->fetch($res[user])){
$res[groups] = $db->select_query("SELECT * FROM ".TB_ADMIN_GROUP." WHERE id='".$arr[user][level]."' ");
$arr[groups] = $db->fetch($res[groups]);
$res[working] = $db->select_query("SELECT * FROM ".TB_POSITION_CAT." WHERE category_name='".$arr[user][posit]."' ");
$arr[working] = $db->fetch($res[working]);
//ดึงค่า
$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
$res[yearla] = $db->select_query("SELECT * FROM ".TB_YEARLA_CAT." ORDER BY id ");
$arr[yearla] = $db->fetch($res[yearla]);
?>
<?php
// Make สถิติลาป่วย
$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
$query = "SELECT la SUM(la) FROM web_tkk6 WHERE cat='".$arr[user][id]."'and yearla='".$arr[yearla][name]."' GROUP BY id";
$sql1="select sum(la='ป่วย') as tt1 from web_tkk6 where cat='".$arr[user][id]."' and yearla='".$arr[yearla][name]."' and comment1='อนุญาต' and (date1 LIKE '____-04-__' OR date1 LIKE '____-05-__' OR date1 LIKE '____-06-__' OR date1 LIKE '____-07-__' OR date1 LIKE '____-08-__' OR date1 LIKE '____-09-__' ) ";
$dbquery1 = mysql_db_query($dbname, $sql1);
$result1 = mysql_fetch_array($dbquery1);
$poi=$result1[tt1];
$query = "SELECT numpoi SUM(numpoi) FROM web_tkk6 WHERE cat='".$arr[user][id]."'and yearla='".$arr[yearla][name]."' GROUP BY id";
$sql2="select sum(numpoi) as tt2 from web_tkk6 where cat='".$arr[user][id]."' and yearla='".$arr[yearla][name]."' and la='ป่วย' and comment1='อนุญาต' and (date1 LIKE '____-04-__' OR date1 LIKE '____-05-__' OR date1 LIKE '____-06-__' OR date1 LIKE '____-07-__' OR date1 LIKE '____-08-__' OR date1 LIKE '____-09-__' ) ";
$dbquery2 = mysql_db_query($dbname, $sql2);
$result2 = mysql_fetch_array($dbquery2);
$sumpoi=$result2[tt2];
?>
<?php
// Make สถิติลากิจ
$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
$query = "SELECT la SUM(la) FROM web_tkk6 WHERE cat='".$arr[user][id]."'and yearla='".$arr[yearla][name]."' GROUP BY id";
$sql3="select sum(la='กิจส่วนตัว') as tt3 from web_tkk6 where cat='".$arr[user][id]."' and numpoi>0 and yearla='".$arr[yearla][name]."' and comment1='อนุญาต' and (date1 LIKE '____-04-__' OR date1 LIKE '____-05-__' OR date1 LIKE '____-06-__' OR date1 LIKE '____-07-__' OR date1 LIKE '____-08-__' OR date1 LIKE '____-09-__' ) ";
$dbquery3 = mysql_db_query($dbname, $sql3);
$result3 = mysql_fetch_array($dbquery3);
$kit=$result3[tt3];
$query = "SELECT numpoi SUM(numpoi) FROM web_tkk6 WHERE cat='".$arr[user][id]."'and yearla='".$arr[yearla][name]."' GROUP BY id";
$sql4="select sum(numpoi) as tt4 from web_tkk6 where cat='".$arr[user][id]."' and yearla='".$arr[yearla][name]."' and comment1='อนุญาต' and la='กิจส่วนตัว' and (date1 LIKE '____-04-__' OR date1 LIKE '____-05-__' OR date1 LIKE '____-06-__' OR date1 LIKE '____-07-__' OR date1 LIKE '____-08-__' OR date1 LIKE '____-09-__' ) ";
$dbquery4 = mysql_db_query($dbname, $sql4);
$result4= mysql_fetch_array($dbquery4);
$sumkit=$result4[tt4];
?>
<?php
// Make สถิติลาคลอด
$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
$query = "SELECT la SUM(la) FROM web_tkk6 WHERE cat='".$arr[user][id]."' and yearla='".$arr[yearla][name]."' GROUP BY id";
$sql5="select sum(la='คลอดบุตร') as tt5 from web_tkk6 where cat='".$arr[user][id]."' and yearla='".$arr[yearla][name]."' and comment1='อนุญาต' and (date1 LIKE '____-04-__' OR date1 LIKE '____-05-__' OR date1 LIKE '____-06-__' OR date1 LIKE '____-07-__' OR date1 LIKE '____-08-__' OR date1 LIKE '____-09-__' ) ";
$dbquery5 = mysql_db_query($dbname, $sql5);
$result5 = mysql_fetch_array($dbquery5);
$klod=$result5[tt5];
$query = "SELECT numpoi SUM(numpoi) FROM web_tkk6 WHERE cat='".$arr[user][id]."'and yearla='".$arr[yearla][name]."' GROUP BY id";
$sql6="select sum(numpoi) as tt6 from web_tkk6 where cat='".$arr[user][id]."' and yearla='".$arr[yearla][name]."' and la='คลอดบุตร' and comment1='อนุญาต' and (date1 LIKE '____-04-__' OR date1 LIKE '____-05-__' OR date1 LIKE '____-06-__' OR date1 LIKE '____-07-__' OR date1 LIKE '____-08-__' OR date1 LIKE '____-09-__' ) ";
$dbquery6 = mysql_db_query($dbname, $sql6);
$result6= mysql_fetch_array($dbquery6);
$sumklod=$result6[tt6];
?>
<?php
// Make สถิติลาคลอด
$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
$query = "SELECT la SUM(la) FROM web_tkk6 WHERE cat='".$arr[user][id]."' and yearla='".$arr[yearla][name]."' GROUP BY id";
$sql7="select sum(la='พักผ่อน') as tt7 from web_tkk6 where cat='".$arr[user][id]."' and numpoi>0 and yearla='".$arr[yearla][name]."' and comment1='อนุญาต' and (date1 LIKE '____-04-__' OR date1 LIKE '____-05-__' OR date1 LIKE '____-06-__' OR date1 LIKE '____-07-__' OR date1 LIKE '____-08-__' OR date1 LIKE '____-09-__' ) ";
$dbquery7 = mysql_db_query($dbname, $sql7);
$result7 = mysql_fetch_array($dbquery7);
$rest=$result7[tt7];
$query = "SELECT numpoi SUM(numpoi) FROM web_tkk6 WHERE cat='".$arr[user][id]."'and yearla='".$arr[yearla][name]."' GROUP BY id";
$sql8="select sum(numpoi) as tt8 from web_tkk6 where cat='".$arr[user][id]."' and yearla='".$arr[yearla][name]."' and la='พักผ่อน' and (date1 LIKE '____-10-__' OR date1 LIKE '____-11-__' OR date1 LIKE '____-12-__' OR date1 LIKE '____-01-__' OR date1 LIKE '____-02-__' OR date1 LIKE '____-03-__' )";
$dbquery8 = mysql_db_query($dbname, $sql8);
$result8= mysql_fetch_array($dbquery8);
$sumrest=$result8[tt8];
$query = "SELECT numpoi SUM(numpoi) FROM web_tkk6 WHERE cat='".$arr[user][id]."'and yearla='".$arr[yearla][name]."' GROUP BY id";
$sql9="select sum(numpoi) as tt9 from web_tkk6 where cat='".$arr[user][id]."' and yearla='".$arr[yearla][name]."' and la='พักผ่อน' and comment1='อนุญาต' and (date1 LIKE '____-04-__' OR date1 LIKE '____-05-__' OR date1 LIKE '____-06-__' OR date1 LIKE '____-07-__' OR date1 LIKE '____-08-__' OR date1 LIKE '____-09-__' ) ";
$dbquery9 = mysql_db_query($dbname, $sql9);
$result9= mysql_fetch_array($dbquery9);
$sumrest1=$result9[tt9];
?>
<tr>
<td width="20" align="center"><? echo"".$i?></td>
<td width="250" > <A HREF="?name=tkk6&file=checkperson&op=tkk6_read&cat=<?=$arr[user][id];?> "><? echo $arr[user][category_name];?></a></td>
<td width="270" ><?=$arr[working][category_name];?></td>
<?
$res[category] = $db->select_query("SELECT * FROM ".TB_TKK6_CAT." WHERE cat='".$arr[user][id]."' and yearla='".$arr[yearla][name]."' ");
$arr[category] = $db->fetch($res[category]);
?>
<td width="50" align="center"><font color=red><? echo number_format($poi),''; ?></font></td>
<td width="50" align="center"><font color=blue><?$a=$sumpoi; echo "" .round($a,1);?></font></td>
<td width="50" align="center"><font color=red><? echo number_format($kit),''; ?></font></td>
<td width="50" align="center"><font color=blue><?$a=$sumkit; echo "" .round($a,1);?></font></td>
<td width="50" align="center"><font color=red><? echo number_format($klod),''; ?></font></td>
<td width="50" align="center"><font color=blue><?$a=$sumklod; echo "" .round($a,1);?></font></td>
<td width="50" align="center"><font color=red><? echo number_format($rest),''; ?></font></td>
<td width="50" align="center"><font color=blue><?$a=$sumrest1; echo "" .round($a,1);?></font></td>
<td width="50" align="center"><font color=red><?$a=(($arr[category][cumulative]+$arr[category][claim])-($sumrest+$sumrest1));echo "" .round($a,1)?></td>
</tr>
<tr bgcolor=FFFFFF>
<td colspan="9" height="1" class="dotline">
</td>
</tr>
<?
$i++;
}
?>
</table>
</form>
<BR>
<div align="left">
<?
SplitPage($page,$totalpage,"?name=tkk6&file=userkm2");
echo $ShowSumPages ;
echo "<BR>";
echo $ShowPages ;
echo "<BR><BR>";
//$res[groupstext] = $db->select_query("SELECT * FROM ".TB_ADMIN_GROUP." ORDER BY id ");
//while ($arr[groupstext] = $db->fetch($res[groupstext]))
// {
//echo "<LI><B>".$arr[groupstext][name]." : </B>".$arr[groupstext][description]."</LI>";
// }
//$db->closedb ();
}
?>
</div>
<br />
</td>
</tr>
</table>
</td>
</tr>
</table>
<br /></td>
</tr>
</table></td>
</tr>
</tbody>
</table>