<?
	header("content-type:text/html; charset=utf-8");

//----- 공통 include -----//
	include_once $_SERVER['DOCUMENT_ROOT'] . "/irodori/sClass/pSetSession.php";
	include_once $_SERVER['DOCUMENT_ROOT'] .  "/irodori/sClass/Template.class.php";

//----- DB 접속 -----//
	//$CMysql = new CMysql;
	//$pConnection = $CMysql->m_pConnection;

	$tpl=new Template;
	$tpl->define(array(
		'pageload'=>getTPLFile($_SERVER['SCRIPT_FILENAME']),
	));


//----- 데이터 디렉토리 -----//
	$chSub = getEscString($_GET['chSub']);
	$chSub = $chSub ? $chSub : "starter";
	
	$sGnb = $aGnb[$chSub];
	
//----- Contents -----//
    $aData = array();
    
    // 입문 데이터 -----------------------------------------------
    if($chSub == "starter") {
        $aData['pdf'] = true;
        $aData['batch'] = array("image"=>$chBaseWeb."/images/common/starter_kr.png", "pdf"=>$chDataWeb."/pdf/".$chSub."/X_all.pdf", "mp3"=>$chDataWeb."/audio/".$chSub."/X_audio_all.zip");
        $aData['batch']['pdf_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['batch']['pdf']), 1);
        $aData['batch']['mp3_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['batch']['mp3']), 1);
        
        $aData['lesson'] = array(
            "title"=>"教室の日本語", "image"=>$chDataWeb."/img/".$chSub."/x_kyoshitsu.png",
            "pdf"=>$chDataWeb."/pdf/".$chSub."/X_kyoshitsu.pdf", "mp3"=>$chDataWeb."/audio/".$chSub."/X_audio_L00.zip", "audio"=>$chBaseWeb."/".$chSub."/audio/lesson00",
        );
        $aData['lesson']['pdf_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['lesson']['pdf']), 1);
        $aData['lesson']['mp3_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['lesson']['mp3']), 1);
        
        $aData['aLesson'] = array();
        $aData['aLesson'][] = array("css"=>"c0t1", "topic"=>"はじめての日本語", "title"=>"おはようございます");
        $aData['aLesson'][] = array("css"=>"c0t1", "topic"=>"はじめての日本語", "title"=>"すみません、よくわかりません");
        $aData['aLesson'][] = array("css"=>"c0t2", "topic"=>"私のこと", "title"=>"よろしくお願いします");
        $aData['aLesson'][] = array("css"=>"c0t2", "topic"=>"私のこと", "title"=>"東京に住んでいます");
        $aData['aLesson'][] = array("css"=>"c0t3", "topic"=>"好きな食べ物", "title"=>"うどんが好きです");
        $aData['aLesson'][] = array("css"=>"c0t3", "topic"=>"好きな食べ物", "title"=>"チーズバーガーください");
        $aData['aLesson'][] = array("css"=>"c0t4", "topic"=>"家と職場", "title"=>"部屋が4つあります");
        $aData['aLesson'][] = array("css"=>"c0t4", "topic"=>"家と職場", "title"=>"山田さんはどこにいますか？");
        $aData['aLesson'][] = array("css"=>"c0t5", "topic"=>"毎日の生活", "title"=>"12時から1時まで昼休みです");
        $aData['aLesson'][] = array("css"=>"c0t5", "topic"=>"毎日の生活", "title"=>"ホチキス貸してください");
        $aData['aLesson'][] = array("css"=>"c0t6", "topic"=>"私の好きなこと", "title"=>"どんなマンガが好きですか？");
        $aData['aLesson'][] = array("css"=>"c0t6", "topic"=>"私の好きなこと", "title"=>"いっしょに飲みに行きませんか？");
        $aData['aLesson'][] = array("css"=>"c0t7", "topic"=>"街を歩く", "title"=>"このバスは空港に行きますか？");
        $aData['aLesson'][] = array("css"=>"c0t7", "topic"=>"街を歩く", "title"=>"大きな建物ですね");
        $aData['aLesson'][] = array("css"=>"c0t8", "topic"=>"店で", "title"=>"電池がほしいんですが･･･");
        $aData['aLesson'][] = array("css"=>"c0t8", "topic"=>"店で", "title"=>"これ、いくらですか？");
        $aData['aLesson'][] = array("css"=>"c0t9", "topic"=>"休みの日に", "title"=>"映画を見に行きました");
        $aData['aLesson'][] = array("css"=>"c0t9", "topic"=>"休みの日に", "title"=>"温泉に入りたいです");
        
        $aData['aCover'] = array();
        $aData['aCover'][] = array("title"=>"표지", "image"=>$chDataWeb."/img/".$chSub."/x_cover_kr.png", "pdf"=>$chDataWeb."/pdf/".$chSub."/X_cover.pdf");
        $aData['aCover'][] = array("title"=>"머리말(한글)", "image"=>$chDataWeb."/img/".$chSub."/x_hajimeni_kr.png", "pdf"=>$chDataWeb."/pdf/".$chSub."/X_hajimeni_kr.pdf");
        $aData['aCover'][] = array("title"=>"머리말(영어)", "image"=>$chDataWeb."/img/".$chSub."/x_hajimeni_en.png", "pdf"=>$chDataWeb."/pdf/".$chSub."/X_hajimeni_en.pdf");
        
        $aData['aCm'] = array();
        $aData['aCm'][] = array("title"=>"교재 사용법(한글)", "image"=>$chDataWeb."/img/".$chSub."/x_howto_kr.png", "pdf"=>$chDataWeb."/pdf/".$chSub."/X_howto_kr.pdf");
        $aData['aCm'][] = array("title"=>"교재 사용법(영어)", "image"=>$chDataWeb."/img/".$chSub."/x_howto_en.png", "pdf"=>$chDataWeb."/pdf/".$chSub."/X_howto_en.pdf");
        $aData['aCm'][] = array("title"=>"내용 일람(한글)", "image"=>$chDataWeb."/img/".$chSub."/x_contents_kr.png", "pdf"=>$chDataWeb."/pdf/".$chSub."/X_contents_kr.pdf");
        $aData['aCm'][] = array("title"=>"내용 일람(영어)", "image"=>$chDataWeb."/img/".$chSub."/x_contents_en.png", "pdf"=>$chDataWeb."/pdf/".$chSub."/X_contents_en.pdf");
        $aData['aCm'][] = array("title"=>"Can-do 체크", "image"=>$chDataWeb."/img/".$chSub."/x_candocheck.png", "pdf"=>$chDataWeb."/pdf/".$chSub."/X_candocheck.pdf");
        $aData['aCm'][] = array("title"=>"판권 안내", "image"=>$chDataWeb."/img/".$chSub."/x_okuzuke.png", "pdf"=>$chDataWeb."/pdf/".$chSub."/X_okuzuke.pdf");
        
        for($i=0, $nCnt=count($aData['aLesson']); $i<$nCnt; $i++) {
            $aData['aLesson'][$i]['image'] = $chDataWeb."/img/".$chSub."/x_l".sprintf("%02d", ($i+1)).".png";
            $aData['aLesson'][$i]['pdf'] = $chDataWeb."/pdf/".$chSub."/X_L".sprintf("%02d", ($i+1)).".pdf";
            $aData['aLesson'][$i]['pdf_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['aLesson'][$i]['pdf']), 1);
            $aData['aLesson'][$i]['mp3'] = $chDataWeb."/audio/".$chSub."/X_audio_L".sprintf("%02d", ($i+1)).".zip";
            $aData['aLesson'][$i]['mp3_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['aLesson'][$i]['mp3']), 1);
            $aData['aLesson'][$i]['audio'] = $chBaseWeb."/".$chSub."/audio/lesson".sprintf("%02d", ($i+1));
        }    
        
        for($i=0, $nCnt=count($aData['aCover']); $i<$nCnt; $i++) {
            $aData['aCover'][$i]['pdf_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['aCover'][$i]['pdf']), 1);
        }    
        
        for($i=0, $nCnt=count($aData['aCm']); $i<$nCnt; $i++) {
            $aData['aCm'][$i]['pdf_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['aCm'][$i]['pdf']), 1);
        }
    }
    
    // 초급1 데이터 -----------------------------------------------
    if($chSub == "elementary01") {
        $aData['pdf'] = true;
        $aData['batch'] = array("image"=>$chBaseWeb."/images/common/elementary_1.png", "pdf"=>$chDataWeb."/pdf/".$chSub."/Y_all.pdf", "mp3"=>$chDataWeb."/audio/".$chSub."/Y_audio_all.zip");
        $aData['batch']['pdf_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['batch']['pdf']), 1);
        $aData['batch']['mp3_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['batch']['mp3']), 1);
        
        $aData['aLesson'] = array();
        $aData['aLesson'][] = array("css"=>"c1t1", "topic"=>"今の私", "title"=>"レストランで働いています");
        $aData['aLesson'][] = array("css"=>"c1t1", "topic"=>"今の私", "title"=>"ゲームをするのが好きです");
        $aData['aLesson'][] = array("css"=>"c1t2", "topic"=>"季節と天気", "title"=>"冬はとても寒くなります");
        $aData['aLesson'][] = array("css"=>"c1t2", "topic"=>"季節と天気", "title"=>"昨日はすごい雨でしたね");
        $aData['aLesson'][] = array("css"=>"c1t3", "topic"=>"私の町", "title"=>"とてもにぎやかで便利です");
        $aData['aLesson'][] = array("css"=>"c1t3", "topic"=>"私の町", "title"=>"郵便局はどう行ったらいいですか？");
        $aData['aLesson'][] = array("css"=>"c1t4", "topic"=>"いっしょに出かける", "title"=>"道に迷ってちょっと遅れます");
        $aData['aLesson'][] = array("css"=>"c1t4", "topic"=>"いっしょに出かける", "title"=>"野球、したことありますか？");
        $aData['aLesson'][] = array("css"=>"c1t5", "topic"=>"日本語学習", "title"=>"読み方を教えてもらえませんか？");
        $aData['aLesson'][] = array("css"=>"c1t5", "topic"=>"日本語学習", "title"=>"日本語教室に参加したいんですが･･･");
        $aData['aLesson'][] = array("css"=>"c1t6", "topic"=>"おいしい料理", "title"=>"肉と野菜は私が買って行きます");
        $aData['aLesson'][] = array("css"=>"c1t6", "topic"=>"おいしい料理", "title"=>"お弁当、おいしそうですね");
        $aData['aLesson'][] = array("css"=>"c1t7", "topic"=>"仕事の連絡", "title"=>"あと10分ぐらいで終わりそうです");
        $aData['aLesson'][] = array("css"=>"c1t7", "topic"=>"仕事の連絡", "title"=>"休みを取ってもいいでしょうか？");
        $aData['aLesson'][] = array("css"=>"c1t8", "topic"=>"健康な生活", "title"=>"熱があってのどが痛いんです");
        $aData['aLesson'][] = array("css"=>"c1t8", "topic"=>"健康な生活", "title"=>"食べすぎないようにしています");
        $aData['aLesson'][] = array("css"=>"c1t9", "topic"=>"交際", "title"=>"兄がくれたお守りです");
        $aData['aLesson'][] = array("css"=>"c1t9", "topic"=>"交際", "title"=>"何かプレゼントをあげませんか？");
        
        $aData['aCover'] = array();
        $aData['aCover'][] = array("title"=>"표지", "image"=>$chDataWeb."/img/".$chSub."/e1_cover.jpg", "pdf"=>$chDataWeb."/pdf/".$chSub."/Y_cover.pdf");
        $aData['aCover'][] = array("title"=>"머리말(한글)", "image"=>$chDataWeb."/img/".$chSub."/e1_hajimeni.jpg", "pdf"=>$chDataWeb."/pdf/".$chSub."/Y_hajimeni_kr.pdf");
        $aData['aCover'][] = array("title"=>"머리말(영어)", "image"=>$chDataWeb."/img/".$chSub."/e1_hajimeni_eng.jpg", "pdf"=>$chDataWeb."/pdf/".$chSub."/Y_hajimeni_en.pdf");
        
        $aData['aCm'] = array();
        $aData['aCm'][] = array("title"=>"교재 사용법(한글)", "image"=>$chDataWeb."/img/".$chSub."/e1_howto_jp.jpg", "pdf"=>$chDataWeb."/pdf/".$chSub."/Y_howto_kr.pdf");
        $aData['aCm'][] = array("title"=>"교재 사용법(영어)", "image"=>$chDataWeb."/img/".$chSub."/e1_howto_en.jpg", "pdf"=>$chDataWeb."/pdf/".$chSub."/Y_howto_en.pdf");
        $aData['aCm'][] = array("title"=>"내용 일람(한글)", "image"=>$chDataWeb."/img/".$chSub."/e1_table_of_contents.jpg", "pdf"=>$chDataWeb."/pdf/".$chSub."/Y_contents_kr.pdf");
        $aData['aCm'][] = array("title"=>"내용 일람(영어)", "image"=>$chDataWeb."/img/".$chSub."/e1_table_of_contents_eng.jpg", "pdf"=>$chDataWeb."/pdf/".$chSub."/Y_contents_en.pdf");
        $aData['aCm'][] = array("title"=>"Can-do 체크", "image"=>$chDataWeb."/img/".$chSub."/e1_can_do_check.jpg", "pdf"=>$chDataWeb."/pdf/".$chSub."/Y_candocheck.pdf");
        $aData['aCm'][] = array("title"=>"판권 안내", "image"=>$chDataWeb."/img/".$chSub."/e1_okuduke.jpg", "pdf"=>$chDataWeb."/pdf/".$chSub."/Y_okuzuke.pdf");
        
        for($i=0, $nCnt=count($aData['aLesson']); $i<$nCnt; $i++) {
            $aData['aLesson'][$i]['image'] = $chDataWeb."/img/".$chSub."/e1_l".sprintf("%02d", ($i+1)).".jpg";
            $aData['aLesson'][$i]['pdf'] = $chDataWeb."/pdf/".$chSub."/Y_L".sprintf("%02d", ($i+1)).".pdf";
            $aData['aLesson'][$i]['pdf_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['aLesson'][$i]['pdf']), 1);
            $aData['aLesson'][$i]['mp3'] = $chDataWeb."/audio/".$chSub."/Y_audio_L".sprintf("%02d", ($i+1)).".zip";
            $aData['aLesson'][$i]['mp3_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['aLesson'][$i]['mp3']), 1);
            $aData['aLesson'][$i]['audio'] = $chBaseWeb."/".$chSub."/audio/lesson".sprintf("%02d", ($i+1));
        }    
        
        for($i=0, $nCnt=count($aData['aCover']); $i<$nCnt; $i++) {
            $aData['aCover'][$i]['pdf_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['aCover'][$i]['pdf']), 1);
        }    
        
        for($i=0, $nCnt=count($aData['aCm']); $i<$nCnt; $i++) {
            $aData['aCm'][$i]['pdf_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['aCm'][$i]['pdf']), 1);
        }
    }
    
    // 초급2 데이터 -----------------------------------------------
    if($chSub == "elementary02") {
        $aData['pdf'] = true;
        $aData['batch'] = array("image"=>$chBaseWeb."/images/common/elementary_2.png", "pdf"=>$chDataWeb."/pdf/".$chSub."/Z_all.pdf", "mp3"=>$chDataWeb."/audio/".$chSub."/Z_audio_all.zip");
        $aData['batch']['pdf_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['batch']['pdf']), 1);
        $aData['batch']['mp3_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['batch']['mp3']), 1);
        
        $aData['aLesson'] = array();
        $aData['aLesson'][] = array("css"=>"c2t1", "topic"=>"私の周りの人たち", "title"=>"先週、日本に来たばかりです");
        $aData['aLesson'][] = array("css"=>"c2t1", "topic"=>"私の周りの人たち", "title"=>"まじめそうな人ですね");
        $aData['aLesson'][] = array("css"=>"c2t2", "topic"=>"レストランで", "title"=>"アレルギーがあるので、食べられないんです");
        $aData['aLesson'][] = array("css"=>"c2t2", "topic"=>"レストランで", "title"=>"しょうゆをつけないで食べてください");
        $aData['aLesson'][] = array("css"=>"c2t3", "topic"=>"旅行に行こう", "title"=>"早く予約したほうがいいですよ");
        $aData['aLesson'][] = array("css"=>"c2t3", "topic"=>"旅行に行こう", "title"=>"いろいろなところに行けて、よかったです");
        $aData['aLesson'][] = array("css"=>"c2t4", "topic"=>"地域のイベント", "title"=>"雨が降ったら、ホールでやります");
        $aData['aLesson'][] = array("css"=>"c2t4", "topic"=>"地域のイベント", "title"=>"屋台はどこかわかりますか？");
        $aData['aLesson'][] = array("css"=>"c2t5", "topic"=>"年中行事とマナー", "title"=>"成人の日は、何をするんですか？");
        $aData['aLesson'][] = array("css"=>"c2t5", "topic"=>"年中行事とマナー", "title"=>"どんな服を着て行けばいいですか？");
        $aData['aLesson'][] = array("css"=>"c2t6", "topic"=>"上手な買い物", "title"=>"ポイントカードを忘れてしまいました");
        $aData['aLesson'][] = array("css"=>"c2t6", "topic"=>"上手な買い物", "title"=>"この掃除機は軽くて動かしやすいですよ");
        $aData['aLesson'][] = array("css"=>"c2t7", "topic"=>"さまざまなサービス", "title"=>"いろいろな資料を展示してあります");
        $aData['aLesson'][] = array("css"=>"c2t7", "topic"=>"さまざまなサービス", "title"=>"前髪は、もう少し短く切ってもらえますか？");
        $aData['aLesson'][] = array("css"=>"c2t8", "topic"=>"自然と環境", "title"=>"会議室の電気がついたままでした");
        $aData['aLesson'][] = array("css"=>"c2t8", "topic"=>"自然と環境", "title"=>"地震が来ても、あわてて動かないでください");
        $aData['aLesson'][] = array("css"=>"c2t9", "topic"=>"私の人生", "title"=>"日本語が前より話せるようになりました");
        $aData['aLesson'][] = array("css"=>"c2t9", "topic"=>"私の人生", "title"=>"将来、自分の会社を作ろうと思います");
        
        $aData['aCover'] = array();
        $aData['aCover'][] = array("title"=>"표지", "image"=>$chDataWeb."/img/".$chSub."/e2_cover.jpg", "pdf"=>$chDataWeb."/pdf/".$chSub."/Z_cover.pdf");
        $aData['aCover'][] = array("title"=>"머리말(한글)", "image"=>$chDataWeb."/img/".$chSub."/e2_hajimeni.jpg", "pdf"=>$chDataWeb."/pdf/".$chSub."/Z_hajimeni_kr.pdf");
        $aData['aCover'][] = array("title"=>"머리말(영어)", "image"=>$chDataWeb."/img/".$chSub."/e2_hajimeni_eng.jpg", "pdf"=>$chDataWeb."/pdf/".$chSub."/Z_hajimeni_en.pdf");
        
        $aData['aCm'] = array();
        $aData['aCm'][] = array("title"=>"교재 사용법(한글)", "image"=>$chDataWeb."/img/".$chSub."/e2_howto_jp.jpg", "pdf"=>$chDataWeb."/pdf/".$chSub."/Z_howto_kr.pdf");
        $aData['aCm'][] = array("title"=>"교재 사용법(영어)", "image"=>$chDataWeb."/img/".$chSub."/e2_howto_en.jpg", "pdf"=>$chDataWeb."/pdf/".$chSub."/Z_howto_en.pdf");
        $aData['aCm'][] = array("title"=>"내용 일람(한글)", "image"=>$chDataWeb."/img/".$chSub."/e2_table_of_contents.jpg", "pdf"=>$chDataWeb."/pdf/".$chSub."/Z_contents_kr.pdf");
        $aData['aCm'][] = array("title"=>"내용 일람(영어)", "image"=>$chDataWeb."/img/".$chSub."/e2_table_of_contents_eng.jpg", "pdf"=>$chDataWeb."/pdf/".$chSub."/Z_contents_en.pdf");
        $aData['aCm'][] = array("title"=>"Can-do 체크", "image"=>$chDataWeb."/img/".$chSub."/e2_can_do_check.jpg", "pdf"=>$chDataWeb."/pdf/".$chSub."/Z_candocheck.pdf");
        $aData['aCm'][] = array("title"=>"판권 안내", "image"=>$chDataWeb."/img/".$chSub."/e2_okuduke.jpg", "pdf"=>$chDataWeb."/pdf/".$chSub."/Z_okuzuke.pdf");
        
        for($i=0, $nCnt=count($aData['aLesson']); $i<$nCnt; $i++) {
            $aData['aLesson'][$i]['image'] = $chDataWeb."/img/".$chSub."/e2_l".sprintf("%02d", ($i+1)).".jpg";
            $aData['aLesson'][$i]['pdf'] = $chDataWeb."/pdf/".$chSub."/Z_L".sprintf("%02d", ($i+1)).".pdf";
            $aData['aLesson'][$i]['pdf_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['aLesson'][$i]['pdf']), 1);
            $aData['aLesson'][$i]['mp3'] = $chDataWeb."/audio/".$chSub."/Z_audio_L".sprintf("%02d", ($i+1)).".zip";
            $aData['aLesson'][$i]['mp3_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['aLesson'][$i]['mp3']), 1);
            $aData['aLesson'][$i]['audio'] = $chBaseWeb."/".$chSub."/audio/lesson".sprintf("%02d", ($i+1));
        }    
        
        for($i=0, $nCnt=count($aData['aCover']); $i<$nCnt; $i++) {
            $aData['aCover'][$i]['pdf_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['aCover'][$i]['pdf']), 1);
        }    
        
        for($i=0, $nCnt=count($aData['aCm']); $i<$nCnt; $i++) {
            $aData['aCm'][$i]['pdf_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['aCm'][$i]['pdf']), 1);
        }
    }
    
    // 부속교재 데이터 -----------------------------------------------
    if($chSub == "resources") {
        // 합본판
        $aData['pdf'] = true;
        $aData['aMerges'] = array();
        $aData['aMerges'][] = array("title"=>"문법노트", "image"=>$chDataWeb."/img/".$chSub."/grammar.jpg", "pdf"=>$chDataWeb."/pdf/".$chSub."/Grammar_all.pdf");
        $aData['aMerges'][] = array("title"=>"일본생활 TIPS", "image"=>$chDataWeb."/img/".$chSub."/tips.jpg", "pdf"=>$chDataWeb."/pdf/".$chSub."/TIPS_all.pdf");
        $aData['aMerges'][] = array("title"=>"한자", "image"=>$chDataWeb."/img/".$chSub."/kanji.jpg", "pdf"=>$chDataWeb."/pdf/".$chSub."/Kanji_all.pdf");
        $aData['aMerges'][] = array("title"=>"ひらがな・カタカナ", "image"=>$chDataWeb."/img/".$chSub."/kana.jpg", "pdf"=>$chDataWeb."/pdf/".$chSub."/Kana_all.pdf");
        for($i=0, $nCnt=count($aData['aMerges']); $i<$nCnt; $i++) {
            $aData['aMerges'][$i]['pdf_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['aMerges'][$i]['pdf']), 1);
        }
        
        // 단어리스트
        $aData['aWords'] = array();
        $aData['aWords'][] = array(
            "title"=>"입문", "image"=>$chDataWeb."/img/".$chSub."/wordlist_x.png", "pdf"=>$chDataWeb."/pdf/".$chSub."/wordlist_X.pdf",
            "mp3"=>$chDataWeb."/audio/".$chSub."/wordlist_X.zip", "audio"=>$chBaseWeb."/".$chSub."/audio/starter"
        );
        $aData['aWords'][] = array(
            "title"=>"초급1", "image"=>$chDataWeb."/img/".$chSub."/wordlist_y.png", "pdf"=>$chDataWeb."/pdf/".$chSub."/wordlist_Y.pdf",
            "mp3"=>$chDataWeb."/audio/".$chSub."/wordlist_Y.zip", "audio"=>$chBaseWeb."/".$chSub."/audio/elementary01"
        );
        $aData['aWords'][] = array(
            "title"=>"초급2", "image"=>$chDataWeb."/img/".$chSub."/wordlist_z.png", "pdf"=>$chDataWeb."/pdf/".$chSub."/wordlist_Z.pdf",
            "mp3"=>$chDataWeb."/audio/".$chSub."/wordlist_Z.zip", "audio"=>$chBaseWeb."/".$chSub."/audio/elementary02"
        );
        $aData['aWords'][] = array(
            "title"=>"수정일람(초판->Ver.2021/10/01)", "image"=>$chDataWeb."/img/".$chSub."/correct_word_list.png", 
            "pdf"=>$chDataWeb."/pdf/".$chSub."/Corrections_list_of_Word_lists.pdf"
        );
        $aData['aWords'][] = array(
            "title"=>"Excel 파일 (입문~초급2)", "image"=>$chDataWeb."/img/".$chSub."/wordlist_all.png", "type"=>"xlsx",
            "pdf"=>$chDataWeb."/pdf/".$chSub."/wordlist_all.xlsx"
        );
        
        
        for($i=0, $nCnt=count($aData['aWords']); $i<$nCnt; $i++) {
            $aData['aWords'][$i]['pdf_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['aWords'][$i]['pdf']), 1);
            $aData['aWords'][$i]['mp3_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['aWords'][$i]['mp3']), 1);
        }
        
        // 해답
        $aData['aAnswers'] = array();
        $aData['aAnswers'][] = array(
            "title"=>"입문", "image"=>$chDataWeb."/img/".$chSub."/X_answer.png", "pdf"=>$chDataWeb."/pdf/".$chSub."/X_answer.pdf"
        );
        $aData['aAnswers'][] = array(
            "title"=>"초급1", "image"=>$chDataWeb."/img/".$chSub."/Y_answer.jpg", "pdf"=>$chDataWeb."/pdf/".$chSub."/Y_answer.pdf"
        );
        $aData['aAnswers'][] = array(
            "title"=>"초급2", "image"=>$chDataWeb."/img/".$chSub."/Z_answer.jpg", "pdf"=>$chDataWeb."/pdf/".$chSub."/Z_answer.pdf"
        );        
        
        for($i=0, $nCnt=count($aData['aAnswers']); $i<$nCnt; $i++) {
            $aData['aAnswers'][$i]['pdf_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['aAnswers'][$i]['pdf']), 1);
        }
        
        // JF생활일본어 Can-do 와 Can-do 대응표
        $aData['aCando'] = array();
        $aData['aCando'][] = array(
            "title"=>"이로도리 Can-do -> JF생활일본어 Can-do", "image"=>$chDataWeb."/img/".$chSub."/irodori_can-do-jf_can-do_for_life_in_japan.png", 
            "pdf"=>$chDataWeb."/pdf/".$chSub."/irodori_can-do-jf_can-do_for_life_in_japan.xlsx", "type"=>"xlsx",
        );
        $aData['aCando'][] = array(
            "title"=>"JF생활일본어 Can-do -> 이로도리 Can-do", "image"=>$chDataWeb."/img/".$chSub."/jf_can-do_for_life_in_japan-irodori_can-do.png", 
            "pdf"=>$chDataWeb."/pdf/".$chSub."/jf_can-do_for_life_in_japan-irodori_can-do.xlsx", "type"=>"xlsx",
        );      
        
        for($i=0, $nCnt=count($aData['aCando']); $i<$nCnt; $i++) {
            $aData['aCando'][$i]['pdf_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['aCando'][$i]['pdf']), 1);
        }
        
        // 문형・한자 리스트
        $aData['aKanji'] = array();
        $aData['aKanji'][] = array(
            "title"=>"문형 리스트", "image"=>$chDataWeb."/img/".$chSub."/sentence_patterns_list.png", 
            "pdf"=>$chDataWeb."/pdf/".$chSub."/sentence_patterns_list.xlsx", "type"=>"xlsx",
        );
        $aData['aKanji'][] = array(
            "title"=>"한자 리스트", "image"=>$chDataWeb."/img/".$chSub."/kanji_list.png", 
            "pdf"=>$chDataWeb."/pdf/".$chSub."/kanji_list.xlsx", "type"=>"xlsx",
        );      
        
        for($i=0, $nCnt=count($aData['aKanji']); $i<$nCnt; $i++) {
            $aData['aKanji'][$i]['pdf_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['aKanji'][$i]['pdf']), 1);
        }
        
        // 일본 생활 TIPS 인덱스
        $aData['aTips'] = array();
        $aData['aTips'][] = array(
            "title"=>"인쇄용 PDF", "image"=>$chDataWeb."/img/".$chSub."/tips_index_pdf.png", 
            "pdf"=>$chDataWeb."/pdf/".$chSub."/TIPS_index.pdf"
        );
        $aData['aTips'][] = array(
            "title"=>"Excel 파일", "image"=>$chDataWeb."/img/".$chSub."/tips_index_xlsx.png", 
            "pdf"=>$chDataWeb."/pdf/".$chSub."/TIPS_index.xlsx", "type"=>"xlsx",
        );      
        
        for($i=0, $nCnt=count($aData['aTips']); $i<$nCnt; $i++) {
            $aData['aTips'][$i]['pdf_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['aTips'][$i]['pdf']), 1);
        }
        
        // 전단지・링크용 배너
        $aData['aBanners'] = array();
        $aData['aBanners'][] = array(
            "title"=>"전단지(일본어)", "image"=>$chDataWeb."/img/".$chSub."/irodori_flyer_jp.jpg", 
            "pdf"=>$chDataWeb."/pdf/".$chSub."/irodori_flyer_jp.pdf"
        );
        $aData['aBanners'][] = array(
            "title"=>"전단지(영어)", "image"=>$chDataWeb."/img/".$chSub."/irodori_flyer_en.jpg", 
            "pdf"=>$chDataWeb."/pdf/".$chSub."/irodori_flyer_en.pdf"
        );
        $aData['aBanners'][] = array(
            "title"=>"링크용 배너(大)", "image"=>$chDataWeb."/img/".$chSub."/irodori_banner_large.jpg", 
            "pdf"=>$chDataWeb."/pdf/".$chSub."/irodori_banner_large.jpg", "type"=>"jpeg", "size"=>"195×119"
        );
        $aData['aBanners'][] = array(
            "title"=>"링크용 배너(小)", "image"=>$chDataWeb."/img/".$chSub."/irodori_banner_small.jpg", 
            "pdf"=>$chDataWeb."/pdf/".$chSub."/irodori_banner_small.jpg", "type"=>"jpeg", "size"=>"300×55"
        );
        
        for($i=0, $nCnt=count($aData['aBanners']); $i<$nCnt; $i++) {
            $aData['aBanners'][$i]['pdf_size'] = getFileSize(filesize($_SERVER['DOCUMENT_ROOT'].$aData['aBanners'][$i]['pdf']), 1);
        }
    }


//----- DB 접속 종료 -----//
	//$CMysql->fnClose();

//----- 메인 변수 -----//
    $chPageTitle .=" - ".$sGnb['title'];



//----- 변수설정 -----//
	$chTargetURL = urlencode($REQUEST_URI);


//----- 변수 등록 -----//
    $tpl->assign('chSub', $chSub);
	$tpl->assign('aGnb', $aGnb);	
	$tpl->assign('sGnb', $sGnb);

	$tpl->assign('chTargetURL', $chTargetURL);
	$tpl->assign('chPageTitle', $chPageTitle);
	//--------------------------------------
	$tpl->assign('aData', $aData);


//----- 출력 -----//
	$tpl->print_('pageload');
?>