<!DOCTYPE html>
<!--[if IE 8 ]><html dir="ltr" lang="zh-TW" class="ie8"><![endif]-->
<!--[if IE 9 ]><html dir="ltr" lang="zh-TW" class="ie9"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html dir="ltr" lang="zh-TW">
<!--<![endif]-->
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
<title>管理後臺</title>
<meta name="robots" content="noindex, nofollow" />
<link href="less/page.less" rel="stylesheet/less">
<link href="css/main.css" rel="stylesheet">
<link href="css/page.css" rel="stylesheet">
<script src="/jquery/jquery-1.10.js"></script>
<!--tabs-->
<script src="/jquery/horizontalmenu/jquery.horizontalmenu.js"></script>
<!-- 下拉選單 -->
<link href="/jquery/select/nice-select.css" rel="stylesheet">
<script src="/jquery/select/jquery.nice-select.js"></script>
<script>
	if('<?# alertMsg ?>' != ''){
		alert('<?# alertMsg ?>');
		if('<?# goBack ?>' == 'Y') history.back();
	}
	if('<?# locationHref ?>' != '') location.href = '<?# locationHref ?>';
</script>
</head>
<body>
	<?# sidePage ?>
	<div class="pos_rel" id="content">
		<?# header ?>
		<form id="form1" name="form1" method="post">
            <input type="hidden" id="id" name="id" value="<?# id ?>" />
			<div class="row mt_10 mb_5 h3 page_title"><?# page_name ?></div>
			<div class="card">
				<div class="pos_rel bg_g_100 tabs_warp" id="tabs_warp">
					<div class="tabs_list">
						<a class="tabs_item" data-action="true" data-id="box1" href="javascript:void(0);">每頁數量設置</a>
						<a class="tabs_item" data-id="box2" href="javascript:void(0);">側選單標題</a>
						<a class="tabs_item" data-id="box3" href="javascript:void(0);">產品顯示設定</a>
					</div>
				</div>
				<div id="tabs_box" class="card_body form_box">
					<div id="box1" class="d_md_flex flex_wrap tab_content" data-action="true">
						<div class="col_md_4 d_flex form_list"><label>文章</label><input type="text" id="articlePageSize" name="articlePageSize" value="<?# articlePageSize ?>" /></div>
						<div class="col_md_4 d_flex form_list"><label>產品資訊</label><input type="text" id="productPageSize" name="productPageSize" value="<?# productPageSize ?>" /></div>
						<div class="col_md_4 d_flex form_list"><label>最新消息</label><input type="text" id="newsPageSize" name="newsPageSize" value="<?# newsPageSize ?>" /></div>
						<div class="col_md_4 d_flex form_list"><label>問與答</label><input type="text" id="faqPageSize" name="faqPageSize" value="<?# faqPageSize ?>" /></div>
						<div class="col_md_4 d_flex form_list"><label>影音相本</label><input type="text" id="bookPageSize" name="bookPageSize" value="<?# bookPageSize ?>" /></div>
						<div class="col_12 d_flex form_btn"><a class="ml_2 btn btn_tertiary" data-action="nextPage" href="javascript:void(0);">下一步</a></div>
					</div>
					<div id="box2" class="d_md_flex flex_wrap tab_content">
						<div class="col_md_6 d_flex form_list"><label>網站資訊</label><input type="text" id="sideNavInfo" name="sideNavInfo" value="<?# sideNavInfo ?>" /></div>
						<div class="col_md_6 d_flex form_list"><label>產品資訊</label><input type="text" id="sideNavProduct" name="sideNavProduct" value="<?# sideNavProduct ?>" /></div>
						<div class="col_md_6 d_flex form_list"><label>小廣告</label><input type="text" id="sideNavPhoto" name="sideNavPhoto" value="<?# sideNavPhoto ?>" /></div>
						<div class="col_md_6 d_flex form_list"><label>額外資訊</label><input type="text" id="sideExtraInfo" name="sideExtraInfo" value="<?# sideExtraInfo ?>" /></div>
						<div class="col_12 d_flex form_btn">
							<a class="ml_2 btn btn_orange" data-action="upPage" href="javascript:void(0);">上一步</a>
							<a class="ml_2 btn btn_tertiary" data-action="nextPage" href="javascript:void(0);">下一步</a>
						</div>
					</div>
					<div id="box3" class="d_md_flex flex_wrap tab_content">
						<div class="col_md_6 d_flex form_list">
							<label>前台顯示</label>
							<select id="categoryListMode" name="categoryListMode">
                                <option value="1">商品</option>
                                <option value="2">分類</option>
                            </select>
						</div>
						<div class="col_md_6 d_flex form_list">
							<label>內頁顯示</label>
							<p class="d_flex flex_wrap">
								<font class="mr_3 d_block el-checkbox"><input type="checkbox" id="chkAll" name="chkAll"><span class="el-checkbox-style"></span><span>全選</span></font>
								<font class="mr_3 d_block el-checkbox"><input type="checkbox" name="categorySidePageShow[]" value="40"><span class="el-checkbox-style"></span><span>文章</span></font>
								<font class="mr_3 d_block el-checkbox"><input type="checkbox" name="categorySidePageShow[]" value="50"><span class="el-checkbox-style"></span><span>產品</span></font>
								<font class="mr_3 d_block el-checkbox"><input type="checkbox" name="categorySidePageShow[]" value="60"><span class="el-checkbox-style"></span><span>最新消息</span></font>
								<font class="mr_3 d_block el-checkbox"><input type="checkbox" name="categorySidePageShow[]" value="70"><span class="el-checkbox-style"></span><span>問與答</span></font>
								<font class="mr_3 d_block el-checkbox"><input type="checkbox" name="categorySidePageShow[]" value="80"><span class="el-checkbox-style"></span><span>相本</span></font>
								<font class="mr_3 d_block el-checkbox"><input type="checkbox" name="categorySidePageShow[]" value="90"><span class="el-checkbox-style"></span><span>聯絡表單</span></font>
								<font class="mr_3 d_block el-checkbox"><input type="checkbox" name="categorySidePageShow[]" value="100"><span class="el-checkbox-style"></span><span>訂單</span></font>
							</p>
						</div>
						<div class="col_md_6 d_flex form_list IsIndex"><label>產品價格</label><p><font class="checkbox"><input type="checkbox" id="ShowPrice" name="ShowPrice" value="1"><span></span></font></p></div>
						<div class="col_12 d_flex form_btn"><a class="ml_2 btn btn_orange" data-action="upPage" href="javascript:void(0);">上一步</a></div>
					</div>
				</div>
			</div>
            <div class="row mt_5 d_flex start_box"><a class="mr_2 btn btn_info" id="btnOK" href="javascript:void(0);">送出</a></div>
		</form>
		<?# footer ?>
	</div>
</body>
</html>
<script>
	$(function(){
		$('#categoryListMode').val('<?# categoryListMode ?>');
		
		if('<?# ShowPrice ?>' == '1') $('#ShowPrice').prop('checked', true);
		
		$('select').niceSelect();
		
		$('#tabs_warp').horizontalmenu({
			itemClick: function (item) {
				$('#tabs_box .tab_content').removeAttr('data-action');
				$('#tabs_box .tab_content:eq(' + $(item).index() + ')').attr('data-action', 'true');
				return false;
			}
		});
		
		$('#chkAll').click(function(){
			var id = $(this).val();
			
			if($(this).eq(0).prop("checked") == true){
				$('input:checkbox[name="categorySidePageShow[]"]').each(function(){
					$(this).prop("checked", true);
				});
			}else{
				$('input:checkbox[name="categorySidePageShow[]"]').each(function(){
					$(this).prop("checked", false);
				});
			}
		});
		var cateSP = '<?# categorySidePageShow ?>';
		var aryCSP = cateSP.split(',');
		var num = 0;
		$('input:checkbox[name="categorySidePageShow[]"]').each(function(a,b){
			if(aryCSP.indexOf($(b).val()) >= 0){
				$(b).prop('checked', true);
				num++
			}
		});
		if(num == '7') $('#chkAll').prop('checked', true);

		$('#btnOK').click(function(){
			if($('#articlePageSize').val() == ''){
				alert('請設定文章列表每頁數量!');
				$('#articlePageSize').focus();
				tabchk(1);
				return false;
			}
			if($('#productPageSize').val() == ''){
				alert('請設定產品列表每頁數量!');
				$('#productPageSize').focus();
				tabchk(1);
				return false;
			}
			if($('#newsPageSize').val() == ''){
				alert('請設定最新消息列表每頁數量!');
				$('#newsPageSize').focus();
				tabchk(1);
				return false;
			}
			if($('#faqPageSize').val() == ''){
				alert('請設定問與答列表每頁數量!');
				$('#faqPageSize').focus();
				tabchk(1);
				return false;
			}
			if($('#bookPageSize').val() == ''){
				alert('請設定影音相本列表每頁數量!');
				$('#bookPageSize').focus();
				tabchk(1);
				return false;
			}
			$('#form1').submit();
		});
	});
</script>