<?PHP
session_start();
include("chksession.inc.php");
include("../include/connect.inc.php");
include("../include/thumbnail.inc.php");
include("../include/function.inc.php");
$option=$_GET['option'];
$action=$_GET['action'];
$id=$_GET['id'];
$obj_db = new mysql_operator($obj_dbconfig->get_configdb());
$obj_db->opendb();
if(empty($option)){$option="config";}
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Maximumdev : Administrator</title>
<script type="text/javascript" src="ckeditor/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="ckeditor/ckfinder/ckfinder.js"></script>
<link rel="stylesheet" type="text/css" href="css/backoffice.css">

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/i18n/ui.datepicker-th.js"></script>
<link type="text/css" rel="stylesheet" href="css/jquery-ui.css" media="all" />

<script type="text/javascript" src="js/jquery.validate.js"></script>
<script type="text/javascript" src="js/ddaccordion.js"></script>
<script type="text/javascript" src="js/flexigrid.pack.js"></script>

<link rel="stylesheet" type="text/css" href="css/flexigrid.css" /> 
<link rel=stylesheet href="calendar/xc2_default.css" type="text/css">
<script language="javascript" src="calendar/xc2_default.js"></script>

<script type="text/javascript" src="js/jquery.autocomplete.js"></script>
<script type="text/javascript" src="js/lib/jquery.bgiframe.min.js"></script>
<script type="text/javascript" src="js/lib/jquery.ajaxQueue.js"></script>
<script type="text/javascript" src="js/lib/thickbox-compressed.js"></script>
<script type="text/javascript" src="js/jquery.colorbox.js"></script>
<link rel="stylesheet" href="css/lib/thickbox.css" />
<link rel="stylesheet" href="css/jquery.autocomplete.css" />
<link rel="stylesheet" href="css/colorbox.css" />

<link type="text/css" href="css/aristo/jquery-ui-1.8.7.custom.css" rel="stylesheet" />

<script language="javascript">
xcAutoHide=1000;
xcStickyMode=1;
</script>
<style type="text/css">
<!--
.text-none {
	border-top-style: none;
	border-right-style: none;
	border-bottom-style: none;
	border-left-style: none;
	background-color: #FFF;
	border-color:#FFF;
	font-family: "MS Serif", "New York", serif;
	font-size: 12px;
}
-->
</style>

<script language="javascript" src="calendar/xc2_inpage.js"></script>
  <script language="javascript" type="text/javascript" src="calendar/datetimepicker.js"></script>
  <style type="text/css">
.ui-datepicker{  
width:200px;  
font-family:tahoma;  
font-size:13px;  
text-align:center;  
}
  </style>
<script type="text/javascript">
ddaccordion.init({
	headerclass: "expandable", //Shared CSS class name of headers group that are expandable
	contentclass: "categoryitems", //Shared CSS class name of contents group
	revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
	mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
	collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
	defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc]. [] denotes no content
	onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
	animatedefault: false, //Should contents open by default be animated into view?
	persiststate: true, //persist state of opened contents within browser session?
	toggleclass: ["", "openheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
	togglehtml: ["prefix", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
	animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
	oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
		//do nothing
	},
	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
		//do nothing
	}
})
$(function() {
	$("#tabs").tabs();
});
$(function(){
 
  $('#cor-input').keyup(function(e){
  var user = $.trim($(this).val());
  if (user.length > 0){
   $.ajax({
    url: 'ajax/chk_course_code.php?cor_code',
    type: 'POST',
    dataType: 'html',
    data: $(this).serialize(),
    success: function(data){

     if (data.indexOf('yes') != -1){
                                            $('#cor-status').html('<font color="red">รหัสนี้ได้ถูกใช้ไปแล้ว</font>');
											
									 
     } else {
                                            $('#cor-status').html ('<font color="green">รหัสนี้สามารถใช้งานได้</green>');
     }

    }
   });
  }
  e.preventDefault();
 });
 
});
//]]>

$(document).ready(function(){
	$("#divButton, #linkButton,div[id^=gmap]").button();
	// Validate Form
	$("form").each(function(){
		$(this).validate();
	});
	$("#mem_start").datepicker({
		minDate: 0 , dateFormat: 'yy-mm-dd'
		});
    $("#mag_public").datepicker({
		dateFormat: 'yy-mm-dd'
		});
	$("#mem_end").datepicker({
		minDate: 0 , dateFormat: 'yy-mm-dd'
		});
		$(".example6").colorbox({iframe:true, innerWidth:800, innerHeight:600,overlayClose:false});
 }
);
//function stopErrors() { 
//return true ; 
//} 
//window.onerror = stopErrors;

</script>

<?  jsload(); ?>

</head>

<body>
<table width="984" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr >
    <td colspan="3" align="left"><?php require_once('imc_head.php'); ?></td>
  </tr>
  <tr>
    <td height="20" colspan="3"></td>
  </tr>
  <tr>
    <td width="231" align="left" valign="top"><?php require_once('inc_menu.php'); ?></td>
    <td width="753" align="right" valign="top">
    <? if($_GET['option']=="home"){?>
    <table width="740" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="56"><img src="img/icon1.jpg" width="36" height="35" hspace="10" /></td>
        <td width="315" align="left"><span class="head">Admin</span></td>
        <td width="202">&nbsp;</td>
        <td align="right">&nbsp;</td>
      </tr>
    </table>
      <br />
      <? }?>
      <table width="740" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="99%" align="center">
		  <?php 
		   if($_GET["postdb"] !="")
			{
			include("opt-db/".$_GET["postdb"].".php");
			}
			else
			{
		  include("opt/".$option."_model.php");
			};
		  ?></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td colspan="3">&nbsp;</td>
  </tr>
    <tr>
    <td colspan="3" align="center" valign="middle" class="copy"><?php require_once('inc_foot.php'); 
	$obj_db->closedb();
	?></td>
  </tr>
</table>
</body>
</html>