Viewing file: PlanList.php (10.77 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");
ConnectDB();
$sql = "Select * From personal_tb Where Username='$Username'";
$result1 = mysql_query($sql) or die("error".mysql_error());
$rss = mysql_fetch_array($result1);
$Teacher_code = $rss["Teacher_code"];
$strSQL ="Select * From tech_plan_tb Where Teacher_code='$Teacher_code'";
if (! $Page)
$Page = 1;
$Pre_Page = $Page - 1;
$Next_Page = $Page +1;
$Per_Page =20;
$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) or die("Error $result".mysql_error());
$num = mysql_num_rows( $result );
?>
<html>
<head>
<title>Display Plan List</title>
<link rel="stylesheet" href="../../css/style1.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=windows-874"></head>
<body bgcolor="#FFFFFF">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="29" bgcolor="#0066CC"><div align="left"><img src="../../Image/Ponallogo.jpg" width="550" height="71"></div></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="2" bgcolor="#DBEFF7">
<tr bgcolor="#DBEFF7" background="../Image/bart1.jpg">
<td width="20%" height="25" bgcolor="#DBEFF7" background="../../Image/bart1.jpg" class="table" >
<div align="center"><font size="2" face="Tahoma"><strong><a href="../menu_teacher.php" class="d">กลับหน้าหลัก</a></strong></font></div></td>
<td width="20%" height="25" bgcolor="#DBEFF7" background="../../Image/bart1.jpg" class="table" >
<div align="center"><font size="2" face="Tahoma"><strong><a href="Frmplan.php?Teacher_code=<? echo $rss[Teacher_code]?>" class="d">เพิ่ม</a></strong></font></div></td>
<td width="20%" height="25" bgcolor="#DBEFF7" background="../../Image/bart1.jpg" class="table" >
<div align="center" ><font size="2" face="Tahoma"><strong><a href="EditPlanList.php?Teacher_code=<? echo $rss[Teacher_code]?>" class="d">แก้ไข</a></strong></font></div></td>
<td width="20%" height="25" bgcolor="#DBEFF7" background="../../Image/bart1.jpg" class="table" >
<div align="center"><font size="2" face="Tahoma"><strong><a href="../../logout.php" class="d">Logout</a></strong></font></div></td>
</tr>
</table></td>
</tr>
<tr>
<td><div align="center"><font color="#003366" size="2" face="Tahoma">ขณะนี้
อ.</font> <font color="#993333" size="2" face="Tahoma"><strong><?php echo $rss["Teacher_name"]?>
<?php echo $rss["Teacher_lastname"]?> </strong><font color="#000066">กำลัง</font></font><font color="#003366" size="2" face="Tahoma">ใช้งานระบบ</font></div></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bordercolor="#99CCFF" style="border:1px solid gray">
<tr >
<td colspan="6" bgcolor="#D3E4F8"> <div align="center"><font color="#FFFF99" size="4" face="Tahoma"><strong><font color="#003366">รายการแผนการสอนรายวิชา
ของ อ</font><font color="#000000">. <font size="2" face="Tahoma"><?php echo"$rss[Teacher_name]"?> </font></font>
<font size="2" face="Tahoma" color="#000000"> <?php echo"$rss[Teacher_lastname]"?></font></strong></font></div></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="4%"> <div align="center"><font color="#003399" size="2" face="Tahoma"><b>ลำดับ</b></font></div></td>
<td width="8%"> <div align="center"><font color="#003399" size="2" face="Tahoma"><b>รหัสวิชา</b></font></div></td>
<td width="49%"> <div align="center"><font color="#003399" size="2" face="Tahoma"><b>ชื่อวิชา</b></font></div></td>
<td width="16%"> <div align="center"><font color="#003399" size="2" face="Tahoma"><b>ภาคการสอน</b></font></div></td>
<td width="13%"> <div align="center"><font color="#003399" size="2" face="Tahoma"><b>วันที่เิ่ริ่มสอน</b></font></div></td>
<td width="10%"> <div align="center"><font color="#003399" size="2" face="Tahoma"><b>รายละเอียด</b></font></div></td>
</tr>
<?
$i = 1;
while($row = mysql_fetch_array($result))
{
if($count==0)
{
?>
<tr bordercolor="#EEEEEE" >
<td align=center bgcolor="#EEEEEE" ><strong><font color="#000000" size="2" face="Tahoma">
<?
$no = ($Per_Page * ( $Page -1))+$i ;
echo $no;
?>
</font></strong></td>
<td align=center bgcolor="#EEEEEE" > <div align="center"><font color="#0033CC" size="2" face="Tahoma">
<?php
$Subject_no = $row["Subject_no"];
$strsql = "Select * From subject_tb Where Subject_no='$Subject_no'";
$result_1 = mysql_query($strsql) or die("Error".mysql_error());
$rss2 = mysql_fetch_array($result_1);
echo"$rss2[Subject_code]";
?></a>
</font></div></td>
<td align=center bgcolor="#EEEEEE" > <div align="left"><font color="#000000" size="2" face="Tahoma">
<?php
$Subject_no = $row["Subject_no"];
$strSQL1 = "SELECT * FROM subject_tb WHERE Subject_no='$Subject_no' ";
$result1= mysql_query($strSQL1);
$rs1 = mysql_fetch_array($result1);
echo"<a href=\"../../edu_depart/Subject/SubjectDetail.php?Subject_no=$rs1[Subject_no]\" class=\"d\">";
echo"$rs1[Subject_name]";
echo"</a>";
?>
</font></div></td>
<td bgcolor="#EEEEEE"> <div align="left"><font color="#000000" size="2" face="Tahoma">
<?php
$Method_code = $row["Method_code"];
$strSQL2 = "SELECT * FROM method_tb WHERE Method_code='$Method_code' ";
$result2= mysql_query($strSQL2);
$rs2 = mysql_fetch_array($result2);
echo"$rs2[Method_name]";
?>
</font></div></td>
<td bgcolor="#EEEEEE" > <div align="center"><font color="#003366" size="2" face="Tahoma">
<?php
$sday = $row[Start_date];
$yearthai = explode("-",$sday);
$day = intval($yearthai[2]);
$month = intval($yearthai[1]);
$year = intval($yearthai[0]);
//////////////////
// $yearthai = $day ;
$m = getThaiSubMonth($month);
$year = getYear($year);
echo"$day"." "."$m"." "."$year";
?>
</font></div></td>
<td bgcolor="#EEEEEE" > <div align="center"><font color="#000000" size="2" face="Tahoma"> <a href="PlanDetail.php?Teacher_code=<? echo $row[Teacher_code]?>&Plan_code=<? echo $row[Plan_code]?>" class="c">แผนการสอน</a></font></div></td>
</tr>
<?
$count=1;
}
else
{
?>
<tr bordercolor="#EEEEEE">
<td align="center" bgcolor="#FFFFFF" ><strong><font color="#000000" size="2" face="Tahoma">
<?
$no = ($Per_Page * ( $Page -1))+$i ;
echo $no;
?>
</font></strong></td>
<td align="center" bgcolor="#FFFFFF" > <div align="center"><font color="#0033CC" size="2" face="Tahoma">
<?php
$Subject_no = $row["Subject_no"];
$strsql = "Select * From subject_tb Where Subject_no='$Subject_no'";
$result_1 = mysql_query($strsql) or die("Error".mysql_error());
$rss2 = mysql_fetch_array($result_1);
echo"$rss2[Subject_code]";
?>
</font></div></td>
<td align="center" > <div align="left"><font color="#000000" size="2" face="Tahoma">
<?php
$Subject_no = $row["Subject_no"];
$strSQL1 = "SELECT * FROM subject_tb WHERE Subject_no='$Subject_no' ";
$result1= mysql_query($strSQL1);
$rs1 = mysql_fetch_array($result1);
echo"<a href=\"../../edu_depart/Subject/SubjectDetail.php?Subject_no=$rs1[Subject_no]\" class=\"d\">";
echo"$rs1[Subject_name]";
echo"</a>";
?>
</font></div></td>
<td bgcolor="#FFFFFF"> <div align="left"><font color="#000000" size="2" face="Tahoma">
<?php
$Method_code = $row["Method_code"];
$strSQL2 = "SELECT * FROM method_tb WHERE Method_code='$Method_code' ";
$result2= mysql_query($strSQL2);
$rs2 = mysql_fetch_array($result2);
echo"$rs2[Method_name]";
?>
</font></div></td>
<td bgcolor="#FFFFFF" > <div align="center"><font color="#003366" size="2" face="Tahoma">
<?php
$sday = $row[Start_date];
$yearthai = explode("-",$sday);
$day = intval($yearthai[2]);
$month = intval($yearthai[1]);
$year = intval($yearthai[0]);
//////////////////
// $yearthai = $day ;
$m = getThaiSubMonth($month);
$year = getYear($year);
echo"$day"." "."$m"." "."$year";
?>
</font></div></td>
<td bgcolor="#FFFFFF" ><div align="center"><font color="#000000" size="2" face="Tahoma"> <a href="PlanDetail.php?Teacher_code=<?echo $row[Teacher_code]?>&Plan_code=<?echo $row[Plan_code]?>" class="c">แผนการสอน</a></font></div></td>
</tr>
<?
$count=0;
}
$i++;
}
CloseDB();
?>
<tr>
<td colspan="6" align="center" bgcolor="#D3E4F8"> <div align="center"><font color="#003366" size="2" face="Tahoma">ทั้งหมด
<? echo $num ?> รายการ</font></div></td>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bordercolor="#99CCFF">
<tr>
<td align="right" bordercolor="#CCCCCC" bgcolor="#FFFFFF" class="Tahoma11">
<div align="center"><font color="#FFFFFF"> <font color="#FFFFFF" size="3" face="MS Sans Serif"><strong>
<font color="#003366" size="2" face="Tahoma"><?php echo $Num_Pages;?></font></strong></font><font color="#003366" size="2" face="Tahoma"><strong> หน้า</strong></font>
<font color="#003366" size="2" face="Tahoma"><strong>
<?php
if ($Pre_Page)
echo"<a href=\"$PHP_SELF?Page=$Pre_Page\" 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\" 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\" class=\"PageLink\"><font =\"Ms San serif\" size=\"2\"><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=FrmLogin.php\" target=\"mainFrame\">\n";
echo"Please Login ";
}
?>
|