<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
	<head>
		<title></title>
		<meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link rel="stylesheet" type="text/css" href="<?php echo (THEME_PATH_ABS); ?>/css/bootstrap.min.css" />
		<link rel="stylesheet" type="text/css" href="<?php echo (THEME_PATH_ABS); ?>/css/bootstrap-responsive.min.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo (THEME_PATH_ABS); ?>/css/colorpicker.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo (THEME_PATH_ABS); ?>/css/datepicker.css" />
		<link rel="stylesheet" type="text/css" href="<?php echo (THEME_PATH_ABS); ?>/css/uniform.css" />
		<link rel="stylesheet" type="text/css" href="<?php echo (THEME_PATH_ABS); ?>/css/select2.css" />		
		<link rel="stylesheet" type="text/css" href="<?php echo (THEME_PATH_ABS); ?>/css/unicorn.main.css" />
		<link rel="stylesheet" type="text/css" href="<?php echo (THEME_PATH_ABS); ?>/css/unicorn.grey.css" />
		<link rel="stylesheet" type="text/css" href="<?php echo (THEME_PATH_ABS); ?>/css/select2.css" />
		<link rel="stylesheet" type="text/css" href="/wublog/Public/imagesel/css/style.css" />
		<script type="text/javascript" src="<?php echo (THEME_PATH_ABS); ?>/js/jquery.min.js"></script>	
		<script type="text/javascript" src="<?php echo (THEME_PATH_ABS); ?>/js/jquery.ui.custom.js"></script>
		<script type="text/javascript" src="<?php echo (THEME_PATH_ABS); ?>/js/bootstrap.min.js"></script>
		<script type="text/javascript" src="<?php echo (THEME_PATH_ABS); ?>/js/bootstrap-colorpicker.js"></script>
		<script type="text/javascript" src="<?php echo (THEME_PATH_ABS); ?>/js/bootstrap-datepicker.js"></script>
		<script type="text/javascript" src="<?php echo (THEME_PATH_ABS); ?>/js/jquery.uniform.js"></script>
		<script type="text/javascript" src="<?php echo (THEME_PATH_ABS); ?>/js/select2.min.js"></script>
		<script type="text/javascript" src="<?php echo (THEME_PATH_ABS); ?>/js/unicorn.js"></script>
		<script type="text/javascript" src="<?php echo (THEME_PATH_ABS); ?>/js/unicorn.tables.js"></script>
		<script type="text/javascript" src="<?php echo (THEME_PATH_ABS); ?>/js/jquery.dataTables.min.js"></script>
		<script type="text/javascript" src="<?php echo (THEME_PATH_ABS); ?>/js/unicorn.form_common.js"></script>
		<link rel="stylesheet" href="/wublog/Public/jquery-foxibox-0.2/style/jquery-foxibox-0.2.css" type="text/css" media="screen" />
		<script src="/wublog/Public/jquery-foxibox-0.2/script/jquery-foxibox-0.2.js" type="text/javascript"></script>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
	<body>
		
		
		<div id="header">

			<h1><a href="./dashboard.html">Unicorn Admin</a></h1>	
		</div>
		<!--
		<div id="search">
			<input type="text" placeholder="Search here..." /><button type="submit" class="tip-right" title="Search"><i class="icon-search icon-white"></i></button>
		</div>-->
		<div id="user-nav" class="navbar navbar-inverse">
            <ul class="nav btn-group">

                <!--<li class="btn btn-inverse"><a title="" href="#"><i class="icon icon-user"></i> <span class="text">Profile</span></a></li>
                <!--
                <li class="btn btn-inverse dropdown" id="menu-messages"><a href="#" data-toggle="dropdown" data-target="#menu-messages" class="dropdown-toggle"><i class="icon icon-envelope"></i> <span class="text">Messages</span> <span class="label label-important">5</span> <b class="caret"></b></a>
                    <ul class="dropdown-menu">
                        <li><a class="sAdd" title="" href="#">new message</a></li>
                        <li><a class="sInbox" title="" href="#">inbox</a></li>
                        <li><a class="sOutbox" title="" href="#">outbox</a></li>
                        <li><a class="sTrash" title="" href="#">trash</a></li>
                    </ul>-->
                </li>
                <li class="btn btn-inverse"><a title="" href="/wublog/index.php/index.php/Admin/Index/profile"><i class="icon icon-cog"></i> <span class="text"><?php echo ($_SESSION['username']); ?>设置</span></a></li>

                <li class="btn btn-inverse"><a title="" href="/wublog/index.php/Admin/Login/do_logout/"><i class="icon icon-share-alt"></i> <span class="text">注销</span></a></li>
            </ul>
        </div>
		<div id="sidebar">
			<a href="#" class="visible-phone"> <i class="icon icon-home"></i>
				Dashboard
			</a>
			<ul>
				<?php if(($data["PageFun"]) == "index"): ?><li class="active">
						<?php else: ?>		
						<li><?php endif; ?>
						<a href="/wublog/index.php/Admin/Index"> <i class="icon icon-home"></i>
							<span>首页</span>
						</a>
					</li>
					<?php if(in_array(($data["PageFun"]), explode(',',"archive,items,archivelists,archivelists"))): ?><li class="submenu open active">
							<?php else: ?>		
							<li class="submenu"><?php endif; ?>
							<a href="#">
								<i class="icon icon-th-list"></i>
								<span>内容管理</span>
								<span class="label"></span>
							</a>
							<ul>
								<?php if(($data["PageFun"]) == "items"): ?><li class="active">
										<?php else: ?>		
										<li><?php endif; ?>
										<a href="/wublog/index.php/Admin/Index/items">我的栏目</a>
									</li>
									<?php if(($data["PageFun"]) == "archivelists"): ?><li class="active">
											<?php else: ?>		
											<li><?php endif; ?>
											<a href="/wublog/index.php/Admin/Index/archivelists">所有文章</a>
										</li>
										<?php if(($data["PageFun"]) == "archive"): ?><li class="active">
												<?php else: ?>		
												<li><?php endif; ?>
												<a href="/wublog/index.php/Admin/Index/archive">内容发布</a>
											</li>

										</ul>
									</li>
									<?php if(($data["PageFun"]) == "mycomment"): ?><li class="active">
											<?php else: ?>		
											<li><?php endif; ?>
											<a href="/wublog/index.php/Admin/Index/mycomment">
												<i class="icon icon-pencil"></i>
												我的评论
											</a>
										</li>

										<?php if(in_array(($data["PageFun"]), explode(',',"myfiles,myimages"))): ?><li class="submenu open active">
												<?php else: ?>		
												<li class="submenu"><?php endif; ?>
												<a href="#">
													<i class="icon icon-th-list"></i>
													<span>上传管理</span>
													<span class="label"></span>
												</a>
												<ul>
													<?php if(($data["PageFun"]) == "myfiles"): ?><li class="active">
															<?php else: ?>		
															<li><?php endif; ?>
															<a href="/wublog/index.php/Admin/Index/myfiles/filter/all">我的文档</a>
														</li>
														<?php if(($data["PageFun"]) == "myimages"): ?><li class="active">
																<?php else: ?>		
																<li><?php endif; ?>
																<a href="/wublog/index.php/Admin/Index/myimages/filter/all">我的图片</a>
															</li>
														</ul>
													</li>

													<?php if(in_array(($data["PageFun"]), explode(',',"profile,link"))): ?><li class="submenu open active">
															<?php else: ?>		
															<li class="submenu"><?php endif; ?>
															<a href="#">
																<i class="icon icon-th-list"></i>
																<span>设置</span>
																<span class="label"></span>
															</a>
															<ul>
																<?php if(($data["PageFun"]) == "profile"): ?><li class="active">
																		<?php else: ?>		
																		<li><?php endif; ?>
																		<a href="/wublog/index.php/Admin/Index/profile">
																			<i class="icon icon-pencil"></i>
																			<span>常规选项</span>
																		</a>
																	</li>
																	<?php if(($data["PageFun"]) == "link"): ?><li class="active">
																			<?php else: ?>		
																			<li><?php endif; ?>
																			<a href="/wublog/index.php/Admin/Index/mylink">
																				<i class="icon icon-pencil"></i>
																				<span>友情链接</span>
																			</a>
																		</li>
																	</ul>

																</ul>

															</div>

															<div id="content">
																<div id="content-header">
																	<h1><?php echo ($data["PageName"]); ?></h1>
																</div>

																<div id="breadcrumb">
																	<a href="#" title="Go to Home" class="tip-bottom">
																		<i class="icon-home"></i>
																		Home
																	</a>
																	<a href="#" class="current"><?php echo ($data["PageName"]); ?></a>
																</div>
																<div id="style-switcher">
																	<i class="icon-arrow-left icon-white"></i>
																	<span>Style:</span>
																	<a href="#grey" style="background-color: #555555;border-color: #aaaaaa;"></a>
																	<a href="#blue" style="background-color: #2D2F57;"></a>
																	<a href="#red" style="background-color: #673232;"></a>
																</div>
<div class="container-fluid">
<div class="row-fluid">
					<div class="span12">
					<div id='alert'></div>
						<div class="widget-box">
							<div class="widget-title">
							<h5>上传文件列表</h5>
							</div>
							<div class="widget-content nopadding">
								<table class="table table-bordered data-table">
									<thead>
									<tr>
									<th></th>
									<th>文件名</th>
									<th>文件大小</th>
									<th>上传日期</th>
									<th>依附文章</th>
									<th>操作</th>
									</tr>
									</thead>
									<tbody>
									<?php if(is_array($data["Files"])): $k = 0; $__LIST__ = $data["Files"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($k % 2 );++$k;?><tr id="tr-<?php echo ($k); ?>" class="gradeX">
										<td><img src="/wublog/Public/ueditor/dialogs/attachment/fileTypeImages/icon_<?php echo ($vo["extension"]); ?>.gif" /></td>
										<td><?php echo ($vo["filename"]); ?></td>
										<td><?php echo ($vo["filesize"]); ?>KB</td>
										<td><?php echo ($vo["filetime"]); ?></td>
										<td><?php echo ($vo["fileattach"]); ?></td>
										<td class="center">
										<div class="btn-group">
									  		<button data-toggle="dropdown" class="btn btn-primary dropdown-toggle">操作 <span class="caret"></span></button>
									  		<ul class="dropdown-menu">
												<li><a href="/wublog<?php echo ($vo["fileroot"]); ?>"><i class="icon-pencil icon-black"></i>下载</a></li>
												<li><a href="#" onclick="delAlert('<?php echo ($vo["filename"]); ?>','tr-<?php echo ($k); ?>')"><i class="icon-file icon-black"></i>删除</a></li>
									  		</ul>
										</div>
										</td>
									</tr><?php endforeach; endif; else: echo "" ;endif; ?>
									</tbody>
									</table>  
							</div>
						</div>
					</div>
				</div>

					</div>
				</div>
<script type="text/javascript">
function delAlert(filename,trid)
{
$('#alertinfo').html('确认是否删除'+filename);
$('#filename').val(filename);
$('#trid').val(trid);
$("#myAlert").modal(); 
}
function delAjaxPost()
{
	var filename=$('#filename').val();
	var trid=$('#trid').val();
	$.ajax({
		type:'post',
		url:'/wublog/index.php/Admin/File/delFiles?filetype=file&file='+filename,
		datatype:'json',
		data:{},
		success:function(data)
		{
			$('#'+trid).remove();
			var obj = eval('(' + data + ')'); 
			var html="<div class='alert alert-success'><button class='close' data-dismiss='alert'>×</button><strong>"+obj.msg+"</strong> </div>";
			$("#alert").html($("#alert").html()+html).delay(5000).slideUp(500);
		},
	});
}
</script>
									<div id="myAlert" class="modal hide">
										<div class="modal-header">
											<button data-dismiss="modal" class="close" type="button">×</button>
											<h3>确认删除</h3>
										</div>
										<div class="modal-body">
											<p id='alertinfo'></p>
											<input id='filename' type='hidden' value='' />
											<input id='trid' type='hidden' value='' />
										</div>
										<div class="modal-footer">
											<a data-dismiss="modal" onclick="delAjaxPost()" class="btn  btn-primary" href="#">Confirm</a>
											<a data-dismiss="modal" class="btn" href="#">Cancel</a>
										</div>
									</div>

			</div>
			
            <script type="text/javascript">
$('#style-switcher a').click(function()
      {
            var pub="/wublog/Public";
            var style = $(this).attr('href').replace('#','');
            $('.skin-color').attr('href',pub+'/css/unicorn.'+style+'.css');
            $(this).siblings('a').css({'border-color':'transparent'});
            $(this).css({'border-color':'#aaaaaa'});
      });
            </script>
	</body>
</html>