Viewing file: MonnyPersonList.php (18.66 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
session_start();
if (session_is_registered("valid_user")&&session_is_registered("Priority") )
{
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_year='$Start_year' and Start_mont='$Start_mont' ";
$res1 = mysql_query($sql1);
$rs = mysql_fetch_array($res1);
$strSQL = "SELECT * FROM salary_repot_tb Where StatusId='1' and Start_year='$Start_year' and Start_mont='$Start_mont' and Person_type ='$Person_type' Order By Teacher_id ASC";
if (! $Page)
$Page = 1;
$Pre_Page = $Page - 1;
$Next_Page = $Page +1;
$Per_Page = 50;
$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);
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<style type="text/css">
<!--
.style1 {font-size: 14px}
.style2 {
font-family: Tahoma;
font-size: 14px;
}
.style4 {font-family: Tahoma; font-size: 14px; font-weight: bold; }
-->
</style>
<table width="838" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="838"><br>
<fieldset>
<legend><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><span class="style1"><a href="menu_manage.php" >หน้าหลัก</a> </span></font><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><span class="style1"> <img src="../picture/ico3.gif" width="10" height="10" border="0" align="absmiddle" /><a href="PersonalMonyList.php">บันทึกข้อมูลเงินเดือนบุคลากร</a></span></font><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><span class="style1"><img src="../picture/ico3.gif" width="10" height="10" border="0" align="absmiddle"><a href="MonnyList.php?Start_year=<? echo $rs[Start_year] ?>&Start_mont=<? echo $rs[Start_mont]?>">ข้อมูลเงินเดือนบุคลากรรายเดือน</a> </span></font><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><span class="style1"> <img src="../picture/ico3.gif" width="10" height="10" border="0" align="absmiddle" /><a href="EditMonnyList.php?Start_year=<? echo $rs[Start_year] ?>&Start_mont=<? echo $rs[Start_mont]?>">แก้ไขข้อมูลเงินเดือน</a></span></font><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><span class="style1"><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="">
<table width="97%" border="0" cellpadding="0" cellspacing="0" style="background-color:#eeeeee; border:0px solid gray">
<tr bgcolor="#CCCCFF">
<td height="24" colspan="9" bgcolor="#FFFFFF" ><font size="2" face="Tahoma"><img src="../picture/previous.gif" onclick="window.history.back()" width="85" height="22" border="0" /></font></td>
</tr>
<tr bgcolor="#CCCCFF">
<td height="24" bgcolor="#FFFFFF" > </td>
<td height="24" colspan="6" bgcolor="#FFFFFF" >
<div align="right">
<select name="select" id="select" onchange="MM_jumpMenu('parent',this,0)">
<option >เลือกรายการ</option>
<option value="MonnyPersonList.php?Start_year=<? echo $rs[Start_year] ?>&Start_mont=<? echo $rs[Start_mont] ?>&Person_type=1">ข้าราชการ</option>
<option value="MonnyPersonList.php?Start_year=<? echo $rs[Start_year] ?>&Start_mont=<? echo $rs[Start_mont] ?>&Person_type=2">พนักงานรัฐ</option>
<option value= "MonnyPersonList.php?Start_year=<? echo $rs[Start_year] ?>&Start_mont=<? echo $rs[Start_mont] ?>&Person_type=3">ลูกจ้างประจำ</option>
<option value= "MonnyPersonList.php?Start_year=<? echo $rs[Start_year] ?>&Start_mont=<? echo $rs[Start_mont] ?>&Person_type=4">ลูกชั่วคราวเหมาจ่าย</option>
</select>
</div></td>
<td height="24" bgcolor="#FFFFFF" > </td>
<td height="24" bgcolor="#FFFFFF" ><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>">ส่งออกเป็น <a href="ExcelMonnyPersonList.php?Start_year=<? echo $rs[Start_year] ?>&Start_mont=<? echo $rs[Start_mont] ?>&Person_type=<? echo $rs[Person_type]?>"><img src="../picture/excel.gif" width="18" height="18" border="0" align="absmiddle" /></a></font></td>
</tr>
<tr bgcolor="#CCCCFF">
<td height="24" colspan="9" bgcolor="#FFFFFF" ><div align="center"><span class="style1"><font color="#003366" face="Tahoma">ประวัติเงินเดือน</font><font size="4" face="Tahoma"><font color="#003399">
<?php
$Ptype_code = $rs["Person_type"];
// $Person_type = $rs["Ptype_code"];
$sql = "Select * From person_type_tb Where Ptype_code='$Person_type'";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rss = mysql_fetch_array($result1);
echo "$rss[Ptype_name]";
?>
</font></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="55" align="center" bgcolor="#FF9966" style="border:1px solid gray"><span class="style1"><font face="Tahoma">รหัส</font></span></td>
<td width="221" align="center" bgcolor="#FF9966" style="border:1px solid gray"> <span class="style1"><font color="#000000" 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="92" align="center" bordercolor="#0066CC" bgcolor="#FF9966" style="border:1px solid gray"><span class="style2">ประจำตำแหน่ง</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="65" align="center" bordercolor="#0066CC" bgcolor="#FF9966" style="border:1px solid gray"><span class="style2">สหกรณ</span><span class="style1">์</span></td>
<td width="74" align="center" bordercolor="#0066CC" bgcolor="#FF9966" style="border:1px solid gray"><span class="style1"><font face="Tahoma">รวมรายจ่าย</font></span></td>
<td width="103" 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="#EBFAeE" ><font color="#996600" size="1" face="Tahoma">
<?=$i?>
</font></td>
<td align="center" bgcolor="#EBFAeE" ><font size="2" face="Tahoma"><font color="#003366" size="2" face="Tahoma">
<?php
echo "$row[Teacher_id]";
?>
</font></font></td>
<td align="center" bgcolor="#EBFAeE"onclick="MM_openBrWindow('MonnyDetail.php?Code=<? echo $row[Code]?>&Start_year=<? echo $row[Start_year]?>&Start_mont=<? echo $row[Start_mont]?>','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="#EBFAeE"><div align="right"><font color="#993333" size="2" face="Tahoma"><?echo number_format($row['Salary_1'],2,'.',','); ?></font></div></td>
<td bordercolor="#FFFBFF" bgcolor="#EBFAeE"><div align="right"><font color="#993333" size="2" face="Tahoma"><?echo number_format($row['Salary_3'],2,'.',','); ?></font></div></td>
<td bordercolor="#FFFBFF" bgcolor="#EBFAeE"><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="#EBFAeE"><div align="right"><font color="#993333" size="2" face="Tahoma"><?echo number_format($row['Costt_11'],2,'.',','); ?></font></div></td>
<td bordercolor="#FFFBFF" bgcolor="#EBFAeE"><div align="right"><font color="#993333" size="2" face="Tahoma"><?echo number_format($row['Costt_to'],2,'.',','); ?></font></div></td>
<td bordercolor="#FFFBFF" bgcolor="#EBFAeE"><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" ><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 $row[Code]?>','Detail','scrollbars=yes,width=700,height=440')"><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['Salary_3'],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" bgcolor="#FFFFFF"><div align="right"><font color="#993333" size="2" face="Tahoma"><?echo number_format($row['Costt_11'],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>
</tr>
<?
$count=0;
}
$i++;
}
?>
<tr bgcolor="#FFFFFF">
<td align="center" bgcolor="#eeeeee" > </td>
<td align="center" bgcolor="#eeeeee" > </td>
<td align="center" bgcolor="#eeeeee" ><span class="style4">รวมเงิน</span></td>
<td align="center" bgcolor="#eeeeee" ><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' and Person_type='$Person_type' ";
$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 align="center" bgcolor="#eeeeee" ><div align="right"><font color="#993333" size="2" face="Tahoma">
<?php
$sql6 = "Select Sum(Salary_3) as SumC8 From salary_repot_tb Where Start_mont='$Start_mont' and Start_year='$Start_year' and Person_type='$Person_type' ";
$result6 = mysql_query($sql6) or die("Erro".mysql_error());
$rss6 = mysql_fetch_array($result6);
echo number_format($rss6[SumC8],2,'.',',');
//echo"$rss5[SumC5]";
?>
</font></div></td>
<td align="center" bgcolor="#eeeeee" ><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' and Person_type='$Person_type' ";
$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 align="center" bgcolor="#eeeeee" ><div align="right"><font color="#993333" size="2" face="Tahoma">
<?php
$sql6 = "Select Sum(Costt_11) as SumC7 From salary_repot_tb Where Start_mont='$Start_mont' and Start_year='$Start_year' and Person_type='$Person_type' ";
$result6 = mysql_query($sql6) or die("Erro".mysql_error());
$rss6 = mysql_fetch_array($result6);
echo number_format($rss6[SumC7],2,'.',',');
//echo"$rss5[SumC5]";
?>
</font></div></td>
<td align="center" bgcolor="#eeeeee" ><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' and Person_type='$Person_type' ";
$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></td>
<td align="center" bgcolor="#eeeeee" ><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' and Person_type='$Person_type' ";
$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>
<tr bgcolor="#CCCCFF">
<td colspan="9" align="center" bgcolor="#FFFFFF" ><div align="center"><span class="style1"><font color="#000000" face="Tahoma">ทั้งหมด</font><font color="#003399" face="Tahoma"> <? echo $num ?> </font><font color="#FFFFFF" face="Tahoma"><font color="#003366">รายการ</font><font color="#FFFFFF"> </font></font></span> </div></td>
</tr>
</table>
<table width="95%" 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 ";
}
?>
|