
	<div class="news_cont2">
		<div class="cont_top">
			<div class="cont_top_img">
				<span class="shadow"></span>
				<a href="/m/life/life_view/<?=$arr_grace_bigone[1]['content_idx']?>">
					<img src="<?= thumb($arr_grace_bigone[1]['theme_img']) ?>">
				</a>
			</div>
			<p class="cont_top_txt2">
				<a href="/m/life/editor/<?=$arr_grace_bigone[1]['partner_idx']?>">
					<?= $arr_grace_bigone[1]['editor_name'] ?>
				</a>
			</p>
			<p class="chn_bar2">
				<img src="/img/mobile/bg_bar.gif">
			</p>
			<p class="cont_top_title4">
				<a href="/m/life/life_view/<?=$arr_grace_bigone[1]['content_idx']?>">
					<?= $arr_grace_bigone[1]['title'] ?>
				</a>
			</p>
		</div>

		<div class="news_lists">

			<? for ($i = 1; $i <= 6; $i++):@$data = $arr_grace_middle[$i]; ?>

				<div class="news_list_cont">
					<div class="art-img2<?=($data['video_url']) ? " plays_b" : ""; ?>">
						<a href="/m/life/life_view/<?=$data['content_idx']?>">
							<img src="<?= thumb($data['theme_img']) ?>"
								 onerror="this.src='https://dummyimage.com/201x113/000/fff&text=no-data'"
								 class="art-img">
						</a>
					</div>
					<div class="art-info2">
						<a href="/m/life/life_view/<?=$data['content_idx']?>">
							<p class="art-info">
								<?= $data['sub_title']; ?>
							</p>
						</a>
						<h2 class="art-title">
							<a href="/m/life/life_view/<?=$data['content_idx']?>">
								<span  class="beachblue"><a href="/m/life/editor/<?=$data['partner_idx']?>"  style="color:#2bbec6">[<?=$data['editor_name']?>]</a></span>
								<a href="/m/life/life_view/<?=$data['content_idx']?>">	<?= $data['title'] ?></a>
							</a>
						</h2>
						<p class="art-info">
							<?= $data['hit_count'] ?>명이 봤어요</p>
					</div>
				</div>
			<? endfor ?>

		</div>
		<div class="channel_cont">
			<div class="wrap">
				<div class="channel_top">

					<?$a = $ci->db->query("select * from (select a.*, b.category_name, c.channel_name, c.channel_icon, (select count(*) from partner where channel_idx=a.channel_idx) as editor_count, (select count(*) from life where channel_idx=a.channel_idx and is_del='N') as article_count, (select sum(hit_count) from life where channel_idx=a.channel_idx and is_del='N') as hit_count from life_etc_section as a join category as b on (a.category_idx = b.idx) join channel as c on (a.channel_idx = c.idx) where a.is_del='N' and b.is_del='N' and c.is_del='N' and a.etc_section_type = '2') as AA where is_del = 'N' order by AA.reg_date  desc limit 0, 30")->result(); ?>
					<a href="/m/life/channel/<?=$a[0]->channel_idx?>">
						<span class="fl beachblue"><?=$a[0]->channel_name?></span>
					</a>
					<span class="fr">
									<a href="/m/life/channel/<?=$a[0]->channel_idx?>"><button type="button" class="btn btn-default br20">더보기</button></a>
								</span>
				</div>

				<? for ($i = 0; $i < 6; $i++) : @$data = $arr_random_chanel[$i]; ?>

					<? if ($i % 2 == 0): ?><div class="channel_boxs" style="margin-bottom:0;"><? endif ?>
					<div class="channel_con2<?=($data['video_url']) ? " plays_b" : ""; ?>">
						<a href="/m/life/life_view/<?=$data['content_idx']?>">
													<img src="<?= thumb($data['main_img']) ?>" class="art-img">
						</a>
						<p class="chtitle">
							<a href="/m/life/life_view/<?=$data['content_idx']?>">
								<span class="beachblue"><? if ($data['head_title']) echo "[" . $data['head_title'] . "]"; ?></span> <?= $data['title']; ?>
							</a>
						</p>
						<p class="editor2">
							<a href="/m/life/editor/<?=$data['partner_idx']?>">
							by <?= $data['editor_name'] ?>
							</a>
						</p>
					</div>

					<? if ($i % 2 != 0): ?></div><? endif ?>
				<? endfor; ?>
			</div>
		</div>
		<div class="channel_cont" style="background:#fff;">
			<div class="wrap">

				<?
				$ci->db->select("*");
				$ci->db->from('vw_mid_editor');
				$res = $ci->db->get();
				$mid = $res->result_array();

				$ci->db->select("*");
				$ci->db->from('life_etc_section_detail');
				$ci->db->where('etc_section_type', 4);
				$ci->db->where('is_del', 'N');
				$ci->db->order_by('life_etc_section_idx', 'asc');
				$ci->db->order_by('rank', 'asc');
				$res = $ci->db->get();

				$tmp = $res->result_array();
				$detail = array();
				foreach ($tmp as $data) {
					$detail[$data['life_etc_section_idx']][] = $data;
				}

				$detail = array_values($detail);

				//							var_dump($detail);

				foreach ($mid as $key => $data):?>


					<div class="channel_boxs bgb3" style="margin-top:10px;">
						<div class="channel_detail_box">
							<div class="channel_detail fl">
								<a href="/m/life/editor/<?= $data['partner_idx'] ?>">
											<span class="channel_profile">
												<img src="<?= thumb($data['partner_img']) ?>" style="width:50px;height:50px;">
											</span>
									<div style="padding-top:15px;">
										<span class="chinfo"><?= $data['partner_name'] ?></span>
									</div>
								</a>
							</div>
							<div class="fr" style="margin-top:20px;">
								<p>
									<a href="/m/life/editor/<?= $data['partner_idx'] ?>">
										<span class="beachblue"
											  style="font-size:13px;"><?= $data['article_count'] ?></span> stories</a>
								</p>
							</div>
						</div>

						<?
						//								var_dump($d);
						foreach ($detail[$key] as $d):


							?>
							<div class="channel_con">
								<a href="/m/life/life_view/<?= $d['content_idx'] ?>">
									<img src="<?= thumb($d['main_img']) ?>" class="art-img">
								</a>
								<p class="chtitle">
									<a href="/m/life/life_view/<?= $d['content_idx'] ?>"> <?= $d['title'] ?></a>
								</p>
							</div>

						<? endforeach; ?>
					</div>

				<? endforeach; ?>
			</div>
		</div>
		<div class="cont_middle">
			<div class="cont_top_img">
				<span class="shadow"></span>

				<a  href="/m/life/editor/<?= $bigone_main['partner_idx'] ?>" class="img_profile">
					<?
					$ci->db->from("partner");
					$ci->db->where("idx=", $data['partner_idx']);
					$res = $ci->db->get();
					$res = $res->result_array();

					?>
					<img src="<?= thumb($res[0]['main_img']) ?>">
				</a>
			</div>
			<div class="cover_profile2">
				<a href="/m/life/editor/<?=  $bigone_main['partner_idx'] ?>">
				<img src="<?= thumb($bigone_main['partner_img']) ?>" style="width:50px;height:50px;">
				</a>
			</div>
			<div class="life_editor3">
				<a href="/m/life/editor/<?= $bigone_main['partner_idx'] ?>"> <?= $bigone_main['partner_name'] ?> </a>
			</div>
			<div class="life_editor2">
				<a href="/m/life/life_view/<?= $d['content_idx'] ?>"> <?= $bigone_main['partner_intro'] ?> </a>
			</div>
		</div>
		<div class="channel_cont">
			<div class="wrap">

				<? foreach ($arr_mid_bigone as $i => $data): ?>

					<? if ($i % 2 == 0): ?>
						<div class="channel_boxs" style="margin-bottom:0;">
						<div class="channel_boxs" style="margin-bottom:0;">
					<? endif; ?>

					<div class="channel_con2<?=($data['video_url']) ? " plays_b" : ""; ?>">
						<a href="/m/life/life_view/<?= $data['content_idx'] ?>">
							<img src="<?= thumb($data['main_img']) ?>" class="art-img">
						</a>
						<p class="chtitle">
							<a href="/m/life/life_view/<?= $data['content_idx'] ?>">
								<span class="beachblue"><? if ($data['head_title']) echo "[" . $data['head_title'] . "]"; ?></span> <? echo (mb_strlen($data['title']) > 18) ? iconv_substr($data['title'], 0, 18, "utf-8") . "…" : $data['title']; ?></a>
						</p>
						<p class="editor2">
							<a href=""><?= $data['hit_count'] ?>명이 봤어요</a>
						</p>
					</div>
					<? if ($i % 2 != 0): ?>
						</div>
						</div>
					<? endif ?>
				<? endforeach; ?>


			</div>
		</div>

		<?

		//					$ci->load->model('admin/etc_section/m_life_etc_section');
		$req_data = array(

			"search_type" => "",
			"search_keyword" => "",
			"search_category" => "",
			"search_etc_section_type" => "6",
			"sort_column" => "reg_date",
			"offset" => 0,
			"limit" => "1"

		);
		$result = $ci->m_life_etc_section->life_editor_etc_section_list($req_data);
		?>
		<div class="life_cont4" style="margin-top:30px;">
			<h4 class="beachblue">
				<a href="/m/life/editor/<?=$result[0]['partner_idx']?>"><?=$result[0]['partner_name']?>
					<br>
					<span style="color:#818181; font-weight:normal; font-size:12px;">(읽을거리 <?=$result[0]['article_count']?>) </span>
				</a>
			</h4>
			<span class="a_left"><!--<a><img src="/img/mobile/editor_left.gif"></a>--></span>
			<div class="life_cont4_box responsive"  style="width:86%;">

				<?
				$result2    = $this->m_life_etc_section->life_etc_section_detail_list($result[0]['idx']);
				$arr_etc_section_detail_rank = array();
				foreach ($result2 as $val) {
					$arr_etc_section_detail_rank[$val['rank']] = array('idx'=>$val['idx'], 'main_img'=> $val['main_img'], 'head_title'=> $val['head_title'], 'title'=> $val['title'], 'content_idx'=> $val['content_idx'], 'hit_count'=>$val['hit_count'], 'editor_name'=>$val['editor_name'], 'video_url' => $val['video_url']);
				}

				foreach($arr_etc_section_detail_rank as $data):
				?>
							<div class="tr_img<?=($data['video_url']) ? " plays_b" : ""; ?>">
								<a href="/m/life/life_view/<?= $data['content_idx'] ?>">
									<img src="<?=thumb($data['main_img'])?>" class="art-img">
								</a>
								<p class="tr_txt">
									<a href="/m/life/life_view/<?= $data['content_idx'] ?>"><?=$data['title']?></a>
								</p>
							</div>

				<?endforeach;?>

			</div>
			<span class="a_right"><!--<a><img src="/img/mobile/editor_right.gif"></a>--></span>
		</div>
		<div class="news_lists">
			<?

			//					$ci->load->model('admin/etc_section/m_life_etc_section');
			$req_data = array(

				"search_type" => "",
				"search_keyword" => "",
				"search_category" => "",
				"search_etc_section_type" => "3",
				"sort_column" => "reg_date",
				"offset" => 0,
				"limit" => "1"
			);
			$result = $ci->m_life_etc_section->life_etc_section_list($req_data);
//			$result1    = $this->m_life_etc_section->life_etc_section_select();
			$result2    = $this->m_life_etc_section->life_etc_section_detail_list($result[0]['idx']);


			$arr_etc_section_detail_rank = array();
			foreach ($result2 as $val) {
				$arr_etc_section_detail_rank[$val['rank']] = array('idx'=>$val['idx'], 'main_img'=> $val['main_img'], 'head_title'=> $val['head_title'], 'title'=> $val['title'], 'content_idx'=> $val['content_idx'], 'hit_count'=>$val['hit_count'], 'editor_name'=>$val['editor_name'],
					'partner_idx'=>$val['partner_idx'],
                    'video_url' => $val['video_url']

					);
			}
			?>



			<div class="news_lists_top" style="border-top:1px solid #64cacf; padding-top:20px;">
				<?$d = $ci->db->query("select * from (select a.*, b.category_name, c.channel_name, c.channel_icon, (select count(*) from partner where channel_idx=a.channel_idx) as editor_count, (select count(*) from life where channel_idx=a.channel_idx and is_del='N') as article_count, (select sum(hit_count) from life where channel_idx=a.channel_idx and is_del='N') as hit_count from life_etc_section as a join category as b on (a.category_idx = b.idx) join channel as c on (a.channel_idx = c.idx) where a.is_del='N' and b.is_del='N' and c.is_del='N' and a.etc_section_type = '3') as AA where 1 order by AA.reg_date desc limit 0, 30");
					$d= $d->result()[0];?>
							<span class="fl" >
								<a href="/m/life/channel/<?=$d->channel_idx?>">
								<?

								echo $d->channel_name;
								?>

								<span class="beachblue" style="padding-left: 10px;">인기베스트 5</span>
								</a>
							</span>
			</div>
			<?
			foreach($arr_etc_section_detail_rank as $i=>$data):

			?>
			<div class="news_list_cont">
				<div class="art-img2<?=($data['video_url']) ? " plays_b" : ""; ?>">
					<a href="/m/life/life_view/<?= $data['content_idx'] ?>">
						<img src="<?=thumb($data['main_img'])?>" onerror="this.src='<?=$data['main_img']?>'">
					</a>
				</div>
				<div class="box_no"><?=$i?></div>
				<div class="art-info2">
					<p class="art-info">

						<a href="/m/life/editor/<?= $data['partner_idx'] ?>"><?=$data['editor_name']?></a>
					</p>
					<h2 class="art-title">
						<?if($data['head_title'] != ''):?><a href="/m/life/life_view/<?= $data['content_idx'] ?>">[<?=$data['head_title']?>] </a><?endif?> <a href="/m/life/life_view/<?= $data['content_idx'] ?>"><?=$data['title']?></a>
					</h2>
				</div>
			</div>
			<?endforeach?>
		</div>
	</div>
<!-- <link rel="stylesheet" type="text/css" href="/css/slick.css" />
<script type="text/javascript" src="/js/slick.js"></script>
 --><script>
window.onload=function(){
    $('.responsive').slick({
      dots: false,
    	infinite: true,
      speed: 300,
      slidesToShow: 3,
      slidesToScroll: 1,
      responsive: [
        {
          breakpoint: 1024,
          settings: {
            slidesToShow: 3,
            slidesToScroll: 1,
           }
        },
        {
          breakpoint: 600,
          settings: {
      slidesToShow: 3,
      slidesToScroll: 1,
          }
        },
        {
          breakpoint: 480,
          settings: {
      slidesToShow: 3,
      slidesToScroll: 1,
          }
        }
       ]
    });
};
</script>
<style>
/*.life_cont4 .a_left, .life_cont4 .a_right{display:none}*/
.life_cont4 {position:relative}
.life_cont4 .life_cont4_box{/*float:none;*/margin:0 auto}
.life_cont4 .slick-prev.slick-arrow{cursor:pointer;z-index:99;position:absolute;left:-5%;top:30%;background:url('/img/mobile/editor_left.gif') center center no-repeat;width:14px;height:25px;border:none;text-indent:-9999rem;}
.life_cont4 .slick-next.slick-arrow{cursor:pointer;z-index:99;position:absolute;right:-5%;top:30%;background:url('/img/mobile/editor_right.gif') center center no-repeat;width:14px;height:25px;border:none;text-indent:-9999rem;}
.life_cont4_box .tr_txt{padding-top:1rem}
.life_cont4 .life_cont4_box div img{margin:0 auto}
@media screen and (max-width: 640px){
	.life_cont4 .slick-prev.slick-arrow{left:-5%;top:20%;background:url('/img/mobile/editor_left.gif') center center no-repeat;width:10px;background-size:100% auto }
	.life_cont4 .slick-next.slick-arrow{ right:-5%;top:20%;background:url('/img/mobile/editor_right.gif') center center no-repeat;width:10px;background-size:100% auto}
}
@media screen and (max-width: 400px){
	.life_cont4 .slick-prev.slick-arrow{top:10%;}
	.life_cont4 .slick-next.slick-arrow{top:10%;}
}
</style>
