Web 在线文件管理器学习笔记与总结(2)显示文件列表(名称,类型,大小,可读,可写,可执行,创建时间,修改时间,访问时间)

主要函数:

filetype() 判断文件类型

filesize() 得到文件大小(字节)

is_readable() 判断文件是否可读

is_writeable() 判断文件是否可写

is_executable() 判断文件是否可执行

filectime() 文件创建时间

filemtime() 文件修改时间

fileatime() 文件访问时间

file.func.php 封装文件操作的文件:

<?php
/*
    转换字节大小
*/
function transByte($size){
    $arr = array(‘B‘,‘KB‘,‘MB‘,‘GB‘,‘TB‘,‘EB‘);
    $i = 0;
    while($size > 1024){
        $size /= 1024;
        $i++;
    }
    return round($size,2).‘ ‘.$arr[$i];
}

index.php:

 1 <?php
 2 require ‘dir.func.php‘;
 3 require ‘file.func.php‘;
 4 $path = ‘file‘;
 5 $info = readDirectory($path);
 6 ?>
 7 <!DOCTYPE html>
 8 <html>
 9 <head>
10 <meta charset="UTF-8">
11 <title>Insert title here</title>
12 <link rel="stylesheet" href="cikonss.css" />
13 <link rel="stylesheet" href="common.css" />
14 </head>
15 <body>
16 <h1>在线文件管理器</h1>
17 <div id="top">
18     <ul id="navi">
19         <li><a href="index.php" title="主目录"><span style="margin-left: 8px; margin-top: 0px; top: 4px;" class="icon icon-small icon-square"><span class="icon-home"></span></span></a></li>
20         <li><a href="#" title="新建文件" ><span style="margin-left: 8px; margin-top: 0px; top: 4px;" class="icon icon-small icon-square"><span class="icon-file"></span></span></a></li>
21         <li><a href="#" title="新建文件夹"><span style="margin-left: 8px; margin-top: 0px; top: 4px;" class="icon icon-small icon-square"><span class="icon-folder"></span></span></a></li>
22         <li><a href="#" title="上传文件"><span style="margin-left: 8px; margin-top: 0px; top: 4px;" class="icon icon-small icon-square"><span class="icon-upload"></span></span></a></li>
23         <li><a href="#" title="返回上级目录"><span style="margin-left: 8px; margin-top: 0px; top: 4px;" class="icon icon-small icon-square"><span class="icon-arrowLeft"></span></span></a></li>
24     </ul>
25 </div>
26 <table width=‘100%‘ border=‘1‘ cellpadding="5" cellspacing="0" bgcolor="#abcdef" align="center">
27     <tr align="center">
28         <td>编号</td>
29         <td>名称</td>
30         <td>类型</td>
31         <td>大小</td>
32         <td>可读</td>
33         <td>可写</td>
34         <td>可执行</td>
35         <td>创建时间</td>
36         <td>修改时间</td>
37         <td>访问时间</td>
38         <td>操作</td>
39     </tr>
40     <?php
41         if($info[‘file‘]){
42             $i = 1;
43             foreach($info[‘file‘] as $val){
44                 $p = $path.‘/‘.$val;
45     ?>
46     <tr align="center">
47         <td><?php echo $i;?></td>
48         <td><?php echo $val;?></td>
49         <td><?php $src = filetype($p) == ‘file‘?‘file_ico.png‘:‘folder_ico.png‘;?><img src="images/<?php echo $src;?>"  title=‘文件‘></td>
50         <td><?php echo transByte(filesize($p));?></td>
51         <td><?php $src = is_readable($p)?‘correct.png‘:‘error.png‘;?><img src="images/<?php echo $src;?>" width="32"  title=‘可读‘></td>
52         <td><?php $src = is_writeable($p)?‘correct.png‘:‘error.png‘;?><img src="images/<?php echo $src;?>" width="32"  title=‘可写‘></td>
53         <td><?php $src = is_executable($p)?‘correct.png‘:‘error.png‘;?><img src="images/<?php echo $src;?>" width="32"  title=‘可写‘></td>
54         <td><?php echo date(‘Y-m-d H:i:s‘,filectime($p));?></td>
55         <td><?php echo date(‘Y-m-d H:i:s‘,filemtime($p));?></td>
56         <td><?php echo date(‘Y-m-d H:i:s‘,fileatime($p));?></td>
57         <td>
58             <a href="" title=‘查看‘><img src="images/show.png" width="32" ></a>
59             <a href="" title=‘修改‘><img src="images/edit.png" width="32" ></a>
60             <a href="" title=‘重命名‘><img src="images/rename.png" width="32" ></a>
61             <a href="" title=‘复制‘><img src="images/copy.png" width="32" ></a>
62             <a href="" title=‘剪切‘><img src="images/cut.png" width="32" ></a>
63             <a href="" title=‘删除‘><img src="images/delete.png" width="32" ></a>
64             <a href="" title=‘下载‘><img src="images/download.png" width="32" ></a>
65         </td>
66     </tr>
67     <?php
68                 $i++;
69             }
70         }
71     ?>
72 </table>
73 </body>
74 </html>

common.css:

    body,p,div,ul,ol,table,dl,dd,dt{
        margin:0;
        padding: 0;
    }
    a{
        text-decoration: none;
    }
    ul,li{
        list-style: none;
        float: left;
    }
    #top{
        width:100%;
        height:48px;
        margin:0 auto;
        background: #E2E2E2;
    }
    #navi a{
        display: block;
        width:48px;
        height: 48px;
    }
    #main{
        margin:0 auto;
        border:2px solid #ABCDEF;
    }
    .small{
        width:25px;
        height:25px;
        border:0;
}

cikonss.css:

/*
 * Cikonss v1.0
 *
 * URL: https://github.com/zzap/Cikonss
 * License: MIT License
 *
 */

/* Generals */
.icon {
    /* don‘t change width and height in order to change the size of the icon,
    you can control the size with font-size for different class(es) - below */
    line-height: 100%;
    width: 1em;
    height: 1em;
    position: relative;
    display: block;
    float: left;
}
/* Button like icons */
.icon-square,
.icon-rounded {
    border: .75em solid rgb(242, 242, 242); /* #f2f2f2 */
    background-color: rgb(242, 242, 242); /* #f2f2f2 */
    margin: 0 .5em .5em 0;
    /* for browsers that supports */
    -webkit-box-shadow: 0 0 0 .0625em rgb(226, 226, 226); /* #e2e2e2 */
    -moz-box-shadow: 0 0 0 .0625em rgb(226, 226, 226); /* #e2e2e2 */
    box-shadow: 0 0 0 .0625em rgb(226, 226, 226); /* #e2e2e2 */
}
.icon-rounded {
    border-radius: 1.5em;
}
/*
 * Sizes
 *
 * 5 preset sizes, simply change the font-size or add your custom class.
 *
 */
.icon-small {
    font-size: 1em;
}
.icon-mid {
    font-size: 2em;
}
.icon-large {
    font-size: 4em;
}
.icon-extra-large {
    font-size: 8em;
}
.icon-huge {
    font-size: 12em;
}

/*
 * Icons
 *
 * Icons are somewhat grouped so that you can easily pick the ones you like
 * if the whole file is too large for your project.
 *
 */

/* Home */
.icon-home {
    position: absolute;
    top: 0;
    left: .125em;
    width: .25em;
    height: .5em;
    background-color: rgb(102, 102, 102); /* #666 */
}
.icon-home:before,
.icon-home:after {
    content: "";
    position: absolute;
    border-style: solid;
}
.icon-home:before {
    top: .5em;
    left: 0;
    width: .25em;
    height: .3125em;
    border-width: .1875em .25em 0 .25em;
    border-color: rgb(102, 102, 102); /* #666 */
}
.icon-home:after {
    top: -.5em;
    left: -.125em;
    width: 0;
    height: 0;
    border-width: .5em;
    border-color: transparent transparent rgb(102, 102, 102) transparent; /* #666 */
}

/* Arrows */
.icon-arrowRight,
.icon-arrowLeft,
.icon-arrowDown,
.icon-arrowUp {
    position: absolute;
    width: .5em;
    height: .5em;
    background-color: rgb(102, 102, 102); /* #666 */
}
.icon-arrowRight:after,
.icon-arrowLeft:after,
.icon-arrowDown:after,
.icon-arrowUp:after {
    content: "";
    position: absolute;
    width: 0;
    height: 0;
    border-width: .5em;
    border-style: solid;
}
/* Arrows - Left and Right */
.icon-arrowRight,
.icon-arrowLeft {
    top: .25em;
}
.icon-arrowRight {
    left: 0;
}
.icon-arrowLeft {
    right: 0;
}
.icon-arrowRight:after,
.icon-arrowLeft:after {
    top: -.25em;
}
.icon-arrowRight:after {
    left: .5em;
    border-color: transparent transparent transparent rgb(102, 102, 102); /* #666 */
}
.icon-arrowLeft:after {
    right: .5em;
    border-color: transparent rgb(102, 102, 102) transparent transparent; /* #666 */
}
/* Arrows -  Down and Up */
.icon-arrowDown,
.icon-arrowUp {
    left: .25em;
}
.icon-arrowDown {
    top: 0;
}
.icon-arrowUp,
.icon-arrowDown:after {
    top: .5em;
}
.icon-arrowDown:after,
.icon-arrowUp:after {
    left: -.25em;
}
.icon-arrowDown:after {
    border-color: rgb(102, 102, 102) transparent transparent transparent; /* #666 */
}
.icon-arrowUp:after {
    top: -1em;
    border-color: transparent transparent rgb(102, 102, 102) transparent; /* #666 */
}

/* Comments */
.icon-comment,
.icon-comment-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 1em;
    height: .75em;
    background-color: rgb(102, 102, 102); /* #666 */
    /* for browsers that supports */
    border-radius: .125em;
}
.icon-comment:after,
.icon-comment-text:before,
.icon-comment-text:after {
    content: "";
    position: absolute;
    border-style: solid;
}
.icon-comment-text:before {
    top: .1875em;
    left: .125em;
    width: .75em;
    height: .125em;
    border-width: .09375em 0;
    border-color: rgb(249, 249, 249); /* #f9f9f9 */
}
.icon-comment:after,
.icon-comment-text:after {
    top: .75em;
    left: .25em;
    width: 0;
    height: 0;
    border-width: .125em;
    border-color: rgb(102, 102, 102) transparent transparent rgb(102, 102, 102); /* #666 */
}

/* Mail */
.icon-mail {
    position: absolute;
    top: .15625em;
    left: 0;
    width: 1em;
    height: .75em;
    background-color: rgb(102, 102, 102); /*#666*/
}
.icon-mail:before,
.icon-mail:after {
    content: "";
    position: absolute;
    left: 0;
    width: 0;
    height: 0;
    border-width: .4em .5em;
    border-style: solid;
}
.icon-mail:before {
    top: 0;
    border-color: rgb(249, 249, 249) transparent transparent transparent; /* #f9f9f9 */
}
.icon-mail:after {
    top: -.0625em;
    border-color: rgb(102, 102, 102) transparent transparent transparent; /* #666 */
}

/* Calendar */
.icon-calendar{
    position: absolute;
    top: .125em;
    left: 0;
    width: .875em;
    height: .6875em;
    border-width: .125em .0625em .0625em .0625em;
    border-style: solid;
    border-color: rgb(102, 102, 102); /* #666 */
    background-color: rgb(249, 249, 249); /* #f9f9f9 */
    /* for browsers that supports */
    border-radius: .0625em;
}
.icon-calendar:before{
    content: "";
    position: absolute;
    top: -.25em;
    left: .125em;
    width: .375em;
    height: .125em;
    border-width: 0 .125em;
    border-style: solid;
    border-color: rgb(102, 102, 102); /* #666 */
}
.icon-calendar:after{
    content: "15";
    position: absolute;
    top: -.25em;
    left: .25em;
    font-family: Arial, sans-serif;
    font-size: .5em;
    font-weight: bold;
    color: rgb(102, 102, 102); /* #666 */
}

/* Plus */
.icon-plus,
.icon-plus:after {
    position: absolute;
    width: .375em;
    height: .375em;
    border-style: solid;
    border-color: rgb(102, 102, 102); /* #666 */
}
.icon-plus {
    top: 0;
    left: 0;
    border-width: 0 .25em .25em 0;
}
.icon-plus:after {
    content: "";
    top: .375em;
    left: .375em;
    border-width: .25em 0 0 .25em;
}

/* Minus */
.icon-minus {
    position: absolute;
    top: .375em;
    left: 0;
    width: 1em;
    height: .25em;
    background-color: rgb(102, 102, 102); /* #666 */
}

/* File */
.icon-file {
    position: absolute;
    top: 0;
    left: .125em;
    width: .5em;
    height: .75em;
    border-width: .125em;
    border-style: solid;
    border-color: rgb(102, 102, 102); /* #666 */
    background-color: rgb(249, 249, 249); /* #f9f9f9 */
    /* for browsers that supports */
    border-radius: .0625em;
}
.icon-file:before {
    content: "";
    position: absolute;
    top: -.125em;
    left: -.125em;
    width: 0;
    height: 0;
    border-width: .15625em;
    border-style: solid;
    border-color: rgb(255, 255, 255) rgb(102, 102, 102) rgb(102, 102, 102) rgb(255, 255, 255); /* #fff and #666 - #fff has to mach body bg*/
}
.icon-square .icon-file:before,
.icon-rounded .icon-file:before {
    border-color: rgb(242, 242, 242) rgb(102, 102, 102) rgb(102, 102, 102) rgb(242, 242, 242); /* #f2f2f2 and #666 - #f2f2f2 has to mach with .icon-square and .icon-rounded bg*/
}

/* Folder */
.icon-folder {
    position: absolute;
    top: .125em;
    left: 0;
    width: 1em;
    height: .875em;
    background-color: rgb(102, 102, 102); /* #666 */
    /* for browsers that supports */
    border-bottom-left-radius: .0625em;
    border-bottom-right-radius: .0625em;
}
.icon-folder:before {
    content: "";
    position: absolute;
    top: -.125em;
    left: .125em;
    width: .375em;
    height: .125em;
    background-color: rgb(102, 102, 102); /* #666 */
    /* for browsers that supports */
    border-top-left-radius: .0625em;
    border-top-right-radius: .0625em;
}

/* Tag */
.icon-tag {
    position: absolute;
    top: 0;
    left: .25em;
    width: .5em;
    height: .75em;
    background-color: rgb(102, 102, 102); /* #666 */
    /* for browsers that supports */
    border-top-left-radius: .0625em;
    border-top-right-radius: .0625em;
}
.icon-tag:before,
.icon-tag:after {
    content: "";
    position: absolute;
    top: .75em;
    width: 0;
    height: 0;
    border-width: .125em;
    border-style: solid;
}
.icon-tag:before {
    left: 0;
    border-color: rgb(102, 102, 102) transparent transparent rgb(102, 102, 102); /* #666 */
}
.icon-tag:after {
    left: .25em;
    border-color: rgb(102, 102, 102) rgb(102, 102, 102) transparent transparent; /* #666 */
}

/* Desktop */
.icon-desktop {
    position: absolute;
    top: 0;
    left: 0;
    width: .875em;
    height: .625em;
    border-width: .0625em;
    border-style: solid;
    border-color: rgb(102, 102, 102); /* #666 */
    background-color: rgb(249, 249, 249); /* #f9f9f9 */
    /* for browsers that supports */
    border-radius: .0625em;
}
.icon-desktop:before,
.icon-desktop:after {
    content: "";
    position: absolute;
    background-color: rgb(102, 102, 102); /* #666 */
}
.icon-desktop:before {
    top: .6875em;
    left: .3125em;
    width: .25em;
    height: .1875em;
}
.icon-desktop:after {
    top: .875em;
    left: .125em;
    width: .625em;
    height: .0625em;
}

/* Tablet */
.icon-tablet {
    position: absolute;
    top: .0625em;
    left: 0;
    width: .75em;
    height: .625em;
    border-width: .125em;
    border-style: solid;
    border-color: rgb(102, 102, 102); /* #666 */
    background-color: rgb(249, 249, 249); /* #f9f9f9 */
    /* for browsers that supports */
    border-radius: .0625em;
}
.icon-tablet:before {
    content: "";
    position: absolute;
    top: .28125em;
    left: -.09375em;
    width: .0625em;
    height: .0625em;
    background-color: rgb(255, 255, 255); /* #fff */
    /* for browsers that supports */
    border-radius: .0625em;
}

/* Phone */
.icon-phone {
    position: absolute;
    top: 0;
    left: .1875em;
    width: .5em;
    height: .75em;
    border-width: .125em .0625em;
    border-style: solid;
    border-color: rgb(102, 102, 102); /* #666 */
    background-color: rgb(249, 249, 249); /* #f9f9f9 */
    /* for browsers that supports */
    border-radius: .0625em;
}
.icon-phone:after {
    content: "";
    position: absolute;
    top: .78125em;
    left: .21875em;
    width: .0625em;
    height: .0625em;
    background-color: rgb(255, 255, 255); /* #fff */
    /* for browsers that supports */
    border-radius: .0625em;
}

/* Menu */
.icon-menu,
.icon-menu:before,
.icon-menu:after {
    position: absolute;
    left: 0;
    width: 1em;
    height: .25em;
    background-color: rgb(102, 102, 102); /* #666 */
}
.icon-menu {
    top: .0625em;
}
.icon-menu:before {
    content: "";
    top: .3125em;
}
.icon-menu:after {
    content: "";
    top: .625em;
}

/* Download  and Upload */
.icon-download,
.icon-upload {
    position: absolute;
    left: .375em;
    width: .25em;
    height: .5em;
    background-color: rgb(102, 102, 102); /* #666 */
}
.icon-download {
    top: 0;
}
.icon-upload {
    top: .25em;
}
.icon-download:before,
.icon-upload:before {
    content: "";
    position: absolute;
    left: -.125em;
    width: 0;
    height: 0;
    border-width: .25em;
    border-style: solid;
}
.icon-download:before {
    top: .5em;
    border-color: rgb(102, 102, 102) transparent transparent transparent; /* #666 */
}
.icon-upload:before {
    top: -.5em;
    border-color: transparent transparent rgb(102, 102, 102) transparent; /* #666 */
}
.icon-download:after,
.icon-upload:after {
    content: "";
    position: absolute;
    left: -.375em;
    width: .75em;
    height: .125em;
    border-width: 0 .125em .125em .125em;
    border-style: solid;
    border-color: rgb(102, 102, 102); /* #666 */
}
.icon-download:after {
    top: .75em;
}
.icon-upload:after {
    top: .5em;
}

/* Page Templates */
.icon-tpl-full,
.icon-tpl-side-r,
.icon-tpl-side-l {
    position: absolute;
    top: 0;
    left: 0;
    width: 1em;
    height: .25em;
    background-color: rgb(102, 102, 102);
}
.icon-tpl-full:after,
.icon-tpl-side-r:before,
.icon-tpl-side-r:after,
.icon-tpl-side-l:before,
.icon-tpl-side-l:after {
    content: "";
    position: absolute;
    top: .3125em;
    height: .6875em;
    background-color: rgb(102, 102, 102);
}
.icon-tpl-full:after,
.icon-tpl-side-r:before,
.icon-tpl-side-l:before {
    left: 0;
}
.icon-tpl-full:after {
    width: 1em;
}
.icon-tpl-side-r:before,
.icon-tpl-side-l:after {
    width: .6875em;
}
.icon-tpl-side-r:after,
.icon-tpl-side-l:before {
    width: .25em;
}
.icon-tpl-side-r:after {
    left: .75em;
}
.icon-tpl-side-l:after {
    left: .3125em;
}

/* Views */
/* List view */
.icon-list-view,
.icon-list-view:before,
.icon-list-view:after {
    position: absolute;
    width: .0625em;
    height: .25em;
    border-width: 0 .6875em 0 .25em;
    border-style: solid;
    border-color: rgb(102, 102, 102);
}
.icon-list-view {
    top: .0625em;
    left: 0;
}
.icon-list-view:before,
.icon-list-view:after {
    content: "";
    left: -.25em;
}
.icon-list-view:before {
    top: .3125em;
}
.icon-list-view:after {
    top: .625em;
}
/* Grid view */
.icon-grid-view,
.icon-grid-view:before {
    position: absolute;
    width: .0625em;
    height: .46875em;
    border-width: 0 .46875em;
    border-style: solid;
    border-color: rgb(102, 102, 102);
}
.icon-grid-view {
    top: 0;
    left: 0;
}
.icon-grid-view:before {
    content: "";
    top: .53125em;
    left: -.46875em;
}

/* Camera */
.icon-camera {
    position: absolute;
    top: .25em;
    left: 0;
    width: .75em;
    height: .5em;
    background-color: rgb(102, 102, 102); /* #666 */
}
.icon-camera:after {
    content: "";
    position: absolute;
    top: 0;
    left: .5em;
    width: 0;
    height: 0;
    border-width: .25em;
    border-style: solid;
    border-color: transparent rgb(102, 102, 102) transparent transparent; /* #666 */
}

/* Image */
.icon-image {
    position: absolute;
    top: .125em;
    left: 0;
    width: .875em;
    height: .625em;
    border-width: .0625em;
    border-style: solid;
    border-color: rgb(102, 102, 102); /* #666 */
    /* for browsers that supports */
    border-radius: .0625em;
}
.icon-image:before,
.icon-image:after {
    content: "";
    position: absolute;
    bottom: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-color: transparent transparent rgb(102, 102, 102) transparent; /* #666 */
}
.icon-image:before {
    left: 0;
    border-width: .25em .25em .125em .125em;
}
.icon-image:after {
    right: 0;
    border-width: .25em .25em .375em .375em;
}

/* Player controls */
/* Play */
.icon-play {
    position: absolute;
    top: 0;
    left: .1875em;
    width: 0;
    height: 0;
    border-width: .5em .625em;
    border-style: solid;
    border-color: transparent transparent transparent rgb(102, 102, 102); /* #666 */
}
/* Stop */
.icon-stop {
    position: absolute;
    top: .0625em;
    left: .0625em;
    width: .875em;
    height: .875em;
    background-color: rgb(102, 102, 102); /* #666 */
}
/* Pause */
.icon-pause,
.icon-pause:after {
    position: absolute;
    width: .25em;
    height: .875em;
    background-color: rgb(102, 102, 102); /* #666 */
}
.icon-pause {
    top: .0625em;
    left: .21875em;
}
.icon-pause:after {
    content: "";
    top: 0;
    left: .3125em;
}
/* Forward, Next, Rewind and Prev */
.icon-forward,
.icon-next,
.icon-rewind,
.icon-prev,
.icon-forward:after,
.icon-next:before,
.icon-rewind:after,
.icon-prev:before {
    position: absolute;
    width: 0;
    height: 0;
    border-width: .4375em;
    border-style: solid;
}
.icon-forward,
.icon-next,
.icon-rewind,
.icon-prev {
    top: .0625em;
}
.icon-forward:after,
.icon-next:before,
.icon-rewind:after,
.icon-prev:before,
.icon-next:after,
.icon-prev:after {
    content: "";
    top: -.4375em;
}
.icon-forward,
.icon-next,
.icon-forward:after,
.icon-next:before {
    border-color: transparent transparent transparent rgb(102, 102, 102); /* #666 */
}
.icon-rewind,
.icon-prev,
.icon-rewind:after,
.icon-prev:before {
    border-color: transparent rgb(102, 102, 102) transparent transparent; /* #666 */
}
.icon-forward {
    left: .0625em;
}
.icon-rewind {
    right: .0625em;
}
.icon-next,
.icon-forward:after,
.icon-next:before {
    left: 0;
}
.icon-prev,
.icon-rewind:after,
.icon-prev:before {
    right: 0;
}
.icon-next:after,
.icon-prev:after {
    position: absolute;
    width: .125em;
    height: .875em;
    background-color: rgb(102, 102, 102); /* #666 */
}
.icon-next:after {
    left: .4375em;
}
.icon-prev:after {
    right: .4375em;
}

/* Stats */
.icon-stats,
.icon-stats:before {
    position: absolute;
    width: .3125em;
    border-width: 0 .1875em;
    border-style: solid;
    border-color: rgb(102, 102, 102); /* #666 */
}
.icon-stats {
    top: 0;
    left: 0;
    height: .875em;
}
.icon-stats:before {
    content: "";
    top: .3125em;
    left: .0625em;
    height: .5625em;
}
.icon-stats:after {
    content: "";
    position: absolute;
    top: .875em;
    left: -.1875em;
    width: 1em;
    height: .125em;
    background-color: rgb(102, 102, 102); /* #666 */
}

/* Battery */
.icon-battery-empty,
.icon-battery-1_4,
.icon-battery-half,
.icon-battery-3_4,
.icon-battery-full {
    position: absolute;
    top: .25em;
    left: 0;
    width: .75em;
    height: .375em;
    border-width: .0625em;
    border-style: solid;
    border-color: rgb(102, 102, 102); /* #666 */
    background-color: rgb(249, 249, 249); /* #f9f9f9 */
}
.icon-battery-empty:after,
.icon-battery-1_4:after,
.icon-battery-half:after,
.icon-battery-3_4:after,
.icon-battery-full:after {
    content: "";
    position: absolute;
    top: .0625em;
    left: .8125em;
    width: .125em;
    height: .25em;
    background-color: rgb(102, 102, 102); /* #666 */
}
.icon-battery-1_4:before,
.icon-battery-half:before,
.icon-battery-3_4:before,
.icon-battery-full:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: .375em;
    background-color: rgb(153, 153, 153); /* #999 */
}
.icon-battery-1_4:before {
    width: .1875em;
}
.icon-battery-half:before {
    width: .375em;
}
.icon-battery-3_4:before {
    width: .5625em;
}
.icon-battery-full:before {
    width: .75em;
}

/* Sound */
.icon-sound-mute,
.icon-sound-normal,
.icon-sound-loud {
    position: absolute;
    top: .375em;
    left: .09375em;
    width: .25em;
    height: .25em;
    background-color: rgb(102, 102, 102);
}
.icon-sound-mute:before,
.icon-sound-normal:before,
.icon-sound-loud:before {
    content: "";
    position: absolute;
    top: -.3125em;
    left: -.3125em;
    width: .375em;
    height: .375em;
    border-width: .25em;
    border-style: solid;
    border-color: transparent rgb(102, 102, 102) transparent transparent;
}
.icon-sound-normal:after,
.icon-sound-loud:after {
    content: "";
    position: absolute;
    top: -.125em;
    left: .625em;
    width: .0625em;
    height: .53125em;
    border-style: solid;
    border-color: rgb(102, 102, 102);
}
.icon-sound-normal:after {
    border-width: 0 0 0 .0625em;
}
.icon-sound-loud:after {
    border-width: 0 .0625em;
}

时间: 2024-10-14 20:37:23

Web 在线文件管理器学习笔记与总结(2)显示文件列表(名称,类型,大小,可读,可写,可执行,创建时间,修改时间,访问时间)的相关文章

Web 在线文件管理器学习笔记与总结(19)上传文件

dir.func.php 中添加方法: /* 上传文件 */ function uploadFile($fileInfo,$path,$allowExt = array('jpg','jpeg','png','gif','txt'),$maxSize = 10487560){ //判断错误号 if($fileInfo['error'] == 0){ //文件是否是http上传上来的 if(is_uploaded_file($fileInfo['tmp_name'])){ $uniqid = md

Web 在线文件管理器学习笔记与总结(5)

① 读出要修改的文件的内容 ② 进行修改 ③ 将修改后的内容写进文件 index.php: <?php require 'dir.func.php'; require 'file.func.php'; require 'common.func.php'; $path = 'file'; $info = readDirectory($path); $act = @$_REQUEST['act']; $filename = @$_REQUEST['filename']; //跳转变量 $redire

Web 在线文件管理器学习笔记与总结(13)重命名文件夹(14)复制文件夹

(13)重命名文件夹 ① 重命名文件夹通过 rename($oldname,$newname) 实现 ② 检测文件夹名是否符合规范 ③ 检测当前目录中是否存在同名文件夹名称,如果不存在则重命名成功 index.php: <?php require 'dir.func.php'; require 'file.func.php'; require 'common.func.php'; $path = 'file'; $path = @$_REQUEST['path'][email protected

Web 在线文件管理器学习笔记与总结(11)获取文件夹信息 (12)返回上一级操作

(11)获取文件夹信息 文件夹没有修改操作. index.php: <?php require 'dir.func.php'; require 'file.func.php'; require 'common.func.php'; $path = 'file'; $path = @$_REQUEST['path'][email protected]$_REQUEST['path']:$path; $info = readDirectory($path); if($info == NULL){ e

Web 在线文件管理器学习笔记与总结(4)查看文件内容

② 查看文件内容 a.通过 file_get_contents($filename) 得到文件内容 b.通过 highlight_string($string) 或者 highlight_file($filename) 显示内容.使用 PHP 内置的语法高亮器所定义的颜色,打印输出或者返回输出或者返回语法高亮版本的 PHP 代码 当使用 file_get_contents 读取(php)文件的内容并且显示在页面上,可以使用 <textarea></textarea> 包裹输出的内容

Web 在线文件管理器学习笔记与总结(1)初始文件以及获取首层目录信息

在线文件管理器即使用浏览器管理和操作项目中的目录和文件 文件相关操作包括: 1.创建文件 2.判断文件的权限 3.文件的大小 4.文件的创建时间.修改时间.访问时间 5.查看文件的内容 6.修改文件的内容 7.删除文件 8.重命名文件 9.复制文件 10.剪切文件 11.上传文件 12.下载文件 文件夹相关操作: 1.新建文件夹 2.判断文件夹的权限 3.文件夹的大小 4.文件夹的创建时间.修改时间.访问时间 5.查看文件夹的内容 6.重命名文件夹 7.复制文件夹 8.剪切文件夹 9.文件夹的下

Web 在线文件管理器学习笔记与总结(3)创建文件

① 创建文件 a. 文件名的合法性:不能包含 \/:*"<>| 等特殊字符 b. 检测当前目录下是否存在同名文件,如果存在提示请重命名后创建,如果不存在则直接创建 index.php: <?php require 'dir.func.php'; require 'file.func.php'; require 'common.func.php'; $path = 'file'; $info = readDirectory($path); $act = @$_REQUEST['a

Web 在线文件管理器学习笔记与总结(6)jQuery UI 预览图片

① 查看文件内容,如果文件是图片类型,点击直接查看图片: ② 如果不是图片类型,显示文件中的内容: ③ 使用 jQuery UI 中的 Dialog 显示图片 a.引入: <script src="jquery-1.8.3.min.js"></script> <script src="jquery-ui-1.11.3/jquery-ui.min.js"></script> <link rel="styl

Web 在线文件管理器学习笔记与总结(10)查看文件夹中的内容

① 读取文件夹大小 a. 封装计算文件夹大小的函数 b.  打开文件夹 c. 循环判断文件夹下的内容是文件还是文件夹,如果是文件,则累积相加文件的大小:如果是文件夹,则递归调用该函数 注意两个问题: a. 在计算每个文件夹大小之前,应该清空变量 $size,否则文件夹大小会累加(index.php) <td><?php $size = 0; echo transByte(dirSize($p));?></td> b. 在计算文件夹大小的方法中,$size 应该设置为全局