List

Try: ca/tecreations/ViewFile.php -- Online


<?php

//die($_SERVER['DOCUMENT_ROOT']);
    require_once $_SERVER['DOCUMENT_ROOT'] . "/tec_SiteRoot.php";

    include_once $DOCROOT . $TEC_PREFIX_DIR . "html_start.php";
?>
    <link rel="stylesheet" type="text/css" href="/ca/tecreations/style.css">
    </head>
    <body> 
        <?php
            include_once $DOCROOT . $TEC_PREFIX_DIR . "html_brand_menu_start.php";
            include_once $DOCROOT . $TEC_PREFIX_DIR . "menu/menuRoot.php";
            include_once $DOCROOT . $TEC_PREFIX_DIR . "html_brand_menu_stop.php";
        ?>
    <div class="padded">
        <?php
            $subPath = substr(getcwd(),STRLEN($DOCROOT));
            $files = scandir(getcwd(),SCANDIR_SORT_ASCENDING);
            for($i = 0; $i < count($files); $i++) {
                if (!isDot($files[$i]) && !isDotDot($files[$i])) {
                    if (isTextFile($files[$i])) {
                        print("<p><a href='/" . $TEC_PREFIX_DIR . "ViewFile.php?path=$subPath/$files[$i]'>$files[$i]</a>" .
                              "&nbsp;--&nbsp;<a href='" . $files[$i] . "'>View Online</a></p>\n"
                        );
                    } else if (isImage($DOCROOT . $subPath . "/" . $files[$i])) {
                        print("<p><a href='$files[$i]'>$files[$i]</a></p>\n");
                    } else {
                        print("<p><a href='$files[$i]'>$files[$i]</a></p>\n");
                    }
                }
            }
        ?>
    </div>
<?php
    require_once $DOCROOT . $TEC_PREFIX_DIR . "footer.php";