<!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>
</head>

<body>
	<div class="wrapper">
    	<?# header ?>
    	<div class="wrap">
        	<?# sidePage ?>
            <div class="contentMain">
            	<h3>自動插入關鍵字</h3>
                <div class="article">
                    <form id="form1" name="form1" action="menuEdit.php" method="post" onsubmit="return false;">
                        <input type="hidden" id="id" name="id" value="<?# id ?>" />
                        <input type="hidden" id="pUrl" name="pUrl" value="<?# pUrl ?>" />
                        <fieldset style="width: 100%;">
                        	<div class="titleTyp"><p>插入關鍵字資訊</p></div>
                            <p style="margin: 15px auto;">
                                輸入確認碼： <input type="text" id="pd" name="pd" />
                                <input type="button" id="btnOK" name="btnOK" value="執行" />
                            </p>                            
                            <p style="margin: 15px auto;"></p><ul id="returnUL"></ul><p></p>
                        </fieldset>
                    </form>
                </div>
            </div>
        </div>
        <?# footer ?>
    </div>
<script>
<!--
	function plugIN(typ,start){
		$.ajax({
			url: 'ajax/autokeyword.php',
			type: 'POST',
			data: {'do':'plugin','typ':typ,'no':start,'pd':$('#pd').val()},
			dataType: 'json',
			context: $('#returnUL'),
			success: function(JData){
				$(this).append($('<li></li>').html(JData["return"]));
				if(JData["over"] == "0"){
					plugIN(JData["type"],JData["start"]);
				}else{
					$('#btnOK').attr('disabled',false);
				}
			},
			error: function(){
				alert('系統異常!');
			}
		});
	}
	$(function(){
		$('#btnOK').click(function(){
			if($('#pd').val() == ''){
				alert('請輸入確認碼!');
				return false;
			}
			$('#btnOK').attr('disabled',true);
			plugIN("A","0");
		});
	});
//-->
</script>
</body>
</html>