mirror of
https://github.com/sctn4elk/CustomerRewardsRESTAPI.git
synced 2025-01-09 15:44:29 -06:00
Revert "More work and troubleshooting image upload"
This reverts commit 0a78c4fddc
.
This commit is contained in:
parent
0a78c4fddc
commit
0cecde088c
|
@ -1,11 +1,12 @@
|
|||
<?php
|
||||
header("Content-Type: application/json");
|
||||
define('PD', 'D:\DEV\Git Repository\CustomerRewardsRESTAPI');
|
||||
require_once PD . "/Model/CustomerModel.php";
|
||||
|
||||
/**
|
||||
* Description of CustomerController
|
||||
*
|
||||
* @author Mike Howard
|
||||
* @author SCTN4
|
||||
* http://localhost:8000/index.php/customer/process/insert?name=Mike%20Howard&email=sctn4elk@msn.com&phone=208-841-4159&birthday=05/07/1965&loyalty=1&city=Winnsboro&state=TX&zip=75494
|
||||
* http://localhost:8000/index.php/customer/process/select?limit=20
|
||||
*/
|
||||
|
|
|
@ -3,12 +3,13 @@ header("Content-Type: application/json");
|
|||
header("Access-Control-Allow-Origin: *");
|
||||
header("Access-Control-Allow-Methods: POST");
|
||||
|
||||
define('PD', 'D:\DEV\Git Repository\CustomerRewardsRESTAPI');
|
||||
require_once PD . "/Model/ImageModel.php";
|
||||
|
||||
/**
|
||||
* Description of ImageController
|
||||
*
|
||||
* @author Mike Howard
|
||||
* @author SCTN4
|
||||
*/
|
||||
class ImageController extends BaseController {
|
||||
|
||||
|
@ -71,13 +72,12 @@ class ImageController extends BaseController {
|
|||
}
|
||||
|
||||
/* Upload the image and store on server as file */
|
||||
private function uploadImage() {
|
||||
if ($this->checkRequestType('GET') == 'false') {
|
||||
private function uploadImage(){
|
||||
if ($this->checkRequestType('POST') == 'false') {
|
||||
return $this->unprocessableRequestResponse();
|
||||
}
|
||||
return var_dump(file_get_contents('php://input'));
|
||||
$this->imagePayload = file_get_contents($_FILES['image']['tmp_name']);
|
||||
|
||||
$this->imagePayload = file_get_contents($_FILES['image']['tmp_name']);
|
||||
$this->imageModel->fileName = $_FILES['image']['name'];
|
||||
if(empty($this->imageModel->fileName)){
|
||||
return $this->notFoundResponse();
|
||||
|
|
|
@ -8,7 +8,7 @@ header("Content-Type: application/json");
|
|||
/**
|
||||
* Description of PurchaseController
|
||||
*
|
||||
* @author Mike Howard
|
||||
* @author SCTN4
|
||||
*/
|
||||
class PurchaseController extends BaseController{
|
||||
/**
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
*/
|
||||
|
||||
define("PROJECT_ROOT_PATH", __DIR__ . "/../");
|
||||
//define('PD', 'D:\DEV\Git Repository\CustomerRewardsRESTAPI');
|
||||
define('PD', 'C:\DEV\UniServerZ\www\CustomerRewardsRESTAPI');
|
||||
// include main configuration file
|
||||
require_once PROJECT_ROOT_PATH . "/include/config.php";
|
||||
// include the base controller file
|
||||
require_once PROJECT_ROOT_PATH . "/Controller/Api/BaseController.php";
|
||||
// include the use model file
|
||||
//require_once PROJECT_ROOT_PATH . "/Model/CustomerModel.php";
|
||||
//require_once PROJECT_ROOT_PATH . "/Model/ImageModel.php";
|
||||
// include the tests autoloader when in development
|
||||
//require_once __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
|
|
|
@ -22,16 +22,14 @@
|
|||
* address_zip varchar(10)
|
||||
*/
|
||||
|
||||
define('PD', 'D:\DEV\Git Repository\CustomerRewardsRESTAPI');
|
||||
//require_once PROJECT_ROOT_PATH . "/Model/Database.php";
|
||||
require_once PD . "/Model/Database.php";
|
||||
require_once PD . "/Model/ModelTraits.php";
|
||||
|
||||
class CustomerModel extends Database {
|
||||
use ModelTraits;
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function findAllCustomers()
|
||||
{
|
||||
return $this->processQuery("SELECT * FROM customer_view ORDER BY customer_id ASC LIMIT ?", ["i", $this->limit]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Description of Database
|
||||
*
|
||||
* @author Mike Howard
|
||||
* @author SCTN4
|
||||
*/
|
||||
class Database {
|
||||
protected $connection = null;
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
* loyalty_value_blob blob
|
||||
*/
|
||||
|
||||
define('PD', 'D:\DEV\Git Repository\CustomerRewardsRESTAPI');
|
||||
require_once PD . "/Model/Database.php";
|
||||
require_once PD . "/Model/ModelTraits.php";
|
||||
|
||||
|
@ -29,7 +30,6 @@ class ImageModel extends Database {
|
|||
public $fileType;
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$this->uploadTo = "public/images/";
|
||||
$this->allowFileType = array('jpg','png','jpeg','gif');
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
/**
|
||||
* Description of ModelTraits
|
||||
*
|
||||
* @author Mike Howard
|
||||
* @author SCTN4
|
||||
*/
|
||||
trait ModelTraits {
|
||||
private $params = array();
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
/**
|
||||
* Description of PurchaseModel
|
||||
*
|
||||
* @author Mike Howard
|
||||
* @author SCTN4
|
||||
*/
|
||||
require_once PROJECT_ROOT_PATH . "/Model/Database.php";
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
auxiliary.org-netbeans-modules-php-smarty.smarty-framework=true
|
||||
browser.reload.on.save=true
|
||||
code.analysis.excludes=
|
||||
ignore.path=
|
||||
|
|
Loading…
Reference in New Issue
Block a user