<?php require_once('../Connections/edu_system.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}





mysql_select_db($database_edu_system, $edu_system);
$query_course_list = "SELECT program.PROGRAM_NAME_TH,course_all_edu.course_no,course_all_edu.course_code,course_all_edu.course_name,course_all_edu.course_approve_date,
course_all_edu.course_ser_date1,course_all_edu.course_ser_file1,course_all_edu.course_ser_date2,course_all_edu.course_ser_file2,course_all_edu.course_ser_date3,
course_all_edu.course_ser_file3,course_all_edu.course_ser_date4,course_all_edu.course_ser_file4,course_all_edu.course_file FROM course_all_edu
Left Join program ON program.PROGRAM_ID = course_all_edu.course_code WHERE course_code = '".$_GET["course"]."' ORDER BY course_all_edu.course_approve_date ASC";
$course_list = mysql_query($query_course_list, $edu_system) or die(mysql_error());
$row_course_list = mysql_fetch_assoc($course_list);
$totalRows_course_list = mysql_num_rows($course_list);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>หลักสูตร คณะครุศาสตร์</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="description" content="Place your description here" />
<meta name="keywords" content="put, your, keyword, here" />
<meta name="author" content="Templates.com - website templates provider" />
<link href="../ict/style.css" rel="stylesheet" type="text/css" />
<link href="../ict/layout.css" rel="stylesheet" type="text/css" />
<style type="text/css">
a:hover {
	color: #cc7108;
	text-decoration: none;
}
a:link {
	text-decoration: none;
}
a:visited {
	text-decoration: none;
}
a:active {
	text-decoration: none;
}
</style>
<!--[if lt IE 7]>
   <link href="style_ie.css" rel="stylesheet" type="text/css" />
<![endif]-->
</head>
<body>
<?php include("header.php"); ?>
<div id="main">
    <div id="content">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td align="center"><?php if ($row_course_list['course_code'] == '712') { // Show if recordset empty ?><h2>หลักสูตรปรัชญาดุษฎีบัณฑิต</h2>  <?php }?>
                             <?php if ($row_course_list['course_code'] == '730') { // Show if recordset empty ?><h2>ครุศาสตรมหาบัณฑิต</h2>  <?php }?>
          <?php if ($row_course_list['course_code'] == '715') { // Show if recordset empty ?><h2>หลักสูตรวิชานวัตกรรมการบริหารการศึกษา หลักสูตรใหม่ 55</h2> <?php }?>
<?php if ($row_course_list['course_code'] < '712') { // Show if recordset empty ?><h2>หลักสูตรครุศาสตรบัณฑิต สาขาวิชา<?php echo $row_course_list['PROGRAM_NAME_TH']; ?></h2> <?php }?>
          </td>
        </tr>
      </table>
      <p>&nbsp; </p>
<table width="100%" border="0" cellpadding="1" cellspacing="1">
 <?php do { ?>
            <tr bgcolor="#FF33FF">
              <td height="16" align="center" bgcolor="#FF9900">หลักสูตร</td>
              <?php if ($row_course_list['course_ser_date1']!=""){ ?><td width="110" align="center" bgcolor="#FF9900">สภามหาวิทยาลัย</td> <?php }?>
              <?php if ($row_course_list['course_ser_date2']!=""){ ?><td width="110" align="center" bgcolor="#FF9900">สกอ.</td> <?php }?>
              <?php if ($row_course_list['course_ser_date3']!=""){ ?><td width="110" align="center" bgcolor="#FF9900">คุรุสภา</td> <?php }?>
              <?php if ($row_course_list['course_ser_date4']!=""){ ?><td width="110" align="center" bgcolor="#FF9900">กคศ.</td> <?php }?>
        </tr>

           
              <tr>
                <td height="53" align="left">&nbsp;<a href="course/<?php echo $row_course_list['course_file']; ?>"><?php echo ++$i+$startRow_school; ?>.&nbsp;<?php echo $row_course_list['course_name']; ?></a></td>
                
                <?php if ($row_course_list['course_ser_date1']!=""){ ?><td align="center"><a href="course/<?php echo $row_course_list['course_ser_file1']; ?>">
				     <?php echo $row_course_list['course_ser_date1']; ?></a></td> <?php }?>
                     
                <?php if ($row_course_list['course_ser_date2']!=""){ ?><td align="center"><a href="course/<?php echo $row_course_list['course_ser_file2']; ?>">
				     <?php echo $row_course_list['course_ser_date2']; ?></a></td><?php }?>
                     
                <?php if ($row_course_list['course_ser_date3']!=""){ ?><td align="center"><a href="course/<?php echo $row_course_list['course_ser_file3']; ?>">
				     <?php echo $row_course_list['course_ser_date3']; ?></a></td><?php }?>
                     
                <?php if ($row_course_list['course_ser_date4']!=""){ ?><td align="center"><a href="course/<?php echo $row_course_list['course_ser_file4']; ?>">
				      <?php echo $row_course_list['course_ser_date4']; ?></a></td><?php }?>
        </tr>

              
              <?php } while ($row_course_list = mysql_fetch_assoc($course_list)); ?>
        </table>

      <p><br />
        * เลือกชื่อหลักสูตรเพื่อแสดงรายละเอียดของหลักสูตร<br />
      ** เลือกวันที่เพื่อแสดงการรับรองหลักสูตร</p>
  </div>
</div>
<?php include("../footer.php"); ?>
</body>
</html>
<?php
mysql_free_result($course_list);
?>
