'.get_lang('RandomPick').'
';
echo '';
// level 1
foreach ($browse_course_categories[0] as $category) {
$category_name = $category['name'];
$category_code = isset($category['code']) ? $category['code'] : null;
$count_courses_lv1 = $category['count_courses'];
if (isset($code) && $code == $category_code) {
$category_link = '
'.$category_name.' ('.$count_courses_lv1.')';
} else {
if (!empty($count_courses_lv1)) {
$category_link = '
'.$category_name.' ('.$count_courses_lv1.') ';
} else {
$category_link = ''.$category_name.' ('.$count_courses_lv1.')';
}
}
echo '
'.$category_link.'';
// level 2
if (!empty($browse_course_categories[$category_code])) {
foreach ($browse_course_categories[$category_code] as $subcategory1) {
$subcategory1_name = $subcategory1['name'];
$subcategory1_code = $subcategory1['code'];
$count_courses_lv2 = $subcategory1['count_courses'];
if ($code == $subcategory1_code) {
$subcategory1_link = '
'.$subcategory1_name.' ('.$count_courses_lv2.')';
} else {
$subcategory1_link = '
'.$subcategory1_name.' ('.$count_courses_lv2.') ';
}
echo '
'.$subcategory1_link.'';
// level 3
if (!empty($browse_course_categories[$subcategory1_code])) {
foreach ($browse_course_categories[$subcategory1_code] as $subcategory2) {
$subcategory2_name = $subcategory2['name'];
$subcategory2_code = $subcategory2['code'];
$count_courses_lv3 = $subcategory2['count_courses'];
if ($code == $subcategory2_code) {
$subcategory2_link = '
'.$subcategory2_name.' ('.$count_courses_lv3.')';
} else {
$subcategory2_link = '
'.$subcategory2_name.' ('.$count_courses_lv3.')';
}
echo '
'.$subcategory2_link.'';
// level 4
if (!empty($browse_course_categories[$subcategory2_code])) {
foreach ($browse_course_categories[$subcategory2_code] as $subcategory3) {
$subcategory3_name = $subcategory3['name'];
$subcategory3_code = $subcategory3['code'];
$count_courses_lv4 = $subcategory3['count_courses'];
if ($code == $subcategory3_code) {
$subcategory3_link = '
'.$subcategory3_name.' ('.$count_courses_lv4.')';
} else {
$subcategory3_link = '
'.$subcategory3_name.' ('.$count_courses_lv4.') ';
}
echo '
'.$subcategory3_link.'';
}
}
}
}
}
}
}
}
?>