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,61 @@
<?php
/**
* Created by Pensare Software.
* User: Theo Weijmer
* Date: 10/01/2018
* Time: 14:20
*/
class CommentsController 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 getComments( $foreignID, $tablename )
{
$comments = Comment::getComments( $foreignID, $tablename );
$this->json( $comments );
}
public function getComment( $commentID )
{
$comment = Comment::find( $commentID );
$comment->comment = base64_decode( $comment->comment );
$this->json( $comment );
}
public function addComment( $foreignID, $tablename )
{
$commentID = Comment::addComment( $foreignID, $tablename );
$this->json( $commentID );
}
public function saveComment( $commentID )
{
$comment = $this->input->post( 'comment' );
$comment = base64_encode( $comment );
Comment::whereId( $commentID )->update( ['comment' => $comment] );
}
}