Viewing file: MonnyList.php (15.39 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php session_start(); if (session_is_registered("valid_user")) { $Username = $valid_user; include("../../../include/FunctionDB.php"); include("../../../include/Function.php"); // include("header.php"); ConnectDB(); //$sql = "SELECT * FROM project_tb Order By Orderlist_2 "; //$res = mysql_query($sql); //$rs = mysql_fetch_array($res); //$Teacher_code = $rs[Teacher_code]; $strSQL = "SELECT * FROM salary_repot_tb Where Start_mont='$Start_mont' and Start_year='$Start_year' 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 ); ?> <html> <head> <title>Display Instructor List</title> <meta http-equiv="Content-Type" content="text/html; charset=windows-874"> <link href="../../../css/style1.css" rel="stylesheet" type="text/css"> <style type="text/css"> <!-- .style5 {color: #FF00FF} .style7 {font-size: 18px} .style9 {color: #0000FF} .style10 {font-size: 14px} .style11 {color: #0000FF; font-size: 14px; } .style12 {font-size: 9px} .style13 {color: #FF00FF; font-size: 9px; } .style14 {color: #0000FF; font-weight: bold; } --> </style> </head> <body bgcolor="#F5FEE9"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td bgcolor="#0066CC"><div align="left"><img src="../../../Image/Monnylogo.jpg" width="550" height="71" longdesc="../../menu_teacher.php"></div></td> </tr> <tr> <td><table width="100%" border="0" cellspacing="1" cellpadding="0" style="border:1px solid #CCCCFF"> <form name="form1" method="get" action="../../../Plan_dura/personal/Monny/SearchList.php"> <tr> <td height="25" bgcolor="#DFDFFF"> <div align="center"><font size="2" face="Tahoma"> </font><font size="2" face="Tahoma"><strong>ชื่อที่ต้องการค้นหา</strong></font> <font size="2" face="Tahoma"> <img src="../../../Image/b_select.png" width="16" height="16" align="absmiddle" border="0"> <input name="keyword" type="text" style="background-color:#F0FFD2;" value="<? echo"$keyword"; ?>" size="50" > <strong>จาก</strong></font> <font size="2" face="Tahoma"> <select name="fields" style="background-color:#F0FFD2;" > <option value="<? echo "$fields"; ?>">เลือกรายการ</option> <option value="Start_mont">เดือน</option> <option value="Teacher_id">รหัสประจำตัว</option> <option value="Start_year">ปี พ.ศ</option> </select> <input type="submit" name="Submit" value="ค้นหา"> </font></div></td> </tr> </form> </table></td> </tr> <tr> <td><table width="100%" border="0" cellspacing="2" cellpadding="0" style="border:1px solid #CCCCFF"> <tr> <td width="4%" height="25" class="style7"> <div align="center"><span class="style12"></span></div></td> <td width="28%" class="style7"><div align="center" class="style13"> <form name="form2"> <div align="left"></div> </form> </div> </td> <td width="19%" class="style7"><div align="center"><a href="InstructorList48.php" class="style9 style10"><span class="style12"></span></a></div></td> <td width="17%" class="style7"><div align="center" class="style5"><span class="style12"></span></div></td> <td width="20%" class="style12"> </td> <td width="12%" class="style14"><div align="right"></div></td> </tr> </table></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>ประวัติเงินเดือน </strong></font><font size="4" face="Tahoma"><strong><font color="#003399"><? echo $Start_mont?></font></strong></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($row = 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"> <?=$row["Start_mont"]?> </a></font></strong></td> <td align=center bordercolor="#EEEEEE" bgcolor="#eeeeee" ><strong><font color="#003366" size="2" face="Tahoma"> <?php echo "$row[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 "$row[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"> <?=$row["Start_mont"]?> </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_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="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_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="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_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="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_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> </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> <table width="100%" 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"><strong> <?php if ($Pre_Page) echo"<a href=\"$PHP_SELF?Page=$Pre_Page\" class=\"PageLink\"><font =\"Ms San serif\" size=\"3\"><b><< Previus</b> </font></a>";
for($i=1;$i<=$Num_Pages;$i++) { if($i != $Page) echo" [<a href=\"$PHP_SELF?Page=$i\" class=\"PageLink\"><font =\"Ms San serif\" size=\"3\"><b>$i</b></font></a>] "; else echo"<b>$i</b>"; } if($Page != $Num_Pages) echo"<a href=\"$PHP_SELF?Page=$Next_Page\" class=\"PageLink\"><font =\"Ms San serif\" size=\"3\"><b> Next >></b> </font></a>"; ?> </strong></font> </font> </div></td> </tr> </table>
<p> </p> </html> <?php } else { echo"<meta http-equiv=\"refresh\" content=\"3;URL=../../login.php\">\n"; echo"Please Login "; } ?>
|