Warning: Undefined array key "HTTPS" in /var/www/sumscool.ca/html/SiteRoot.php on line 21
Hits: 644

List

Try: /ViewFile.php?path=ViewFile.php -- Online


<?php

//die($_SERVER['DOCUMENT_ROOT']);
 
    global $DB_DEBUG;
    $DB_DEBUG = false;

    if ($_SERVER['DOCUMENT_ROOT'] == "") { 
        require_once "/var/www/sumscool.ca/html/SiteRoot.php";
    } else {
        require_once $_SERVER['DOCUMENT_ROOT'] . "/SiteRoot.php";
    }

    //die("DR: '" . $DOCROOT . "'");
    include_once $DOCROOT . $SUMSCOOL_PREFIX_SUBPATH . "html_start.php";
?>
    <link rel="stylesheet" type="text/css" href="/ca/tecreations/style.css">
    </head>
    <body> 
        <?php
            include_once $DOCROOT . $SUMSCOOL_PREFIX_SUBPATH . "html_brand_menu_start.php";
            include_once $DOCROOT . $SUMSCOOL_PREFIX_SUBPATH . "menu/menuRoot.php";
            include_once $DOCROOT . $SUMSCOOL_PREFIX_SUBPATH . "html_brand_menu_stop.php";
        ?>
    <div class="padded">
        <?php
            global $DOCROOT, $dirs, $filesList;
            $dirs = array();
            $filesList = array();
            $subPath = substr(getcwd(),strlen($DOCROOT)) . "/";
            $files = scandir(getcwd(),SCANDIR_SORT_ASCENDING);
            for($i = 0; $i < count($files); $i++) {
                if (!isDot($files[$i])) {
                    if (isDotDot($files[$i])) {
                        if (strcmp($subPath,"/") != 0) {
                             array_push($dirs,"<p><a href='/$subPath" . $files[$i] . "'>Parent</a> : " . getTimsLastModified($files[$i]) . "</p>\n");
                        }
                    } else if (is_dir($files[$i])) {
                       array_push($dirs,"<p><a href='/" . $files[$i] . "'>" . $files[$i] . "/</a> : " . getTimsLastModified($files[$i]) . "</p>\n");
                    } else if (isTextFile($files[$i])) {
                        if (strcmp($subPath,"/") != 0) {
                            $path = "/ViewFile.php?path=$files[$i]";
                        } else {
                            if (!endsWith($subPath,"/")) $subPath .= "/";
                            $target = $subPath . $files[$i];
                            while (startsWith($target,"/")) {
                                $target = substr($target,1);
                            }
                            $path = "/ViewFile.php?path=$target";
                        }
                        if (strcmp($files[$i],"List.php") == 0) {
                             array_push($filesList,"<p><a href='$path'>$files[$i]</a>&nbsp;--&nbsp;Current Page</a> : " . getFileSize($files[$i]) . " : " . getTimsLastModified($files[$i]) . "</p>\n");
                        } else {
                             array_push($filesList,"<p><a href='$path'>$files[$i]</a>&nbsp;--&nbsp;<a href='" . $files[$i] . "'>View Online</a> : " . getFileSize($files[$i]) . " : " . getTimsLastModified($files[$i]) . "</p>\n");
                        }
                    } else if (isImage($DOCROOT . $subPath . "/" . $files[$i])) {
                        array_push($filesList,"<p><a href='$files[$i]'>$files[$i]</a> : " . getFileSize($files[$i]) . " : " . getTimsLastModified($files[$i]) . "</p>\n");
                    } else {
                        array_push($filesList,"<p><a href='$files[$i]'>$files[$i]</a> : " . getFileSize($files[$i]) . " : " . getTimsLastModified($files[$i]) . "</p>\n");
                    }
                }
            }
            for($i = 0; $i < count($dirs); $i++) {
                print($dirs[$i]);
            }
            for($i = 0; $i < count($filesList); $i++) {
                print($filesList[$i]);
            }
        ?>
    </div>
<?php
    $footer = $DOCROOT . $SUMSCOOL_PREFIX_SUBPATH . "footer.php";
    if (is_file($footer)) {
        require_once $footer;
    }