Work on member image

This commit is contained in:
sctn4elk 2024-05-30 10:42:53 -05:00
parent 49dd152914
commit 12384fc2d6
3 changed files with 19 additions and 8 deletions

View File

@ -40,13 +40,16 @@ class ImageController extends BaseController {
break;
case "update":
$response = $this->updateImage();
$response = $this->updateImage();
break;
case "delete":
$response = $this->deleteImage();
$response = $this->deleteImage();
break;
case "blob":
$response = $this->blobImage();
break;
default:
$response = (object) ['Result' => 'Default'];
$this->strErrorDesc = 'Controller Method not supported for processAction: ' . $this->action;
@ -156,7 +159,7 @@ class ImageController extends BaseController {
private function handleImage() {
$moved = false;
if(move_uploaded_file($this->imageModel->tempPath, $this->imageModel->uploadTo . $this->imageModel->memberId)) {
if(move_uploaded_file($this->imageModel->tempPath, $this->imageModel->uploadTo . $this->imageModel->memberId . '.' . $this->imageModel->fileType)) {
$moved = true;
}
return $moved;
@ -216,6 +219,14 @@ class ImageController extends BaseController {
return $this->unprocessableRequestResponse("deleteImage is not implemented");
}
private function blobImage(){
if ($this->checkRequestType('GET') == 'false') {
return $this->unprocessableRequestResponse("Request type is not GET");
}
return $this->unprocessableRequestResponse("updateImage is not implemented");
}
private function validateImage(){
$validtion = false;
if(in_array($this->imageModel->fileType, $this->imageModel->allowFileType)){

View File

@ -73,11 +73,6 @@ class Database {
public function processImage($query, $imageModel) {
try
{
/*if($this->connection == null)
{
$this->connection = new mysqli(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_DATABASE_NAME);
}*/
$data = $this->connection->real_escape_string($imageModel->imageBlob);
$result = $this->connection->query($query."(".$imageModel->memberId.", '".$imageModel->imageType."', '".$data."')");

View File

@ -69,4 +69,9 @@ class ImageModel extends Database {
FROM toast_schema.loyalty_value_blob
ORDER BY loyalty_member_id ASC LIMIT ?", ["i", $this->limit]);
}
public function returnImageBlob()
{
}
}