<!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>
    <?php $this->load->view('mobile/news/news-head-meta')?>
    <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet"
        href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css" />
    <?php $this->load->view('mobile/news/news-head')?>
</head>

<body>
    <?php $this->load->view('mobile/news/news-header')?>
    <div class="main-container">
        <!--Body Container-->
        <div class="container">

            <!--Main Slide-->
            <div class="mainNews">
                <a href="<?php echo $sortByPosted[0]->articleURL?>">
                    <div class="photo"
                        style="background:url('https://crossmap.co.kr<?php echo $sortByPosted[0]->postImage?>') no-repeat center; background-size:cover;">
                    </div>
                </a>
                <div class="mainNewsTitle">
                    <h2><a href="<?php echo $sortByPosted[0]->articleURL?>"><?php echo $sortByPosted[0]->postTitle?></a>
                    </h2>
                    <ul>
                        <li>
                            <a
                                href="<?php echo $sortByPosted[1]->articleURL?>"><?php echo $sortByPosted[1]->postTitle?></a>
                        </li>
                        <li><a
                                href="<?php echo $sortByPosted[2]->articleURL?>"><?php echo $sortByPosted[2]->postTitle?></a>
                        </li>
                    </ul>
                </div>
            </div>

            <!--Banner-->
            <div class="mBanner">
                <a href="#"><img src="<?php echo THEME_FOLDER?>/mobile/img/m-banner.gif"></a>
            </div>

            <div class="mainBox">
                <div class="thumbList">
                    <ul>
                        <?php foreach(array_slice($sortByPosted, 3, 6) as $a) {?>
                        <li>
                            <a class="img-scaleup" href="<?php echo $a->articleURL?>"><img
                                    src="https://crossmap.co.kr<?php echo $a->postImage?>" style="max-height:86px"></a>
                            <div class="des">
                                <p><a href="<?php echo $a->articleURL?>">
                                        <span
                                            class="blue"><?php echo $a->sectionCategory['title'] == '오피니언' ? '['.$a->sectionCategory['title'].']':''?></span>
                                        <?php echo $a->postTitle?></a>
                                </p>
                            </div>


                        </li>
                        <?php }?>
                    </ul>
                </div>
            </div>

            <div class="mainBox">
                <div class="tagBox">
                    <ul class='owl-carousel'>
                        <?php foreach(array_slice($sortByPosted, 9, 9) as $a) {?>
                        <li>
                            <a class="img-scaleup" href="<?php echo $a->articleURL?>"><img
                                    src="https://crossmap.co.kr<?php echo $a->postImage?>" style="max-height:141px"></a>
                            <h3><a
                                    href="<?php echo $a->articleURL?>"><?php echo mb_strimwidth($a->postTitle, 0, 30, '...', 'utf-8')?></a>
                            </h3>
                        </li>
                        <?php }?>
                    </ul>
                </div>
            </div>

            <!--Banner-->
            <div class="mBanner">
                <a href="#"><img src="<?php echo THEME_FOLDER?>/mobile/img/m-banner.gif"></a>
            </div>

            <div class="mainBox">
                <div class="thumbList">
                    <ul>
                        <?php 
                        $seciontNames = array_keys(NEWS_SECTION_CATEGORY);
                        shuffle($seciontNames);
                        foreach($seciontNames as $sn) { 
                          if(!count($posts[$sn]))continue;
                        ?>
                        <li>
                            <a class="img-scaleup" href="<?php echo $posts[$sn][0]->articleURL?>"><img
                                    src="https://crossmap.co.kr<?php echo $posts[$sn][0]->postImage?>"
                                    style="max-height:86px"></a>
                            <div class="des">
                                <div class="blue"><?php echo $posts[$sn][0]->sectionCategory['title']?></div>
                                <p><a
                                        href="<?php echo $posts[$sn][0]->articleURL?>"><?php echo $posts[$sn][0]->postTitle?></a>
                                </p>
                            </div>
                        </li>
                        <?php }?>
                    </ul>
                </div>
            </div>

            <!--Banner-->
            <div class="mBanner">
                <a href="#"><img src="<?php echo THEME_FOLDER?>/mobile/img/m-banner.gif"></a>
            </div>

            <!--선교/국제-->
            <div class="mainBox">
                <div class="titleBox">
                    <ul>
                        <li class="view"><a href="#">선교/국제</a></li>
                    </ul>
                </div>
                <div class="mainBox-slider">
                    <div class="thumbBox">
                        <ul>
                            <li>
                                <a class="img-scaleup" href="<?php echo $posts['mission'][1]->articleURL?>"><img
                                        src="https://crossmap.co.kr<?php echo $posts['mission'][1]->postImage?>"></a>
                                <div class="des">
                                    <p><a
                                            href="<?php echo $posts['mission'][1]->articleURL?>"><?php echo $posts['mission'][1]->postTitle?></a>
                                    </p>
                                </div>
                            </li>
                            <li>
                                <a class="img-scaleup" href="<?php echo $posts['mission'][2]->articleURL?>"><img
                                        src="https://crossmap.co.kr<?php echo $posts['mission'][2]->postImage?>"></a>
                                <div class="des">
                                    <p><a
                                            href="<?php echo $posts['mission'][2]->articleURL?>"><?php echo $posts['mission'][2]->postTitle?></a>
                                    </p>
                                </div>
                            </li>
                        </ul>
                    </div>
                    <div class="thumbList newsList">
                        <ul>
                            <?php foreach(array_slice($posts['mission'], 3, 4) as $a) {?>
                            <li>
                                <p><a href="<?php echo $a->articleURL?>"><?php echo $a->postTitle?></a></p>
                            </li>
                            <?php }?>
                        </ul>
                    </div>
                </div>
            </div>

            <!--사회-->
            <div class="mainBox">
                <div class="titleBox">
                    <ul>
                        <li class="view"><a href="#">사회</a></li>
                    </ul>
                </div>
                <div class="mainBox-slider">
                    <div class="thumbBox">
                        <ul>
                            <li>
                                <a class="img-scaleup" href="<?php echo $posts['society'][1]->articleURL?>"><img
                                        src="https://crossmap.co.kr<?php echo $posts['society'][1]->postImage?>"></a>
                                <div class="des">
                                    <p><a
                                            href="<?php echo $posts['society'][1]->articleURL?>"><?php echo $posts['society'][1]->postTitle?></a>
                                    </p>
                                </div>
                            </li>
                            <li>
                                <a class="img-scaleup" href="<?php echo $posts['society'][2]->articleURL?>"><img
                                        src="https://crossmap.co.kr<?php echo $posts['society'][2]->postImage?>"></a>
                                <div class="des">
                                    <p><a
                                            href="<?php echo $posts['society'][2]->articleURL?>"><?php echo $posts['society'][2]->postTitle?></a>
                                    </p>
                                </div>
                            </li>
                        </ul>
                    </div>
                    <div class="thumbList newsList">
                        <ul>
                            <?php foreach(array_slice($posts['society'], 3, 4) as $a) {?>
                            <li>
                                <p><a href="<?php echo $a->articleURL?>"><?php echo $a->postTitle?></a></p>
                            </li>
                            <?php }?>
                        </ul>
                    </div>
                </div>
            </div>

            <!--문화-->
            <div class="mainBox">
                <div class="titleBox">
                    <ul>
                        <li class="view"><a href="#">문화</a></li>
                    </ul>
                </div>
                <div class="mainBox-slider">
                    <div class="thumbBox">
                        <ul>
                            <li>
                                <a class="img-scaleup" href="<?php echo $posts['culture'][1]->articleURL?>"><img
                                        src="https://crossmap.co.kr<?php echo $posts['culture'][1]->postImage?>"></a>
                                <div class="des">
                                    <p><a
                                            href="<?php echo $posts['culture'][1]->articleURL?>"><?php echo $posts['culture'][1]->postTitle?></a>
                                    </p>
                                </div>
                            </li>
                            <li>
                                <a class="img-scaleup" href="<?php echo $posts['culture'][2]->articleURL?>"><img
                                        src="https://crossmap.co.kr<?php echo $posts['culture'][2]->postImage?>"></a>
                                <div class="des">
                                    <p><a
                                            href="<?php echo $posts['culture'][2]->articleURL?>"><?php echo $posts['culture'][2]->postTitle?></a>
                                    </p>
                                </div>
                            </li>
                        </ul>
                    </div>
                    <div class="thumbList newsList">
                        <ul>
                            <?php foreach(array_slice($posts['culture'], 3, 4) as $a) {?>
                            <li>
                                <p><a href="<?php echo $a->articleURL?>"><?php echo $a->postTitle?></a></p>
                            </li>
                            <?php }?>
                        </ul>
                    </div>
                </div>
            </div>

            <!--많이 본/댓글많은 뉴스-->
            <div class="mainBox">
                <ul class="titleBoxTab">
                    <li class="current">많이 본</li>
                    <li>댓글 많은</li>
                </ul>
                <div class="thumbList countList">
                    <ul>
                        <?php for ($i = 0; $i < 9; $i++) { ?>
                        <li>
                            <a class="img-scaleup" href="<?php echo $hotNews[$i]->articleURL?>"><img
                                    src="https://crossmap.co.kr<?php echo $hotNews[$i]->postImage?>"
                                    style="max-height:86px"></a>
                            <div class="des">
                                <span class="blue"><?php $i+1?></span>
                                <p><a
                                        href="<?php echo $hotNews[$i]->articleURL?>"><?php echo $hotNews[$i]->postTitle?></a>
                                </p>
                            </div>
                        </li>
                        <?php }?>
                    </ul>
                </div>
            </div>

            <!--기도소식-->
            <div class="mainBox">
                <div class="titleBox">
                    <ul>
                        <li class="view"><a href="#">기도소식</a></li>
                    </ul>
                </div>
                <div class="mainBox-slider">
                    <div class="thumbBox">
                        <ul>
                            <li>
                                <a class="img-scaleup"
                                    href="/channel/<?php echo $prayNews[0]->pageID?>/<?php echo $prayNews[0]->postID?>"><img
                                        src="https://crossmap.co.kr<?php echo $prayNews[0]->postImage?>"></a>
                                <div class="des">
                                    <p><a
                                            href="/channel/<?php echo $prayNews[0]->pageID?>/<?php echo $prayNews[0]->postID?>"><?php echo $prayNews[0]->postTitle?></a>
                                    </p>
                                </div>
                            </li>
                            <li>
                                <a class="img-scaleup"
                                    href="/channel/<?php echo $prayNews[1]->pageID?>/<?php echo $prayNews[1]->postID?>"><img
                                        src="https://crossmap.co.kr<?php echo $prayNews[1]->postImage?>"></a>
                                <div class="des">
                                    <p><a
                                            href="/channel/<?php echo $prayNews[1]->pageID?>/<?php echo $prayNews[1]->postID?>"><?php echo $prayNews[1]->postTitle?></a>
                                    </p>
                                </div>
                            </li>
                        </ul>
                    </div>

                </div>
            </div>

        </div>
        <?php $this->load->view('mobile/news/news-footer')?>
    </div>
    <!-- container end -->
    <?php $this->load->view('mobile/news/news-foot')?>

</body>

</html>