######################################################################################
##
## Program :
## Description :
## Programmer : äªÂÃѵ¹ì Êع·ÃÇÔÀÒµ
## Email : webmaster@sixhead.com
## : webmaster@todaysoftware.com
## Website : http://www.sixhead.com
## : http://www.todaysoftware.com
## Date :
## Modify log :
##
######################################################################################
#####################################################################
#### start setup ####
$tp_training_category = "_tp_ws_v4.html";
#### end of setup ####
#####################################################################
#####################################################################
#### start program ####
require "../module/_config.php";
require "../module/_module.php";
ob_start();
@$db = mysql_connect($db_host,$db_user,$db_pass);
mysql_select_db($db_name);
if (!$db) { echo "Error connect to Database: " . mysql_error(); ob_end_flush(); exit; }
$i = 0;
$sql1 = "SELECT * FROM $db_table_training_category ORDER BY SORT_ORDER";
$result1 = mysql_query($sql1);
while($row1 = mysql_fetch_array($result1)) {
$i++;
$tr_open = "";
$tr_close = "";
if ($i == 1) { $tr_open = "
"; }
if ($i == 2) { $tr_close = "
"; $i = 0; }
$sql = "SELECT * FROM $db_table_training WHERE (CATEGORY_ID = '$row1[CATEGORY_ID]' AND TRAINING_ACTIVE = 'Y') ORDER BY TRAINING_ID DESC LIMIT 0,20";
$result = mysql_query($sql);
$training_detail = "";
while($row = mysql_fetch_array($result)) {
list ($training_date_start,$training_date_start_hr,$training_date_start_min) = Convert_YMDHMS_2_DateHrMin($row[TRAINING_DATE_START]);
list ($training_date_end,$training_date_end_hr,$training_date_end_min) = Convert_YMDHMS_2_DateHrMin($row[TRAINING_DATE_END]);
$training_date_start = Convert_YMD_2_DMY_Training_Month($training_date_start);
$training_date_end = Convert_YMD_2_DMY_Training_Month($training_date_end);
$training_code = $row[TRAINING_CODE];
$open_img = "";
if ($row[TRAINING_OPEN] == "Y") {
$open_img = "";
}
else if ($row[TRAINING_OPEN] == "N") {
$open_img = "";
}
else if ($row[TRAINING_OPEN] == "F") {
$open_img = "";
}
$img_free = "";
if ($row[TRAINING_FREE] == "Y") {
$img_free = "";
}
$training_detail .= " $training_code - $row[TRAINING_TOPIC] [ $training_date_start - $training_date_end ] $open_img $img_free
";
}
$DATA .= "
$tr_open
$row1[CATEGORY_NAME]
$training_detail
>> �ʴ��ء��¡��
|
$tr_close
";
}
if ($i == 1) {
$DATA .= " | ";
}
mysql_free_result($result);
mysql_close($db);
$template = $tp_training_category;
$fp = fopen($template,"r");
$HTML = fread($fp,filesize($template)); fclose($fp);
$HTML = preg_replace("/\\$(\w+)/e","$$1",$HTML);
echo $HTML;
ob_end_flush();
exit;
ob_end_flush();
#### end of program ####
#####################################################################
#### Start sub program. Don't touch anything below ####
?>