Beispiel #1
0
 public function __construct($project)
 {
     $this->_project = $project;
     $this->_db = DataBaseFactory::connectDB();
     $this->_crypter = new Crypter();
     $this->_fileSystem = new SystemTree($project, $this->_db);
     $this->_currentFile = $this->_fileSystem->getRoot()->getID();
 }
Beispiel #2
0
 public function savingMoveFile()
 {
     $crypter = new Crypter();
     $source = $crypter->Decode($_POST['id']);
     $destination = $crypter->Decode($_POST['direction']);
     $type = $_POST['type'];
     $db = DataBaseFactory::connectDb();
     if ($type == "file") {
         $query = 'UPDATE `file` SET `parentDirectory`=:parent WHERE id=:id';
     } else {
         $query = 'UPDATE `directory` SET `parentDirectory`=:parent WHERE id=:id';
     }
     $exec = $db->prepare($query);
     $exec->bindValue('parent', $destination);
     $exec->bindValue('id', $source);
     $result = $exec->execute();
     if ($result) {
         echo 'Moving Success';
     } else {
         echo 'Moving Failed';
     }
 }
Beispiel #3
0
<?php

$_GRUNT_PATH = 1;
require_once '../GruntFileSystem.php';
$crypter = new Crypter();
$source = $crypter->Decode($_POST['id']);
$destination = $crypter->Decode($_POST['direction']);
$type = $_POST['type'];
$db = DataBaseFactory::connectDb();
if ($type == "file") {
    $query = 'UPDATE `file` SET `parentDirectory`=:parent WHERE id=:id';
} else {
    $query = 'UPDATE `directory` SET `parentDirectory`=:parent WHERE id=:id';
}
$exec = $db->prepare($query);
$exec->bindValue('parent', $destination);
$exec->bindValue('id', $source);
$result = $exec->execute();
if ($result) {
    echo 'Moving Success';
} else {
    echo 'Moving Failed';
}