Ejemplo n.º 1
0
 public function tr_td($bookdir)
 {
     $BOOKDIR = $bookdir;
     //"books/c";
     $ud = new Ureaddir();
     $arr = $ud->readdir2arr($BOOKDIR);
     foreach ($arr[0] as $dir) {
         echo "<tr>";
         echo "<td><a href='book_statistic.php?book=" . $BOOKDIR . $dir . "'>" . $dir . "</a></td>\r\n";
         //////////////////////
         echo "<td>";
         $udf = new Ureaddir();
         $udf->readdir2arr_RecursFiles($BOOKDIR . $dir);
         foreach ($udf->dirFiles as $fname) {
             echo "<a href='" . $fname . "'>" . basename($fname) . "</a><br>\r\n";
         }
         echo "</td>";
         ///////////////////////
         echo "<td>";
         //echo $BOOKDIR.$dir;
         echo $_REQUEST["keyword"];
         echo ChineseCharacterStatistic::FindStatisticFromFile($BOOKDIR . $dir, $_REQUEST["keyword"]);
         echo "</td>";
     }
 }
function select($selid)
{
    $ur = new Ureaddir();
    $dir = "/tmp";
    $files = $ur->readdir2arr($dir);
    $stafiles = array();
    foreach ($files[1] as $file) {
        if (preg_match("/^xyz/i", $file) == 0) {
            continue;
        }
        $stafiles[] = $file;
        //print("<a href='$file'>$file</a><br>\r\n");
    }
    //print_r($_SESSION);
    $idsel = "sel_{$selid}";
    print "<select id='{$idsel}'  name='{$idsel}'>";
    foreach ($stafiles as $file) {
        $selected = "";
        if ($_SESSION[$idsel] == $file) {
            $selected = "selected";
        }
        printf("<option value='%s' {$selected}>%s</option>\r\n", $file, $file);
    }
    print "</select>";
}
Ejemplo n.º 3
0
 public function loadDir($dir)
 {
     $ud = new Ureaddir();
     $arr = $ud->readdir2arr($dir);
     $this->loadFilesArr($arr[1]);
     //1:file array
     $this->dir = $dir;
     $this->Calc();
     arsort($this->cat);
 }
Ejemplo n.º 4
0
<?php

require_once "../uti/Ureaddir.php";
$ur = new Ureaddir();
$files = $ur->readdir2arr("./");
foreach ($files[1] as $file) {
    print "<a href='{$file}'>{$file}</a><br>\r\n";
}