<?php include $this->admin_tpl('meta');?>
<title>网站地图 - YzmCMS内容管理系统</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 内容管理 <span class="c-gray en">&gt;</span> 网站地图 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
  <div class="explain"> 
       <p>网站地图可方便网站管理员通知搜索引擎他们网站上有哪些可供抓取的网页，能够有效提升整站的收录率。</p>
  </div>
	<div class="pd-5 mt-20 formdoby_normal">
		<form method="post" action="<?php echo U('make_sitemap');?>" id="myform" onsubmit="return do_submit()">
		<ul>
			<li class="yzm-explain-box"><label>选择模型：</label>
				<select name="model" class="select" style="width:200px">
				<option value="0">所有模型</option>
				<?php 
				foreach($modelinfo as $val){
					echo '<option value="'.$val['modelid'].'">'.$val['name'].'</option>';
				}
				?>
				</select>		
				<span class="yzm-explain">选择要生成地图的模型</span>
			</li> 
			<li class="yzm-explain-box"><label>优先权：</label>
				<select name="priority" class="select" style="width:200px">
				<option value="1">1</option>
				<option value="0.9">0.9</option>
				<option value="0.8"  selected="">0.8</option>
				<option value="0.7">0.7</option>
				<option value="0.6">0.6</option>
				<option value="0.5">0.5</option>
				<option value="0.4">0.4</option>
				<option value="0.3">0.3</option>
				<option value="0.2">0.2</option>
				<option value="0.1">0.1</option>
				</select>		
				<span class="yzm-explain">搜索引擎抓取的优先级。数字越大，优先级越高</span>
			</li> 
			<li class="yzm-explain-box"><label>更新频率：</label>
				<select name="changefreq" class="select" style="width:200px">
				<option value="always">一直更新</option>
				<option value="hourly">小时</option>
				<option value="daily">天</option>
				<option selected="" value="weekly">周</option>
				<option value="monthly">月</option>
				<option value="yearly">年</option>
				<option value="never">从不更新</option>
				</select>	
				<span class="yzm-explain">您的网站内容的更新频率</span>
			</li> 
			<li><label>限制数量：</label>
			 	<label><input name="limit_total" type="radio" value="0" checked > 不限制</label>
			 	<label><input name="limit_total" type="radio" value="10000" > 一万条</label>
			 	<label><input name="limit_total" type="radio" value="50000" > 五万条</label>
			 	<label><input name="limit_total" type="radio" value="100000" > 十万条</label>
			</li>
			<li><label>文件格式：</label>
				<label><input type="radio" name="type" value="0" checked >XML格式</label>
				<label><input type="radio" name="type" value="1" > TXT格式</label>
			</li>
			<?php if($is_make_xml){ ?>
			<li><label>sitemap.xml：</label>
			<span>更新时间：<?php echo $make_xml_time;?></span>
			<a href="javascript:;" onclick="yzm_del('<?php echo U('delete',array('type'=>0));?>', 1)" class="btn btn-danger size-MINI radius ml-5" >删除文件</a>
			<a href="<?php echo SITE_URL.'sitemap.xml';?>" target="_blank" class="btn btn-success size-MINI radius ml-5" >点击查看</a>
			</li>
			<?php } ?>
			<?php if($is_make_txt){ ?>
			<li><label>sitemap.txt：</label>
			<span>更新时间：<?php echo $make_txt_time;?></span>
			<a href="javascript:;" onclick="yzm_del('<?php echo U('delete',array('type'=>1));?>', 1)" class="btn btn-danger size-MINI radius ml-5" >删除文件</a>
			<a href="<?php echo SITE_URL.'sitemap.txt';?>" target="_blank" class="btn btn-success size-MINI radius ml-5" >点击查看</a>
			</li>
			<?php } ?>
			<li><input class="dosubmit w_120 btn-primary radius" name="dosubmit" type="submit" value="开始生成"></li>
		</ul>
		</form>
	</div>
</div>
<script type="text/javascript">
	function do_submit(){
		layer.msg('<span id="yzm_message">正在生成中……</span>', {icon:16, shade:0.21, shadeClose:true, time:false});
	    do_request(1, 0);		 
		return false;			
	}

	function do_request(page, total) {
		$.ajax({
	        type: 'POST',
	        url: '<?php echo U('make_sitemap');?>', 
	        data: $("#myform").serialize()+'&page='+page+'&total='+total,
		    dataType: "json", 
	        success: function (msg) {
				if(msg.status == 1){
					layer.msg(msg.message, {icon:1, time:1500}, function(){
						location.reload();
					});
			    }else if(msg.status == 2){
			    	$("#yzm_message").html(msg.message);
					do_request(msg.page, msg.total);
				}else{
					layer.msg(msg.message, {icon:2});
				}
	        }
	    })
	    return false;	
	}
</script>
<?php include $this->admin_tpl('footer');?>
</body>
</html>