2024-05-09 16:40:42 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
|
|
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Scripting/PHPClass.php to edit this template
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Description of ImageModel
|
|
|
|
*
|
|
|
|
* @author SCTN4
|
|
|
|
*/
|
|
|
|
class ImageModel extends Database {
|
2024-05-09 20:25:56 -05:00
|
|
|
use ModelTraits;
|
2024-05-09 16:40:42 -05:00
|
|
|
|
2024-05-09 20:25:56 -05:00
|
|
|
public function insertImage($inputModel)
|
2024-05-09 16:40:42 -05:00
|
|
|
{
|
2024-05-09 20:25:56 -05:00
|
|
|
// table name for admin profiles
|
|
|
|
$query = "INSERT INTO " . $this->imageTable;
|
|
|
|
$query .= " (filename, filepath) VALUES (?,?)";
|
|
|
|
|
|
|
|
}
|
2024-05-09 16:40:42 -05:00
|
|
|
|
2024-05-09 20:25:56 -05:00
|
|
|
$data = [
|
|
|
|
'Errormsg' => $uploadImage['msg'] ?? '',
|
|
|
|
'success' => $success
|
|
|
|
];
|
2024-05-09 16:40:42 -05:00
|
|
|
|
2024-05-09 20:25:56 -05:00
|
|
|
return json_encode($data);
|
|
|
|
|
|
|
|
//return var_dump($jsonPayLoad);
|
|
|
|
$keys = array_keys($inputModel);
|
|
|
|
$n = count($keys);
|
|
|
|
|
|
|
|
$query .= "CALL insert_new_customer_proc (";
|
|
|
|
for($i = 0; $i < $n-1; $i++) {
|
|
|
|
$query .= "'" . $inputModel[$keys[$i]] . "', ";
|
|
|
|
}
|
|
|
|
$query .= $inputModel[$keys[$i]] . ")";
|
|
|
|
//return var_dump($query);
|
|
|
|
|
|
|
|
$rowCount = $this->processImage($query);
|
|
|
|
return $rowCount;
|
2024-05-09 16:40:42 -05:00
|
|
|
}
|
|
|
|
}
|