Example #1
0
<?php

require_once "conf/top.php";
//$user = new User($_SESSION['user_session']);
include_once 'models/class.Folder.php';
include_once 'models/class.Doc.php';
$doc = new Doc();
$folder_cur = null;
if (isset($_REQUEST['id'])) {
    $id = $_REQUEST['id'];
    $folder = new Folder($_REQUEST['id']);
    $folder_cur = $folder->folder();
    $doc_list = $doc->list_doc_folder($id);
} else {
    $folder = new Folder();
    $doc_list = $doc->getAll($userid);
}
$folder_list = $folder->ListUserFolder($userid);
if (isset($_REQUEST['dossier'])) {
    $dossier = $_REQUEST['dossier'];
    $folder->new_folder($dossier, $userid);
    $session->refresh();
}
if (isset($_REQUEST['upload']) && $_FILES['userfile']['size'] > 0) {
    if (isset($_REQUEST['folder_id']) && isset($_FILES['userfile']['name']) && isset($_FILES['userfile']['tmp_name']) && isset($_FILES['userfile']['type'])) {
        $db = Database::getInstance();
        $folder_id = $_REQUEST['folder_id'];
        $fileName = $_FILES['userfile']['name'];
        $tmpName = $_FILES['userfile']['tmp_name'];
        $fileSize = $_FILES['userfile']['size'];
        $fileType = $_FILES['userfile']['type'];