<?php
// This script and data application were generated by AppGini 5.76
// Download AppGini for free from https://bigprof.com/appgini/download/

	$currDir = dirname(__FILE__);
	include("$currDir/defaultLang.php");
	include("$currDir/language.php");
	include("$currDir/lib.php");

	handle_maintenance();

	header('Content-type: text/javascript; charset=' . datalist_db_encoding);

	$table_perms = getTablePermissions('courses');
	if(!$table_perms[0]){ die('// Access denied!'); }

	$mfk = $_GET['mfk'];
	$id = makeSafe($_GET['id']);
	$rnd1 = intval($_GET['rnd1']); if(!$rnd1) $rnd1 = '';

	if(!$mfk){
		die('// No js code available!');
	}

	switch($mfk){

		case 'course_name':
			if(!$id){
				?>
				$j('#description<?php echo $rnd1; ?>').html('&nbsp;');
				<?php
				break;
			}
			$res = sql("SELECT `courses_catalog`.`cat_id` as 'cat_id', `courses_catalog`.`course_code` as 'course_code', `courses_catalog`.`course_name` as 'course_name', if(CHAR_LENGTH(`courses_catalog`.`course_summary`)>400, concat(left(`courses_catalog`.`course_summary`,400),' ...'), `courses_catalog`.`course_summary`) as 'course_summary', `courses_catalog`.`course_contents` as 'course_contents', `courses_catalog`.`notes` as 'notes' FROM `courses_catalog`  WHERE `courses_catalog`.`cat_id`='{$id}' limit 1", $eo);
			$row = db_fetch_assoc($res);
			?>
			$j('#description<?php echo $rnd1; ?>').html('<?php echo addslashes(str_replace(array("\r", "\n"), '', nl2br($row['course_summary']))); ?>&nbsp;');
			<?php
			break;


	}

?>