<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>模板文件选择</title>
<LINK href="<?=base_url()?>csdj/admin/images/admin.css" type="text/css" rel="stylesheet">
<script language="JavaScript"> 
var FileName=""
function onClickFile(Obj){
	var mlinks = document.getElementById("MB").getElementsByTagName("tr");
	for (var j = 0; j < mlinks.length; j++){
		mlinks[j].className = "TempletItem";
	}
	Obj.className='TempletSelectItem';
	FileName=Obj.id;
}
</script>
</head>
<BODY style="margin:2px;">
<?php
$strs=get_dir_file_info('skins/'.Skins_dir, $top_level_only = TRUE);
?>
<table align="center" border="1" cellspacing="0" cellpadding="2" bordercolor="#A2DAE7" width="100%" style="border-collapse:collapse;" id="MB"><tr><td align="center" colspan=3 class="title">选择模板文件</td></tr><tr><td colspan=3>&nbsp;当前目录：skins/<?=Skins_dir?>&nbsp;&nbsp;&nbsp;&nbsp;模版文件：<font color=blue><?=count($strs)?></font>&nbsp;个</td></tr>
<tr>
<td width="50%" align="center">文件/文件夹名</td>
<td width="22%" align="center">文件类型</td>
<td width="28%" align="center">修改时间</td>
</tr>
<?php
foreach ($strs as $value) {
    echo "<tr class='TempletItem' onClick=\"onClickFile(this);\" id=\"".$value['name']."\" title=\"单击选择文件\"><td><img src=\"".base_url()."csdj/admin/images/filetype/".getpicType($value['name']).".gif\" align=\"absmiddle\"> ".$value['name']."</td><td align=\"center\">".getTemplateType($value['name'])."</td><td align=\"center\">".date('Y-m-d H:i:s',$value['date'])."</td></tr>";
}
?>
</table>
<?php
function getpicType($type){
	if(stristr($type,'.html')){
		return "url";
	}elseif(stristr($type,'.js')){
		return substr($type,-2);
	}else{
		return substr($type,-3);
	}
}
function getTemplateType($filename){
	switch(strtolower($filename)){
		case "home-head.html":
			$getTemplateType="会员主页顶部";
			break;
		case "home-bottom.html":
			$getTemplateType="会员主页底部";
			break;
		case 'home-index.html':
			$getTemplateType="会员主页";
			break;
		case "user-head.html":
			$getTemplateType="会员中心顶部";
			break;
		case "user-bottom.html":
			$getTemplateType="会员中心底部";
			break;
		case 'user-index.html':
			$getTemplateType="会员中心主页";
			break;
		case 'cs-index.html':
			$getTemplateType="网站首页";
			break;
		case 'cs-404.html':
			$getTemplateType="网站404";
			break;
		case "cs-head.html":
			$getTemplateType="网站顶部";
			break;
		case "cs-bottom.html":
			$getTemplateType="网站底部";
			break;
		case "cs-ding.html":
			$getTemplateType="顶踩模版";
			break;
		case "dance-index.html":
			$getTemplateType="音乐主页";
			break;
		case "news-index.html":
			$getTemplateType="文章主页";
			break;
		case "singer-index.html":
			$getTemplateType="歌手主页";
			break;
		case "singer-list.html":
			$getTemplateType="歌手分类";
		case "singer-show.html":
			$getTemplateType="歌手内容";
			break;
		case "vod-index.html":
			$getTemplateType="视频主页";
			break;
		case "vod-list.html":
			$getTemplateType="视频列表";
			break;
		case "vod-show.html":
			$getTemplateType="视频内容";
			break;
		case "vod-play.html":
			$getTemplateType="视频播放";
			break;
		case "so-dance-key.html":
			$getTemplateType="歌曲搜索";
			break;
		case "so-user-key.html":
			$getTemplateType="会员搜索";
			break;
		case "so-singer-key.html":
			$getTemplateType="歌手搜索";
			break;
		case "so-singer-tags.html":
			$getTemplateType="歌手标签";
			break;
		case "so-dance-tags.html":
			$getTemplateType="歌曲标签";
			break;
		case "so-topic-key.html":
			$getTemplateType="专集搜索";
			break;
		case "so-topic-tags.html":
			$getTemplateType="专集标签";
			break;
		case "so-vod-key.html":
			$getTemplateType="视频搜索";
			break;
		case "so-vod-tags.html":
			$getTemplateType="视频标签";
			break;
		case "so-news-key.html":
			$getTemplateType="文章搜索";
			break;
		case "topic-dance.html":
			$getTemplateType="音乐专集列表";
			break;
		case "topic-news-show.html":
			$getTemplateType="文章专题内容";
			break;
		case "topic-dance-show.html":
			$getTemplateType="音乐专集内容";
			break;
		case "news-list.html":
			$getTemplateType="文章列表";
			break;
		case "dance-list.html":
			$getTemplateType="歌曲列表";
			break;
		case "news-show.html":
			$getTemplateType="文章内容";
			break;
		case "dance-play.html":
			$getTemplateType="歌曲播放";
			break;
			case "dance-play1.html":
			$getTemplateType="歌曲播放9酷风格";
			break;
			case "dance-play2.html":
			$getTemplateType="歌曲播放青檬风格";
			break;
		case "dance-sp-play.html":
			$getTemplateType="视频播放";
			break;
		case "cs-gbook.html":
			$getTemplateType="留言模板";
			break;
		case "cs-ulogin.html":
			$getTemplateType="会员登陆";
			break;	
		case "cs-uinfo.html":
			$getTemplateType="会员信息";
			break;	
		Case "dance-down.html";
			$getTemplateType="下载页面";
			break;	
		Case "dance-sp-list.html";
			$getTemplateType="视频栏目";
			break;	
		Case "dance-playsong.html";
			$getTemplateType="连播页面";
			break;	
		Case "down-list.html";
			$getTemplateType="下载列表";
			break;	
		Case "fans-list.html";
			$getTemplateType="粉丝列表";
			break;	
		Case "fav-list.html";
			$getTemplateType="收藏列表";
			break;	
		Case "feed-list.html";
			$getTemplateType="动态列表";
			break;	
		Case "friend-list.html";
			$getTemplateType="好友列表";
			break;	
		Case "funco-list.html";
			$getTemplateType="访客列表";
			break;	
		Case "gbook-add.html";
			$getTemplateType="留言框";
			break;	
		Case "gbook-list.html";
			$getTemplateType="留言列表";
			break;	
		Case "pic-show.html";
			$getTemplateType="图片详细页面";
			break;	
		Case "pic-list.html";
			$getTemplateType="图片列表";
			break;	
		Case "blog-list.html";
			$getTemplateType="说说列表";
			break;	
		Case "blog-list.html";
			$getTemplateType="说说列表";
			break;	
		Case "dance-add.html";
			$getTemplateType="上传歌曲";
			break;	
		Case "edit-index.html";
			$getTemplateType="资料修改";
			break;	
		Case "edit-logo.html";
			$getTemplateType="头像修改";
			break;	
		Case "edit-pass.html";
			$getTemplateType="密码修改";
			break;	
		Case "edit-web.html";
			$getTemplateType="主页相关修改";
			break;	
		Case "feed-ajax.html";
			$getTemplateType="动态AJAX页面";
			break;	
		Case "msg-add.html";
			$getTemplateType="发送消息";
			break;	
		Case "msg-list.html";
			$getTemplateType="消息列表";
			break;	
		Case "msg-show.html";
			$getTemplateType="消息内容";
			break;	
		Case "news-add.html";
			$getTemplateType="新增文章";
			break;	
		Case "pay-index.html";
			$getTemplateType="在线充值";
			break;	
		Case "pay-list.html";
			$getTemplateType="充值记录";
			break;	
		Case "pic-add.html";
			$getTemplateType="上传图片";
			break;	
		Case "pic-list-all.html";
			$getTemplateType="大家的相片";
			break;	
		Case "pic-list-my.html";
			$getTemplateType="我的相片";
			break;	
		Case "topic-add.html";
			$getTemplateType="专集制作";
			break;	
		Case "topic-list.html";
			$getTemplateType="专集列表";
			break;	
		Case "user-login.html";
			$getTemplateType="会员登入";
			break;
		Case "user-pass.html";
			$getTemplateType="密码找回";
			break;	
		Case "user-passto.html";
			$getTemplateType="找回新密码";
			break;	
		Case "user-reg.html";
			$getTemplateType="会员注册";
			break;	
		Case "user-space.html";
			$getTemplateType="会员中心";
			break;	
		Case "vip-index.html";
			$getTemplateType="升级VIP";
			break;	
		Case "vod-add.html";
			$getTemplateType="发布视频";
			break;	
		Case "user-denglu.html";
			$getTemplateType="第三方登入";
			break;	
		Case "cs-pl.html";
			$getTemplateType="评论模板";
			break;
		Case "so-dance-zm.html";
			$getTemplateType="歌曲字母搜索";
			break;	
		Case "so-vod-zm.html";
			$getTemplateType="视频字母搜索";
			break;
		Case "so-singer-zm.html";
			$getTemplateType="歌手字母搜索";
			break;
		Case "so-topic-tags.html";
			$getTemplateType="专集Tags搜索";
			break;		
		Case "cs-wap.html";
			$getTemplateType="PC手机模板";
			break;
		Case "home-ulogin.html";
			$getTemplateType="会员主页登陆前";
			break;		
		Case "home-uinfo.html";
			$getTemplateType="会员主页登陆后";
			break;
		default:
			if(stristr($filename,'.gif') or stristr($filename,'.jpg') or stristr($filename,'.png')){
				$getTemplateType="图片文件";
			}elseif(stristr($filename,'.css')){
				 $getTemplateType="样式文件";
			}elseif(stristr($filename,'.js')){
				$getTemplateType="脚本文件";
			}elseif(stristr($filename,'-复制.html')){
				 $getTemplateType="备份文件";
			}else{
				$getTemplateType="自定义文件";
			}
	}
	return $getTemplateType;
}
?>
</body>
</html>

