Commit aff19396 by opal007

Merge branch 'integration' into opal007

parents 9d892594 9765bb8e
...@@ -105,7 +105,7 @@ class UserProfilesController extends AppController { ...@@ -105,7 +105,7 @@ class UserProfilesController extends AppController {
if ($this->request->is(['patch', 'post', 'put'])) { if ($this->request->is(['patch', 'post', 'put'])) {
// debug($this->request->data); // debug($this->request->data);
// exit; // exit;
$data = $this->request->data; #pr($data); $data = $this->request->data; //pr($data);
list($data['UserPersonals']['firstname_th'], $data['UserPersonals']['lastname_th']) = explode(' ', $data['UserPersonals']['fullname']); list($data['UserPersonals']['firstname_th'], $data['UserPersonals']['lastname_th']) = explode(' ', $data['UserPersonals']['fullname']);
unset($data['UserPersonals']['fullname']); unset($data['UserPersonals']['fullname']);
$data['UserPersonals']['birthdate'] = ''; $data['UserPersonals']['birthdate'] = '';
...@@ -117,8 +117,8 @@ class UserProfilesController extends AppController { ...@@ -117,8 +117,8 @@ class UserProfilesController extends AppController {
$data['UserProfiles'][1]['user_id'] = $data['Users']['user_id']; $data['UserProfiles'][1]['user_id'] = $data['Users']['user_id'];
$data['UserProfiles'][1]['user_type_id'] = 2; $data['UserProfiles'][1]['user_type_id'] = 2;
$data['UserProfiles'][1]['modified_by'] = ''; $data['UserProfiles'][1]['modified_by'] = '';
debug($data); // debug($data);
exit; // exit;
#$api_update_profile = 'http://connect06.pakgon.com/api/Connects/Profile/updateProfile'; #$api_update_profile = 'http://connect06.pakgon.com/api/Connects/Profile/updateProfile';
$api_update_profile = Configure::read('Config.apiCore.profile') . '/updateProfile'; $api_update_profile = Configure::read('Config.apiCore.profile') . '/updateProfile';
$http = new Client(); $http = new Client();
...@@ -132,10 +132,10 @@ class UserProfilesController extends AppController { ...@@ -132,10 +132,10 @@ class UserProfilesController extends AppController {
]; ];
#prr($options); #prr($options);
$response = $http->post($api_update_profile, $data, $options)->body(); $response = $http->post($api_update_profile, $data, $options)->body();
pr($response); // pr($response);
$response = json_decode($response, '_full'); $response = json_decode($response, '_full');
pr($response); // pr($response);
die; // die;
} }
// $organization = $this->UserProfiles->MasterOrganizations->find('list')->select(['MasterOrganizations.id', 'MasterOrganizations.org_name_th'])->where(['master_organization_type_id' => 1]); // $organization = $this->UserProfiles->MasterOrganizations->find('list')->select(['MasterOrganizations.id', 'MasterOrganizations.org_name_th'])->where(['master_organization_type_id' => 1]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment