Viewing file: courseInClassTable.php (6.71 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=windows-874" />
<link href="../css/default.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.myForm.courseId.value = courseId;
window.opener.document.myForm.courseCode.value = courseCode;
window.opener.document.myForm.courseName.value = courseName;
window.opener.document.myForm.courseUnit.value = courseUnit;
window.opener.document.myForm.conditionId1.value = conditionId1;
window.opener.document.myForm.conditionId2.value = conditionId2;
window.close();
}
</script>
</head>
<body bgcolor="#FFFFFF">
<form name="myForm" action="<?php echo $PHP_SELF;?>" method="post">
<table width="100%" border="0" cellspacing="1" cellpadding="1" bgcolor="silver">
<tr bgcolor="#FFFFFF">
<td width="100%" height="10"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td>รหัสวิชา <input type="text" name="cCode" size="8" value="<?=$_REQUEST['cCode'];?>" style="color:royalblue" />
ชื่อวิชาไทย
<input name="cName" type="text" style="color:royalblue" value="<?=$_REQUEST['cName'];?>" size="29" />
ชื่อวิชาอังกฤษ
<input name="cNameEng" type="text" style="color:royalblue" value="<?=$_REQUEST['cNameEng'];?>" size="29" />
<input type="submit" class="CURSOR-HAND" name="search" value="ค้นหา">
<input type="reset" class="CURSOR-HAND" 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="#FFFFFF">
<td height="10"></td>
</tr>
<tr>
<td height="22" align="center"><table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF" style="border:1px solid #F0F0F0">
<tr bgcolor="#F0F0F0">
<td width="7%" height="22" align="center"><strong>ลำดับที่</strong></td>
<td width="43%" align="center"><strong>รายวิชา</strong></td>
<td width="10%" align="center"><strong>หน่วยกิต</strong></td>
<td width="40%" align="center"><strong>หลักสูตร</strong></td>
</tr>
<?php
$i = 0;
if( $cCode != '' || $cName != '' || $cNameEng != '' ) {
$oCo->SearchByCourseCodeAndCourseName( $cCode, $cName, $cNameEng );
while( $oCo->GetRecord() ) {
$bgColor = ( $bgColor == "#FFFFFF" ) ? "#FBFBFB" : "#FFFFFF";
/* 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 bgcolor="<?=$bgColor;?>" onmouseover="this.style.backgroundColor='#F5F9F9'" onmouseout="this.style.backgroundColor=''">
<td height="20" align="center"><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><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;?>")'><a href="javascript:;"><?php echo $oCo->courseCode.' '.$oCo->courseName;?></a></font></td>
<td align="center"><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><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++;
} # while
?>
</font></td>
</tr>
<?php
$i++;
} // end if
} // end while
// } // end while
// } // end if
if( $i == 0 ) {
?>
<tr>
<td colspan="4" align="center" bgcolor="#FFFFFF" class="TEXT-RED10">** ไม่ปรากฏรายการดังกล่าวในฐานข้อมูล **</td>
</tr>
<?php
} # if
?>
</table></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="1" bgcolor="silver">
<tr>
<td height="10"></td>
</tr>
<tr>
<td>ทั้งหมด: <strong><?=$i;?></strong> รายการ</td>
</tr>
<tr>
<td align="center" bgcolor="#FFFFFF"><a href="#" class="TEXT-CLIMSON10" onClick="window.close()">[ <strong>ปิดหน้านี้</strong> ]</a></td>
</tr>
</table>
</form>
</body>
</html>
<?php
/*
$oCo->Destroy();
$oCp->Destroy();
$oCl->Destroy();
$oCp2->Destroy();
$oPg->Destroy();
$conn->Disconnect();
*/
?>
|