<?
header("Content-Type: text/xml; charset=UTF-8");
echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";
$_site['base_url'] = "../";
include $_site['base_url']."asset/config.inc.php";
include $_site['base_url']."asset/config.mhome.php";

$time=date("Y-m-d");

$mamin_domain_sitemap = $_site["http_div"]."://m.".$main_domain2."/m/";
?>
<urlset
      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="http://www.sitemaps.org/schemas/sitemap/0.9">
        <url>
          <loc><?=$_site["http_div"]."://m.".$main_domain2?></loc>
          <lastmod><?=$time?></lastmod>
          <changefreq>always</changefreq>
          <priority>0.8</priority>
        </url>
        <url>
          <loc><?=$_site["http_div"]."://m.".$main_domain2?>/index.html</loc>
          <lastmod><?=$time?></lastmod>
          <changefreq>always</changefreq>
          <priority>0.8</priority>
        </url>
<?
$db_result_m1_c = $DBD->dbResult("select count(*) from ez_menu_m where m_sitecode='".$chk_domain."' and m_tab='0' order by m_order");
$total_cnt_m1 = (int)@mysql_result($db_result_m1_c["result"],0,0);

$db_result_m1 = $DBD->dbResult("select * from ez_menu_m where m_sitecode='".$chk_domain."' and m_tab='0' order by m_order");
for($m1_i=1; $m1_i <= $total_cnt_m1; $m1_i++) {
    $row_m1 = @mysql_fetch_array($db_result_m1['result']);

    if ($menu_info) {
        $menu_info_org = explode("|",$menu_info);
        $menu_info_count = count($menu_info_org);

        for($m2=0; $m2 < $menu_info_count; $m2++) {
            $menu_info_div = explode("--",$menu_info_org[$m2]);
            if ($row_m1["m_no"] == $menu_info_div[1] && $menu_info_div[0]=="1") {
                $menu_href = "";
                switch($row_m1["m_option"]) {
                    case 1: // 인사말
                        $menu_href1 = $mamin_domain_sitemap."sub.html?mc=".$row_m1["m_no_st"]."&amp;mo=".$row_m1["m_option"]."&amp;mn=".$row_m1["m_no"]."&amp;ms=".$row_m1["m_no"];
                        $menu_o = 1;
                        break;
                    case 2: // 사업안내
                        $menu_href2 = $mamin_domain_sitemap."sub.html?mc=".$row_m1["m_no_st"]."&amp;mo=".$row_m1["m_option"]."&amp;mn=".$row_m1["m_no"]."&amp;ms=".$row_m1["m_no"];
                        break;
                    case 3: // 공지사항
                        $menu_href3 = $mamin_domain_sitemap."sub.html?mc=".$row_m1["m_no_st"]."&amp;mo=".$row_m1["m_option"]."&amp;mn=".$row_m1["m_no"]."&amp;ms=".$row_m1["m_no"];
                        break;
                    case 4: // 포토갤러리
                        $menu_href4 = $mamin_domain_sitemap."sub.html?mc=".$row_m1["m_no_st"]."&amp;mo=".$row_m1["m_option"]."&amp;mn=".$row_m1["m_no"]."&amp;ms=".$row_m1["m_no"];
                        break;
                    case 5: // 온라인상담
                        $menu_href5 = $mamin_domain_sitemap."sub.html?mc=".$row_m1["m_no_st"]."&amp;mo=".$row_m1["m_option"]."&amp;mn=".$row_m1["m_no"]."&amp;ms=".$row_m1["m_no"];
                        break;
                    case 6: // 오시는길
                        $menu_href6 = $mamin_domain_sitemap."sub.html?mc=".$row_m1["m_no_st"]."&amp;mo=".$row_m1["m_option"]."&amp;mn=".$row_m1["m_no"]."&amp;ms=".$row_m1["m_no"];
                        break;
                    case 7: // 링크
                        $menu_href7 = $mamin_domain_sitemap."sub.html?mc=".$row_m1["m_no_st"]."&amp;mo=".$row_m1["m_option"]."&amp;mn=".$row_m1["m_no"]."&amp;ms=".$row_m1["m_no"];
                        break;
                    case 99:

                        $db_result_m2 = $DBD->dbResult("select * from ez_menu_m where m_sitecode='".$chk_domain."' and m_tab='".$row_m1["m_no"]."' order by m_order limit 0,1");
                        $row_m2 = @mysql_fetch_array($db_result_m2['result']);
                        $menu_href99 = $mamin_domain_sitemap."sub.html?mc=".$row_m2["m_no_st"]."&amp;mo=".$row_m2["m_option"]."&amp;mn=".$row_m2["m_no"]."&amp;ms=".$row_m1["m_no"];
                        break;
                }
                ?>

        <url>
          <loc><?=${"menu_href".$row_m1["m_option"]}?></loc>
          <lastmod><?=$time?></lastmod>
          <changefreq>always</changefreq>
          <priority>0.8</priority>
        </url>
                <?

            }
        }
    }
}
?>

</urlset>