<?php
$t=0;//echo APP_DIR;
    $filepath = $_GET['loc'];
    foreach (glob(APP_DIR."/CONTENT/ROOT_URI/".$filepath."/*") as $filename)  
//    echo   
    {
        $filename =explode('/', $filename);
        $filename =end($filename);
        $ret->fname[$t]=$filename;
        $t++;
    }
    if($t<1){
        $ret->msg="No files found";
    }
    else $ret->status="y";

    echo json_encode($ret);
?>