<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理後臺</title>
<meta name="keywords" content="管理後臺" />
<meta name="description" content="管理後臺" />
<script src="/jquery/jquery-1.8.2.min.js"></script>
<script src="ckeditor/ckeditor.js" type="text/javascript"></script>
<script type="text/javascript" src="ckfinder/ckfinder.js"></script>
<!-- 瀏覽用燈箱片效果 -->
<link rel="stylesheet" href="/jquery/fancybox/source/jquery.fancybox.css?v=2.1.5" type="text/css" media="screen" />
<script type="text/javascript" src="/jquery/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
</head>
<body>
	<div class="wrapper">
    	<?# header ?>
    	<div class="wrap">
        	<?# sidePage ?>
            <div class="contentMain">
            	<h3>首頁設置</h3>
                <div class="article" style="width: 100%;">
                    <form id="form1" name="form1" action="indexSet.php" method="post">
                        <fieldset style="width: 100%;">
                            <div style="overflow: hidden;">
                            	<div class="titleTyp"><p>展示列表</p></div>
                                <div style=" background: rgba(75, 141, 248, 0.07); padding: 10px 0;">
                                    <p>
                                        <label>展示項目</label>
                                        <select id="indexListType" name="indexListType">
                                            <option value="10">產品資訊</option>
                                            <option value="20">影音相本</option>
                                        </select>
                                    </p>
                                </div>
                                <div class="titleTyp" style="background: #66CC96; margin: 5px 0 0;"><p>關於我們</p></div>
                                <div style="background: rgba(102, 204, 150, 0.11); padding: 10px 0;">
                                    <p>
                                        <label>簡介</label>
                                        <textarea id="indexAboutIntroduction" name="indexAboutIntroduction" style="width:540px; height:200px;"><?# indexAboutIntroduction ?></textarea>
                                    </p>
                                    <div class="writList">
                                        <label style="float: left;">文章圖片</label>
                                        <a id="aImg" class="fancybox" style="float: left; margin: 0 10px;"><img id="imgImg" style="width:50px; height:50px; border:0; display:none;" /></a>
                                        <input type="text" id="indexAboutImage" name="indexAboutImage" value="<?# indexAboutImage ?>" />
                                        <input type="button" id="btnImg" name="btnImg" value="瀏覽" />
                                    </div>
                                    <p>
                                        <label>超連結</label>
                                        <input type="text" id="indexAboutLink" name="indexAboutLink" value="<?# indexAboutLink ?>" style="width: 300px;" />
                                    </p>
                                </div>
                                <div class="titleTyp" style="background: #852b99; margin: 5px 0 0;"><p>自訂欄位1</p></div>
                                <div style="background: rgba(133, 43, 153, 0.15); padding: 10px 0;">
                                    <p>
                                        <label>標題</label>
                                        <input type="text" id="indexCustomTitle1" name="indexCustomTitle1" value="<?# indexCustomTitle1 ?>" style="width: 300px;" />
                                    </p>
                                    <div class="writList">
                                        <label style="float: left;">內容</label>
                                        <textarea id="indexCustomContent1" name="indexCustomContent1" style="width:540px; height:200px;"><?# indexCustomContent1 ?></textarea>
                                    </div>
                                </div>
                                <div class="titleTyp" style="background: #C66; margin: 5px 0 0;"><p>自訂欄位2</p></div>
                                <div style="background: rgba(204, 102, 102, 0.14); padding: 10px 0;">
                                    <p>
                                        <label>標題</label>
                                        <input type="text" id="indexCustomTitle2" name="indexCustomTitle2" value="<?# indexCustomTitle2 ?>" style="width: 300px;" />
                                    </p>
                                    <div class="writList">
                                        <label style="float: left;">內容</label>
                                        <textarea id="indexCustomContent2" name="indexCustomContent2" style="width:540px; height:200px;"><?# indexCustomContent2 ?></textarea>
                                    </div>
                                </div>
                                <div class="titleTyp" style="background: #667BCC; margin: 5px 0 0;"><p>自訂欄位3</p></div>
                                <div style="background: rgba(102, 123, 204, 0.17); padding: 10px 0;">
                                    <p>
                                        <label>標題</label>
                                        <input type="text" id="indexCustomTitle3" name="indexCustomTitle3" value="<?# indexCustomTitle3 ?>" style="width: 300px;" />
                                    </p>
                                    <div class="writList">
                                        <label style="float: left;">內容</label>
                                        <textarea id="indexCustomContent3" name="indexCustomContent3" style="width:540px; height:200px;"><?# indexCustomContent3 ?></textarea>
                                    </div>
                                </div>
                            </div>
                            <p>
	                            <input type="button" id="btnOK" name="btnOK" value="確 定" />
							</p>
                        </fieldset>
                    </form>
                </div>
            </div>
        </div>
        <?# footer ?>
    </div>
<script>
<!--
	function SetFileField(fileUrl,data){
		$('#'+data["selectActionData"]).val(fileUrl);
		$('#'+data["selectActionData"]).change();
	}
	$(function(){
		$(".fancybox").fancybox();

		$('#indexListType').val("<?# indexListType ?>");

		$('#indexAboutImage').change(function(){
			if($(this).val() == ''){
				$('#imgImg').attr('src','');
				$('#imgImg').css('display','none');
				$('#aImg').attr('href','');
			}else{
				$('#imgImg').attr('src',$(this).val());
				$('#imgImg').css('display','block');
				$('#aImg').attr('href',$(this).val());
			}
		});
		$('#indexAboutImage').change();

		$('#btnImg').click(function(){
			var finder = new CKFinder();
			finder.basePath = 'ckfinder/';
			finder.resourceType = 'Images';
			finder.selectActionFunction = SetFileField;
			finder.selectActionData = 'indexAboutImage';
			finder.popup();
		});
		$('#btnOK').click(function(){
			$('#form1').submit();
		});
	});
//-->
</script>
</body>
</html>