<!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>
<!-- 日曆效果 -->
<script type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"></script>
</head>
<body>
	<div class="wrapper">
    	<?# header ?>
    	<div class="wrap">
        	<?# sidePage ?>
            <div class="contentMain">
            	<h3><?# editTitle ?></h3>
                <div class="article" style="width: 100%;">
                    <form id="form1" name="form1" action="newsEdit.php" method="post">
                        <fieldset style="width: 100%;">
                        	<div class="titleTyp"><p>最新消息資訊</p></div>
                            <div style=" background: rgba(75, 141, 248, 0.07); padding: 10px 0;">
                                <p>
                                    <label>最新消息名稱</label>
                                    <input type="text" id="Title" name="Title" value="<?# Title ?>" maxlength="128" style="width: 300px;" />
                                </p>
                                <p>
                                    <label>最新消息分類</label>
                                    <select id="CategoryID" name="CategoryID">
                                        <php:repeater id="listC">
                                            <template>
                                                <option value="<?# CategoryID ?>"><?# CategoryName ?></option>
                                            </template>
                                        </php:repeater>
                                    </select>
                                </p>
                                <p>
                                    <label>引用宣告</label>
                                    <input type="text" id="QuoteText" name="QuoteText" value="<?# QuoteText ?>" maxlength="128" style="width: 300px;" />
                                </p>
                                <p>
                                	<label>引用來源網址</label>
                                    <input type="text" id="QuoteLink" name="QuoteLink" value="<?# QuoteLink ?>" maxlength="256" style="width: 300px;" />
                                </p>
                                <div class="writList">
                                	<label>最新消息圖片</label>
                                    <a id="aImg" class="fancybox"><img id="imgImg" style="width:50px; height:50px; border:0; display:none;" /></a>
                                    <input type="text" id="Image" name="Image" value="<?# Image ?>" />
                                    <input type="button" id="btnImg" name="btnImg" value="瀏覽" />
                                </div>
                                <p>
                                    <label>最新消息簡述</label>
                                    <textarea id="Introduction" name="Introduction" style="width:540px; height:100px;"><?# Introduction ?></textarea>
                                </p><div class="writList">
                                    <label>最新消息內容</label>
                                    <div class="ckeList"><textarea class="ckeditor" id="Description" name="Description"><?# Description ?></textarea></div>
                                </div>
                                <p>
                                    <label>上線時間</label>
                                    <input type="text" id="OnlineTime" name="OnlineTime" value="<?# OnlineTime ?>" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" style="width: 300px;" />
                                </p>
                                <p>
                                    <label>啟用</label>
                                    <input type="radio" name="Visible" value="1" />啟用
                                    <input type="radio" name="Visible" value="0" />不啟用
                                </p>
                                <p>
                                    <label>排序</label>
                                    <input type="text" id="OrderNO" name="OrderNO" value="<?# OrderNO ?>" onkeypress="if (event.keyCode < 48 || event.keyCode >57) event.returnValue = false;" style="width: 300px;" />
                                </p>
                            </div>
                            <div class="titleTyp" style="background: #66CC96; margin: 5px 0 0;"><p>SEO設定</p></div>
                            <div style="background: rgba(102, 204, 150, 0.11); padding: 10px 0;">
                                <p>
                                    <label>頁面標題</label>
                                    <input type="text" id="WebTitle" name="WebTitle" value="<?# WebTitle ?>" maxlength="128" style="width: 300px;" />
                                </p>
                                <p>
                                    <label>頁面關鍵字</label>
                                    <input type="text" id="WebKeyword" name="WebKeyword" value="<?# WebKeyword ?>" maxlength="256" style="width: 300px;" />
                                </p>
                                <p>
                                    <label>頁面描述</label>
                                    <textarea style="width:540px; height:100px;" id="WebDescription" name="WebDescription"><?# WebDescription ?></textarea>
                                </p>
                            </div>
                            <p>
                                <input type="button" id="btnOK" name="btnOK" value="確 定" />
								<input type="button" id="btnCancel" value="返 回" />
                            </p>
                            <input type="hidden" id="id" name="id" value="<?# id ?>" />
                            <input type="hidden" id="pUrl" name="pUrl" value="<?# pUrl ?>" />
                        </fieldset>
                    </form>
                </div>
            </div>
        </div>
        <?# footer ?>
    </div>
<script>
<!--
	function SetFileField(fileUrl,data){
		$('#'+data["selectActionData"]).val(fileUrl);
		$('#'+data["selectActionData"]).change();
	}
	$(function(){
		$(".fancybox").fancybox();

		$('#CategoryID').val("<?# CategoryID ?>");
		$('input:radio[name="Visible"][value="<?# Visible ?>"]').attr('checked',true);

		$('#Image').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());
			}
		});
		$('#Image').change();

		$('#btnImg').click(function(){
			var finder = new CKFinder();
			finder.basePath = 'ckfinder/';
			finder.resourceType = 'Images';
			finder.selectActionFunction = SetFileField;
			finder.selectActionData = 'Image';
			finder.popup();
		});
		$('#btnOK').click(function(){
			if($('#Title').val() == ''){
				alert('最新消息名稱不可空白!');
				$('#Title').focus();
				return false;
			}
			if($('#CategoryID').val() == '0'){
				alert('請選擇最新消息分類!');
				$('#CategoryID').focus();
				return false;
			}
			if($('input:radio[name="Visible"]:checked').size() == 0){
				alert('請選擇是否啟用此最新消息!');
				return false;
			}
			$('#form1').submit();
		});
		$('#btnCancel').click(function(){
			if($('#pUrl').val() == '')
				location.href = 'newsList.php';
			else
				location.href = $('#pUrl').val();
		});
	});
//-->
</script>
</body>
</html>