Viewing file: courseInClassTable.php (6.25 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include_once "../class/clsCourse.php";
include_once "../class/clsCourseInProgram.php";
include_once "../class/clsClass.php";
include_once "../class/clsProgram.php";
$conn = new Connection();
$oCo = new Course();
$oCp = new CourseInProgram();
$oCl = new Class1();
$oCp2 = new CourseInProgram();
$oPg = new Program();
?>
<html>
<head>
<title>ตารางรายวิชาในหลักสูตร</title>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<link href="../source/style.css" rel="stylesheet" type="text/css">
<style>
<!--
A:link {text-decoration: none }
A:visited {text-decoration: none}
A:hover {text-decoration: none; font-weight: underline}
-->
</style>
<!---------------------------------------Begin JavaScript---------------------------------------->
<script language="JavaScript">
function ReturnValue(courseId,courseCode,courseName,courseUnit,conditionId1,conditionId2)
{
window.opener.document.pc.courseId.value = courseId;
window.opener.document.pc.courseCode.value = courseCode;
window.opener.document.pc.courseName.value = courseName;
window.opener.document.pc.courseUnit.value = courseUnit;
window.opener.document.pc.conditionId1.value = conditionId1;
window.opener.document.pc.conditionId2.value = conditionId2;
window.close();
}
</script>
</head>
<body bgcolor="#FFFFFF">
<form name="pc" action="<?php echo $PHP_SELF;?>" method="post">
<table width="100%" border="0" cellspacing="1" cellpadding="1" bgcolor="silver">
<tr bgcolor="#FFFFFF">
<td colspan="4"><font face="Microsoft Sans Serif" size="2"><b>รหัสวิชา</b>
<input type="text" name="cCode" size="8">
<b>ชื่อวิชาไทย</b>
<input type="text" name="cName">
<b>ชื่อวิชาอังกฤษ</b></font>
<input type="text" name="cNameEng">
<input type="submit" name="search" value="ค้นหา">
<input type="reset" value="เคลียร์ข้อมูล">
<input type="hidden" value="<?php echo $programId;?>" name="programId">
<input type="hidden" value="<?php echo $semester;?>" name="semester">
<input type="hidden" value="<?php echo $acadYear;?>" name="acadYear">
<input type="hidden" value="<?php echo $studentYear;?>" name="studentYear"></td>
</tr>
<tr bgcolor="#0066CC">
<td width="7%" align="center"><font face="Microsoft Sans Serif" size="2" color="#FFFFFF"><b>ลำดับที่</b></font></td>
<td width="43%" align="center"><font face="Microsoft Sans Serif" size="2" color="#FFFFFF"><b>รายวิชา</b></font></td>
<td width="10%" align="center"><font face="Microsoft Sans Serif" size="2" color="#FFFFFF"><b>หน่วยกิต</b></font></td>
<td width="40%" align="center"><font face="Microsoft Sans Serif" size="2" color="#FFFFFF"><b>หลักสูตร</b></font></td>
</tr>
<?php
$i = 0;
if($cCode!='' || $cName!='' || $cNameEng!='') {
$oCo->SearchByCourseCodeAndCourseName($cCode, $cName, $cNameEng);
while($oCo->GetRecord()) {
/* if($programId == 'NULL')
$oCp->RSCourseInProgramByCoIdAndCoStatus($oCo->courseId);
else
$oCp->RSCourseInProgramByPgIdAndCoIdAndCoStatus($programId, $oCo->courseId);
while($oCp->GetRecord()) {
$res = 0;
// Not found -> Display
if($programId == 'NULL')
$oCl->RSClassByAcYAndStYAndSeAndCoIdAndNoPgId($acadYear, $studentYear, $semester, $oCo->courseId);
else {
$oCl->RSClassByPgIdIsNullAndAcYAndStYAndSeAndCoId($acadYear, $studentYear, $semester, $oCo->courseId);
$res = $oCl->GetRecord();
$oCl->SearchByKeyPgIdAndCoIdAndStudy($programId, $oCo->courseId, $studentYear, $semester, $acadYear);
}
if(!$res && !$oCl->GetRecord()) {
*/
?>
<tr>
<td align="center" bgcolor="#FFFFFF"><font size="2" face="Microsoft Sans Serif" style="CURSOR: hand" onClick='ReturnValue("<?php echo $oCo->courseId;?>","<?php echo $oCo->courseCode;?>","<?php echo $oCo->courseName;?>","<?php echo $oCo->courseUnit;?>","<?php echo $oCp->conditionId1;?>","<?php echo $oCp->conditionId2;?>")'><?php echo $i+1;?></font></td>
<td bgcolor="#FFFFFF"><font size="2" face="Microsoft Sans Serif" style="CURSOR: hand" onClick='ReturnValue("<?php echo $oCo->courseId;?>","<?php echo $oCo->courseCode;?>","<?php echo $oCo->courseName;?>","<?php echo $oCo->courseUnit;?>","<?php echo $oCp->conditionId1;?>","<?php echo $oCp->conditionId2;?>")'><?php echo $oCo->courseCode.' '.$oCo->courseName;?></font></td>
<td align="center" bgcolor="#FFFFFF"><font size="2" face="Microsoft Sans Serif" style="CURSOR: hand" onClick='ReturnValue("<?php echo $oCo->courseId;?>","<?php echo $oCo->courseCode;?>","<?php echo $oCo->courseName;?>","<?php echo $oCo->courseUnit;?>","<?php echo $oCp->conditionId1;?>","<?php echo $oCp->conditionId2;?>")'><?php echo $oCo->courseUnit;?></font></td>
<td bgcolor="#FFFFFF"><font size="2" face="Microsoft Sans Serif" style="CURSOR: hand" onClick='ReturnValue("<?php echo $oCo->courseId;?>","<?php echo $oCo->courseCode;?>","<?php echo $oCo->courseName;?>","<?php echo $oCo->courseUnit;?>","<?php echo $oCp->conditionId1;?>","<?php echo $oCp->conditionId2;?>")'>
<?php
$j = 0;
$oCp2->RSCourseInProgramByCd1AndCd2AndCoId($oCp->conditionId1, $oCp->conditionId2, $oCo->courseId);
while($oCp2->GetRecord()) {
$oPg->SearchByKey($oCp2->programId);
$oPg->GetRecord();
if($j > 0)
echo '<br>';
echo $oPg->programName;
$j++;
}
?>
</font></td>
</tr>
<?php
$i++;
} // end if
} // end while
// } // end while
// } // end if
if($i == 0) {
?>
<tr>
<td colspan="4" align="center" bgcolor="#FFFFFF"><font size="2" color="#FF0000" face="Microsoft Sans Serif">** ไม่ปรากฏรายการดังกล่าวในฐานข้อมูล **</font></td>
</tr>
<?php
}
?>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="1" bgcolor="silver">
<tr>
<td><font size="2" face="MS Sans Serif" color="<?php echo $GLOBALS['COLOR_FONT_4'];?>">หน้า-></font></td>
<td align="right"><font face="Microsoft Sans Serif" size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>">รวม <?php echo $i;?> รายการ</font></td>
</tr>
<tr>
<td align="center" colspan="2" bgcolor="#FFFFFF"><a href="#" onClick="window.close()"><font face="Microsoft Sans Serif" size="1">[ปิดหน้านี้]</font></a></td>
</tr>
</table>
</form>
</body>
</html>
<?php
$oCo->Destroy();
$oCp->Destroy();
$oCl->Destroy();
$oCp2->Destroy();
$oPg->Destroy();
$conn->Disconnect();
?>
|