<?php include $this->admin_tpl('meta');?>
<title>网站地图 - YzmCMS内容管理系统</title>
</head>
<body>
<nav class="breadcrumb"><i class="yzm-iconfont yzm-iconai-home"></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="yzm-iconfont yzm-iconshuaxin"></i></a></nav>
<div class="page-container">
  <div class="explain light"> 
     <p><span class="yzm-iconfont yzm-iconshuoming"></span>网站地图可方便网站管理员通知搜索引擎他们网站上有哪些可供抓取的网页，能够有效提升整站的收录率。</p>
  </div>
	<div class="pd-5 mt-10 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" <?php if($priority=='1') echo 'selected';?>>1</option>
				<option value="0.9" <?php if($priority=='0.9') echo 'selected';?>>0.9</option>
				<option value="0.8" <?php if($priority=='0.8') echo 'selected';?>>0.8</option>
				<option value="0.7" <?php if($priority=='0.7') echo 'selected';?>>0.7</option>
				<option value="0.6" <?php if($priority=='0.6') echo 'selected';?>>0.6</option>
				<option value="0.5" <?php if($priority=='0.5') echo 'selected';?>>0.5</option>
				<option value="0.4" <?php if($priority=='0.4') echo 'selected';?>>0.4</option>
				<option value="0.3" <?php if($priority=='0.3') echo 'selected';?>>0.3</option>
				<option value="0.2" <?php if($priority=='0.2') echo 'selected';?>>0.2</option>
				<option value="0.1" <?php if($priority=='0.1') echo 'selected';?>>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" <?php if($changefreq=='always') echo 'selected';?>>一直更新</option>
				<option value="hourly" <?php if($changefreq=='hourly') echo 'selected';?>>小时</option>
				<option value="daily" <?php if($changefreq=='daily') echo 'selected';?>>天</option>
				<option value="weekly" <?php if($changefreq=='weekly') echo 'selected';?>>周</option>
				<option value="monthly" <?php if($changefreq=='monthly') echo 'selected';?>>月</option>
				<option value="yearly" <?php if($changefreq=='yearly') echo 'selected';?>>年</option>
				<option value="never" <?php if($changefreq=='never') echo 'selected';?>>从不更新</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="9000" > 一万条</label>
			 	<label><input name="limit_total" type="radio" value="29000" > 三万条</label>
			 	<label><input name="limit_total" type="radio" value="49000" > 五万条</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_100 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, 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>