Viewing file: programs.php (12.11 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/** Define Validate Access */
define( '_VALID_ACCESS', 1 );
/** Configuration */
include( "configuration.php" );
require_once( $_Config_absolute_path . "/includes/framework.php" );
require_once( $_Config_absolute_path . "/includes/FunctionDB.php" );
/** Create Database Object */
$dbObj = new DBConn;
/** Course */
//include_once "template.php";
include_once "./class/clsProgram.php";
include_once "./class/clsLevel.php";
include_once "./class/clsProgramStructure.php";
include_once "./class/clsCourseInProgram.php";
include_once "./class/clsCourse.php";
include_once "./class/clsCondition.php";
include_once "global.php";
$conn = new Connection();
$oPg = new Program();
$oPg2 = new Program();
$oLv = new Level();
$oPs = new ProgramStructure();
$oPs2 = new ProgramStructure();
$oPs3 = new ProgramStructure();
$oPs4 = new ProgramStructure();
$oCi = new CourseInProgram();
$oCo = new Course();
$oCd = new Condition();
$oCd2 = new Condition();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title><?=$_Config_sitename;?> - รายวิชาที่เปิดสอน - หลักสูตรที่เปิดสอน</title>
<script type="text/javascript" src="./js/utilities.js"></script>
<link href="./css/default.css" rel="stylesheet" type="text/css" />
</head>
<body topmargin="0" rightmargin="0" bottommargin="0" leftmargin="0">
<?php
include( "./templates/incHeader.php" );
?>
<table width="1003" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="215" align="left" valign="top" style="padding:10px 0px 0px 5px"><?php include( "templates/incMainMenuLeft.php" );?></td>
<td width="788" height="300" align="center" valign="top" style="padding:10px 0px 5px 10px"><fieldset><table width="770" border="0" cellspacing="0" cellpadding="0">
<form id="myForm" name="myForm" method="post" action="<?=$PHP_SELF;?>?page=<?=$page;?>&<?=$param;?>">
<tr>
<td height="5"></td>
</tr>
<tr>
<td height="30" background="images/background/bg-head-topic-w780.gif"><span class="PADDING-LEFT-10"><strong><a href="index.php">หน้าหลัก</a></strong> <strong>» <a href="Menu_Edu.php">ข้อมูลฝ่ายวิชาการ</a> » <a href="CourseList.php">รายชื่อหลักสูตร</a> » <span class="NOTE">หลักสูตรที่เปิดสอน</span></strong></span></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td align="center" valign="top"><table width="750" border="0" cellspacing="1" cellpadding="1">
<tr>
<td></td>
</tr>
<tr>
<td><b>หลักสูตร : </b>
<?php
$oPg->SearchByKey($programId);
$oPg->GetRecord();
?>
<select name="programId" onChange="location.href='<?php echo $PHP_SELF;?>?programId='+encodeURI(options[selectedIndex].value)">
<?php
if($oPg->programId != '' ) {
?>
<option value="<?php echo $oPg->programId;?>" <?php if($oPg->programId!='') echo "selected";?>><?php echo $oPg->programCode1." ".$oPg->programName;?></option>
<?php
}
?>
<option value="0" <?php if($oPg->programId=='') echo "selected";?>>--เลือกหลักสูตร--</option>
<?php
$i=0;
$oPg->RSProgram();
while($oPg->GetRecord()){
?>
<option value="<?php echo $oPg->programId;?>"><?php echo $oPg->programCode1." ".$oPg->programName;?></option>
<?
$i++;
}
?>
</select></td>
</tr>
<?php
if($programId!=0){
$oPg2->SearchByKey($programId);
$oPg2->GetRecord();
$oLv->SearchByKey($oPg2->levelId);
$oLv->GetRecord();
?>
<tr>
<td align="center"><br>
<table width="750">
<tr>
<td colspan="4" height="22"><font size="4" class="NOTE"><b>โครงสร้างหลักสูตร</b></font></td>
</tr>
<tr>
<td colspan="4" height="22"><font size="3" color="<?php echo $GLOBALS['COLOR_FONT_4']; ?>"><b>หลักสูตร : </b><?php echo $oPg2->programName;?></font></td>
</tr>
<tr>
<td colspan="4" height="22"><font size="3" color="<?php echo $GLOBALS['COLOR_FONT_4']; ?>"><b>ระดับการศึกษา : </b><?php echo $oLv->levelName;?></font></td>
</tr>
<tr>
<td colspan="4" height="22"><font size="3" color="<?php echo $GLOBALS['COLOR_FONT_4']; ?>"><b>จำนวนหน่วยกิตที่เรียน : </b><?php echo $oPg2->creditTotal;?> <b> หลักสูตร : </b><?php echo $oPg2->studyYear." ปี";?> <b> จำนวนปีที่ศึกษาสูงสุด : </b><?php echo $oPg2->studyYearMax." ปี";?></font></td>
</tr>
<tr>
<td colspan="4" height="22"><font size="3" color="<?php echo $GLOBALS['COLOR_FONT_4']; ?>"> </font></td>
</tr>
<?php
$ci=0;
$cdStr='';
$cdStr2='';
$oPs->RSProgramStructureByPgIdOredrBySeq($programId);
while($oPs->GetRecord()){
$oCd->SearchByKey($oPs->conditionId1);
$oCd->GetRecord();
$oCd2->SearchByKey($oPs->conditionId2);
$oCd2->GetRecord();
$sum=0;
if($cdStr!=$oPs->conditionId1){
$cdStr=$oPs->conditionId1;
?>
<tr>
<td colspan="4" height="22"><font color="<?php echo $GLOBALS['COLOR_FONT_3']; ?>" size="3" class="TEXT-HEADER11-BLUE"><b><?php echo $oPs->sequence.". ";?><?php echo "หมวดวิชา".$oCd->condition.", จำนวน ".$oPs->creditTotal." หน่วยกิต";?></b></font></td>
</tr>
<?php
$ci=$oPs2->CountCondition1($programId,$oPs->conditionId1);
}
if($oPs->conditionId2!=1) {
?>
<tr>
<td colspan="4" height="22"><font color="<?php echo $GLOBALS['COLOR_FONT_3']; ?>" size="3" class="TEXT-HEADER11-BLUE"><?php echo $oPs->sequence.". ";?><?php echo "กลุ่มวิชา".$oCd2->condition.", จำนวน ".$oPs->creditTotal." หน่วยกิต";?></font></td>
</tr>
<tr bgcolor="#CCCCCC">
<td align="center" height="22" width="100"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_1']; ?>"><b>รหัสวิชา</b></font></td>
<td align="center" width="400"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_1']; ?>"><b>รายวิชา</b></font></td>
<td align="center" width="100"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_1']; ?>"><b>หน่วยกิต</b></font></td>
</tr>
<?php
$j=0;
$oCi->RSCourseInProgramByPgIdAndCd1AndCd2($programId, $oPs->conditionId1, $oPs->conditionId2);
while($oCi->GetRecord()){
$oCo->SearchByKey($oCi->courseId);
$oCo->GetRecord();
?>
<tr>
<td height="22"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4']; ?>"><b> <?php echo $oCo->courseCode;?></b></font></td>
<td><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4']; ?>"> <?php echo $oCo->courseName;?></font></td>
<td align="center"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4']; ?>"><?php echo $oCo->courseUnit;?></font></td>
</tr>
<?php
$sum=$oCo->creditTotal+$sum;
$j++;
}
if($j==0){
?>
<tr>
<td height="22" colspan="3" align="center" class="TEXT-RED10"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_3']; ?>">** ไม่ปรากฏรายการรายวิชาในหมวดวิชา หรือ กลุ่มวิชาดังกล่าว **</font></td>
</tr>
<?php
}
?>
<tr bgcolor="<?php echo $GLOBALS["COLOR_BG_TABLE_3"];?>">
<td height="22" colspan="2" align="right"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4']; ?>"><b>รวมจำนวนหน่วยกิต</b></font> </td>
<td align="center"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4']; ?>"><?php echo $sum;?></font></td>
</tr>
<tr><td> </td></tr>
<?php
} else if($oPs->conditionId2==1 && $ci==1 && strlen($oPs->sequence)==1) {
?>
<tr bgcolor="#CCCCCC">
<td align="center" height="22" width="100"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_1']; ?>"><b>รหัสวิชา</b></font></td>
<td align="center" width="400"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_1']; ?>"><b>รายวิชา</b></font></td>
<td align="center" width="100"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_1']; ?>"><b>หน่วยกิต</b></font></td>
</tr>
<?php
$j=0;
$oCi->RSCourseInProgramByPgIdAndCd1AndCd2($programId, $oPs->conditionId1, $oPs->conditionId2);
while($oCi->GetRecord()){
$oCo->SearchByKey($oCi->courseId);
$oCo->GetRecord();
?>
<tr>
<td height="22"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4']; ?>"><b> <?php echo $oCo->courseCode;?></b></font></td>
<td><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4']; ?>"> <?php echo $oCo->courseName;?></font></td>
<td align="center"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4']; ?>"><?php echo $oCo->courseUnit;?></font></td>
</tr>
<?php
$sum=$oCo->creditTotal+$sum;
$j++;
}
if($j==0){
?>
<tr>
<td height="22" colspan="3" align="center" class="TEXT-RED10"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_3']; ?>">** ไม่ปรากฏรายการรายวิชาในหมวดวิชา หรือ กลุ่มวิชาดังกล่าว **</font></td>
</tr>
<?php
}
?>
<tr bgcolor="<?php echo $GLOBALS["COLOR_BG_TABLE_3"];?>">
<td height="22" colspan="2" align="right"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4']; ?>"><b>รวมจำนวนหน่วยกิต</b></font> </td>
<td align="center"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4']; ?>"><?php echo $sum;?></font></td>
</tr>
<tr><td> </td></tr>
<?php
}
} // end of loop while
?>
</table></td>
</tr>
<?php
}
?>
<tr><td> </td></tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr></form>
</table>
</fieldset></td>
</tr>
</table>
<?php include( "./templates/incFooter.php" ); ?>
</body>
</html>
<?php
/** Free Resource */
$dbObj->freeresult($result);
/** Close the Database */
$dbObj->disconn();
$oPg->Destroy();
$conn->Disconnect();
/** Unset Class */
unset($dbObj);
?>
|