<?php
include_once "global.php";
include_once 
"class/clsClass.php";
include_once 
"class/clsProgram.php";
include_once 
"class/clsSysSemesterDes.php";
include_once 
"class/clsSysStudentYearDes.php";
include_once 
"class/clsCourse.php";

$conn = new Connection();

$oCl = new Class1();
$oPg = new Program();
$oSsd = new SysSemesterDes();
$oSsy = new SysStudentYearDes();
$oCo = new Course();
?>
<meta http-equiv="Content-Type" content="text/html; charset=TIS-620">
<link href="source/style.css" rel="stylesheet" type="text/css">
<table width="420" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td><fieldset>
            <legend align="center"><font size="3" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><b>รายละเอียดข้อมูลรายวิชาที่เปิดสอน</b></font></legend>
            <label><div align="center"><br><table width="400" align="center" border="0" cellpadding="0" cellspacing="1">
                <tr>
                    <td align="center"><table width="400" border="0" cellpadding="1" cellspacing="1" bordercolor="<?php echo $GLOBALS["COLOR_BORDER_TABLE_2"];?>">
<?php
                        $oCl
->SearchByKey($classId);
                        
$oCl->GetRecord();
?>
                        <tr>
                            <td width="130"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>"><strong>รหัสรายวิชาที่เปิดสอน</strong></font></td>
                            <td width="10">&nbsp;</td>
                            <td width="260"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>"><?php echo $oCl->classId;?></font></td>
                        </tr>
                        <tr>
                            <td height="22" bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_4"];?>"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>"><b>หลักสูตร</b></font></td>
                            <td height="22" bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_4"];?>">&nbsp;</td>
                            <td height="22" bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_4"];?>"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>"><?php if($programId=='NULL'){ echo "ไม่ระบุหลักสูตร";}else{ $oPg->SearchByKey($oCl->programId); $oPg->GetRecord(); echo $oPg->programName; } ?></font></td>
                        </tr>
                        <tr>
                            <td><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>"><strong>ปี</strong></font></td>
                            <td>&nbsp;</td>
                            <td><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>"><?php echo $oCl->acadYear;?></font></td>
                        </tr>
                        <tr>
                            <td bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_4"];?>"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>"><strong>ชั้นปี</strong></font></td>
                            <td bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_4"];?>">&nbsp;</td>
                            <td bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_4"];?>"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>"><?php $oSsy->SearchByKey($oCl->studentYear); $oSsy->GetRecord(); echo $oSsy->studentYearName;?></font></td>
                        </tr>
                        <tr>
                            <td><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>"><strong>ภาคการเรียน</strong></font></td>
                            <td>&nbsp;</td>
                            <td><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>"><?php $oSsd->SearchByKey($oCl->semester); $oSsd->GetRecord(); echo $oSsd->semesterName;?></font></td>
                        </tr>
                        <tr>
                            <td height="22" bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_4"];?>"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>"><b>รายวิชา</b></font></td>
                            <td height="22" bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_4"];?>">&nbsp;</td>
                            <td height="22" bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_4"];?>"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>"><?php $oCo->SearchByKey($oCl->courseId); $oCo->GetRecord(); echo $oCo->courseCode." ".$oCo->courseName." ".$oCo->courseUnit;?></font></td>
                        </tr>
                        <tr>
                            <td><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>"><strong>จำนวนกลุ่มที่เปิดสอน</strong></font></td>
                            <td>&nbsp;</td>
                            <td><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>"><?php echo $oCl->sectionClass;?></font></td>
                        </tr>
                        <tr>
                            <td bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_4"];?>"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>"><strong>กลุ่มเรียน</strong></font></td>
                            <td bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_4"];?>">&nbsp;</td>
                            <td bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_4"];?>"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>"><?php echo $oCl->section;?></font></td>
                        </tr>
                        <tr>
                            <td><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>"><strong>จำนวนที่นั่งที่เปิดรับ</strong></font></td>
                            <td>&nbsp;</td>
                            <td><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>"><?php echo $oCl->totalSeat;?></font></td>
                        </tr>
                        <tr>
                            <td height="22" bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_4"];?>"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>"><b>จำนวนที่นั่งที่ลงทะเบียน</b></font></td>
                            <td height="22" bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_4"];?>">&nbsp;</td>
                            <td height="22" bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_4"];?>"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>"><?php echo $oCl->enrollSeat;?></font></td>
                        </tr>                        
                    </table></td>
                </tr>
                <tr>
                    <td align="center"><br><input type="button" name="close" value="ปิดหน้าต่าง" onClick="window.close()"></td>
                </tr>
            </table></div></label>
        </fieldset></td>
    </tr>
</table>
<?php
$oCl
->Destroy();
$oPg->Destroy();
$oSsd->Destroy();
$oSsy->Destroy();
$oCo->Destroy();
$conn->Disconnect();

?>