<?php $action = getValue('action', 'str', 'POST', ''); switch ($action) { case 'get_section': $id_map = getValue('id_map', 'int', 'POST', 0); $db_query = new db_query('SELECT sec_id,sec_name,sec_desc FROM sections LEFT JOIN anatomy_map ON ana_sec_id = sec_id WHERE ana_id = ' . $id_map); $list_section = mysqli_fetch_assoc($db_query->result); unset($db_query); $list_section['link_detail'] = generate_section_detail($list_section); //query các bộ phận con $db_query = new db_query('SELECT sec_id,sec_name FROM sections WHERE sec_parent_id = ' . $list_section['sec_id']); $list_section['sec_child'] = array(); $cdi_sec_id = array($sec_data['sec_id']); while ($row = mysqli_fetch_assoc($db_query->result)) { $row['link_detail'] = generate_section_detail($row); $list_section['sec_child'][] = $row; } unset($db_query); //assign to template $rainTpl = new RainTPL(); $rainTpl->assign('list_section', $list_section); ob_clean(); echo $rainTpl->draw('cat_section_list', 1); break; }
function get_anatomy_data($zzzz = DOITUONG_NAMGIOI, $eeeee = SECTION_TYPE_FRONT) { global $lllll; if (isset($lllll['anatomy_data'])) { return $lllll['anatomy_data']; } if ($zzzz == DOITUONG_NAMGIOI) { $iiiiii = $eeeee == SECTION_TYPE_FRONT ? '/themes/pc/img/nam-truoc.jpg' : '/themes/pc/img/nam-sau.jpg'; } else { $iiiiii = $eeeee == SECTION_TYPE_FRONT ? '/themes/pc/img/nu-truoc.jpg' : '/themes/pc/img/nu-sau.jpg'; } $jjjjjj = array('image' => $iiiiii); $ll = new db_query('SELECT anatomy_map.*,sec_id,sec_name FROM anatomy_map STRAIGHT_JOIN sections ON sec_id = ana_sec_id WHERE ana_type = ' . $eeeee . ' AND ana_sex = ' . $zzzz); while ($ooooo = mysqli_fetch_assoc($ll->result)) { $ooooo['link_detail'] = generate_section_detail($ooooo); $jjjjjj['data'][] = $ooooo; } $lllll['anatomy_data'] = $jjjjjj; return $jjjjjj; }
require 'config.php'; $lastmod_first = date('Y-m-d') . 'T00:00:00+07:00'; ob_clean(); header('Content-Type: text/xml'); echo '<?xml version="1.0" encoding="UTF-8" ?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns:xhtml="http://www.w3.org/1999/xhtml"> <url> <loc>' . DOMAIN_URL . $link_detail . '</loc> <lastmod>' . $lastmod_first . '</lastmod> <changefreq>daily</changefreq> <priority>1.0</priority> </url>'; $db = new db_query('SELECT sec_id,sec_name FROM sections'); while ($row = mysqli_fetch_assoc($db->result)) { $link_detail = generate_section_detail($row); ?> <url> <loc><?php echo DOMAIN_URL . $link_detail; ?> </loc> <?php /* <xhtml:link rel="alternate" media="only screen and max-width: 480px" href="http://m.24h.com.vn/" /> */ ?> <lastmod><?php echo $lastmod_first; ?> </lastmod>
unset($db_query); } } else { //neu khong co section $db_query = new db_query('SELECT * FROM sections WHERE sec_parent_id = 0 LIMIT 1'); if ($row = mysqli_fetch_assoc($db_query->result)) { $list_section['sec_id'] = $row['sec_id']; $list_section['sec_name'] = $row['sec_name']; $sec_name = $row['sec_name']; $sec_desc = $row['sec_desc']; $sec_picture = get_picture_path($row['sec_picture']); $list_section['link_detail'] = generate_section_detail($list_section); $list_section['sec_child'] = array(); $db_child = new db_query('SELECT * FROM sections WHERE sec_parent_id = ' . $row['sec_id']); while ($row_child = mysqli_fetch_assoc($db_child->result)) { $row_child['link_detail'] = generate_section_detail($row_child); $list_section['sec_child'][] = $row_child; } } unset($db_query); } $rainTpl->assign('section_exits', $section_exist); if ($section_exist) { $rainTpl->assign('is_section_child', $is_section_child); } $sec_id = $sec_id ? $sec_id : $list_section['sec_id']; $rainTpl->assign('sec_id', $sec_id); $rainTpl->assign('sec_name', $sec_name); $rainTpl->assign('sec_desc', $sec_desc); $rainTpl->assign('list_section', $list_section); //query ra các bệnh thường gặp ở bộ phận này
function get_anatomy_data($sex = DOITUONG_NAMGIOI, $type = SECTION_TYPE_FRONT) { global $_static_value; if (isset($_static_value['anatomy_data'])) { return $_static_value['anatomy_data']; } if ($sex == DOITUONG_NAMGIOI) { $human_front_image = $type == SECTION_TYPE_FRONT ? '/themes/pc/img/nam-truoc.jpg' : '/themes/pc/img/nam-sau.jpg'; } else { $human_front_image = $type == SECTION_TYPE_FRONT ? '/themes/pc/img/nu-truoc.jpg' : '/themes/pc/img/nu-sau.jpg'; } $anatomy_data = array('image' => $human_front_image); //query ra theo đối tượng và loại từ bảng anatomy_map $db_query = new db_query('SELECT anatomy_map.*,sec_id,sec_name FROM anatomy_map STRAIGHT_JOIN sections ON sec_id = ana_sec_id WHERE ana_type = ' . $type . ' AND ana_sex = ' . $sex); while ($row = mysqli_fetch_assoc($db_query->result)) { $row['link_detail'] = generate_section_detail($row); $anatomy_data['data'][] = $row; } $_static_value['anatomy_data'] = $anatomy_data; return $anatomy_data; }