Viewing file: Show_Dec_History1.php (13.85 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
session_start();
if (session_is_registered("valid_user")&&session_is_registered("password"))
{
$Username = $valid_user;
$Password = $password;
include("../../../include/FunctionDB.php");
ConnectDB();
$sql = "Select * From personal_tb Where Teacher_code='$Teacher_code'";
$result = mysql_query($sql) or die(" Error").mysql_error();
$rss = mysql_fetch_array($result);
//$Teacher_code = $rss[Teacher_code];
$sql2 = "Select * FROM salary_repot_tb Where Teacher_code='$Teacher_code' Order By Start_year ,code ";
$result2 = mysql_query($sql2) or die(" Error").mysql_error();
$num = mysql_num_rows($result2);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>History Detail</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<link rel="stylesheet" href="../../../css/style1.css" type="text/css">
<link href="../../css/style1.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #FF0000}
.style2 {color: #000000}
-->
</style>
</head>
<body bgcolor="#FFFFFF">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bordercolor="#CCCCCC">
<tr>
<td height="18" colspan="3" bgcolor="#0066CC"><img src="../../../Image/Ponallogo.jpg" width="550" height="71"></td>
</tr>
<tr>
<td width="20%" height="18" background="../../../Image/bart1.jpg" class="table"><div align="center"><strong><font size="2" face="Tahoma"><a href="../../menu_teacher.php" class="d">กลับเมนูหลัก</a></font></strong></div></td>
<td width="20%" background="../../../Image/bart1.jpg" class="table"><div align="center"><strong><font size="2" face="Tahoma"><a href="../Menu_History.php" class="d">ข้อมูลประวัติ</a></font></strong></div></td>
<td width="20%" background="../../../Image/bart1.jpg" class="table"><div align="center"><strong><font size="2" face="Tahoma"><a href="../../../logout.php" class="d">Logout</a></font></strong></div></td>
</tr>
</table></td>
</tr>
</table>
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#EEEEEE">
<tr>
<td width="31%" bgcolor="#F9FEFF">
<div align="center"><font size="2" face="Tahoma"></font></div></td>
<td width="69%" bgcolor="#F9FEFF"> <div align="left"><font color="#003366" size="2" face="Tahoma">
</font><font size="2" face="Tahoma">ขณะนี้ อ.<font color="#993333"><strong><? echo $rss['Teacher_name'] ?> <? echo $rss['Teacher_lastname'] ?> </strong></font>กำลังใช้งานระบบ </font></div></td>
</tr>
<tr>
<td bgcolor="#F9FEFF">
<div align="center"><font size="2" face="Tahoma"></font></div></td>
<td bgcolor="#F9FEFF"><font size="2" face="Tahoma"> </font><font color="#003366" size="2" face="Tahoma">
</font></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="1" style="background-color:#eeeeee; border:1px solid gray">
<tr bgcolor="#CCCCFF">
<td height="24" colspan="9" ><div align="center"><font color="#003366" size="4" face="Tahoma"><strong>ประวัติเงินเดือน ปี 2549</strong></font><font size="2" face="Tahoma">
<?php
$Start_year = $row["Start_year"];
$sql8 = "Select * From salary_repot_tb Where Start_year='$Start_year'";
$result8 = mysql_query($sql8) or die("Error".mysql_error());
$rss8 = mysql_fetch_array($result8);
echo "$rss8[Start_year] ";
?>
</font></div></td>
</tr>
<tr bgcolor="#E6E6E6">
<td width="32" align="center" bgcolor="#FF9966" style="border:1px solid gray"><strong><font color="#000000" size="2" face="Tahoma">No.</font></strong></td>
<td width="76" align="center" bgcolor="#FF9966" style="border:1px solid gray"><strong><font size="2" face="Tahoma">เดือน</font></strong></td>
<td width="62" align="center" bgcolor="#FF9966" style="border:1px solid gray"><strong><font color="#000000" size="2" face="Tahoma">ปี พ.ศ </font></strong></td>
<td width="74" align="center" bgcolor="#FF9966" style="border:1px solid gray"><strong><font size="2" face="Tahoma">รหัส</font></strong></td>
<td width="327" align="center" bgcolor="#FF9966" style="border:1px solid gray"><strong><font color="#000000" size="2" face="Tahoma"> ชื่อ</font></strong></td>
<td width="125" align="center" bordercolor="#0066CC" bgcolor="#FF9966" style="border:1px solid gray"><font size="2" face="Tahoma">เงินเดือน</font></td>
<td width="83" align="center" bordercolor="#0066CC" bgcolor="#FF9966" style="border:1px solid gray"><font size="2" face="Tahoma">รวมรายรับ</font></td>
<td width="114" align="center" bordercolor="#0066CC" bgcolor="#FF9966" style="border:1px solid gray"><font size="2" face="Tahoma">รวมรายจ่าย</font></td>
<td width="118" align="center" bordercolor="#0066CC" bgcolor="#FF9966" style="border:1px solid gray"><font size="2" face="Tahoma">คงเหลือเงินสุทธิ</font></td>
</tr>
<?php
$i = 1;
while($rs = mysql_fetch_array($result))
{
if($count==0)
{
?>
<tr bgcolor="#F7F7F7" >
<td align=center bgcolor="#eeeeee" ><strong><font color="#996600" size="1" face="Tahoma">
<?=$i?>
</font></strong></td>
<td align=center bgcolor="#eeeeee" ><strong><font color="#990099" size="2" face="Tahoma"><a href="MonnyDetail.php?Code=<?=$row["Code"]?>"title="Click to see Detail" class="d">
<?=$rss["Start_mont"]?>
</a><a href="ProjectList1.php?Project_code=<?=$row["Project_code"]?>"title="Click to see Detail" class="d"></a></font></strong></td>
<td align=center bordercolor="#EEEEEE" bgcolor="#eeeeee" ><strong><font color="#003366" size="2" face="Tahoma">
<?php
echo "$rs[Start_year]";
?>
</font></strong></td>
<td align=center bgcolor="#eeeeee" ><font size="2" face="Tahoma"><strong><font color="#003366" size="2" face="Tahoma">
<?php
echo "$rs[Teacher_id]";
?>
</font></strong></font></td>
<td align=center bgcolor="#eeeeee" ><div align="left"><font size="2" face="Tahoma">
<?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]";
?>
<a href="ManDetail.php?code=<?=$row["code"]?>"title="Click to see Detail" class="d" ></a></font><font size="2" face="Tahoma"><a href="ManDetail.php?code=<?=$row["code"]?>"title="Click to see Detail" class="d" ></a></font><font color="#996600" size="2" face="Tahoma"><a href="ManDetail.php?code=<?=$row["code"]?>"title="Click to see Detail" class="d" ></a> </font><font color="#996600" size="2" face="Tahoma"><a href="ManDetail.php?code=<?=$row["code"]?>"title="Click to see Detail" class="d" ></a></font></div></td>
<td bordercolor="#FFFBFF" bgcolor="#eeeeee"><div align="center"><font color="#993333" size="2" face="Tahoma"><?echo number_format($row['Salary_1'],2,'.',','); ?></font></div></td>
<td bordercolor="#FFFBFF" bgcolor="#eeeeee"><div align="center"><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="#eeeeee"><div align="center"><font color="#993333" size="2" face="Tahoma"><?echo number_format($row['Costt_to'],2,'.',','); ?></font></div></td>
<td bordercolor="#FFFBFF" bgcolor="#eeeeee"><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>
</tr>
<?
$count=1;
}
else
{
?>
<tr bgcolor="#FFFFFF">
<td align="center" bordercolor="#FFFFFF" ><strong><font color="#996600" size="1" face="Tahoma">
<?=$i?>
</font></strong></td>
<td align="center" bordercolor="#FFFFFF" ><div align="center"><strong><font color="#990099" size="2" face="Tahoma"><a href="MonnyDetail.php?Code=<?=$row["Code"]?>"title="Click to see Detail" class="d">
<?=$rs["Start_mont"]?>
</a><a href="ProjectList1.php?Project_code=<?=$row["Project_code"]?>"title="Click to see Detail" class="d"></a></font></strong></div></td>
<td align="center" bordercolor="#EEEEEE" ><div align="center"><strong><font color="#003366" size="2" face="Tahoma"> </font><font color="#003366" size="2" face="Tahoma">
<?php
echo "$row[Start_year]";
?>
</font><font color="#990099" size="2" face="Tahoma"><a href="ProjectList1.php?Project_code=<?=$row["Project_code"]?>"title="Click to see Detail" class="d"></a></font><font color="#003366" size="2" face="Tahoma"> </font></strong></div></td>
<td align="center" bordercolor="#FFFFFF" ><font size="2" face="Tahoma"><strong><font color="#003366" size="2" face="Tahoma">
<?php
echo "$row[Teacher_id]";
?>
</font></strong></font></td>
<td align="center" bordercolor="#FFFFFF" ><div align="left"><font color="#996600" size="2" face="Tahoma"> </font><font size="2" face="Tahoma">
<?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]";
?>
<a href="ManDetail.php?code=<?=$row["code"]?>"title="Click to see Detail" class="d" ></a></font><font color="#996600" size="2" face="Tahoma"><a href="ManDetail.php?code=<?=$row["code"]?>"title="Click to see Detail" class="d" ></a></font><font size="2" face="Tahoma"><a href="ManDetail.php?code=<?=$row["code"]?>"title="Click to see Detail" class="d" ></a></font><font color="#996600" size="2" face="Tahoma"><a href="ManDetail.php?code=<?=$row["code"]?>"title="Click to see Detail" class="d" ></a> </font><font color="#996600" size="2" face="Tahoma"><a href="ManDetail.php?code=<?=$row["code"]?>"title="Click to see Detail" class="d" ></a></font></div></td>
<td bordercolor="#FFFFFF"><div align="center"><font color="#993333" size="2" face="Tahoma"><?echo number_format($row['Salary_1'],2,'.',','); ?></font></div></td>
<td bordercolor="#FFFFFF"><div align="center"><font color="#993333" size="2" face="Tahoma"><?echo number_format($row['Costt_salary'],2,'.',','); ?></font></div></td>
<td bordercolor="#FFFFFF"><div align="center"><font color="#993333" size="2" face="Tahoma"><?echo number_format($row['Costt_to'],2,'.',','); ?></font></div></td>
<td bordercolor="#FFFFFF" bgcolor="#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>
</tr>
<?
$count=0;
}
$i++;
}
?>
<tr bgcolor="#FFFFFF">
<td colspan="9" align="center" ><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="57%" bgcolor="#E8FAFD"><div align="right"><font color="#0033CC" size="2" face="Tahoma"><strong> <font color="#993333"> ราคารวมทั้งหมด</font></strong></font></div></td>
<td width="12%" bgcolor="#E8FAFD"><div align="center"><font color="#993333" size="2" face="Tahoma">
<?php
$sql7 = "Select Sum(Salary_1) as SumC7 From salary_repot_tb Where Start_year='2549' ";
$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="8%" bgcolor="#E8FAFD"><div align="center"><font color="#993333" size="2" face="Tahoma">
<?php
$sql6 = "Select Sum(Costt_salary) as SumC6 From salary_repot_tb Where Start_year='2549' ";
$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="11%" bgcolor="#E8FAFD"><div align="center">
<div align="center"><font color="#993333" size="2" face="Tahoma">
<?php
$sql5 = "Select Sum(Costt_to) as SumC5 From salary_repot_tb Where Start_year='2549' ";
$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="12%" bgcolor="#E8FAFD"><div align="right"><strong><font color="#993333" size="2" face="Tahoma"> </font><font color="#993333" size="2" face="Tahoma">
<?php
$sql = "Select Sum(Costt_total) as Sum From salary_repot_tb Where Start_year='2549' ";
$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>
</tr>
</table></td>
<tr bgcolor="#CCCCFF">
<td colspan="9" align="center" ><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>
</table>
<p> </p>
</body>
</html>
<?php
}
else
{
echo"<meta http-equiv=\"refresh\" content=\"3;URL=../../login.php\">\n";
echo"Please Login ";
}
?>
|