Commit b1632bdb by Prasong Putichanchai

update card

parent 5f361851
......@@ -103,13 +103,13 @@ class ProfilesController extends AppController
$userPersonals['master_province_id'] = $this->request->data['master_province_id'];
$userPersonals['modified_by'] = $id;
if ($this->UserPersonals->save($userPersonals)) {
$this->Flash->success(__('Update Complete.'));
return $this->redirect(['action' => 'index']);
}
}else{
$this->Flash->error(__('Email Address already used by others.'));
if ($this->UserPersonals->save($userPersonals)) {
$this->Flash->success(__('Update Complete.'));
return $this->redirect(['action' => 'index']);
}
}else{
$this->Flash->error(__('Email Address already used by others.'));
}
$this->Flash->error(__('Not update. Please, try again.'));
}
$this->set(compact('userPersonals', 'responseUserProfile', 'dateNow', 'username', 'Country', 'Province', 'responseUserPersonal'));
......
......@@ -231,7 +231,7 @@ class UserCardsController extends AppController
}
public function viewCard($user_id = null){
$this->viewBuilder()->layout('blank');
// $user = $this->Auth();
$user_id = $this->Auth->user('id');
$this->loadModel('UserCards');
$UserCards = $this->UserCards->find('all')
->select($this->UserCards)
......@@ -301,8 +301,8 @@ class UserCardsController extends AppController
$userCard['date_expiry'] = $TempUserCards['date_expiry'];
$userCard['signature'] = $TempUserCards['signature'];
$userCard['is_used'] = $TempUserCards['is_used'];
$userCard['created_by'] = 1;
$userCard['user_id'] = 1;
$userCard['created_by'] = $this->Auth->user('id');
$userCard['user_id'] = $this->Auth->user('id');
// pr($userCard);die;
if ($this->UserCards->save($userCard)) {
$TempUserCards['is_used'] = 0;
......
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