Commit b1632bdb by Prasong Putichanchai

update card

parent 5f361851
......@@ -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