From 7a6e01e562cbbebbe0fc539f27d155e48904b1d8 Mon Sep 17 00:00:00 2001 From: velz Date: Fri, 5 Oct 2018 14:36:19 +0530 Subject: [PATCH] DB CHANGES --- api/application/config/constants.php | 2 +- api/application/config/database.php | 8 ++++---- .../controllers/Common_Masters_Controller.php | 11 ++++------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/api/application/config/constants.php b/api/application/config/constants.php index dc1721a2..e00b0b36 100644 --- a/api/application/config/constants.php +++ b/api/application/config/constants.php @@ -86,7 +86,7 @@ defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest auto // define login route name for token verification //defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', '(listLessPDDetails/:any)'); // no errors -defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', 'getListOfPDAllocationTypes'); // no errors +defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', 'saveCompany'); // no errors /*********************AWS resources Constants*************************************************/ defined('PROFILE_PICTURE_BUCKET_NAME') OR define('PROFILE_PICTURE_BUCKET_NAME','sineedgedevprofilepic'); diff --git a/api/application/config/database.php b/api/application/config/database.php index b565b49d..4fe59f5e 100644 --- a/api/application/config/database.php +++ b/api/application/config/database.php @@ -100,10 +100,10 @@ $db['dev'] = array( $db['test'] = array( 'dsn' => '', - 'hostname' => 'apollodec.com', - 'username' => 'apollod4_DEV', - 'password' => 'apollo1234', - 'database' => 'apollod4_ApolloDECDev', + 'hostname' => 'sine-edge-dev.cya6cheplup2.ap-south-1.rds.amazonaws.com', + 'username' => 'asparqdev_mas001', + 'password' => 'sparqvenba', + 'database' => 'sine_edge_test', 'dbdriver' => 'mysqli', 'dbprefix' => '', 'pconnect' => FALSE, diff --git a/api/application/controllers/Common_Masters_Controller.php b/api/application/controllers/Common_Masters_Controller.php index b624edc0..b3a6b8ff 100644 --- a/api/application/controllers/Common_Masters_Controller.php +++ b/api/application/controllers/Common_Masters_Controller.php @@ -538,16 +538,15 @@ class Common_Masters_Controller extends REST_Controller { * Company File Upload */ public function saveCompany_post(){ - //echo "function in"; + $records = json_decode($this->post('records'),true); - if(!empty($_FILES['logo']['tmp_name'])) { $logo = $_FILES['logo']['tmp_name']; $logoname = $_FILES['logo']['name']; $logoname = strtolower($logoname); - $logos3path = ""; + //$logos3path = ""; $logos3path = 'sineedge/'.$logoname; $bucketname = PROFILE_PICTURE_BUCKET_NAME; $key = $logos3path; @@ -555,7 +554,7 @@ class Common_Masters_Controller extends REST_Controller { $bucket_data = array('bucket_name'=>$bucketname,'key'=>$key,'sourcefile'=>$sourcefile); $s3result= $this->aws_s3->uploadFileToS3Bucket($bucket_data); - + print_r($s3result); if(is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200) { $records['logo'] = $logoname; @@ -571,11 +570,9 @@ class Common_Masters_Controller extends REST_Controller { } - - $result = $this->Common_Masters_Model->saveRecords($records,COMPANY); - if(count($result) > 0) + if($result != "" || $result != null) { $data['dataStatus'] = true; $data['status'] = REST_Controller::HTTP_OK;