Viewing file: PlaningList.php (16.04 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include("./include/FunctionDB.php");
include("admin_menu.php");
ConnectDB();
$sql = "SELECT * FROM projectStdPlan_tb Where Faculty_code='$Faculty_code' and Budget_Year='$Budget_Year' and Project_code='$Project_code' ORDER BY Faculty_code,Orderlist ASC ";
$res = mysql_query($sql);
$rs = mysql_fetch_array($res);
//$Teacher_code = $rs[Teacher_code];
$strSQL = "SELECT * FROM project_type_tb Where Budget_Year='$Budget_Year' and Faculty_code='$Faculty_code' and Project_code='$Project_code' ORDER BY Orderlist 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);
}
//-->
</script>
<style type="text/css">
<!--
.style12 {font-size: 14px}
.style14 {font-size: 14px; font-weight: bold; }
.style15 {color: #FF0000}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<table width="823" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="823"><br>
<fieldset>
<legend><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><span class="style12"><a href="PlaningByYear.php" >หน้าหลัก</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="get" action=" ">
<table width="99%" border="0" cellpadding="0" cellspacing="0" style="background-color:#eeeeee; border:0px solid gray">
<tr bgcolor="#CCCCFF">
<td height="24" colspan="6" bgcolor="#FFFFFF" ><font size="2" face="Tahoma"><img src="./picture/previous.gif" onclick="window.history.back()" width="85" height="22" border="0" /></font></td>
<td height="24" colspan="3" bgcolor="#FFFFFF" ><div align="right"><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><span class="style12">ส่งออก <a href="PlaningByYear.php"><img src="./picture/excel.gif" width="18" height="18" border="0" align="absmiddle" /></a></span></font></div></td>
</tr>
<tr bgcolor="#CCCCFF">
<td height="24" colspan="9" bgcolor="#eeeeee" ><div align="center"><span class="style12"><font color="#000000" face="Tahoma"><font face="Tahoma"><font color="#000000" face="Tahoma"><span class="style14"><font color="#000000" face="Tahoma"><font face="Tahoma"><strong>
<font color="#000000" face="Tahoma"><font face="Tahoma"><strong><font color="#000000" face="Tahoma"><strong>
</strong><font face="Tahoma"><font color="#000000" face="Tahoma"><font color="#000000" face="Tahoma"><font face="Tahoma"><strong><font color="#000000" face="Tahoma"><font face="Tahoma"><strong><font color="#000000" face="Tahoma"><strong>
<input name="Project_code" type="hidden" id="Project_code" value="<?=$Project_code ?>" />
</strong></font></strong></font></font></strong></font></font></font></font><strong>
<input name="Faculty_code" type="hidden" id="Faculty_code" value="<?=$Faculty_code ?>" />
</strong></font></strong></font></font>
<input name="Budget_Year" type="hidden" id="Budget_Year" value="<?=$Budget_Year?>" />
</strong></font></font></span>รายละเอียดแผนดำเนินการประจำปีงบประมาณ </font></font></font></span><span class="style14"><font color="#000000" face="Tahoma"><font face="Tahoma"><strong><font color="#000000" face="Tahoma"><strong><span class="style12"><font color="#000066" face="Tahoma"><font color="#000000" face="Tahoma"><font face="Tahoma"><strong><font size="2" face="Tahoma"><font color="#003399"><? echo $Budget_Year?></font> </font></strong></font></font></font></span></strong></font></strong></font></font></span><span class="style12"><font color="#000000" face="Tahoma"><font face="Tahoma"><font color="#000000" face="Tahoma"><span class="style12"><font color="#000066" face="Tahoma"><font color="#000000" face="Tahoma"><font face="Tahoma"><font face="Tahoma"><span class="style12"><font color="#000000" face="Tahoma"><font face="Tahoma"><font color="#000000" face="Tahoma">หน่วยงาน</font></font></font></span></font></font></font></font></span></font></font></font></span> <span class="style12"><font color="#000000" size="2" face="Tahoma">
<?php
//$Faculty_code = $row[Faculty_code];
$sql3 = "Select * From faculty_tb Where Faculty_code='$Faculty_code'";
$result3 = mysql_query($sql3) or die("Error".mysql_error());
$rss = mysql_fetch_array($result3);
echo"$rss[Faculty_name]";
?>
</font></span></div></td>
</tr>
<tr bgcolor="#E6E6E6">
<td colspan="9" align="center" bgcolor="#FFFFFF" style="border:0px solid gray"> </td>
</tr>
<tr bgcolor="#E6E6E6">
<td colspan="9" align="center" bgcolor="#FFFFFF" style="border:0px solid gray"><div align="left"><span class="style12"><font color="#000000" face="Tahoma">ข้อ</font></span><font color="#000000" size="2" face="Tahoma">
<?php
//$Faculty_code = $row[Faculty_code];
$sql3 = "Select * From projectStdPlan_tb Where Project_code='$Project_code'";
$result3 = mysql_query($sql3) or die("Error".mysql_error());
$rss = mysql_fetch_array($result3);
echo"$rss[Orderlist]";
?>
</font><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><span class="style12"><img src="./picture/ico3.gif" width="10" height="10" border="0" align="absmiddle" /></span></font><font color="#000000" size="2" face="Tahoma">
<?php
//$Faculty_code = $row[Faculty_code];
$sql3 = "Select * From projectStdPlan_tb Where Project_code='$Project_code'";
$result3 = mysql_query($sql3) or die("Error".mysql_error());
$rss = mysql_fetch_array($result3);
echo" $rss[Project_plan]";
?>
</font></div>
<div align="left">
<span class="style12"><font color="#000000" size="2" face="Tahoma"> </font></span>
<div align="left"></div></td>
</tr>
<?php
$i = 1;
while($row = mysql_fetch_array($result))
{
if($count==0)
{
?>
<tr bgcolor="#F7F7F7" >
<td width="33" align="center" bgcolor="#FFFFFF" > </td>
<td width="22" align="center" bgcolor="#FFFFFF" ><div align="right"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><img src="./picture/linesub.gif" width="16" height="16" border="0" align="absmiddle" /></font></div></td>
<td width="29" align="center" bgcolor="#FFFFFF" ><div align="left"><a href="#">
<?=$row["Orderlist"]?>
</a></div></td>
<td width="410" align="left" bgcolor="#FFFFFF" ><div align="left"><?=$row["Project_plan"]?>
</a></div></td>
<td width="121" bordercolor="#EEEEEE" bgcolor="#FFFFFF" ><div align="right"><font color="#000000" size="2" face="Tahoma">
<?php
$MoneyS_C = $row[MoneyS_C];
$sql3 = "Select * From money_source_tb Where MoneyS_C='$MoneyS_C'";
$result3 = mysql_query($sql3) or die("Error".mysql_error());
$rss = mysql_fetch_array($result3);
echo" $rss[MoneyS_M]";
?>
</font></div></td>
<td width="111" bgcolor="#FFFFFF" ><div align="right"><font color="#993333" size="2" face="Tahoma"> <?echo number_format($row['Budget_use'],2,'.',','); ?> </font></div></td>
<td width="36" bordercolor="#EEEEEE" bgcolor="#FFFFFF" onclick="MM_openBrWindow('showPlaning.php?ProjectId=<? echo $row[ProjectId]?>&Orderlist=<?php echo $row[Orderlist]?>&Project_code=<? echo $row[Project_code]?>&Faculty_code=<? echo $row[Faculty_code]?>','Detail','scrollbars=yes,width=750,height=300')"><div align="right"><font size="2" face="Tahoma"><a href="#"><img src="./picture/icoa11.jpg" alt="รายละเอียดของยอดเงินตามข้อย่อย" width="20" height="20" border="0" /></a></font></div></td>
<td width="23" bordercolor="#EEEEEE" bgcolor="#FFFFFF" onclick="MM_openBrWindow('PlaningDetail.php?ProjectId=<?=$row["ProjectId"]?>&Budget_Year=<?=$row["Budget_Year"]?>&Faculty_code=<?=$row["Faculty_code"]?>','Detail','scrollbars=yes,width=680,height=400')"><div align="right"><font size="2" face="Tahoma"><a href="#"><img src="./picture/icoa12.jpg" alt="รายละเอียดข้อย่อย" width="20" height="20" border="0" /></a></font></div></td>
<td width="28" bordercolor="#EEEEEE" bgcolor="#FFFFFF" onclick="MM_openBrWindow('RepPlaning.php?ProjectId=<? echo $row[ProjectId]?>&Orderlist=<?php echo $row[Orderlist]?>&Project_code=<? echo $row[Project_code]?>&Faculty_code=<? echo $row[Faculty_code]?>','Detail','scrollbars=yes,width=750,height=400')"><div align="center"><font size="2" face="Tahoma"><a href="#"><img src="./picture/print.gif" alt="พิมพ์ใบขออนุมัติ" width="15" height="14" border="0" /></a></font></div></td>
</tr>
<?
$count=1;
}
else
{
?>
<tr bgcolor="#FFFFFF">
<td align="center" bordercolor="#FFFFFF" > </td>
<td align="center" bordercolor="#FFFFFF" ><div align="right"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><img src="./picture/linesub.gif" width="16" height="16" border="0" align="absmiddle" /></font></div></td>
<td align="center" bordercolor="#FFFFFF" ><div align="left"><a href="#">
<?=$row["Orderlist"]?>
</a></div></td>
<td align="left" ><div align="left"><?=$row["Project_plan"]?>
</a></div></td>
<td bordercolor="#EEEEEE" ><div align="right"><font color="#000000" size="2" face="Tahoma">
<?php
$MoneyS_C = $row[MoneyS_C];
$sql3 = "Select * From money_source_tb Where MoneyS_C='$MoneyS_C'";
$result3 = mysql_query($sql3) or die("Error".mysql_error());
$rss = mysql_fetch_array($result3);
echo" $rss[MoneyS_M]";
?>
</font></div></td>
<td bordercolor="#FFFFFF" bgcolor="#FFFFFF" ><div align="right"><font color="#993333" size="2" face="Tahoma"> <?echo number_format($row['Budget_use'],2,'.',','); ?> </font></div></td>
<td bordercolor="#EEEEEE" onclick="MM_openBrWindow('showPlaning.php?ProjectId=<? echo $row[ProjectId]?>&Orderlist=<?php echo $row[Orderlist]?>&Project_code=<? echo $row[Project_code]?>&Faculty_code=<? echo $row[Faculty_code]?>','Detail','scrollbars=yes,width=750,height=300')"><div align="right"><font size="2" face="Tahoma"><a href="#"><img src="./picture/icoa11.jpg" alt="รายละเอียดยอดเงินตามข้อย่อย" width="20" height="20" border="0" /></a></font></div></td>
<td bordercolor="#EEEEEE" onclick="MM_openBrWindow('PlaningDetail.php?ProjectId=<?=$row["ProjectId"]?>&Budget_Year=<?=$row["Budget_Year"]?>&Faculty_code=<?=$row["Faculty_code"]?>','Detail','scrollbars=yes,width=690,height=400')"><div align="right"><font size="2" face="Tahoma"><div align="right"><font size="2" face="Tahoma"><a href="#"><img src="./picture/icoa12.jpg" alt="รายละเอียดข้อย่อย" width="20" height="20" border="0" /></a></font></div></td>
<td bordercolor="#EEEEEE" onclick="MM_openBrWindow('RepPlaning.php?ProjectId=<? echo $row[ProjectId]?>&Orderlist=<?php echo $row[Orderlist]?>&Project_code=<? echo $row[Project_code]?>&Faculty_code=<? echo $row[Faculty_code]?>','Detail','scrollbars=yes,width=750,height=400')"><div align="center"><font size="2" face="Tahoma"><a href="#"><img src="./picture/print.gif" alt="พิมพ์ใบขออนุมัติ" width="15" height="14" border="0" /></a></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="76%"><div align="right"><font color="#0033CC" size="2" face="Tahoma"><strong> </strong></font><font color="#0033CC" face="Tahoma"><span class="style12"><font color="#993333"> รวมจำนวนเงินทั้งหมด</font></span></font></div></td>
<td width="13%"><div align="right"><strong><font color="#993333" size="2" face="Tahoma">
<?php
$sql = "Select Sum(Budget_use) as Sum From project_type_tb Where Budget_Year='$Budget_Year' AND Faculty_code='$Faculty_code' and project_code='$Project_code' ";
$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="5%"> </td>
<td width="6%"> </td>
</tr>
</table></td>
</tr>
<tr bgcolor="#CCCCFF">
<td colspan="9" align="center" bgcolor="#FFFFFF" ><span class="style12"><font color="#000000" face="Tahoma">ทั้งหมด</font></span><strong><font color="#003399" size="2" face="Tahoma"> <? echo $num ?> </font></strong><font color="#FFFFFF" face="Tahoma"><span class="style12"><font color="#003366">รายการ</font></span></font><font color="#FFFFFF" size="2" face="Tahoma"><font color="#FFFFFF"> </font></font> </td>
</tr>
</table>
<div align="center">
<div align="center"><font color="#FFFFFF"> <font color="#FFFFFF" size="3" face="MS Sans Serif"><strong> <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><font color="#0033CC" size="2" face="Tahoma"> </font></strong></font><font color="#000000" size="2" face="Tahoma"> หน้า</font></font> <font color="#FFFFFF"><font color="#0033CC" size="2" face="Tahoma"><strong>
<?php
if ($Pre_Page)
echo"<a href=\"$PHP_SELF?Page=$Pre_Page&&Budget_Year=$Budget_Year&&Faculty_code=$Faculty_code\" 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&&Budget_Year=$Budget_Year&&Faculty_code=$Faculty_code\" 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&&Budget_Year=$Budget_Year&&Faculty_code=$Faculty_code\" class=\"PageLink\"><font =\"Ms San serif\" size=\"2\"><b> Next >></b> </font></a>";
?>
</strong></font></font></div>
</form>
</label>
</fieldset><br>
<font color="<?php echo $GLOBALS["COLOR_FONT_3"];?>" size="2"><b>หมายเหตุ :</b> ใช้เมาส์คลิกที่ชื่อ<br>
</font></td>
</tr>
</table>
|