Viewing file: PlanCodeDetail.php (10.44 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include("../link/function.php");
include("../include/FunctionDB.php");
include("../include/Function.php");
ConnectDB();
$strSQL = "SELECT * FROM project_type_tb Where Budget_Year='$Budget_Year' and Flag='Y' 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 );
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>รายละเอียดโควตา</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<link href="../source/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style23 {font-size: 14px}
.style24 {
font-family: Tahoma;
font-size: 14px;
}
-->
</style>
<!---------------------------------------Begin JavaScript---------------------------------------->
<SCRIPT LANGUAGE="JavaScript" src="../source/script.js"></SCRIPT>
<script language="JavaScript">
function ReturnValue(ProjectId,Orderlist,Project_plan,Budget_Year,MoneyS_C,MoneyId,Faculty_code,Project_code)
{
// if(id == 1){
window.opener.document.form1.ProjectId.value = ProjectId;
window.opener.document.form1.Orderlist.value = Orderlist;
window.opener.document.form1.Project_plan.value = Project_plan;
window.opener.document.form1.Budget_Year.value = Budget_Year;
window.opener.document.form1.Year_std.value = Budget_Year;
window.opener.document.form1.MoneyS_C.value = MoneyS_C;
window.opener.document.form1.MoneyId.value = MoneyId;
window.opener.document.form1.Faculty_code.value = Faculty_code;
window.opener.document.form1.Project_code.value = Project_code;
window.close();
}
/*
if(id == 2){
window.opener.document.pc.quotaId2.value = quotaId;
window.opener.document.pc.provinceId2.value = provinceId;
}
if(id == 3){
window.opener.document.pc.quotaId3.value = quotaId;
window.opener.document.pc.provinceId3.value = provinceId;
}
if(id == 4){
window.opener.document.pc.quotaId4.value = quotaId;
window.opener.document.pc.provinceId4.value = provinceId;
}
if(id == 5){
window.opener.document.pc.quotaId5.value = quotaId;
window.opener.document.pc.provinceId5.value = provinceId;
}
if(id == 6){
window.opener.document.pc.quotaId6.value = quotaId;
window.opener.document.pc.provinceId6.value = provinceId;
}
if(id == 7){
window.opener.document.pc.quotaId7.value = quotaId;
window.opener.document.pc.provinceId7.value = provinceId;
}
if(id == 8){
window.opener.document.pc.quotaId8.value = quotaId;
window.opener.document.pc.provinceId8.value = provinceId;
}
if(id == 9){
window.opener.document.pc.quotaId9.value = quotaId;
window.opener.document.pc.provinceId9.value = provinceId;
}
if(id == 10){
window.opener.document.pc.quotaId10.value = quotaId;
window.opener.document.pc.provinceId10.value = provinceId;
}
if(id == 11){
window.opener.document.pc.quotaId11.value = quotaId;
window.opener.document.pc.provinceId11.value = provinceId;
}
if(id == 12){
window.opener.document.pc.quotaId12.value = quotaId;
window.opener.document.pc.provinceId12.value = provinceId;
}
window.opener.document.pc.No_in.value = No_in;
window.opener.document.pc.provinceName.value = provinceName;
if(id == 1 && window.opener.document.pc.countQuota.value == 1){
window.opener.document.pc.quotaName.value = quotaTypeName;
window.opener.document.pc.provinceName.value = provinceName;
}
if((id != 1 || id == 1) && window.opener.document.pc.countQuota.value != 1){
window.opener.document.pc.quotaName[id-1].value = quotaTypeName;
window.opener.document.pc.provinceName[id-1].value = provinceName;
}
window.close();
}
*/
</script>
</head>
<form name="pc" action="<?php echo $PHP_SELF?>" method="post">
<div align="center">
<p align="left"><font size="2" face="Tahoma"><img src="../picture/previous.gif" onClick="window.history.back()" width="85" height="22" border="0" /></font></p>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="background-color:#eeeeee; border:0px solid gray">
<tr bgcolor="#E6E6E6">
<td width="816" align="center" style="border:1px solid gray"><div align="left"><span class="style23"><font color="#000000" face="Tahoma"><font color="#000000" face="Tahoma">ข้อแผน/กิจกรรม</font></font></span></div></td>
<td width="159" align="center" style="border:1px solid gray"><span class="style24">หมวดเงิน</span></td>
<td width="48" align="center" style="border:1px solid gray"><span class="style23"><font color="#000000" face="Tahoma">เลือก</font></span></td>
</tr>
<?php
$i = 1;
while($row = mysql_fetch_array($result))
{
if($count==0)
{
?>
<tr bgcolor="#F7F7F7" >
<td bgcolor="#FFFFFF"><font color="#996600" size="2" face="Tahoma"><a href="#"><font size="2" face="Tahoma">
<?=$row["Orderlist"]?>
</font></a></a></font><font color="#996600" size="2" face="Tahoma" onclick='ReturnValue("<?php echo $row["ProjectId"]?>","<?php echo $row["Orderlist"]?>","<?php echo $row["Project_plan"]?>","<?php echo $row["Budget_Year"]?>","<?php echo $row["MoneyS_C"]?>","<? echo $row["MoneyId"]?>","<? echo $row["Faculty_code"]?>","<? echo $row["Project_code"]?>")'><a href="#" >
<?=$row["Project_plan"]?>
</a></a></font></td>
<td width="159" align="center" bgcolor="#FFFFFF" ><div align="left"><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="48" align="center" bgcolor="#FFFFFF" ><font size="2" face="Microsoft Sans Serif" style="CURSOR: hand" onClick='ReturnValue("<?php echo $row["ProjectId"]?>","<?php echo $row["Orderlist"]?>","<?php echo $row["Project_plan"]?>","<?php echo $row["Budget_Year"]?>","<?php echo $row["MoneyS_C"]?>","<? echo $row["MoneyId"]?>","<? echo $row["Faculty_code"]?>","<? echo $row["Project_code"]?>")'><a href="#" ><img src="../picture/addc.gif" width="15" height="19" border="0" align="absmiddle" /></a></font></td>
</tr>
<?
$count=1;
}
else
{
?>
<tr bgcolor="#FFFFFF">
<td bgcolor="#ECF5FF"><font color="#996600" size="2" face="Tahoma"><a href="#"><font size="2" face="Tahoma">
<?=$row["Orderlist"]?>
</font></a></a></font><font color="#996600" size="2" face="Tahoma" onClick='ReturnValue("<?php echo $row["ProjectId"]?>","<?php echo $row["Orderlist"]?>","<?php echo $row["Project_plan"]?>","<?php echo $row["Budget_Year"]?>","<?php echo $row["MoneyS_C"]?>","<? echo $row["MoneyId"]?>","<? echo $row["Faculty_code"]?>","<? echo $row["Project_code"]?>")'><a href="#" >
<?=$row["Project_plan"]?>
</a></a></font></td>
<td align="center" bordercolor="#FFFFFF" bgcolor="#ECF5FF" ><div align="left"><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 align="center" bordercolor="#FFFFFF" bgcolor="#ECF5FF" ><font size="2" face="Microsoft Sans Serif" style="CURSOR: hand" onClick='ReturnValue("<?php echo $row["ProjectId"]?>","<?php echo $row["Orderlist"]?>","<?php echo $row["Project_plan"]?>","<?php echo $row["Budget_Year"]?>","<?php echo $row["MoneyS_C"]?>","<? echo $row["MoneyId"]?>","<? echo $row["Faculty_code"]?>","<? echo $row["Project_code"]?>")'><a href="#" ><img src="../picture/addc.gif" width="15" height="19" border="0" align="absmiddle" /></a></font></td>
</tr>
<?
$count=0;
}
$i++;
}
?>
<tr bgcolor="#CCCCFF">
<td height="25" colspan="3" 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>
<td height="24" colspan="3" align="center"><div align="center"><font color="#FFFFFF"> <font color="#FFFFFF" size="3" face="MS Sans Serif"><strong> <font color="#0033CC"><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 size="2" face="Tahoma"> </font></font></strong></font><font color="#000000" size="2" face="Tahoma"><strong> หน้า</strong></font> <font color="#0033CC" size="1" face="Tah<?php echo $Num_Pages;?>oma"><strong>
<?php
if ($Pre_Page)
echo"<a href=\"$PHP_SELF?Page=$Pre_Page&Year=$Year&Teacher_code=$Teacher_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&Year=$Year&Teacher_code=$Teacher_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&Year=$Year&Teacher_code=$Teacher_code\" class=\"PageLink\"><font =\"Ms San serif\" size=\"2\"><b> Next >></b> </font></a>";
?>
</strong></font> </font></div></td>
</tr>
<tr>
<td align="center" colspan="3"><a href="#" onClick="window.close()"><font face="Microsoft Sans Serif" size="1">[ปิดหน้านี้]</font></a></td>
</tr>
<tr>
<td height="2"> </tr>
</table>
</div>
</form>
|