

<?
$page_title = "추천채널";
$page_title_link = '#';
require_once(APPPATH."/views/m/common/light_header.php");?>

<div class="channel_cont  channel_cont_fixed">
	<div class="wrap">
		<div class="channel_top" style="text-align:center; margin-bottom:0 !important;">
			<button type="button" class="btn btn-default_bb br20"
					style="padding:10px 40px;font-size: 19px; font-weight: 200 !important;">추천채널
			</button>
			<button type="button" class="btn btn-default br20" onclick="location.href='/m/life/category'"
					style="padding:10px 40px;font-size: 19px; font-weight: 200 !important;">카테고리
			</button>
		</div>
		<div id="channel_list">
			<?
			$i = 1;
			$etc_section_count = count($arr_etc_section);
			$etc_section_page = ceil($etc_section_count / 3);

			foreach ($arr_etc_section as $val1) {

				$curr_page = ceil($i / 3);

				$style = 'display:block;';
				if ($i > 3) $style = 'display:none;';


				$class = 'bgb3';
				if ($etc_section_count < 3 || $i % 3 == 0) {
					$style .= 'margin-bottom: 0 !important;';
					$class = '';
				}

				$class .= ' channel_page' . $curr_page;


				?>

				<div class="channel_boxs <?=$class?>" style="margin-top:10px;<?=$style?>">
					<div class="channel_detail_box">
						<div class="channel_detail fl">
							<div class="channel_profile">
								<div onclick="location.href='/m/life/channel/<?= $val1['channel_idx'] ?>'"
									 style="cursor:pointer;border-radius: 50px;width:50px;height:50px;background:url('<?= $val1['channel_icon'] ?>') no-repeat center; background-size:cover;"></div>
							</div>
							<div style="padding-top:7px;"><a href="/m/life/channel/<?= $val1['channel_idx'] ?>"><span
										class="chinfo"><?= $val1['channel_name'] ?></span></a>
								<p><span class="beachblue"><?= number_format($val1['channel_article_count']) ?></span>
									stories</p></a></div>
						</div>
						<div class="fr" style="margin-top:15px !important; margin-right:10px;">
							<span class="delivery"><?= number_format($val1['delivery_count']) ?>명에게 배달중</span>
							<button type="button" class="btn btn-success br20"
									onclick="location.href='/m/life/channel/<?= $val1['channel_idx'] ?>'">더보기 <img
									src="/img/web/img_down.png" style="padding-top:8px;"></button>
						</div>
					</div>
					<? if (isset($arr_etc_section_detail[$val1['idx']]) == true) {
						foreach ($arr_etc_section_detail[$val1['idx']] as $j=>$val2) {
							if($j >2 )break;
							$head_title = '';
							if ($val2['head_title'] != '') $head_title = '<span class="beachblue">[' . $val2['head_title'] . ']</span> ';
							$title = $head_title . $val2['title'];

							$title_txt = mb_strimwidth($title, '0', '90', '..', 'utf-8');
							?>

							<div class="channel_con">
								<a href="/m/life/life_view/<?= $val2['content_idx'] ?>"><img src="<?= $val2['main_img'] ?>" class="art-img"></a>
								<p class="chtitle"><a href="/m/life/life_view/<?= $val2['content_idx'] ?>"><?= $title_txt ?></a>
									<a href="/m/life/editor/<?= $val2['partner_idx'] ?>"><?= $val2['editor_name'] ?></a></span></p>

							</div>



							<?
						}
					}
					?>


				</div>


				<?
				$i++;


			}
			$more_btn_style = 'style="display:none;';
			if ($etc_section_count > 3) {
				$more_btn_style = 'style="display:block;"';
			}

			?>

		</div>

		<p style="text-align:center;" <?=$more_btn_style?> id="life_more_btn"><button onclick="channel_list_more();"  type="button" class="btn btn-default br20" style="padding:8px 40px; font-size:16px; ">더보기 <img src="/img/mobile/arr_down.gif" style="padding-top:3px"> </button></p>


	</div>
</div>


<script>
	var channel_page = 2;

	function channel_list_more() {
		$(".channel_page" + channel_page).show();


		if ("<?=$curr_page?>" == channel_page) {
			$("#life_more_btn").hide();
		} else {
			channel_page++;
		}
	}
</script>








