<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<!--{$page_charset}-->" />

<title>网站地图(sitemap)</title>
<!--{include file="<!--{$cptplpath}-->headerjs.tpl"}-->
<!--{assign var='pluginevent' value=XHook::doAction('adm_head')}-->
</head>
<body>
<!--{assign var='pluginevent' value=XHook::doAction('adm_main_top')}-->
<!--{include file="<!--{$cptplpath}-->lang_all.tpl"}-->
<!--{if $a eq "run"}-->
<div class="main-wrap">
  <div class="path">
    <p>当前位置：系统设置<span>&gt;&gt;</span>其他设置<span>&gt;&gt;</span><a href="<!--{$cpfile}-->?c=sitemap">网站地图(Sitemap)</a></p>
  </div>
  <div class="main-cont">
    <h3 class="title"><span  color="red">本操作可能需要花费一定时间，在执行完成之前，请勿关闭本页面。</span></h3>
    <table cellpadding='3' cellspacing='3' class='tab'>
	  <tr>
	    <td colspan="2" class="hback_yellow"><b>选择要生成的模型</b></td>
	  </tr>
      <tr>
        <td class='hback_1' width="15%">文章模型：<span class='f_red'></span></td>
        <td class="hback" width="85%">
		  <input type="checkbox" name="article" id="article" value="1" checked />生成，
		  生成最新数量：<input type="text" name="article_num" id="article_num" class="input-s" value="50" />条
		</td>
      </tr>
	  <tr>
        <td class='hback_1'>产品模型：<span class='f_red'></span></td>
        <td class="hback">
		  <input type="checkbox" name="product" id="product" value="1" checked />生成，
		  生成最新数量：<input type="text" name="product_num" id="product_num" class="input-s" value="50" />条
		</td>
      </tr>
	  <tr>
        <td class='hback_1'>图库模型：<span class='f_red'></span></td>
        <td class="hback">
		  <input type="checkbox" name="photo" id="photo" value="1" checked />生成，
		  生成最新数量：<input type="text" name="photo_num" id="photo_num" class="input-s" value="50" />条
		</td>
      </tr>
	  <tr>
        <td class='hback_1'>下载模型：<span class='f_red'></span></td>
        <td class="hback">
		  <input type="checkbox" name="download" id="download" value="1" checked />生成，
		  生成最新数量：<input type="text" name="download_num" id="download_num" class="input-s" value="50" />条
		</td>
      </tr>
	  <tr>
        <td class='hback_1'>招聘模型：<span class='f_red'></span></td>
        <td class="hback">
		  <input type="checkbox" name="hr" id="hr" value="1" checked />生成，
		  生成最新数量：<input type="text" name="hr_num" id="hr_num" class="input-s" value="50" />条
		</td>
      </tr>
      <tr>
        <td class='hback_none'></td>
        <td class='hback_none'>
		<input type="button" id="btn_map" class="button" value="点击生成" />&nbsp;&nbsp;&nbsp;
		<a href="<!--{$urlpath}-->sitemap.xml" target="_blank">点击查看sitemap</a>
		</td>
      </tr>
    </table>
  </div>
  <div style="clear:both;"></div>
</div>

<script type="text/javascript">
$(function(){
	$("#btn_map").bind("click", function(){

		$article = $('input[name="article"]:checked').val();
		if (typeof($article) == "undefined") {
			$article = 0;
		}
		$article_num = $("#article_num").val();


		$product = $('input[name="product"]:checked').val();
		if (typeof($product) == "undefined") {
			$product = 0;
		}
		$product_num = $("#product_num").val();


		$photo = $('input[name="photo"]:checked').val();
		if (typeof($photo) == "undefined") {
			$photo = 0;
		}
		$photo_num = $("#photo_num").val();


		$download = $('input[name="download"]:checked').val();
		if (typeof($download) == "undefined") {
			$download = 0;
		}
		$download_num = $("#download_num").val();


		$hr = $('input[name="hr"]:checked').val();
		if (typeof($hr) == "undefined") {
			$hr = 0;
		}
		$hr_num = $("#hr_num").val();
		
		$(this).val("执行中，请稍等...");
		$.ajax({
			type: "POST",
			url: "<!--{$cpfile}-->?c=sitemap",
			cache: false,
			data: {a:"makemap", article:$article, article_num:$article_num, product:$product, product_num:$product_num, photo:$photo, photo_num:$photo_num, download:$download, download_num:$download_num, hr:$hr, hr_num:$hr_num, r:get_rndnum(8)},
			dataType: "json",
			success: function(data) {
				$json = eval(data);
				$response = $json.response;
				$result = $json.result;
				$("#btn_map").val("点击生成");
				if ($response == "1") {
					alert("更新成功");
				}
				else {
					alert("更新失败，请检查网络。");
				}
			},
			error: function() {
				$("#btn_map").val("点击生成");
				alert("操作失败，请检查网络。");
			}
		});

	});
});
</script>
<!--{/if}--> 

<!--{assign var='pluginevent' value=XHook::doAction('adm_footer')}-->
</body>
</html>
