diff --git a/Controller/API/CustomerController.php b/Controller/API/CustomerController.php index 2a124e5..0fb8c5e 100644 --- a/Controller/API/CustomerController.php +++ b/Controller/API/CustomerController.php @@ -1,12 +1,11 @@ checkRequestType('POST') == 'false') { + private function uploadImage() { + if ($this->checkRequestType('GET') == 'false') { return $this->unprocessableRequestResponse(); } - + return var_dump(file_get_contents('php://input')); $this->imagePayload = file_get_contents($_FILES['image']['tmp_name']); + $this->imageModel->fileName = $_FILES['image']['name']; if(empty($this->imageModel->fileName)){ return $this->notFoundResponse(); diff --git a/Controller/API/PurchaseController.php b/Controller/API/PurchaseController.php index 7124f6c..91ac74c 100644 --- a/Controller/API/PurchaseController.php +++ b/Controller/API/PurchaseController.php @@ -8,7 +8,7 @@ header("Content-Type: application/json"); /** * Description of PurchaseController * - * @author SCTN4 + * @author Mike Howard */ class PurchaseController extends BaseController{ /** diff --git a/Include/bootstrap.php b/Include/bootstrap.php index c70be54..fa44429 100644 --- a/Include/bootstrap.php +++ b/Include/bootstrap.php @@ -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'; + diff --git a/Model/CustomerModel.php b/Model/CustomerModel.php index fa03b56..66c384c 100644 --- a/Model/CustomerModel.php +++ b/Model/CustomerModel.php @@ -11,25 +11,27 @@ * customer_email varchar(255) * customer_phone varchar(12) * customer_birthday datetime - * customer_street varchar(255) + * customer_street varchar(255) * address_code_id bigint * loyalty_member tinyint * - * address_code + * address_code * address_code_id bigint AI PK * address_city varchar(45) * address_state varchar(45) * 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]); diff --git a/Model/Database.php b/Model/Database.php index a807a3c..faff114 100644 --- a/Model/Database.php +++ b/Model/Database.php @@ -2,7 +2,7 @@ /** * Description of Database * - * @author SCTN4 + * @author Mike Howard */ class Database { protected $connection = null; diff --git a/Model/ImageModel.php b/Model/ImageModel.php index 0035bd2..877c5ca 100644 --- a/Model/ImageModel.php +++ b/Model/ImageModel.php @@ -14,7 +14,6 @@ * loyalty_value_blob blob */ -define('PD', 'D:\DEV\Git Repository\CustomerRewardsRESTAPI'); require_once PD . "/Model/Database.php"; require_once PD . "/Model/ModelTraits.php"; @@ -30,6 +29,7 @@ class ImageModel extends Database { public $fileType; function __construct() { + parent::__construct(); $this->uploadTo = "public/images/"; $this->allowFileType = array('jpg','png','jpeg','gif'); } diff --git a/Model/ModelTraits.php b/Model/ModelTraits.php index 8a48042..89f0402 100644 --- a/Model/ModelTraits.php +++ b/Model/ModelTraits.php @@ -3,7 +3,7 @@ /** * Description of ModelTraits * - * @author SCTN4 + * @author Mike Howard */ trait ModelTraits { private $params = array(); diff --git a/Model/PurchaseModel.php b/Model/PurchaseModel.php index 1ce2ad7..49097b5 100644 --- a/Model/PurchaseModel.php +++ b/Model/PurchaseModel.php @@ -8,7 +8,7 @@ /** * Description of PurchaseModel * - * @author SCTN4 + * @author Mike Howard */ require_once PROJECT_ROOT_PATH . "/Model/Database.php"; diff --git a/nbproject/project.properties b/nbproject/project.properties index ff962db..bb05833 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -1,3 +1,4 @@ +auxiliary.org-netbeans-modules-php-smarty.smarty-framework=true browser.reload.on.save=true code.analysis.excludes= ignore.path=