@extends('layout')

@section('title')File - {{$path}}@stop

@section('content')
    <h1>{{$path}}</h1>
    <?php
	    $dir = base_path() . "/query/" . $path;
        $files = scandir($dir);
        $out = "";
        if ($path != "")
            if(strpos($path, "/"))
                $out .= "<a href=\"" . substr($path, 0, strrpos($path, "/")) . "\">..</a><br />";
            else
                $out .= "<a href=\"/lists/src\">..</a><br />";
        foreach ($files as $file)
        {
            if ($file != "." AND $file != "..") {
                if (strpos($file, "."))
                    $out .= "<a href=\"" . $path . "/" . substr($file, 0, strpos($file, ".")) . "\">" . $file . "</a><br />";
                else
                    $out .= "<a href=\"/lists/src/" . $path . "/" . $file . "\">" . $file . "</a><br />";
                break;
            }
        }
        echo $out;
    ?>

@stop

@extends('layout')

@section('title')Folder - {{$path}}@stop

@section('content')
    <h1>{{$path}}</h1>
    <?php
        if (strpos($path, "/")) {
            if(strpos($path, "/")) 
                $url = "/lists/" . substr($path, 0, strrpos($path, "/"));
            else
                $url = "/lists";
            echo "<a href=\"" . $url . "\">..</a><br />";
        }

        $files = scandir(base_path() . "/query/" . $path);
        foreach ($files as $file)
        {
            if ($file != "." AND $file != "..") {
                if (strpos($file, "."))
                    $url = "/lists/" . $path . "/" . substr($file, 0, strpos($file, "."));
                else
                    $url = "/lists/" . $path . "/" . $file;
				echo "<a href=\"" . $url . "\">" . $file . "</a><br />";
            }
        }
    ?>

@stop

Improve codestyle and fix all links, since some did not work as expected
Improve codestyle and fix all links, since some did not work as expected
