"; } 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 #### ?>