Commit ba52050f by Teeradone Darunnat

Merge branch 'integration' into teeradone

# Conflicts:
#	www/src/Template/Profiles/index.ctp
parents 0da4c9bb 7c9408b0
...@@ -45,6 +45,7 @@ class AppController extends Controller { ...@@ -45,6 +45,7 @@ class AppController extends Controller {
public function initialize() { public function initialize() {
parent::initialize(); parent::initialize();
//$this->viewBuilder()->theme('Porto'); //$this->viewBuilder()->theme('Porto');
I18n::setLocale('th_TH');
$this->loadComponent('RequestHandler'); $this->loadComponent('RequestHandler');
$this->loadComponent('Flash'); $this->loadComponent('Flash');
......
...@@ -108,6 +108,33 @@ class UsersController extends AppController { ...@@ -108,6 +108,33 @@ class UsersController extends AppController {
} }
} }
/**
*
* Function mobile re-authorized use automatically by mobile application
* @author sarawutt.b
* @return void
*/
public function reautorize() {
$this->viewBuilder()->layout(false);
$reauthorizeAPI = Configure::read('Config.apiCore.reauthorize');
$http = new Client();
$data['data']['username'] = 'pakgon.demo';
$data['data']['password'] = 'deio$5679@qETY';
$data['data']['ip'] = $this->request->clientIp();
$response = $http->post(
$reauthorizeAPI, $data['data'], ['headers' => [
'Authorization' => $this->request->getHeaderLine('Authorization'),
'Accept-Language' => $this->request->getHeaderLine('Accept-Language')
]])->body();
$response = json_decode($response, true);
if (!empty($response['result']['user'])) {
$response['result']['user']['id'] = $response['result']['user']['user_id'];
$this->Auth->setUser($response['result']['user']);
return $this->redirect(Configure::read('RedirectApplicationURL'));
} else {
return $this->redirect(['controller' => 'Users', 'action' => 'signin']);
}
}
public function signup() { public function signup() {
$this->loadModel('MasterCountries'); $this->loadModel('MasterCountries');
$this->loadModel('MasterProvinces'); $this->loadModel('MasterProvinces');
...@@ -492,21 +519,6 @@ class UsersController extends AppController { ...@@ -492,21 +519,6 @@ class UsersController extends AppController {
#--------------------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------
/**
*
* Function user logout / signout
* @author sarawutt.b
* @since 2018/05/22 16:44:20
* @license PAKGON
* @return void
*/
public function signout() {
$http = new Client();
$result = $http->delete(Configure::read('OAUTH2_PROVIDER.TOKEN_DETETE') . '/' . $this->Auth->user('id'))->body();
$this->Flash->success(__('You are now logged out.'));
return $this->redirect($this->Auth->logout());
}
public function forgotsendpin($token=null) { public function forgotsendpin($token=null) {
$this->loadModel('UserPersonals'); $this->loadModel('UserPersonals');
...@@ -568,4 +580,21 @@ class UsersController extends AppController { ...@@ -568,4 +580,21 @@ class UsersController extends AppController {
return $this->redirect(['action' => 'pin_code/'.$token]); return $this->redirect(['action' => 'pin_code/'.$token]);
} }
/**
*
* Function user logout / signout
* @author sarawutt.b
* @since 2018/05/22 16:44:20
* @license PAKGON
* @return void
*/
public function signout() {
$http = new Client();
$result = $http->delete(Configure::read('OAUTH2_PROVIDER.TOKEN_DETETE') . '/' . $this->Auth->user('id'))->body();
$this->Flash->success(__('You are now logged out.'));
return $this->redirect($this->Auth->logout());
}
} }
...@@ -15,6 +15,106 @@ msgstr "" ...@@ -15,6 +15,106 @@ msgstr ""
"Plural-Forms: nplurals=1; plural=0;\n" "Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Poedit 2.0.7\n" "X-Generator: Poedit 2.0.7\n"
#: Controller/AppController.php:318 #: View/Profiles/index:56
msgid "user profile" msgid "user profile"
msgstr "User Profile" msgstr "ข้อมูลสมาชิก"
\ No newline at end of file
#: View/Profiles/index:61,62
msgid "username"
msgstr "ชื่อผู้ใช้งาน"
#: View/Profiles/index:68
msgid "firstname"
msgstr "ชื่อ"
#: View/Profiles/index:75
msgid "lastname"
msgstr "นามสกุล"
#: View/Profiles/index:82
msgid "birthdate"
msgstr "วันเดือนปีเกิด"
#: View/Profiles/index:90
msgid "gender"
msgstr "เพศ"
#: View/Profiles/index:93
msgid "male"
msgstr "ชาย"
#: View/Profiles/index:96
msgid "female"
msgstr "หญิง"
#: View/Profiles/index:103
msgid "blood group"
msgstr "กรุ๊ปเลือด"
#: View/Profiles/index:122
msgid "mobile"
msgstr "หมายเลขโทรศัพท์(มือถือ)"
#: View/Profiles/index:129
msgid "email"
msgstr "ที่อยู่อีเมล"
#: View/Profiles/index:137
msgid "address"
msgstr "ที่อยู่"
#: View/Profiles/index:143
msgid "country"
msgstr "ประเทศ"
#: View/Profiles/index:162
msgid "province"
msgstr "จังหวัด"
#: View/Profiles/index:181
msgid "SAVE"
msgstr "บันทึก"
#: View/Profiles/index:226
msgid "This email is already in the system."
msgstr "อีเมลนี้มีอยู่ในระบบอยู่แล้ว"
#: View/Profiles/index:235
msgid "only numbers"
msgstr "กรอกเฉพาะหมายเลข"
#: View/Profiles/index:244
msgid "Please enter your firstname."
msgstr "กรุณากรอกชื่อของท่าน"
#: View/Profiles/index:249
msgid "Please enter your lastname."
msgstr "กรุณากรอกนามสกุลของท่าน"
#: View/Profiles/index:255
msgid "Please enter your birthdate."
msgstr "กรุณากรอกวันเดือนปีเกิดของท่าน"
#: View/Profiles/index:261
msgid "Please enter your mobile."
msgstr "กรุณากรอกหมายเลขโทรศัพท์(มือถือ)ของท่าน"
#: View/Profiles/index:266
msgid "Please enter a 10 digit mobile number."
msgstr "กรุณากรอกหมายเลขโทรศัพท์ให้ครบ 10 หลัก"
#: View/Profiles/index:272
msgid "Please enter your email address."
msgstr "กรุณากรอกที่อยู่อีเมล"
#: View/Profiles/index:278
msgid "Email address format wrong, Please enter the correct number."
msgstr "รูปแบบของที่อยู่อีเมลผิด กรุณากรอกให้ถูกต้อง"
#: View/Profiles/index:291
msgid "Please specify country"
msgstr "กรุณาระบุประเทศ"
#: View/Profiles/index:296
msgid "Please specify province"
msgstr "กรุณาระบุจังหวัด"
\ No newline at end of file
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<div class="modal fade" id="defaultModal_<?php echo $i;?>" tabindex="-1" role="dialog" aria-labelledby="defaultModalLabel"
aria-hidden="true">
<div class="modal-dialog box-ads">
<a class="close-modal" data-dismiss="modal">X </a>
<div class="container login-container">
<div class="">
<div class="owl-carousel owl-theme" data-plugin-options="{'items': 1}">
<div class="row rotate270 form_1">
<?php echo $this->Html->image('/img/core/img/card-bg-front@3x.png', array('div' => false, 'class' => 'img-responsive img-rounded','style' => 'position: absolute;')); ?>
<div class="row date-name">
<div class="col-xs-8 ">
<br>
<div>
<label>id</label>
</div>
<div>
<?php echo $value['card_code'] ?>
</div>
<div>
<labe>ชื่อ</label>
<?php echo $value['prefix_name_th'].$value['firstname_th'].' '.$value['lastname_th'] ?>
</div>
</div>
<div class="col-xs-4">
<img src="/img/core/img/user-profile@3x.png" class="img-responsive">
</div>
</div>
<div class="row date-position">
<div class="col-xs-12">
<label>ตำแหน่ง</label>
<?php echo $value['position_name'] ?>
</div>
</div>
<div class="row text-center date-time">
<div class="col-xs-6">
<?php
$now = new Time($value['date_issued']);
$dateIssued = $now->i18nFormat('yyyy-MM-dd');
echo $this->DateFormat->formatDateThai($dateIssued);
?>
</div>
<div class="col-xs-6">
<?php
$now = new Time($value['date_expiry']);
$dateExpiry = $now->i18nFormat('yyyy-MM-dd');
echo $this->DateFormat->formatDateThai($dateExpiry);
?>
</div>
</div>
<div class="row text-center date-label">
<div class="col-xs-6">
<label>วันออกบัตร</label>
</div>
<div class="col-xs-6">
<label>วันหมดออายุ</label>
</div>
</div>
</div>
<!--/ .font-card-->
<div>
<?php echo $this->Html->image('/img/core/img/card-bg-back@3x.png', array('div' => false, 'class' => 'img-responsive img-rounded','style' => '3position: absolute;')); ?>
</div>
<!--/ .back-card-->
</div>
<!--/.owl-carousel-->
</div>
</div>
<!--/.container -->
</div>
<!--/.box-ads -->
</div>
<!--/.defaultModal -->
</div>
</div>
...@@ -120,7 +120,11 @@ ...@@ -120,7 +120,11 @@
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12"> <div class="col-xs-12 col-sm-12 col-md-12">
<?php echo __('mobile');?><em>* </em> <?php echo __('mobile');?><em>* </em>
<<<<<<< HEAD
<?php echo $this->Form->input('UserPersonals.moblie_no', ['class' => 'form-control-reg border-bottom-from label-text-sub', 'value' => $responseUserPersonal['moblie_no'], 'id' => 'moblieNo', 'type' => 'text', 'label' => false, 'maxlength' => '10', 'placeholder' => 'moblie']); ?> <?php echo $this->Form->input('UserPersonals.moblie_no', ['class' => 'form-control-reg border-bottom-from label-text-sub', 'value' => $responseUserPersonal['moblie_no'], 'id' => 'moblieNo', 'type' => 'text', 'label' => false, 'maxlength' => '10', 'placeholder' => 'moblie']); ?>
=======
<?php echo $this->Form->input('UserPersonals.moblie_no', ['class' => 'form-control-reg border-bottom-from label-text-sub', 'value' => $responseUserPersonal['moblie_no'], 'id' => 'moblieNo', 'type' => 'text', 'label' => false, 'maxlength' => '10', 'placeholder' => 'mobile']); ?>
>>>>>>> integration
<?php // echo $this->Form->input('moblie_no', ['class' => 'form-control-reg border-bottom-from label-text-sub', 'value' => $userProfiles->moblie_no, 'id' => 'moblieNo', 'type' => 'text', 'label' => __('เบอร์โทรศัพท์'), 'placeholder' => '000-000-0000']); ?> <?php // echo $this->Form->input('moblie_no', ['class' => 'form-control-reg border-bottom-from label-text-sub', 'value' => $userProfiles->moblie_no, 'id' => 'moblieNo', 'type' => 'text', 'label' => __('เบอร์โทรศัพท์'), 'placeholder' => '000-000-0000']); ?>
</div> </div>
</div> </div>
......
...@@ -13,7 +13,7 @@ use Cake\I18n\Time; ...@@ -13,7 +13,7 @@ use Cake\I18n\Time;
</div> </div>
<div class="col-xs-10 col-sm-10 col-md-10"> <div class="col-xs-10 col-sm-10 col-md-10">
<div class="box-card"> <div class="box-card">
<div data-toggle="modal" data-target="#defaultModal_<?php echo $i;?>" style="cursor: pointer; padding-right: 10px; padding-left: 10px;"> <div data-toggle="modal" data-target="#card_<?php echo $i;?>" style="cursor: pointer; padding-right: 10px; padding-left: 10px;">
<div class="row"> <div class="row">
<div class="col-xs-8"> <div class="col-xs-8">
<div style="font-size: 17px"> <div style="font-size: 17px">
...@@ -128,9 +128,10 @@ use Cake\I18n\Time; ...@@ -128,9 +128,10 @@ use Cake\I18n\Time;
</div> </div>
</div> </div>
<!--/.col-xs-12 --> <!--/.col-xs-12 -->
</div> </div>
<!--/.row --> <!--/.row -->
<?php <?php
$i++; $i++;
} }
...@@ -148,11 +149,11 @@ use Cake\I18n\Time; ...@@ -148,11 +149,11 @@ use Cake\I18n\Time;
<div class="row"> <div class="row">
<div class="col-xs-12 col-sm-12 col-md-12"> <div class="col-xs-12 col-sm-12 col-md-12">
<?php echo $this->Form->create('UserCards', [ <?php echo $this->Form->create('UserCards', [
'id' => 'frmSignIn', 'id' => 'frmSignIn',
'type' => 'file', 'type' => 'file',
'onsubmit' => 'return check();', 'onsubmit' => 'return check();',
'url' => ['controller' => 'user-cards', 'action' => 'view-card'] 'url' => ['controller' => 'user-cards', 'action' => 'view-card']
]); ?> ]); ?>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12"> <div class="col-xs-12 col-sm-12 col-md-12">
<?php echo $this->Flash->render(); ?> <?php echo $this->Flash->render(); ?>
...@@ -190,82 +191,17 @@ use Cake\I18n\Time; ...@@ -190,82 +191,17 @@ use Cake\I18n\Time;
<!--/.row --> <!--/.row -->
</div> </div>
<!--/.owl-carousel --> <!--/.owl-carousel -->
<div class="row"> <?php
<div class="col-xs-12 col-sm-12 col-md-12"> $i=0;
<div class="modal fade" id="defaultModal_<?php echo $i;?>" tabindex="-1" role="dialog" aria-labelledby="defaultModalLabel" aria-hidden="true"> foreach ($UserCards as $value) {
<div class="modal-dialog box-ads"> echo $this->element('card_from/from_0',array('value' => $value,'i'=> $i));
<a class="close-modal" data-dismiss="modal">X </a> $i++;
<div class="container login-container"> }
<div class=""> ?>
<div class="owl-carousel owl-theme" data-plugin-options="{'items': 1}">
<div class="row rotate270 form_1">
<?php echo $this->Html->image('/img/core/img/card-bg-front@3x.png', array('div' => false, 'class' => 'img-responsive img-rounded','style' => 'position: absolute;')); ?>
<div class="row date-name">
<div class="col-xs-8 ">
<br>
<div>
<label>id</label>
</div>
<div>
<?php echo $value['card_code'] ?>
</div>
<div>
<labe>ชื่อ</label>
<?php echo $value['prefix_name_th'].$value['firstname_th'].' '.$value['lastname_th'] ?>
</div>
</div>
<div class="col-xs-4">
<img src="/img/core/img/user-profile@3x.png" class="img-responsive">
</div>
</div>
<div class="row date-position">
<div class="col-xs-12">
<label>ตำแหน่ง</label>
<?php echo $value['position_name'] ?>
</div>
</div>
<div class="row text-center date-time">
<div class="col-xs-6">
<?php
$now = new Time($value['date_issued']);
$dateIssued = $now->i18nFormat('yyyy-MM-dd');
echo $this->DateFormat->formatDateThai($dateIssued);
?>
</div>
<div class="col-xs-6">
<?php
$now = new Time($value['date_expiry']);
$dateExpiry = $now->i18nFormat('yyyy-MM-dd');
echo $this->DateFormat->formatDateThai($dateExpiry);
?>
</div>
</div>
<div class="row text-center date-label">
<div class="col-xs-6">
<label>วันออกบัตร</label>
</div>
<div class="col-xs-6">
<label>วันหมดออายุ</label>
</div>
</div>
</div>
<!--/ .font-card-->
<div>
<?php echo $this->Html->image('/img/core/img/card-bg-back@3x.png', array('div' => false, 'class' => 'img-responsive img-rounded','style' => '3position: absolute;')); ?>
</div>
<!--/ .back-card-->
</div>
<!--/.owl-carousel-->
</div>
</div>
<!--/.container -->
</div>
<!--/.box-ads -->
</div>
<!--/.defaultModal -->
</div>
</div>
</div> </div>
<style> <style>
#alertBox { #alertBox {
position: relative; position: relative;
...@@ -661,3 +597,4 @@ use Cake\I18n\Time; ...@@ -661,3 +597,4 @@ use Cake\I18n\Time;
</script> </script>
<?php $this->end();?> <?php $this->end();?>
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