SHARE
TWEET

Untitled

a guest Mar 25th, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. namespace ITS\base;
  2. use \Psr\Http\Message\ServerRequestInterface as Request;
  3. use \Psr\Http\Message\ResponseInterface as Response;
  4. use Slim\Http\UploadedFile;
  5.  
  6. class pictures {
  7.     private $pdo;
  8.     private $directory = "/uploads/pictures/assets/vehicles";
  9.     private $picture = null;
  10.     private $tableId;
  11.     public function __construct($pdo, $tableId){
  12.         $this->pdo = $pdo;
  13.         $this->tableId = $tableId;
  14.     }
  15.     public function preparePic(UploadedFile $uploadedFile){
  16.     // handle single input with single file upload
  17.     if ($uploadedFile->getError() === UPLOAD_ERR_OK) {
  18.             $this->picture = $uploadedFile;
  19.             $this->filename = "ITS-".time();
  20.        return $this->filename;
  21.     }
  22.     }
  23.     public function removePic(){}
  24.     public function commitPic($rowID){
  25.         $filename = moveUploadedFile($this->directory, $this->picture);
  26.         // write to Picture database
  27.        
  28.     }
  29.     public function getEmoji(){}
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top