Viewing file: EditPlanList.php (13.2 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'";
$result = mysql_query($sql) or die("Cannot Select").mysql_error();
$rs = mysql_fetch_array($result);
$Teacher_code = $rs[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 );
?>
<meta http-equiv="Content-Type" content="text/html; charset=TIS-620">
<link rel="stylesheet" href="../css/cart4.css" type="text/css">
<style type="text/css">
<!--
.style14 {color: #000000}
.style18 {font-size: 14px}
-->
</style>
<table width="807" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="807"><span class="style18"><br>
</span>
<fieldset>
<legend><span class="style18"><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><a href="menu_teacher.php " >หน้าหลัก</a> <img src="../picture/ico3.gif" width="10" height="10" border="0" align="absmiddle"><a href="addPlan.php?Teacher_code=<? echo $rs[Teacher_code] ?>">เพิ่มข้อมูลแผนการสอน</a> <img src="../picture/ico3.gif" width="10" height="10" border="0" align="absmiddle" /><a href="PlanList.php?Teacher_code=<? echo $rs[Teacher_code] ?>">ข้อมูลแผนการสอนรายวิชา</a><img src="../picture/ico3.gif" width="10" height="10" border="0" align="absmiddle" />แก้ไขแผนการสอนรายวิชา</font></span></legend>
<label><div align="center">
<form id="form1" name="form1" method="post" action="DelPlan2.php">
<table width="93%" border="0" align="center" cellpadding="0" cellspacing="0" style=" border:1px solid gray"size="12">
<tr>
<td height="29" background="../Image/barIns2.jpg" bgcolor="#D1E1F0"><div align="center" class="style18">
<font face="Tahoma">
<input type="hidden" name="Teacher_code" value="<?=$Teacher_code;?>" />
ขณะนี้ อ.<font color="#993333"><strong><? echo $rs['Teacher_name'] ?> <? echo $rs['Teacher_lastname'] ?> </strong></font><span class="style14">รหัสประจำตัว</span> <font color="#993333"><strong><? echo $rs['Teacher_id'] ?></strong></font> กำลังใช้งานระบบ</font></div></td>
</tr>
<tr>
<td height="43" ><table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#EEEEEE" style="border:1px solid gray">
<tr >
<td colspan="8" bgcolor="#D3E4F8"><div align="center"><font color="#FFFF99" size="4" face="Tahoma"><strong> <font color="#FF0000">แก้ไข</font> <font color="#003366">รายการแผนการสอนรายวิชา</font></strong></font></div></td>
</tr>
<tr bordercolor="#006633">
<td width="3%" bgcolor="#CCCCCC" class="style18"><div align="center" class="style18"><font color="#993333" face="Tahoma">ลบ</font></div></td>
<td width="3%" bgcolor="#CCCCCC" class="style18"><div align="center" class="style18"><font color="#003366" face="Tahoma">no.</font></div></td>
<td width="9%" bgcolor="#CCCCCC" class="style18"><div align="center" class="style18"><font color="#003366" face="Tahoma">รหัสวิชา</font></div></td>
<td width="42%" bgcolor="#CCCCCC" class="style18"><div align="center" class="style18"><font color="#003366" face="Tahoma">ชื่อวิชา</font></div></td>
<td width="10%" bgcolor="#CCCCCC" class="style18"><div align="center" class="style18"><font color="#003366" face="Tahoma">ภาคการสอน</font></div></td>
<td width="13%" bgcolor="#CCCCCC" class="style18"><div align="center" class="style18"><font color="#003366" face="Tahoma">วันที่เริ่มสอน</font></div></td>
<td width="12%" bgcolor="#CCCCCC" class="style18"><div align="center" class="style18"><font color="#003366" face="Tahoma">รายละเอียด</font></div></td>
<td width="4%" bgcolor="#CCCCCC" class="style18"><div align="center" class="style18"><font color="#993333" face="Tahoma"><font color="#003399">แก้ไข</font> </font></div></td>
</tr>
<?
$i = 1;
while($row = mysql_fetch_array($result))
{
if($count==0)
{
?>
<tr bordercolor="#eeeeee" >
<td align="center" bgcolor="#eeeeee" ><input type="checkbox" name="checkbox[]" value="<? echo $row[Plan_code] ?>" /></td>
<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
$courseId = $row["courseId"];
$strsql = "Select * From Course Where courseId='$courseId'";
$result_1 = mysql_query($strsql) or die("Error".mysql_error());
$rss2 = mysql_fetch_array($result_1);
echo"$rss2[courseCode]";
?>
</a> </font></div></td>
<td align="center" bordercolor="#eeeeee" bgcolor="#eeeeee" ><div align="left"><font color="#000000" size="2" face="Tahoma">
<?php
$courseId = $row["courseId"];
$strSQL1 = "SELECT * FROM Course WHERE courseId='$courseId' ";
$result1= mysql_query($strSQL1);
$rs1 = mysql_fetch_array($result1);
echo"<a href=\"SubjectDetail.php?courseId=$rs1[courseId]\" class=\"d\">";
echo"$rs1[courseName] <b>$rs1[courseUnit]";
echo"</a>";
?>
</font></div></td>
<td bgcolor="#eeeeee"><div align="left"><font color="#003366" 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 bordercolor="#eeeeee" 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="g">แผนการสอน</a></font></div></td>
<td bgcolor="#eeeeee" ><div align="center"><font size="2" face="Tahoma"><a href="FrmEditPlan.php?Plan_code=<? echo $row[Plan_code]?>&&Teacher_code=<? echo $row[Teacher_code]?>"><img src="../picture/edit.gif" width="15" height="12" border="0" /></a></font></div></td>
</tr>
<?
$count=1;
}
else
{
?>
<tr bordercolor="#FFFFFF">
<td align="center" ><input type="checkbox" name="checkbox[]2" value="<? echo $row[Plan_code] ?>" /></td>
<td align="center" ><strong><font color="#000000" size="2" face="Tahoma">
<?
$no = ($Per_Page * ( $Page -1))+$i ;
echo $no;
?>
</font></strong></td>
<td align="center" bordercolor="#eeeeee" ><div align="center"><font color="#0033CC" size="2" face="Tahoma">
<?php
$courseId = $row["courseId"];
$strsql = "Select * From Course Where courseId='$courseId'";
$result_1 = mysql_query($strsql) or die("Error".mysql_error());
$rss2 = mysql_fetch_array($result_1);
echo"$rss2[courseCode]";
?>
</font></div></td>
<td align="center" ><div align="left"><font color="#000000" size="2" face="Tahoma">
<?php
$courseId = $row["courseId"];
$strSQL1 = "SELECT * FROM Course WHERE courseId='$courseId' ";
$result1= mysql_query($strSQL1);
$rs1 = mysql_fetch_array($result1);
echo"<a href=\"SubjectDetail.php?courseId=$rs1[courseId]\" class=\"d\">";
echo"$rs1[courseName] <b>$rs1[courseUnit]";
echo"</a>";
?>
</font></div></td>
<td><div align="left"><font color="#003366" 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 ><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 ><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="g">แผนการสอน</a></font></div></td>
<td ><div align="center"><font size="2" face="Tahoma"><a href="FrmEditPlan.php?Plan_code=<? echo $row[Plan_code]?>&&Teacher_code=<? echo $row[Teacher_code]?>"><img src="../picture/edit.gif" width="15" height="12" border="0" /></a></font></div></td>
</tr>
<?
$count=0;
}
$i++;
}
CloseDB();
?>
<tr>
<td colspan="8" align="center" bgcolor="#CCCCCC"><div align="center"><font color="#003366" size="2" face="Tahoma">ทั้งหมด <? echo $num ?> รายการ</font></div></td>
</tr>
<tr>
<td height="24" colspan="8" align="center" bgcolor="#D3E4F8"><input type="submit" name="Submit" value=" ลบ " /></td>
</tr>
</table></td>
</tr>
</table>
<table width="95%" 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>
<table width="93%" border="0" align="center" cellpadding="0" cellspacing="0" style=" border:1px solid gray"size="12">
</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 ";
}
?>
|