<!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')?>
    <!-- //header -->
    <main>
        <section id="channel_tit">
            <div class="container">
                <div class="row">
                    <div class="channel_tit">
                        <div class="chinfo">
                            <div class="chimg">
                                <a href=""><img src="<?php echo imgSrc($editor->partner_img)?>" alt=""></a>
                            </div>
                            <div class="chtxt">
                                <h3><?php echo $editor->partner_name?></h3>
                                <p><?php echo $editor->partner_intro?></p>
                            </div>
                        </div>
                        <div class="chbtns">
                            <ul>
                                <li <?php echo $editor->partner_homepage ? 'style="display:list-item !important;"':'style="display:none"'?>><a href="<?php echo $editor->partner_homepage ? $editor->partner_homepage : ''?>">홈페이지</a></li>
                                <li><a class="share_btn cm-share-btn" href="">공유</a></li>
                            </ul>
                        </div>
								<?php require_once(APPPATH . "views/grace/socialshare.php"); ?>

                    </div>
                </div>
            </div>
        </section>
        <section id="channel_tab">
            <div class="container">
                <div class="row">
                    <div class="channel_tab">
                        <ul>
                            <li class="current">
                                <a href="/cmtv/channel/<?php echo cleanUrl($editor->partner_name)?>/<?php echo $editor->idx?>">홈</a>
                            </li>
                            <li>
                                <a href="/cmtv/channel/<?php echo cleanUrl($editor->partner_name)?>/<?php echo $editor->idx?>/recent">동영상</a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </section>
        <section id="channel_top_box">
            <div class="container">
                <div class="row">
                    <div class="channel_top_box">
                        <div class="videobox">
                            <div class="videoboxin">
                                <iframe src="<?php echo $post->video_url?>" frameborder="0"
                                    allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
                                    allowfullscreen></iframe>
                            </div>
                        </div>
                        <div class="txtbox">
                            <h2><a href="/cmtv/<?php echo $post->titleUrl ?>/<?php echo $post->idx ?>"><?php echo $post->title?></a></h2>
                            <div class="num2">
                                <span> 조회수 <?php echo $post->views?>회</span>
                                <span class="time"><?php echo date('Y. m. d', strtotime($post->reg_date))?></span>
                            </div>
                            <p><?php echo $post->sub_title?></p>
                            <div class="btsbox">
                                <ul>
                                    <li class="selected"><a class="fav_btn cm-like-btn" href=""><?php echo $post->likes?></a></li>
                                    <li><a class="sns_btn cm-share-btn" href=""></a></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>


        <!-- video_listbox -->
        <section id="video_listbox">
            <div class="container">
                <div class="row">
                    <div class="video_listbox mt50">
                        <div class="tit">
                            <h2>최신영상</h2>
                            <span class="more"><a href="/cmtv/channel/<?php echo cleanUrl($editor->partner_name)?>/<?php echo $editor->idx?>/videos">전체보기 <i class="fa fa-angle-right"
                                        aria-hidden="true"></i></a></span>
                        </div>
                        <ul><?php foreach($posts as $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 -->
    </main>
    <!-- footer -->
    <?php $this->load->view('partial/footer')?>
    <script src="/ART/cmtv/js/cmtv_slide.js"></script>
</body>

</html>