Viewing file: ExcelMonnyList.php (42.72 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="Report.xls"');
require_once( "../configuration.php" );
require_once( $_Config_absolute_path . "/includes/framework.php" );
require_once("../include/Function.php");
/** Create Database Object */
$dbObj = new DBConn;
/** Config Table for This Page */
$myTable = "salary_repot_tb";
$myTableFK = "Start_year , Start_mont";
/** Paging */
$page = $_GET['page'];
if( $page == "" ) { $page = 1; }
/** จำนวนข้อมูล ต่อ 1 หน้า */
$perpage = $_REQUEST['perpage'];
if( $perpage == "" ) { $perpage = 500; }
/** Searching */
$keyword = $_REQUEST['keyword'];
} # 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>MIS -- Administrator</title>
</head>
<body topmargin="0" rightmargin="0" bottommargin="0" leftmargin="0">
<table width="1241" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1241" height="440" align="center" valign="top" style="padding:10px 0px 5px 10px">
<?php
/** Config Paging */
if( $perpage == "" ) { $limit = $_Config_limit; }
else { $limit = $perpage; }
$scroll = $_Config_scroll;
/** ตั้งค่า Default สำหรับการทำ Order By */
if( $OrderBy == "" ) { $OrderBy = $myTableFK; }
if( !isset($_GET['ASCDESC']) ) { $ASCDESC = "ASC"; }
if( $_GET['ASCDESC'] == "DESC" ) { $ASCDESC = "ASC"; }
elseif( $_GET['ASCDESC'] == "ASC" ) { $ASCDESC = "DESC"; }
/** Query เพื่อหา Numrows ก่อน */
if( $keyword != "" ) {
$query = "SELECT * FROM $myTable WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
}
else {
$query = "SELECT * FROM $myTable WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
}
$result = $dbObj->execQuery($query);
$numrows = $dbObj->_numrows;
/** Paging */
$display = ( !isset ($_GET['page']) ) ? 1 : $_GET['page'];
$start = ( ($display * $limit) - $limit );
/** Paging */
//### Search
if( $keyword != "" ) {
if( isset($_GET['OrderBy']) ) {
$query = "SELECT * FROM $myTable WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
}
elseif( !isset($_GET['OrderBy']) ) {
$query = "SELECT * FROM $myTable WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
}
}
else {
if( isset($_GET['OrderBy']) ) {
$query = "SELECT * FROM $myTable WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
}
elseif( !isset($_GET['OrderBy']) ) {
$query = "SELECT * FROM $myTable WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
}
}
$query .= " LIMIT $start, $limit ";
//echo $query;
$result = $dbObj->execQuery($query);
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="2"></td>
</tr>
</table>
<table width="99%" border="0" align="left" cellpadding="0" cellspacing="0">
<form id="myForm" name="myForm" method="post" action="<?=$PHP_SELF;?>?Start_year=<?=$Start_year;?>&Start_mont=<?=$Start_mont;?>?page=<?=$page;?>">
<tr>
<td width="100%" height="105" colspan="2" align="center" valign="top"><span class="BORDER-LEFT">เดือน
<?php
//$monthCode = $row['Start_mont'];
$sql = " SELECT * FROM month_tb WHERE monthCode='$Start_mont' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rss = mysql_fetch_array($result1);
echo "$rss[month]";
?>
</span>
<?php if( $numrows > 0 ) { ?>
<table width="1977" border="0" align="center" cellpadding="0" cellspacing="2" class="style1">
<tr bgcolor="#F8F8F8">
<td width="47" height="23" align="center">No</td>
<td width="285" align="center">ชื่อ<span class="BORDER-LEFT">เงินเดือน</span><span class="BORDER-LEFT">เงินเดือน</span></td>
<td width="135" align="center" class="BORDER-LEFT"> เงินเดือน </a></span></td>
<td width="62" align="center" class="BORDER-LEFT"><span class="PADDING-LEFT-5 BORDER-TOP">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='1' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs1 = mysql_fetch_array($result1);
echo "$rs1[Detail]";
?>
</span></td>
<td width="60" align="center" class="BORDER-LEFT"><span class="PADDING-LEFT-5 BORDER-TOP">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='2' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs2 = mysql_fetch_array($result1);
echo "$rs2[Detail]";
?>
</span></td>
<td width="47" align="center" class="BORDER-LEFT"><span class="PADDING-LEFT-5 BORDER-TOP">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='3' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs3 = mysql_fetch_array($result1);
echo "$rs3[Detail]";
?>
</span></td>
<td width="54" align="center" class="BORDER-LEFT"><span class="PADDING-LEFT-5 BORDER-TOP">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='4' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs4 = mysql_fetch_array($result1);
echo "$rs4[Detail]";
?>
</span></td>
<td width="52" align="center" class="BORDER-LEFT"><span class="PADDING-LEFT-5 BORDER-TOP">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='5' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs5 = mysql_fetch_array($result1);
echo "$rs5[Detail]";
?>
</span></td>
<td width="53" align="center" class="BORDER-LEFT"><span class="PADDING-LEFT-5 BORDER-TOP">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='6' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs6 = mysql_fetch_array($result1);
echo "$rs6[Detail]";
?>
</span></td>
<td width="62" align="center" class="BORDER-LEFT"><span class="PADDING-LEFT-5 BORDER-TOP">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='7' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs7 = mysql_fetch_array($result1);
echo "$rs7[Detail]";
?>
</span></td>
<td width="48" align="center" class="BORDER-LEFT"><span class="PADDING-LEFT-5 BORDER-TOP">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='8' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs8 = mysql_fetch_array($result1);
echo "$rs8[Detail]";
?>
</span></td>
<td width="56" align="center" class="BORDER-LEFT"><span class="PADDING-LEFT-5 BORDER-TOP">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='9' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs9 = mysql_fetch_array($result1);
echo "$rs9[Detail]";
?>
</span></td>
<td width="44" align="center" class="BORDER-LEFT"><span class="PADDING-LEFT-5 BORDER-TOP">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='10' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs10 = mysql_fetch_array($result1);
echo "$rs10[Detail]";
?>
</span></td>
<td width="79" align="center" class="BORDER-LEFT">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='11' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs11 = mysql_fetch_array($result1);
echo "$rs11[Detail]";
?>
</td>
<td width="41" align="center" class="BORDER-LEFT">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='12' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs11 = mysql_fetch_array($result1);
echo "$rs11[Detail]";
?>
</td>
<td width="43" align="center" class="BORDER-LEFT">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='13' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs11 = mysql_fetch_array($result1);
echo "$rs11[Detail]";
?>
</td>
<td width="40" align="center" class="BORDER-LEFT">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='14' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs11 = mysql_fetch_array($result1);
echo "$rs11[Detail]";
?>
</td>
<td width="34" align="center" class="BORDER-LEFT">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='15' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs11 = mysql_fetch_array($result1);
echo "$rs11[Detail]";
?>
</td>
<td width="62" align="center" class="BORDER-LEFT">รวมรายรับ</td>
<td width="26" align="center" class="BORDER-LEFT">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='16' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs11 = mysql_fetch_array($result1);
echo "$rs11[Detail]";
?>
</td>
<td width="27" align="center" class="BORDER-LEFT">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='17' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs11 = mysql_fetch_array($result1);
echo "$rs11[Detail]";
?>
</td>
<td width="26" align="center" class="BORDER-LEFT">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='18' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs11 = mysql_fetch_array($result1);
echo "$rs11[Detail]";
?>
</td>
<td width="26" align="center" class="BORDER-LEFT">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='19' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs11 = mysql_fetch_array($result1);
echo "$rs11[Detail]";
?>
</td>
<td width="35" align="center" class="BORDER-LEFT">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='20' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs11 = mysql_fetch_array($result1);
echo "$rs11[Detail]";
?>
</td>
<td width="26" align="center" class="BORDER-LEFT">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='21' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs11 = mysql_fetch_array($result1);
echo "$rs11[Detail]";
?>
</td>
<td width="31" align="center" class="BORDER-LEFT">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='22' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs11 = mysql_fetch_array($result1);
echo "$rs11[Detail]";
?>
</td>
<td width="34" align="center" class="BORDER-LEFT">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='23' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs11 = mysql_fetch_array($result1);
echo "$rs11[Detail]";
?></td>
<td width="36" align="center" class="BORDER-LEFT"><span class="PADDING-LEFT-5 BORDER-TOP">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='24' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs11 = mysql_fetch_array($result1);
echo "$rs11[Detail]";
?>
</span></td>
<td width="35" align="center" class="BORDER-LEFT"><span class="PADDING-LEFT-5 BORDER-TOP">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='25' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs11 = mysql_fetch_array($result1);
echo "$rs11[Detail]";
?>
</span></td>
<td width="33" align="center" class="BORDER-LEFT"><span class="PADDING-LEFT-5 BORDER-TOP">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='26' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs11 = mysql_fetch_array($result1);
echo "$rs11[Detail]";
?>
</span></td>
<td width="26" align="center" class="BORDER-LEFT"><span class="PADDING-LEFT-5 BORDER-TOP">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='27' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs11 = mysql_fetch_array($result1);
echo "$rs11[Detail]";
?>
</span></td>
<td width="26" align="center" class="BORDER-LEFT"><span class="PADDING-LEFT-5 BORDER-TOP">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='28' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs11 = mysql_fetch_array($result1);
echo "$rs11[Detail]";
?>
</span></td>
<td width="26" align="center" class="BORDER-LEFT"><span class="PADDING-LEFT-5 BORDER-TOP">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='29' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs11 = mysql_fetch_array($result1);
echo "$rs11[Detail]";
?>
</span></td>
<td width="26" align="center" class="BORDER-LEFT"><span class="PADDING-LEFT-5 BORDER-TOP">
<?php
$sql = "Select * From salary_type_tb Where SalaryId='30' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs11 = mysql_fetch_array($result1);
echo "$rs11[Detail]";
?>
</span></td>
<td width="70" align="center" class="BORDER-LEFT">รวมรายจ่าย</td>
<td width="90" align="center" class="BORDER-LEFT">คงเหลือเงินสุทธิ</td>
</tr>
<?php
//$no = 1+($display-1)*$limit;
$i = 1;
while($row = $dbObj->fetchArray($result)){
$bgColor = ( $bgColor == "#FFFFFF" ) ? "#F9FBFB" : "#FFFFFF";
if( $keyword != "" ) {
$url = eregi_replace( $keyword, "<font color=red>\\0</font>", $rs->url );
$description = eregi_replace( $keyword, "<font color=red>\\0</font>", $rs->description );
}
else {
$url = $rs->url;
$description = $rs->description;
}
?>
<tr bgcolor="<?=$bgColor;?>" onmouseover="this.style.backgroundColor='#F5F9F9'" onmouseout="this.style.backgroundColor=''">
<td height="23" align="center" class="BORDER-TOP"><?echo $i?></td>
<td width="50" align="left" class="PADDING-LEFT-5 BORDER-TOP" ><?php
$Teacher_code = $row["Teacher_code"];
$sql = "Select * From personal_tb Where Teacher_code='$Teacher_code' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rss = mysql_fetch_array($result1);
echo "$rss[First_name] $rss[Teacher_name] $rss[Teacher_lastname]";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Salary_1'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_1'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_2'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_3'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_4'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_5'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_6'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_7'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_8'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_9'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_10'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_11'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_12'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_13'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_14'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_15'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_salary'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_16'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_17'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_18'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_19'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_20'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_21'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_22'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_23'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_24'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_25'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_26'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_27'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_28'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_29'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_30'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_to'],2,'.',','); ?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><? echo number_format($row['Costt_total'],2,'.',','); ?></td>
</tr>
<?php
$i++;
} # while
$dbObj->freeresult($result);
?>
<tr bgcolor="<?=$bgColor;?>" onmouseover="this.style.backgroundColor='#F5F9F9'" onmouseout="this.style.backgroundColor=''">
<td height="23" colspan="2" align="center" class="BORDER-TOP">รวมเงิน</td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px">
<?php
//### SUM Sum1
$query6 = " SELECT Salary_1 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result6 = $dbObj->execQuery($query6);
//echo $query6;
while( $rs6 = $dbObj->fetchArray($result6) ) {
$Sum += $rs6['Salary_1'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rs6);
echo "<strong>". number_format($Sum,2,'.',',') ."</strong>";
?>
</td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px">
<?php
$query6 = " SELECT Costt_1 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result6 = $dbObj->execQuery($query6);
//echo $query6;
while( $rs6 = $dbObj->fetchArray($result6) ) {
$Sum1 += $rs6['Costt_1'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rs6);
echo "<strong>". number_format($Sum1,2,'.',',') ."</strong>";
?>
</td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px">
<?php
$query6 = " SELECT Costt_2 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result6 = $dbObj->execQuery($query6);
//echo $query6;
while( $rs6 = $dbObj->fetchArray($result6) ) {
$Sum2 += $rs6['Costt_2'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rs6);
echo "<strong>". number_format($Sum2,2,'.',',') ."</strong>";
?>
</td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px">
<?php
$query = " SELECT Costt_3 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum3 += $rss['Costt_3'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum3,2,'.',',') ."</strong>";
?>
</td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px"> <?php
$query = " SELECT Costt_4 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum4 += $rss['Costt_4'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum4,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px"> <?php
$query = " SELECT Costt_5 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum5 += $rss['Costt_5'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum5,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px"><?php
$query = " SELECT Costt_6 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum6 += $rss['Costt_6'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum6,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px"><?php
$query = " SELECT Costt_7 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum7 += $rss['Costt_7'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum7,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px"><?php
$query = " SELECT Costt_8 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum8 += $rss['Costt_8'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum8,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px"><?php
$query = " SELECT Costt_9 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum9 += $rss['Costt_9'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum9,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px"><?php
$query = " SELECT Costt_10 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum10 += $rss['Costt_10'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum10,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px"><?php
$query = " SELECT Costt_11 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum11 += $rss['Costt_11'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum11,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px"><?php
$query = " SELECT Costt_12 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum12 += $rss['Costt_12'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum12,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px"><?php
$query = " SELECT Costt_13 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum13+= $rss['Costt_13'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum13,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px"><?php
$query = " SELECT Costt_14 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum14 += $rss['Costt_14'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum14,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px"><?php
$query = " SELECT Costt_15 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum15 += $rss['Costt_15'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum15,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px">
<?php
//### SUM Sum1
$query6 = " SELECT Costt_salary FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result6 = $dbObj->execQuery($query6);
while( $rs6 = $dbObj->fetchArray($result6) ) {
$Sum2 += $rs6['Costt_salary'];
}
$dbObj->freeresult($rs6);
echo "<strong>". number_format($Sum2,2,'.',',') ."</strong>";
?>
</td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px"><?php
$query = " SELECT Costt_16 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum16 += $rss['Costt_16'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum16,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px"><?php
$query = " SELECT Costt_17 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum17 += $rss['Costt_17'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum17,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px"><?php
$query = " SELECT Costt_18 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum18 += $rss['Costt_18'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum18,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px"><?php
$query = " SELECT Costt_19 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum19 += $rss['Costt_19'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum19,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px"><?php
$query = " SELECT Costt_20 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum20 += $rss['Costt_20'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum20,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px"><?php
$query = " SELECT Costt_21 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum21 += $rss['Costt_21'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum21,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px"><?php
$query = " SELECT Costt_22 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum22 += $rss['Costt_22'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum22,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px"><?php
$query = " SELECT Costt_23 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum23 += $rss['Costt_23'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum23,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px"><?php
$query = " SELECT Costt_24 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum24 += $rss['Costt_24'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum24,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px"><?php
$query = " SELECT Costt_25 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum25 += $rss['Costt_25'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum25,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px"><?php
$query = " SELECT Costt_26 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum26 += $rss['Costt_26'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum26,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px"><?php
$query = " SELECT Costt_27 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum27 += $rss['Costt_27'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum27,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px"><?php
$query = " SELECT Costt_28 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum28 += $rss['Costt_28'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum28,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-CENTER" style="padding-right:25px"><?php
$query = " SELECT Costt_29 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum29 += $rss['Costt_29'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum29,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px"><?php
$query = " SELECT Costt_30 FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result= $dbObj->execQuery($query);
//echo $query6;
while( $rss = $dbObj->fetchArray($result) ) {
$Sum30 += $rss['Costt_30'];
//echo "Sum3 = ". $Sum3;
//echo "<br />";
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum30,2,'.',',') ."</strong>";
?></td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px">
<?php
$query = " SELECT Costt_to FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result = $dbObj->execQuery($query);
while( $rss = $dbObj->fetchArray($result) ) {
$Sum31 += $rss['Costt_to'];
}
$dbObj->freeresult($rss);
echo "<strong>". number_format($Sum31,2,'.',',') ."</strong>";
?>
</td>
<td align="right" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT" style="padding-right:25px">
<?php
//### SUM Sum1
$query6 = " SELECT Costt_total FROM salary_repot_tb WHERE StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' ";
$result6 = $dbObj->execQuery($query6);
while( $rs6 = $dbObj->fetchArray($result6) ) {
$Sum32 += $rs6['Costt_total'];
}
$dbObj->freeresult($rs6);
echo "<strong>". number_format($Sum32,2,'.',',') ."</strong>";
?>
</table>
<?php } #if ( $numrows > 0 ) ?>
</td></tr>
</form>
</table>
</td>
</tr>
</table>
</body>
</html>
<?php
/** Close the Database */
$dbObj->disconn();
/** Unset Class */
unset($dbObj);
?>
|