offer fileupload and comments

This commit is contained in:
2018-01-10 21:09:08 +01:00
parent 6366bbc6a8
commit 665242eb4a
270 changed files with 35840 additions and 17 deletions
@@ -0,0 +1,71 @@
<?php
defined( 'BASEPATH' ) OR exit( 'No direct script access allowed' );
/**
* Created by Pensare Software.
* User: Theo Weijmer
* Date: 05/01/2018
* Time: 15:03
*/
class ProjectsController extends MY_Controller {
public function __construct()
{
parent::__construct();
if ( AUTHENTICATED == FALSE ) die( 'NO ACCESS' );
$models = [];
$libraries = [];
$this->load->model( $models );
$this->load->library( $libraries );
}
public function index()
{
}
public function getAllProjects( $archive = 'F' )
{
$projects = Project::getAllProjects( $archive );
$this->json( $projects );
}
public function saveProject()
{
$projectValidation = new ProjectValidation();
if ( ! $projectValidation->getValidationResult() )
return $this->json( [
'success' => FALSE, 'messages' => $projectValidation->getErrorMessages()] );
$project = $this->input->post();
$projectID = $project['id'];
unset( $project['id'] );
$projectID = Project::saveProject( $projectID, $project );
$this->json( ['success' => TRUE, 'projectID' => $projectID] );
}
public function archiveProject( $projectID, $status )
{
Project::whereId( $projectID )->update( ['archive' => $status] );
}
public function removeProject( $projectID )
{
$removeProject = new RemoveProject( $projectID );
if ( $removeProject->getAllowDelete() === FALSE ) return $this->json( ['result' => FALSE] );
Project::removeProject( $projectID );
$this->json( ['result' => TRUE] );
}
}