Viewing file: MonnyList.php (14.56 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
session_start();
if (session_is_registered("valid_user")&&session_is_registered("Priority")&&session_is_registered("password") )
{
include("../include/FunctionDB.php");
include("../include/Function.php");
include("admin_menu.php");
ConnectDB();
$Username = $valid_user;
$sql = "SELECT * FROM personal_tb WHERE Username='$Username'";
$res = mysql_query($sql);
$rs = mysql_fetch_array($res);
$sql1 = "SELECT * FROM salary_repot_tb WHERE Start_mont='$Start_mont' ";
$res1 = mysql_query($sql1);
$rs = mysql_fetch_array($res1);
$strSQL = "SELECT * FROM salary_repot_tb Where Start_year='$Start_year' and Start_mont='$Start_mont' Order By Teacher_id ASC";
if (! $Page)
$Page = 1;
$Pre_Page = $Page - 1;
$Next_Page = $Page +1;
$Per_Page = 25;
$result = mysql_query($strSQL);
$Page_start = ($Per_Page*$Page) - $Per_Page;
$Num_Rows = mysql_num_rows($result);
if( $Num_Rows <= $Per_Page)
$Num_Pages = 1;
else if (($Num_Rows % $Per_Page) == 0)
$Num_Pages = ($Num_Rows / $Per_Page);
else
$Num_Pages = ($Num_Rows / $Per_Page) + 1;
$Num_Pages = (int)$Num_Pages;
if (( $Page > $Num_Pages) || ($Page < 0))
echo"Page $Page More than $Num_Pages";
$strSQL .=" LIMIT $Page_start,$Per_Page" ;
$result = mysql_query($strSQL);
$num = mysql_num_rows($result );
?>
<meta http-equiv="Content-Type" content="text/html; charset=TIS-620">
<link href="../source/style.css" rel="stylesheet" type="text/css">
<script type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<style type="text/css">
<!--
.style1 {font-size: 14px}
-->
</style>
<table width="814" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="814"><br>
<fieldset>
<legend><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><span class="style1"><a href="menu_manage.php" >หน้าหลัก</a> <img src="../picture/ico3.gif" width="10" height="10" border="0" align="absmiddle"><a href="MonyByYear.php?Teacher_code=<? echo $rs[Teacher_code] ?>">ข้อมูลเงินเดือนบุคลากรรายปี</a> <img src="../picture/ico3.gif" width="10" height="10" border="0" align="absmiddle" />ข้อมูลเงินเดือนบุคคลากร</span></font></legend>
<label><div align="center">
<form id="form1" name="form1" method="post" action="">
<div align="left"><font size="2" face="Tahoma"><img src="../picture/previous.gif" onclick="window.history.back()" width="85" height="22" border="0" /></font>
</div>
<table width="95%" border="0" cellpadding="0" cellspacing="1" style="background-color:#eeeeee; border:0px solid gray">
<tr bgcolor="#CCCCFF">
<td height="24" colspan="8" bgcolor="#FFFFFF" > </td>
</tr>
<tr bgcolor="#CCCCFF">
<td height="24" colspan="8" bgcolor="#FFFFFF" ><div align="center"><span class="style1"><font color="#003366" face="Tahoma">ประวัติเงินเดือน</font> </span><font size="4" face="Tahoma"><font color="#003399">
<?php
$monthCode = $rs["Start_mont"];
$sql = "Select * From month_tb Where monthCode='$monthCode'";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rss = mysql_fetch_array($result1);
echo "$rss[month]";
?>
<? echo $Start_year?></font></font></div></td>
</tr>
<tr bgcolor="#E6E6E6">
<td width="23" align="center" bgcolor="#FF9966" style="border:1px solid gray"><span class="style1"><font color="#000000" face="Tahoma">No.</font></span></td>
<td width="59" align="center" bgcolor="#FF9966" style="border:1px solid gray"><span class="style1"><font face="Tahoma">รหัส</font></span></td>
<td width="213" align="center" bgcolor="#FF9966" style="border:1px solid gray"> <span class="style1"><font color="#000000" face="Tahoma">ชื่อ</font></span></td>
<td width="80" align="center" bordercolor="#0066CC" bgcolor="#FF9966" style="border:1px solid gray"><span class="style1"><font face="Tahoma">เงินเดือน</font></span></td>
<td width="93" align="center" bordercolor="#0066CC" bgcolor="#FF9966" style="border:1px solid gray"><span class="style1"><font face="Tahoma">รวมรายรับ</font></span></td>
<td width="85" align="center" bordercolor="#0066CC" bgcolor="#FF9966" style="border:1px solid gray"><span class="style1"><font face="Tahoma">รวมรายจ่าย</font></span></td>
<td width="97" align="center" bordercolor="#0066CC" bgcolor="#FF9966" style="border:1px solid gray"><span class="style1"><font face="Tahoma">คงเหลือเงินสุทธิ</font></span></td>
<td align="center" bordercolor="#0066CC" bgcolor="#FF9966" style="border:1px solid gray"><span class="style1"><font face="Tahoma">การกระทำ</font></span></td>
</tr>
<?php
$i = 1;
while($row = mysql_fetch_array($result))
{
if($count==0)
{
?>
<tr bgcolor="#F7F7F7" >
<td align="center" bgcolor="#ECF5FF" ><font color="#996600" size="1" face="Tahoma">
<?=$i?>
</font></td>
<td align="center" bgcolor="#ECF5FF" ><font size="2" face="Tahoma"><font color="#003366" size="2" face="Tahoma">
<?php
echo "$row[Teacher_id]";
?>
</font></font></td>
<td align="center" bgcolor="#ECF5FF"onclick="MM_openBrWindow('MonnyDetail.php?Code=<? echo $rs[Code]?>','Detail','width=700,height=440,scrollbars=yes')"><a href="#" >
<div align="left">
<?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]";
?>
</div>
<div align="left"></td>
<td bordercolor="#FFFBFF" bgcolor="#ECF5FF"><div align="right"><font color="#993333" size="2" face="Tahoma"><?echo number_format($row['Salary_1'],2,'.',','); ?></font></div></td>
<td bordercolor="#FFFBFF" bgcolor="#ECF5FF"><div align="right"><font color="#993333" size="2" face="Tahoma"><?echo number_format($row['Costt_salary'],2,'.',','); ?></font><font color="#003366" size="2" face="Tahoma"> </font></div></td>
<td bordercolor="#FFFBFF" bgcolor="#ECF5FF"><div align="right"><font color="#993333" size="2" face="Tahoma"><?echo number_format($row['Costt_to'],2,'.',','); ?></font></div></td>
<td bordercolor="#FFFBFF" bgcolor="#ECF5FF"><div align="right"><font color="#993333" size="2" face="Tahoma"> </font><font color="#993333" size="2" face="Tahoma"><?echo number_format($row['Costt_total'],2,'.',','); ?></font></div></td>
<td width="54" bordercolor="#FFFBFF" bgcolor="#ECF5FF"> </td>
</tr>
<?
$count=1;
}
else
{
?>
<tr bgcolor="#FFFFFF">
<td align="center" bordercolor="#FFFFFF" ><font color="#996600" size="1" face="Tahoma">
<?=$i?>
</font></td>
<td align="center" bordercolor="#FFFFFF" ><font size="2" face="Tahoma"><font color="#003366" size="2" face="Tahoma">
<?php
echo "$row[Teacher_id]";
?>
</font></font></td>
<td align="center" bordercolor="#FFFFFF" onclick="MM_openBrWindow('MonnyDetail.php?Code=<? echo $rs[Code]?>','Detail','width=700,height=440,scrollbars=yes')"><a href="#" ><div align="left">
<?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]";
?>
</div></td>
<td bordercolor="#FFFFFF"><div align="right"><font color="#993333" size="2" face="Tahoma"><?echo number_format($row['Salary_1'],2,'.',','); ?></font></div></td>
<td bordercolor="#FFFFFF"><div align="right"><font color="#993333" size="2" face="Tahoma"><?echo number_format($row['Costt_salary'],2,'.',','); ?></font></div></td>
<td bordercolor="#FFFFFF"><div align="right"><font color="#993333" size="2" face="Tahoma"><?echo number_format($row['Costt_to'],2,'.',','); ?></font></div></td>
<td bordercolor="#FFFFFF" ><div align="right"><font color="#993333" size="2" face="Tahoma"> </font><font color="#993333" size="2" face="Tahoma"><?echo number_format($row['Costt_total'],2,'.',','); ?></font></div></td>
<td bordercolor="#FFFFFF" bgcolor="#FFFFFF" ><div align="right"><font color="#993333" size="2" face="Tahoma"> </font>
<div align="center">
<script language="JavaScript" type="text/javascript">
function Conf<?=$rs[Code];?>0(object) {
if (confirm("คุณต้องการลบข้อมูล <?php echo " ประวัติเงินเดือน $rs[Decoration_name]"; ?> หรือไม่?") == true) {
return true;
}
return false;
}
</script>
</div>
</div></td>
</tr>
<?
$count=0;
}
$i++;
}
?>
<tr bgcolor="#FFFFFF">
<td colspan="8" align="center" ><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="39%" bgcolor="#FFFFFF"><div align="center"><font color="#0033CC" size="2" face="Tahoma"><strong> <font color="#993333"> Total</font></strong></font></div></td>
<td width="10%" bgcolor="#FFFFFF"><div align="right"><font color="#993333" size="2" face="Tahoma">
<?php
$sql7 = "Select Sum(Salary_1) as SumC7 From salary_repot_tb Where Start_mont='$Start_mont' and Start_year='$Start_year' ";
$result7 = mysql_query($sql7) or die("Erro".mysql_error());
$rss7 = mysql_fetch_array($result7);
echo number_format($rss7[SumC7],2,'.',',');
//echo"$rss5[SumC5]";
?>
</font></div></td>
<td width="13%" bgcolor="#FFFFFF"><div align="right"><font color="#993333" size="2" face="Tahoma">
<?php
$sql6 = "Select Sum(Costt_salary) as SumC6 From salary_repot_tb Where Start_mont='$Start_mont' and Start_year='$Start_year' ";
$result6 = mysql_query($sql6) or die("Erro".mysql_error());
$rss6 = mysql_fetch_array($result6);
echo number_format($rss6[SumC6],2,'.',',');
//echo"$rss5[SumC5]";
?>
</font></div></td>
<td width="16%" bgcolor="#FFFFFF"><div align="center">
<div align="right"><font color="#993333" size="2" face="Tahoma">
<?php
$sql5 = "Select Sum(Costt_to) as SumC5 From salary_repot_tb Where Start_mont='$Start_mont' and Start_year='$Start_year' ";
$result5 = mysql_query($sql5) or die("Erro".mysql_error());
$rss5 = mysql_fetch_array($result5);
echo number_format($rss5[SumC5],2,'.',',');
//echo"$rss5[SumC5]";
?>
</font></div>
</div></td>
<td width="14%" bgcolor="#FFFFFF"><div align="right"><strong><font color="#993333" size="2" face="Tahoma">
<?php
$sql = "Select Sum(Costt_total) as Sum From salary_repot_tb Where Start_mont='$Start_mont' and Start_year='$Start_year' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rss1 = mysql_fetch_array($result1);
echo number_format($rss1['Sum'],2,'.',',');
CloseDB();
?>
</font></strong></div></td>
<td width="8%" bgcolor="#FFFFFF"><div align="right"><strong><font color="#993333" size="2" face="Tahoma"> </font></strong></div></td>
</tr>
</table></td>
</tr>
<tr bgcolor="#CCCCFF">
<td colspan="8" align="center" bgcolor="#FFFFFF" ><div align="center"><strong><font color="#000000" size="2" face="Tahoma">ทั้งหมด</font><font color="#003399" size="2" face="Tahoma"> <? echo $num ?> </font><font color="#FFFFFF" size="2" face="Tahoma"><font color="#003366">รายการ</font><font color="#FFFFFF"> </font></font> </strong></div></td>
</tr>
</table>
<table width="93%" border="0" cellpadding="0" cellspacing="1" bordercolor="#CCCCCC">
<tr>
<td align="right" bordercolor="#CCCCCC" class="Tahoma11"><div align="center"><font color="#FFFFFF"> <font color="#FFFFFF" size="3" face="MS Sans Serif"><strong> <font color="#0033CC" size="2" face="Tahoma"> <?php echo $Num_Pages;?></font></strong></font><font color="#000000" size="2" face="Tahoma"><strong> หน้า</strong></font><font color="#0033CC" size="2" face="Tahoma">
<?php
if ($Pre_Page)
echo"<a href=\"$PHP_SELF?Page=$Pre_Page&Start_year=$Start_year&Start_mont=$Start_mont\" class=\"PageLink\"><font =\"Ms San serif\" size=\"2\"><b><< Previus</b> </font></a>";
for($i=1;$i<=$Num_Pages;$i++)
{
if($i != $Page)
echo" [<a href=\"$PHP_SELF?Page=$i&Start_year=$Start_year&Start_mont=$Start_mont\" class=\"PageLink\"><font =\"Ms San serif\" size=\"2\"><b>$i</b></font></a>] ";
else
echo"<b>$i</b>";
}
if($Page != $Num_Pages)
echo"<a href=\"$PHP_SELF?Page=$Next_Page&Start_year=$Start_year&Start_mont=$Start_mont\" class=\"PageLink\"><font =\"Ms San serif\" size=\"2\"><b> Next >></b> </font></a>";
?>
</font></font> </div></td>
</tr>
</table>
</form>
</div>
</label>
</fieldset><br>
<font color="<?php echo $GLOBALS["COLOR_FONT_3"];?>" size="2"><b>หมายเหตุ :</b> ใช้เมาส์คลิกที่ชื่อ<br>
</font></td>
</tr>
</table>
<?php
}
else
{
echo"<meta http-equiv=\"refresh\" content=\"3;URL=../login.php\">\n";
echo"Please Login ";
}
?>
|