<!DOCTYPE html>
<html lang="ko">

<head>
    <?php $this->load->view('partial/head')?>
    <link rel="stylesheet" href="/ART/cmtv/css/default.css">
</head>

<body>
    <?php $this->load->view('partial/sidemenu')?>
    <?php $this->load->view('partial/header')?>
    <main>
        <section id="visual_slide">
            <div class="container">
                <div class="row">
                    <div class="visual_slide">
                        <div class="title">
                            <h2><a href="#">최신 HOT 영상</a></h2>
                        </div>
                        <div class="list">
                            <div class="swiper-container1">
                                <!-- Additional required wrapper -->
                                <div class="swiper-wrapper">
                                    <?php foreach ($slide as $post) {?>
                                    <div class="swiper-slide">
                                        <figure><a href="/cmtv/<?php echo $post->titleUrl ?>/<?php echo $post->idx ?>"><img src="<?php echo $post->mainImg ?>"></a></figure>
                                        <div class="info">
                                            <h3><a href="/cmtv/<?php echo $post->titleUrl ?>/<?php echo $post->idx ?>"><?php echo $post->title ?></a>
                                            </h3>
                                            <p><a href="/cmtv/channel/<?php echo $post->editorNameUrl ?>/<?php echo $post->editorId ?>"><?php echo $post->editorName ?></a></p>
                                        </div>
                                    </div><?php }?>
                                </div>
                                <!-- If we need navigation buttons -->
                                <div class="swiper-button-prev3"><i class="fa fa-angle-left" aria-hidden="true"></i>
                                </div>
                                <div class="swiper-button-next3"><i class="fa fa-angle-right" aria-hidden="true"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- popularvideo -->
        <section id="popularvideo">
            <div class="container">
                <div class="row">
                    <div class="popularvideo">
                        <div class="title">
                            <h2><a href="#">주간 인기영상 TOP 10</a></h2>
                            <span><?php echo date('n.j', time() - 3600)?>
                                <?php echo (date('a') == 'am' ? '오전 ' : '오후 '). (date('H', time() - 3600) > 12 ? date('H', time() - 3600)-12 : date('H', time() - 3600))?>시 ~
                                <?php echo (date('a') == 'am' ? '오전 ' : '오후 '). date('g')?>시 기준 (재생수, 재생시간)</span>
                        </div>
                        <div class="list">
                            <div class="swiper-container3">
                                <!-- Additional required wrapper -->
                                <div class="swiper-wrapper">
                                    <?php foreach ($popularPosts as $k => $post) {?>
                                    <div class="swiper-slide">
                                        <figure><a href="/cmtv/<?php echo $post->titleUrl ?>/<?php echo $post->idx ?>"><img src="<?php echo $post->mainImg ?>"></a></figure>
                                        <div class="info">
                                            <span class="num"><?php echo $k + 1 ?></span>
                                            <h3><a href="/cmtv/<?php echo $post->titleUrl ?>/<?php echo $post->idx ?>"><?php echo $post->title ?></a>
                                            </h3>
                                            <p><a href="/cmtv/channel/<?php echo $post->editorNameUrl ?>/<?php echo $post->editorId ?>"><?php echo $post->editorName ?></a></p>
                                            <div class="num2">
                                                <span> 조회수 <?php echo $post->views ?>회</span>
                                                <span class="time"><?php echo time_elapsed_string($post->reg_date) ?></span>
                                            </div>
                                        </div>
                                    </div>
                                    <?php }?>
                                </div>
                                <!-- If we need navigation buttons -->
                                <div class="swiper-button-prev3"><i class="fa fa-angle-left" aria-hidden="true"></i>
                                </div>
                                <div class="swiper-button-next3"><i class="fa fa-angle-right" aria-hidden="true"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- //popularvideo -->
        <section id="banner_cmtv">
            <div class="container">
                <div class="row">
                    <div class="banner_cmtv clearfix">
                        <div class="babox">
                            <a href="https://www.youtube.com/channel/UCrnxDS-QclED-ej-MFxr8tA" target="_blank">
                                <img src="img/cmtv_ban1.jpg" alt="">
                            </a>
                        </div>
                        <div class="babox">
                            <a href="https://www.youtube.com/user/globalcch" target="_blank">
                                <img src="img/cmtv_ban2.jpg" alt="">
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <section id="channel_section">
            <div class="container">
                <div class="row">
                    <div class="channel_section">
                        <div class="tit">
                            <h2>추천 채널</h2>
                        </div>
                        <div class="list">
                            <ul><?php foreach($editors as $editor) {?>
                                <li>
                                    <div class="chimg">
                                        <a href="/cmtv/channel/<?php echo cleanUrl($editor->editorName)?>/<?php echo $editor->editorId?>"><img src="<?php echo imgSrc($editor->editorImg)?>"></a>
                                    </div>
                                    <div class="txtbox">
                                        <h3> <a href="/cmtv/channel/<?php echo cleanUrl($editor->editorName)?>/<?php echo $editor->editorId?>"><?php echo $editor->editorName?></a>
                                        </h3>
                                        <p><?php echo $editor->editorIntro?></p>
                                    </div>
                                </li><?php }?>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- video_listbox -->
        <section id="video_listbox">
            <div class="container">
                <div class="row">
                    <div class="video_listbox">
                        <div class="tit">
                            <h2>말씀영상</h2>
                            <span class="more"><a
                                    href="/cmtv/category/<?php echo cleanUrl($cmtvCategories[$this->config->item('categories')['crossmaptv']['word']]->category_name)?>/<?php echo $this->config->item('categories')['crossmaptv']['word']?>">전체보기
                                    <i class="fa fa-angle-right" aria-hidden="true"></i></a></span>
                        </div>
                        <ul><?php foreach($word as $k => $post) {?>
                            <li>
                                <div class="box"><a href="/cmtv/<?php echo $post->titleUrl ?>/<?php echo $post->idx ?>"><img src="<?php echo imgSrc($post->mainImg) ?>"></a></div>
                                <div class="txtbox">
                                    <dl>
                                        <dt><a href="/cmtv/<?php echo $post->titleUrl ?>/<?php echo $post->idx ?>"><?php echo $post->title ?></a>
                                        </dt>
                                        <dd class="editor_txt"><a href="/cmtv/channel/<?php echo $post->editorNameUrl ?>/<?php echo $post->editorId ?>"><?php echo $post->editorName ?></a></dd>
                                    </dl>
                                    <span class="info">
                                        <span class="hit">조회수 <?php echo $post->views ?>회</span>
                                        <span class="reple"><?php echo time_elapsed_string($post->reg_date) ?></span>
                                    </span>
                                </div>
                            </li><?php  }?>
                        </ul>
                    </div>
                </div>
            </div>
        </section>
        <!-- //video_listbox -->
        <!-- video_listbox -->
        <section id="video_listbox">
            <div class="container">
                <div class="row">
                    <div class="video_listbox">
                        <div class="tit">
                            <h2>찬양영상</h2>
                            <span class="more"><a
                                    href="/cmtv/category/<?php echo cleanUrl($cmtvCategories[$this->config->item('categories')['crossmaptv']['worship']]->category_name)?>/<?php echo $this->config->item('categories')['crossmaptv']['worship']?>">전체보기
                                    <i class="fa fa-angle-right" aria-hidden="true"></i></a></span>
                        </div>
                        <ul><?php foreach($worship as $k => $post) {?>
                            <li>
                                <div class="box"><a href="/cmtv/<?php echo $post->titleUrl ?>/<?php echo $post->idx ?>"><img src="<?php echo imgSrc($post->mainImg) ?>"></a></div>
                                <div class="txtbox">
                                    <dl>
                                        <dt><a href="/cmtv/<?php echo $post->titleUrl ?>/<?php echo $post->idx ?>"><?php echo $post->title ?></a>
                                        </dt>
                                        <dd class="editor_txt"><a href="/cmtv/channel/<?php echo $post->editorNameUrl ?>/<?php echo $post->editorId ?>"><?php echo $post->editorName ?></a></dd>
                                    </dl>
                                    <span class="info">
                                        <span class="hit">조회수 <?php echo $post->views ?>회</span>
                                        <span class="reple"><?php echo time_elapsed_string($post->reg_date) ?></span>
                                    </span>
                                </div>
                            </li><?php  }?>
                        </ul>
                    </div>
                </div>
            </div>
        </section>
        <!-- //video_listbox -->
        <!-- video_listbox -->
        <section id="video_listbox">
            <div class="container">
                <div class="row">
                    <div class="video_listbox">
                        <div class="tit">
                            <h2>소셜영상</h2>
                            <span class="more"><a
                                    href="/cmtv/category/<?php echo cleanUrl($cmtvCategories[$this->config->item('categories')['crossmaptv']['social']]->category_name)?>/<?php echo $this->config->item('categories')['crossmaptv']['social']?>">전체보기
                                    <i class="fa fa-angle-right" aria-hidden="true"></i></a></span>
                        </div>
                        <ul><?php foreach($social as $k => $post) {?>
                            <li>
                                <div class="box"><a href="/cmtv/<?php echo $post->titleUrl ?>/<?php echo $post->idx ?>"><img src="<?php echo imgSrc($post->mainImg) ?>"></a></div>
                                <div class="txtbox">
                                    <dl>
                                        <dt><a href="/cmtv/<?php echo $post->titleUrl ?>/<?php echo $post->idx ?>"><?php echo $post->title ?></a>
                                        </dt>
                                        <dd class="editor_txt"><a href="/cmtv/channel/<?php echo $post->editorNameUrl ?>/<?php echo $post->editorId ?>"><?php echo $post->editorName ?></a></dd>
                                    </dl>
                                    <span class="info">
                                        <span class="hit">조회수 <?php echo $post->views ?>회</span>
                                        <span class="reple"><?php echo time_elapsed_string($post->reg_date) ?></span>
                                    </span>
                                </div>
                            </li><?php  }?>
                        </ul>
                    </div>
                </div>
            </div>
        </section>
        <!-- //video_listbox -->
        <!-- video_listbox -->
        <section id="video_listbox">
            <div class="container">
                <div class="row">
                    <div class="video_listbox">
                        <div class="tit">
                            <h2>TV방송영상</h2>
                            <span class="more"><a
                                    href="/cmtv/category/<?php echo cleanUrl($cmtvCategories[$this->config->item('categories')['crossmaptv']['tv']]->category_name)?>/<?php echo $this->config->item('categories')['crossmaptv']['tv']?>">전체보기
                                    <i class="fa fa-angle-right" aria-hidden="true"></i></a></span>
                        </div>
                        <ul><?php foreach($tv as $k => $post) {?>
                            <li>
                                <div class="box"><a href="/cmtv/<?php echo $post->titleUrl ?>/<?php echo $post->idx ?>"><img src="<?php echo imgSrc($post->mainImg) ?>"></a></div>
                                <div class="txtbox">
                                    <dl>
                                        <dt><a href="/cmtv/<?php echo $post->titleUrl ?>/<?php echo $post->idx ?>"><?php echo $post->title ?></a>
                                        </dt>
                                        <dd class="editor_txt"><a href="#"><?php echo $post->editorName ?></a></dd>
                                    </dl>
                                    <span class="info">
                                        <span class="hit">조회수 <?php echo $post->views ?>회</span>
                                        <span class="reple"><?php echo time_elapsed_string($post->reg_date) ?></span>
                                    </span>
                                </div>
                            </li><?php  }?>
                        </ul>
                    </div>
                </div>
            </div>
        </section>
        <!-- //video_listbox -->
    </main>
    <?php $this->load->view('partial/footer')?>
    <script src="/ART/cmtv/js/cmtv_slide.js"></script>
</body>

</html>