<!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>
<script src="ckeditor/ckeditor.js"></script>
<!--tabs-->
<script src="/jquery/horizontalmenu/jquery.horizontalmenu.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 ?>" />
            <input type="hidden" id="pUrl" name="pUrl" value="<?# pUrl ?>" />
			<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);"><?# page_name ?></a>
						<a class="tabs_item" data-id="box2" href="javascript:void(0);">線上回覆</a>
					</div>
				</div>
				<?# delTxt ?>
				<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_6 d_flex form_list"><label>姓名</label><input type="text" value="<?# Name ?>" readonly /></div>
						<div class="col_md_6 d_flex form_list"><label>電話</label><input type="text" value="<?# Phone ?>" readonly /></div>
						<div class="col_md_6 d_flex form_list"><label>信箱</label><input type="text" value="<?# Email ?>" readonly /></div>
						<div class="col_md_6 d_flex form_list"><label>標題</label><input type="text" value="<?# Title ?>" readonly /></div>
						<div class="col_md_6 d_flex form_list"><label>是否回覆</label><p><?# IsReply ?></p></div>
						<div class="col_md_6 d_flex form_list"><label>留言時間</label><input type="text" value="<?# CreatedTime ?>" readonly /></div>
						<div class="col_12 form_list"><label>內容</label><textarea readonly><?# Content ?></textarea></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="ReMail" name="ReMail" value="<?# ReMail ?>" /></div>
						<div class="col_md_6 d_flex form_list"><label>回覆標題</label><input type="text" id="ReTitle" name="ReTitle" value="<?# ReTitle ?>" /></div>
						<div class="col_12 form_list"><label>回覆內容</label><textarea class="ckeditor" id="ReContent" name="ReContent"><?# ReContent ?></textarea></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_info" id="btnOK" href="javascript:void(0);">送出回覆</a>
						</div>
					</div>
				</div>
			</div>
            <div class="row mt_5 d_flex start_box"><a class="mr_2 btn btn_g_300" id="btnCancel" href="javascript:void(0);">返回</a></div>
		</form>
		<?# footer ?>
	</div>
</body>
</html>
<script>
	$(function(){
		$('#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;
			}
		});
		$('#btnOK').click(function(){
			if($('#ReMail').val() == ''){
				alert('回覆信箱不可空白!');
				$('#ReMail').focus();
				tabchk(2);
				return false;
			}
			if($('#ReTitle').val() == ''){
				alert('回覆標題不可空白!');
				$('#ReTitle').focus();
				tabchk(2);
				return false;
			}
			if(CKEDITOR.instances.ReContent.getData == ''){
				alert('回覆內容不可空白!');
				tabchk(2);
				return false;
			}
			$('#form1').submit();
		});
		$('#btnCancel').click(function(){
			location.href = ($('#pUrl').val() == '') ?'contactList.php':$('#pUrl').val();
		});
	});
</script>