<?php
# session
$SES_MEMBER_ID              = $this->session->userdata('C_Member_Id');
$SES_MEMBER_NAME            = $this->session->userdata('C_Member_Name');
$SES_MEMBER_NICNAME         = $this->session->userdata('C_Member_Nicname');
$SES_MEMBER_PROFILE         = $this->session->userdata('C_Member_Profile');
$SES_MEMBER_GROUPNAME       = $this->session->userdata('C_Member_Group_Name');
$SES_MEMBER_INTRO           = $this->session->userdata('C_Member_Intro');
$SES_MEMBER_EMAIL           = $this->session->userdata('C_Member_Email');

$weekday = array('일','월','화','수','목','금','토');

if($SES_MEMBER_PROFILE == '')   $SES_MEMBER_PROFILE = '/img/web/img_profile_l.png';
if($SES_MEMBER_NICNAME == '')   $SES_MEMBER_NICNAME = $SES_MEMBER_NAME;

$controller = $this->uri->segment(2);
$method = $this->uri->segment(3);
if($controller != 'search') {
    $search_keyword = '';
}
$content_type    = trim($this->input->get_post('content_type', TRUE));


$ci=& get_instance();

# 실시간급상승 검색어
$ci->load->model('web/m_realtime_keyword');
$arr_realtime_keyword    = $ci->m_realtime_keyword->realtime_keyword_all_list();

$return_data['arr_realtime_keyword']        = $arr_realtime_keyword;

// include(APPPATH."views/web/comm/header.php")
?>

<!doctype html>
<!--[if lt IE 7]><html class="no-js lt-ie10 lt-ie9 lt-ie8 lt-ie7" lang="kr"><![endif]-->
<!--[if (IE 7)&!(IEMobile)]><html class="no-js lt-ie10 lt-ie9 lt-ie8" lang="kr"><![endif]-->
<!--[if (IE 8)&!(IEMobile)]><html class="no-js lt-ie10 lt-ie9" lang="kr"><![endif]-->
<!--[if (IE 9)&!(IEMobile)]><html class="no-js lt-ie10" lang="kr"><![endif]-->
<!--[if gt IE 9]><!--> <html class="no-js" lang="kr"><!--<![endif]-->
<head>
  <meta charset="utf-8">
  <meta name="naver-site-verification" content="894ba0807460988349b1e131377b26966e347fc1">
  <meta name="google-site-verification" content="CitaOJM4btglyBtNxZFYymBBzh3g7Pb9PxKl9YF8jDg">
  <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
  <!-- <meta http-equiv="cleartype" content="on"> -->
  <title>크리스천포털 크로스맵</title>
  <meta name="description" content="">
  <meta name="author" content="">
  <meta name="HandheldFriendly" content="True">
  <meta name="MobileOptimized" content="320">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  <meta property="fb:app_id" content="961578337335000">

  <!-- favicons -->
  <link rel="shortcut icon" href="/img/shortcut_icon.png">
  <link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon">
  <link rel="apple-touch-icon" href="/img/shortcut_icon.png">
  <link rel="apple-touch-startup-image" href="/img/shortcut_icon.png">
  
  <!-- css -->
  <link rel="stylesheet" href="/css/main.css">
  <!-- Font -->
  <link href="https://fonts.googleapis.com/css?family=Nanum+Gothic" rel="stylesheet">
  <link href="https://fonts.googleapis.com/css?family=Nanum+Myeongjo" rel="stylesheet"> 
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tiny-slider/2.9.1/tiny-slider.css">
  <!--[if (lt IE 9)]><script src="https://cdnjs.cloudflare.com/ajax/libs/tiny-slider/2.9.1/min/tiny-slider.helper.ie8.js"></script><![endif]-->

  <!-- javascript -->
  <!--[if (lt IE 9)]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <script src="assets/js/ie.min.js"></script>
    
    <link href="http://externalcdn.com/respond-proxy.html" id="respond-proxy" rel="respond-proxy" />
    <link href="assets/cross-domain/respond.proxy.gif" id="respond-redirect" rel="respond-redirect" />
    <script src="assets/cross-domain/respond.proxy.js"></script>  
  <![endif]-->
  <script src="/js/script.js"></script>
  <!-- <script src="/renew2/js/script.js"></script> -->
</head>
<body>
<noscript>
  <p class="enable-js">
    To enjoy our website, you'll need to enable <b>JavaScript</b> in your web browser. Please <a href="http://enable-javascript.com/" target="_blank"><b>click here</b></a> to learn how.
  </p>
</noscript>
<!--[if lte IE 8]>
  <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/" target="_blank">upgrade your browser</a> to improve your experience.</p>
<![endif]-->

<!-- Mobile nav Overlayer -->
<div class="offcanvas" aria-hidden="true">
  <div class="nav-wrap">
    <button class="btn-close" data-remove=".nav-wrap"><i class="fas fa-times"></i></button>
    <nav class="site-nav">
      <ul>
        <li><a href="/web/news/">뉴스</a></li>
        <li><a href="index.html" onclick="alert('준비중입니다.'); return false;">웹툰</a></li>
        <li <?// class="current"?>><a href="index.html" onclick="alert('준비중입니다.'); return false;">키즈</a></li>
        <li><a href="index.html" onclick="alert('준비중입니다.'); return false;">찬양</a></li>
        <li><a href="/web/life/">은혜</a></li>
        <li><a href="index.html" onclick="alert('준비중입니다.'); return false;">크맵TV</a></li>
        <li><a href="index.html" onclick="alert('준비중입니다.'); return false;">기도공감</a></li>
        <li><a href="index.html" onclick="alert('준비중입니다.'); return false;">자료실</a></li>
        <li class="login">
            <?if($SES_MEMBER_ID=='') {?><a href="/web/user/login">로그인</a><?}else{?>
            <?}?>
        </li>
      </ul>
    </nav>
  </div>
</div>
<header class="site-head">
   <div class="util">
    <div class="container">
     <div class="cm"><a href="/web/cs/faq_view/33?search_keyword=&search_category1=31&search_category2=02&data_num=2">크로스맵을 시작페이지로</a></div>
     <div class="login">
      <?if($SES_MEMBER_ID=='') {?>
            <a href="/web/user/login">로그인</a>
            <a href="/web/user/register">회원가입</a>
      <?} else {?>
        <a href="/web/mypage/bookmark">내 정보</a>
        <a href="/web/member/logout_proc">로그아웃</a>
      <?}?>
     </div>
    </div>
   </div>

   <div class="topbar">
    <div class="container">
      <div class="quicklink">
        <span>이런건 어때?</span>
        <a href="/web/life/">은혜</a>
        <a href="#">찬양</a>
      </div>
      <div class="logo"><a href="/"><img src="/renew2/img/logo.svg" alt="크로스맵"></a></div>

      <!--실시간 급상승 검색어-->
      <div class="keyword">
        <ul>
          <? $i=1;
          foreach ($arr_realtime_keyword as $key=>$val) {$keyword = mb_strimwidth($val['keyword'], '0', '25', '..', 'utf-8');?>
              <li>
                <span><?=$i?></span> 
                <a href="/web/search/?search_keyword=<?=urlencode($val['keyword'])?>"><?=$keyword;?></a>
              </li>
          <?$i++; if($i==11)break;}?>    
        </ul>
        <button data-toggle=".keywordOver" aria-label="Show all the keywords"><img src="/renew2/img/arrow-down.gif" alt="" width="11" height="6" aria-hidden="true"></button>
      </div>

      <!-- Keyword Box Over  -->
      <div class="keywordOver">
        <ul>
          <li><i class="fas fa-arrow-up"></i> 실시간 급상승</li>
          <? $i=1;
            foreach ($arr_realtime_keyword as $key=>$val) {
              $keyword = mb_strimwidth($val['keyword'], '0', '25', '..', 'utf-8');
          ?>
              <li>
                <span><?=$i?></span> 
                <a href="/web/search/?search_keyword=<?=urlencode($val['keyword'])?>"><?=$keyword;?></a>
              </li>
              
          <?$i++;}?>   
        </ul>
      </div>

    </div>
  </div>

  </div>
    <!--Desktop Nav-->
  <div class="site-nav-desktop">
    <div class="container">
      <button class="nav-toggle" data-toggle=".nav-wrap"><img src="/renew2/img/ic-menu.png"></button>
      <nav>
        <ul>
          <li><a href="/web/news">뉴스</a></li>
          <li><a href="index.html" onclick="alert('준비중입니다.'); return false;">웹툰</a></li>
          <li <?// class="current"?>><a href="index.html" onclick="alert('준비중입니다.'); return false;">키즈</a></li>
          <li><a href="index.html" onclick="alert('준비중입니다.'); return false;">찬양</a></li>
          <li><a href="/web/life/">은혜</a></li>
          <li><a href="index.html" onclick="alert('준비중입니다.'); return false;">크맵TV</a></li>
          <li><a href="index.html" onclick="alert('준비중입니다.'); return false;">기도공감</a></li>
          <li><a href="index.html" onclick="alert('준비중입니다.'); return false;">자료실</a></li-->
        </ul>
      </nav>
       <button class="search-toggle" data-add=".search"><img src="/renew2/img/ic-search.png"></button>
      
    </div>
  </div>

  <!-- Search Over -->
   <div class="search">
     <div class="container">
       <button class="btn-close" data-remove=".search"><img src="/renew2/img/ic-close.gif"></button>
       <form class="site-head-search" action="/web/search/" method="get">
         <input type="text" name="search_keyword" id="site-head-search" placeholder="검색어를 입력하세요">
         <button type="submit"><i class="fa fa-search"></i></button>
       </form>
     </div>
   </div> 
</header>

<div class="main-container">
  <!--side banner LEFT-->
  <? /*
  <div class="leftBn">
    <div>
      <img src="/renew2/img/bn-side-left1.jpg">
      <ul>
        <li><a href="">찬양영상 </a></li>
        <li><a href="">간증</a></li>
        <li><a href="">말씀영상</a></li>
      </ul>
    </div>
  </div>
*/
  ?>
  <!--Body Container-->
  <div class="container">

      <!--Main 1st Box-->
      <div class="pb15">
        <?include_once(APPPATH."views/web/homepage/mainbox2.php"); ?>
        <?include_once(APPPATH."views/web/homepage/musicChart.php"); ?>

        <div class="bnRight">
          <a href="<?=$advertisement->Main->fcright->ad_lending?>" target="_new"><img src="<?=$advertisement->Main->fcright->ad_file?>"></a>
        </div>

      </div>

      <!--Main 2nd box-->
      <div class="mainBox2">
        <div class="leftBox">
          <!-- news box -->
          <?include_once(APPPATH."views/web/homepage/newsBox.php");?>
          <!-- logo box -->
          <?include_once(APPPATH."views/web/homepage/logoBox.php");?>
        </div>

        <div class="rightBox">
            <div class="dailyWord">
                <div class="title">
                  <span class="blue">오늘의 말씀</span>
                  <?$yoil = array("일","월","화","수","목","금","토");?>
                  <span><?=date('m')?>.<?=date('d')?> <?echo($yoil[date('w', strtotime(date('Y-m-d')))]);?></span>
                </div>
                <div class="word">
                    <?= $arr_today_word['word']?>
                </div>
                <span class="verse"><?=$arr_today_word['title']?></span>
            </div>
            <?
            if(count($arr_daily_cutie) > 0) {
            ?>
            <div class="dailyQT">
              <div class="titleBox">
                <span class="view qttitle">데일리큐티</span>
              </div>
                  <a href="/web/life/life_view/<?=$arr_daily_cutie[1]['content_idx']?>" target="_new">
                  <div class="photo" style="background:url('<?=$arr_daily_cutie[1]['theme_img'];?>') no-repeat center; background-size:cover;"></div></a>
                  <p class="qttxt"><a href="/web/life/life_view/<?=$arr_daily_cutie[1]['content_idx']?>"><?=$arr_daily_cutie[1]['title']?></a></p>
                </div>
            <?}?>
            </div>
        </div>

      <?include_once(APPPATH."views/web/homepage/cmTv.php")?>

      <!--이런건 어때 -->
      <?include_once(APPPATH."views/web/homepage/featuredBox.php")?>
    </div>

  <!--side banner RIGHT-->
  <?/*
  <div class="rightBn">
    <div><a href="<?=$ad['adwidfirst']['ad_lending']?>" target="_new"><img src="<?=$ad['adwidfirst']['ad_file']?>"></a></div>
    <div><a href="<?=$ad['adwidsecond']['ad_lending']?>" target="_new"><img src="<?=$ad['adwidsecond']['ad_file']?>"></a></div>
    <div><a href="<?=$ad['adwidthird']['ad_lending']?>" target="_new"><img src="<?=$ad['adwidthird']['ad_file']?>"></a></div>
  </div>
  */
  ?>
</div>
<!-- container end -->

<!--footer start-->
<?include_once(APPPATH."views/web/comm/footer.php")?>

<script>
function submit_check() {
    if(!$("#search_keyword").val()) {
        alert('검색어를 입력하세요.');
        return false;
    } else {
        return true;
    }
}

function search_keyword_proc(search_keyword){
    if(search_keyword == '') {
        search_keyword = $("#search_keyword").val();
    }
    
    var result = true;
    if(search_keyword!='')  result = search_keyword_reg(search_keyword);
    if(result==true) {
        $("#search_keyword").val(search_keyword);
        $("#search_form").submit();
    }

}


window.onscroll = function(ev) {
  if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight) {
    var li_node = document.createElement("li");  
    var a_node = document.createElement("a");  
    var img_node = document.createElement('img');
    
    a_node.setAttribute('href','/web/life/life_view/596');
    img_node.setAttribute('src',"/files/life/2019/01/dd1798adb9be200bfe541bc6a497926f.jpg")
    li_node.appendChild(a_node);
    a_node.appendChild(img_node);            
    
    var div_node = document.createElement("div");
    div_node.classList.add( 'des' );
    var p_node1 = document.createElement("p");
    var a_text = document.createTextNode("겸손한 사람은");
    var a_node1 = document.createElement("a");
    div_node.appendChild(p_node1);
    p_node1.appendChild(a_node1);
    a_node1.appendChild(a_text);
    li_node.appendChild(div_node);

    // console.log("data load code add")
    // var footer =document.getElementsByClassName("footer")[0];
    // footer.appendChild(li_node);
  }
}
</script>