Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.88 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement