excel D
This commit is contained in:
parent
1eccc4a897
commit
5d1da58270
|
@ -6,27 +6,55 @@ class FilelistController extends Zend_Controller_Action {
|
||||||
$adapter=$filelist->getAdapter();
|
$adapter=$filelist->getAdapter();
|
||||||
$db=$adapter->query("select file_name,file_path,id,meta_uuid from westdc_fileinfo where meta_uuid='$uuid' order by id");
|
$db=$adapter->query("select file_name,file_path,id,meta_uuid from westdc_fileinfo where meta_uuid='$uuid' order by id");
|
||||||
$files=$db->fetchAll();
|
$files=$db->fetchAll();
|
||||||
$documents=array();
|
$documents=array();
|
||||||
$i=0;
|
$i=0;
|
||||||
foreach($files as $file){
|
foreach($files as $file) {
|
||||||
$fileName = $file['file_name'];
|
$fileName=$file['file_name'];
|
||||||
$filePath = $file['file_path'];
|
if($fileName!=='/uuid.txt') {
|
||||||
$id = $file['id'];
|
$pathArray=explode("/",$fileName);
|
||||||
if($fileName!=='/uuid.txt'){
|
if(empty($pathArray[2])) {
|
||||||
$pathArray = explode("/",$fileName);
|
$documents[$i] = $file;
|
||||||
if(substr($fileName,-1)=='/'&&empty($pathArray[2])){
|
$i++;
|
||||||
$documents[$i] = $file;
|
}
|
||||||
$i++;
|
|
||||||
}else{
|
|
||||||
if(empty($pathArray[2])){
|
|
||||||
$documents[$i]=$file;
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->_helper->layout()->disableLayout();
|
$this->_helper->layout()->disableLayout();
|
||||||
$this->_helper->viewRenderer->setNoRender();
|
$this->_helper->viewRenderer->setNoRender();
|
||||||
echo Zend_Json::encode($documents);
|
echo Zend_Json::encode($documents);
|
||||||
}
|
}
|
||||||
|
function subAction() {
|
||||||
|
$uuid=$this->_request->getParam('uuid');
|
||||||
|
$getUrl=$this->_request->getParam('subpath');
|
||||||
|
$subPath=urldecode($getUrl);
|
||||||
|
$filelist=new FilelistTable();
|
||||||
|
$adapter=$filelist->getAdapter();
|
||||||
|
$db=$adapter->query("select file_name,file_path,id,meta_uuid from westdc_fileinfo where meta_uuid='$uuid' order by id");
|
||||||
|
$files=$db->fetchAll();
|
||||||
|
$documents=array();
|
||||||
|
$i=0;
|
||||||
|
foreach($files as $subFile) {
|
||||||
|
if(substr($subFile['file_name'], 0,strlen($subPath))==$subPath) {// start with "/a/"
|
||||||
|
$subFilePath=str_replace($subPath, '', $subFile['file_name']);
|
||||||
|
if(!empty($subFilePath)) {
|
||||||
|
$pos = strpos($subFilePath, '/');
|
||||||
|
$pathArray=explode("/",$subFilePath);
|
||||||
|
|
||||||
|
if(empty($pathArray[1])) {
|
||||||
|
$documents[$i] = $subFile;
|
||||||
|
if ($pos === false) {
|
||||||
|
$documents[$i]['file_name']=$subPath.$pathArray[0];
|
||||||
|
} else {
|
||||||
|
$documents[$i]['file_name']=$subPath.$pathArray[0].'/';
|
||||||
|
}
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->_helper->layout()->disableLayout();
|
||||||
|
$this->_helper->viewRenderer->setNoRender();
|
||||||
|
echo Zend_Json::encode($documents);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue