<?php include $this->admin_tpl('meta', 'admin');?>
<link rel="stylesheet" type="text/css" href="<?php echo STATIC_URL;?>plugin/swiper/css/swiper.min.css" />
<link rel="stylesheet" type="text/css" href="<?php echo STATIC_URL;?>admin/yzm_admin/css/yzm.admin.home.css" />
<title>我的桌面 - YzmCMS内容管理系统</title>
</head>
<body>
<div class="page-container">
	<div class="col-md-4">
		<div class="panel panel-default">
			<div class="panel-header">快捷方式</div>
			<div class="panel-body yzm-box-container">
				<ul class="yzm-box yzm-quick">
					<li class="col-xs-3"><a data-title="内容管理"  _href="<?php echo U('admin/content/init');?>" onclick="Hui_admin_tab(this)" href="javascript:void(0)" class="yzm-console"><i class="yzm-iconfont yzm-iconneirong"></i><cite>内容管理</cite></a></li>
					<li class="col-xs-3"><a data-title="会员管理"  _href="<?php echo U('member/member/init');?>" onclick="Hui_admin_tab(this)" href="javascript:void(0)" class="yzm-console"><i class="yzm-iconfont yzm-iconyonghu"></i><cite>会员管理</cite></a></li>
					<li class="col-xs-3"><a data-title="登录日志"  _href="<?php echo U('admin_log/admin_login_log_list');?>" onclick="Hui_admin_tab(this)" href="javascript:void(0)" class="yzm-console"><i class="yzm-iconfont yzm-iconrizhi"></i><cite>登录日志</cite></a></li>
					<li class="col-xs-3"><a data-title="系统设置"  _href="<?php echo U('admin/system_manage/init');?>" onclick="Hui_admin_tab(this)" href="javascript:void(0)" class="yzm-console"><i class="yzm-iconfont yzm-iconshezhi"></i><cite>系统设置</cite></a></li>
					<li class="col-xs-3"><a data-title="评论管理"  _href="<?php echo U('comment/comment/init');?>" onclick="Hui_admin_tab(this)" href="javascript:void(0)" class="yzm-console"><i class="yzm-iconfont yzm-iconpinglun"></i><cite>评论管理</cite></a></li>
					<li class="col-xs-3"><a data-title="友情链接"  _href="<?php echo U('link/link/init');?>" onclick="Hui_admin_tab(this)" href="javascript:void(0)" class="yzm-console"><i class="yzm-iconfont yzm-iconlianjie"></i><cite>友情链接</cite></a></li>
					<li class="col-xs-3"><a onclick="yzm_open('修改密码','<?php echo U('admin_manage/public_edit_pwd');?>','630','420')" href="javascript:void(0)" class="yzm-console"><i class="yzm-iconfont yzm-iconyaoshi"></i><cite>修改密码</cite></a></li>
					<li class="col-xs-3"><a data-title="数据备份"  _href="<?php echo U('admin/database/init');?>" onclick="Hui_admin_tab(this)" href="javascript:void(0)" class="yzm-console"><i class="yzm-iconfont yzm-iconshujuku"></i><cite>数据备份</cite></a></li>
				</ul>
			</div>
		</div>
	</div>
	<div class="col-md-4">
		<div class="panel panel-default">
			<div class="panel-header">信息统计</div>
			<div class="panel-body yzm-box-container">
				<ul class="yzm-box">
					<li class="col-xs-6">
						<a data-title="全部内容"  _href="<?php echo U('admin/content/init');?>" onclick="Hui_admin_tab(this)" href="javascript:void(0)" class="yzm-backlog-body">
							<h3>全部内容</h3>
							<p><cite><?php echo $count[0];?></cite></p>
						</a>
					</li>
					<li class="col-xs-6">
						<a data-title="模块插件"  _href="<?php echo U('admin/module/init');?>" onclick="Hui_admin_tab(this)" href="javascript:void(0)" class="yzm-backlog-body">
							<h3>模块插件</h3>
							<p><cite><?php echo $count[1];?></cite></p>
						</a>
					</li>
					<li class="col-xs-6">
						<a data-title="会员统计"  _href="<?php echo U('member/member/init');?>" onclick="Hui_admin_tab(this)" href="javascript:void(0)" class="yzm-backlog-body">
							<h3>会员统计</h3>
							<p><cite><?php echo $count[2];?></cite></p>
						</a>
					</li>
					<li class="col-xs-6">
						<a data-title="管理员"  _href="<?php echo U('admin/admin_manage/init');?>" onclick="Hui_admin_tab(this)" href="javascript:void(0)" class="yzm-backlog-body">
							<h3>管理员</h3>
							<p><cite><?php echo $count[3];?></cite></p>
						</a>
					</li>
				</ul>
			</div>
		</div>
	</div>
	<div class="col-md-4">
		<div class="panel panel-default">
			<div class="panel-header">个人信息</div>
			<div class="panel-body">
				<table class="table table-hover">
				  <tr>
					<td>用户名</td>
					<td><?php echo $_SESSION['admininfo']['adminname'];?></td>
				  </tr>
				  <tr>
					<td>所属角色</td>
					<td><?php echo $_SESSION['admininfo']['rolename'];?></td>
				  </tr>
				  <tr>
					<td>上次登录时间</td>
					<td><?php echo $_SESSION['admininfo']['logintime'] ? date('Y-m-d H:i:s', $_SESSION['admininfo']['logintime']) : '首次登录';?></td>
				  </tr>
				  <tr>
					<td>上次登录IP</td>
					<td><?php echo $_SESSION['admininfo']['loginip'] ? $_SESSION['admininfo']['loginip'] : '首次登录';?></td>
				  </tr>
				  <tr>
					<td>登录日志</td>
					<td><a data-title="登录日志"  _href="<?php echo U('admin_log/admin_login_log_list');?>" onclick="Hui_admin_tab(this)" href="javascript:void(0)">点击查看</a></td>
				  </tr>
				</table>
			</div>
		</div>
	</div>

	<div class="col-md-8 mt-20">
		<div class="panel panel-default">
			<div class="panel-header">软件环境</div>
			<div class="panel-body">
				<table class="table table-hover">
				  <tr>
					<td>WEB服务器</td>
					<td><?php echo $_SERVER['SERVER_SOFTWARE'];?></td>
				  </tr>
				  <tr>
					<td>PHP版本</td>
					<td><?php echo PHP_VERSION;?></td>
				  </tr>
				  <tr>
					<td>MySQL版本</td>
					<td><?php echo D('admin')->version();?></td>
				  </tr>
				  <tr>
					<td>服务器操作系统 </td>
					<td><?php echo php_uname('s');?></td>
				  </tr>
				  <tr>
				  	<td>REGISTER_GLOBALS</td>
				  	<td><?php echo ini_get('register_globals') ? '<span style="color:red;">ON</span>' : 'OFF';?></td>
				  </tr>
				  <tr>
				  	<td>MAGIC_QUOTES_GPC</td>
				  	<td><?php echo MAGIC_QUOTES_GPC ? '<span style="color:red;">ON</span>' : 'OFF';?></td>
				  </tr>
				  <tr>
				  	<td>最大上传限制（UPLOAD_MAX_FILESIZE） </td>
				  	<td><?php echo ini_get('file_uploads') ? ini_get('upload_max_filesize') : 'Disabled';?></td>
				  </tr>
				  <tr>
				  	<td>最大执行时间（MAX_EXECUTION_TIME）</td>
				  	<td><?php echo ini_get('max_execution_time').'秒';?></td>
				  </tr>
				  <tr>
				  	<td>服务器域名 </td>
				  	<td><?php echo $_SERVER['HTTP_HOST'];?></td>
				  </tr>
				  <tr>
				  	<td>服务器端口 </td>
				  	<td><?php echo $_SERVER['SERVER_PORT'];?></td>
				  </tr>
				  <tr>
				  	<td>服务器剩余空间 </td>
				  	<td><?php echo disk_free_space('.') ? sizecount(disk_free_space('.')) : '---';?></td>
				  </tr>
				  <tr>
				  	<td>脚本运行占用最大内存 </td>
				  	<td><?php echo get_cfg_var('memory_limit') ? get_cfg_var('memory_limit') : '---';?></td>
				  </tr>
				</table>
			</div>
		</div>
	</div>

	<div class="col-md-4 mt-20">
		<div class="panel panel-default">
			<div class="panel-header">系统信息</div>
			<div class="panel-body">
				<table class="table table-hover">
					<tr>
						<td width="70">系统版本</td>
						<td><a href="http://www.yzmcms.com" target="_blank"><?php echo YZMCMS_SOFTNAME;?></a> <?php echo YZMCMS_VERSION;?>(<?php echo YZMCMS_UPDATE;?>)</td>
					</tr>
					<tr>
						<td width="70">系统更新</td>
						<td><a href="javascript:;" onclick="check_update(0)">检测更新</a> <span class="c-red" id="new_version"></span></td>
					</tr>
					<tr>
						<td>系统框架</td>
						<td><a href="http://www.yzmphp.com" target="_blank">YZMPHP V<?php echo YZMPHP_VERSION;?></a> </td>
					</tr>
					<tr>
						<td>前端框架</td>
						<td><a href="http://www.h-ui.net" target="_blank">H-ui前端框架</a> </td>
					</tr>
					<tr>
						<td>系统特色</td>
						<td>开源免费/速度快/轻量级/系统简洁/安全稳定... </td>
					</tr>
					<tr>
						<td>授权类型</td>
						<td><span id="yzmcms_license">未授权（<a href="http://www.yzmcms.com/shouquan/" target="_blank" style="color:red">咨询购买</a>）</span></td>
					</tr>
					<?php if(is_file(YZMPHP_PATH.'cache/error_log.php')){?>
					<tr>
						<td>安全提示</td>
						<td>
							<span class="c-red">错误日志（/cache/error_log.php）</span>
							<?php echo sizecount(filesize(YZMPHP_PATH.'cache/error_log.php'));?> 
							<a href="javascript:yzm_clear_log()" title="清除日志" style="border:1px solid #1e9fff;padding:1px 8px;margin:2px 0px 0px 5px;color:#1e9fff;white-space:nowrap;display:inline-block;">清除</a>
						</td>
					</tr>
					<?php } ?>
					<?php if(!is_file(YZMPHP_PATH.'cache/install.lock') && is_dir(YZMPHP_PATH.'application/install')){?>
					<tr>
						<td>安全提示</td>
						<td>程序安装锁（/cache/install.lock）未存在！ <br><span class="c-red">可能会导致程序重装，请检查！</span></td>
					</tr>
				  <?php } ?>
				</table>
			</div>
		</div>
		<script type="text/javascript" src="<?php echo STATIC_URL;?>plugin/swiper/js/swiper.min.js"></script>
		<div class="panel panel-default mt-20">
			<div class="panel-header">官方产品 <div class="yzm-pagination"></div></div>
			<div class="panel-body">
					<div class="swiper-container">
						 <div class="swiper-wrapper">
						      <div class="swiper-slide yzm-bg-primary"><a href="http://www.yzmcms.com" target="_blank">YzmCMS官方网站</a></div>
						      <div class="swiper-slide yzm-bg-secondary"><a href="http://www.yzmask.com" target="_blank">YzmCMS官方社区</a></div>	
						      <div class="swiper-slide yzm-bg-success"><a href="http://blog.yzmcms.com" target="_blank">YzmCMS官方博客</a></div>
						      <div class="swiper-slide yzm-bg-danger"><a href="http://doc.yzmcms.com" target="_blank">YzmCMS官方文档</a></div>
						 </div>
					 </div>		 

			</div>
		</div>
	</div>

</div>
<?php include $this->admin_tpl('footer', 'admin');?>
<script type="text/javascript" src="<?php echo STATIC_URL;?>admin/yzm_admin/js/yzm.update.js?v=<?php echo YZMCMS_VERSION;?>"></script> 
<script type="text/javascript">
	var swiper = new Swiper('.swiper-container', {
		loop: true,
		autoplay: {
			delay: 3500,
			disableOnInteraction: false
		},
		pagination: {
			el: '.yzm-pagination',
			clickable: true
		}
	});
	
	function yzm_clear_log(){
		layer.confirm('确认要清除错误日志吗？', {title:"操作提示"}, function(index){
	        $.ajax({
	            type: 'GET',
	            url: '<?php echo U('public_clear_log');?>', 
			    dataType: "json", 
	            success: function (msg) {
					if(msg.status == 1){
						layer.msg(msg.message, {icon:1,time: 800}, function(){
						  window.location.reload();     
						});
				    }else{
						layer.msg(msg.message, {icon:2,time: 2500});
					}
	            }
	        })	
		});
		
	}
	$(function(){ check_update(1); });
</script>
</body>
</html>