Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
smart_core_connect
/
core-connect
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f2a1c246
authored
May 18, 2018
by
Teeradone-PIM
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'integration' into teeradone
parents
2d65c262
868107e4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
102 additions
and
35 deletions
+102
-35
www/src/Controller/ProfilesController.php
+10
-7
www/src/Template/Profiles/index.ctp
+24
-17
www/src/Template/UserCards/view_card.ctp
+4
-11
www/src/Template/Users/pin_codepassword.ctp
+64
-0
No files found.
www/src/Controller/ProfilesController.php
View file @
f2a1c246
...
...
@@ -20,6 +20,11 @@ class ProfilesController extends AppController
]);
$username
=
$responseUserProfile
[
'username'
];
$this
->
loadModel
(
'UserPersonals'
);
$responseUserPersonal
=
$this
->
UserPersonals
->
get
(
$id
,
[
'contain'
=>
[]
]);
//********DropdownCountry********
$this
->
loadModel
(
'MasterCountries'
);
$Country
=
$this
->
MasterCountries
->
find
(
'list'
,
[
...
...
@@ -28,6 +33,7 @@ class ProfilesController extends AppController
'keyField'
=>
'id'
,
'valueField'
=>
'country_name_th'
]);
// pr($responseUserPersonal['master_country_id']);die;
if
(
!
empty
(
$Country
))
$Country
=
$Country
->
toArray
();
//********DropdownProvince********
...
...
@@ -37,14 +43,11 @@ class ProfilesController extends AppController
'is_used'
=>
true
],
'keyField'
=>
'id'
,
'valueField'
=>
'province_name_th'
]);
])
->
where
([
'master_country_id ='
=>
$responseUserPersonal
[
'master_country_id'
]]);
// pr($Province);die;
if
(
!
empty
(
$Province
))
$Province
=
$Province
->
toArray
();
$this
->
loadModel
(
'UserPersonals'
);
$responseUserProfile
=
$this
->
UserPersonals
->
get
(
$id
,
[
'contain'
=>
[]
]);
$res
=
$responseUserProfile
[
'birthdate'
];
$res
=
$responseUserPersonal
[
'birthdate'
];
$dateNow
=
$res
->
i18nFormat
(
'dd/MM/yyyy'
);
if
(
$this
->
request
->
is
([
'patch'
,
'post'
,
'put'
]))
{
...
...
@@ -104,7 +107,7 @@ class ProfilesController extends AppController
}
$this
->
Flash
->
error
(
__
(
'Not update. Please, try again.'
));
}
$this
->
set
(
compact
(
'userPersonals'
,
'responseUserProfile'
,
'dateNow'
,
'username'
,
'Country'
,
'Province'
));
$this
->
set
(
compact
(
'userPersonals'
,
'responseUserProfile'
,
'dateNow'
,
'username'
,
'Country'
,
'Province'
,
'responseUserPersonal'
));
$this
->
set
(
'_serialize'
,
[
'userPersonals'
,
'responseUserProfile'
,
'dateNow'
,
'username'
,
'Country'
,
'Province'
]);
}
...
...
www/src/Template/Profiles/index.ctp
View file @
f2a1c246
...
...
@@ -30,6 +30,7 @@ public function generate(){
<div class="row">
<div class="col-xs-1 col-sm-1 col-md-1 box-arrow" ></div>
<div class="col-xs-10 col-sm-10 col-md-10">
<div data-toggle="modal" data-target="#defaultModal" style="text-align: center; cursor: pointer;">
<img src="/img/core/img/card-bg-front@3x-V2.png" class="img-responsive" id="img-upload" alt="Profile picture">
...
...
@@ -37,7 +38,12 @@ public function generate(){
</div>
<div class="col-xs-1 col-sm-1 col-md-1 box-arrow" >
<i class = "fa fa-angle-right"></i>
<a>
<?php echo $this->Html->link(
'<i class = "fa fa-angle-right"></i>',
['controller' => 'UserCards', 'action' => 'viewCard', '_full' => true],['escape' => false]
); ?>
</a>
</div>
<div style="clear: both"></div>
</div><!--/row-->
...
...
@@ -57,13 +63,13 @@ public function generate(){
<?php // debug($userProfiles); exit;?>
<div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12">
<?php echo $this->Form->input('UserPersonals.firstname_th', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'value' => $responseUserP
rofile
['firstname_th'], 'id' => 'firstname_th', 'type' => 'text', 'label' => __('ชื่อ'), 'placeholder' => 'ชื่อ', 'required']); ?>
<?php echo $this->Form->input('UserPersonals.firstname_th', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'value' => $responseUserP
ersonal
['firstname_th'], 'id' => 'firstname_th', 'type' => 'text', 'label' => __('ชื่อ'), 'placeholder' => 'ชื่อ', 'required']); ?>
<?php // echo $this->Form->input('fullname', ['class' => 'form-control-reg border-bottom-from label-text-sub', 'value' => $userProfiles->firstname_th . ' ' . $userProfiles->lastname_th, 'id' => 'fullName', 'type' => 'text', 'label' => __('ชื่อ - นามสกุล'), 'placeholder' => 'ชื่อ - นามสกุล', 'required']); ?>
</div>
</div>
<div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12">
<?php echo $this->Form->input('UserPersonals.lastname_th', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'value' => $responseUserP
rofile
['lastname_th'], 'id' => 'lastname_th', 'type' => 'text', 'label' => __('นามสกุล'), 'placeholder' => 'นามสกุล', 'required']); ?>
<?php echo $this->Form->input('UserPersonals.lastname_th', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'value' => $responseUserP
ersonal
['lastname_th'], 'id' => 'lastname_th', 'type' => 'text', 'label' => __('นามสกุล'), 'placeholder' => 'นามสกุล', 'required']); ?>
<?php // echo $this->Form->input('fullname', ['class' => 'form-control-reg border-bottom-from label-text-sub', 'value' => $userProfiles->firstname_th . ' ' . $userProfiles->lastname_th, 'id' => 'fullName', 'type' => 'text', 'label' => __('ชื่อ - นามสกุล'), 'placeholder' => 'ชื่อ - นามสกุล', 'required']); ?>
</div>
</div>
...
...
@@ -79,10 +85,10 @@ public function generate(){
<?php echo __('เพศ'); ?>
<div class="radio-group">
<label class="radio-inline">
<input type="radio" name="UserPersonals[gender]" id="male" value="M" <?php echo ($responseUserP
rofile
['gender'] == 'M') ? 'checked="checked"' : null; ?>> <?php echo __('ชาย'); ?>
<input type="radio" name="UserPersonals[gender]" id="male" value="M" <?php echo ($responseUserP
ersonal
['gender'] == 'M') ? 'checked="checked"' : null; ?>> <?php echo __('ชาย'); ?>
</label>
<label class="radio-inline">
<input type="radio" name="UserPersonals[gender]" id="female" value="F" <?php echo ($responseUserP
rofile
['gender'] == 'F') ? 'checked="checked"' : null; ?>> <?php echo __('หญิง'); ?>
<input type="radio" name="UserPersonals[gender]" id="female" value="F" <?php echo ($responseUserP
ersonal
['gender'] == 'F') ? 'checked="checked"' : null; ?>> <?php echo __('หญิง'); ?>
</label>
</div>
</div>
...
...
@@ -92,35 +98,35 @@ public function generate(){
<?php echo __('กรุ๊ปเลือด'); ?>
<div class="radio-group">
<label class="radio-inline">
<input type="radio" name="UserPersonals[blood_group]" id="blood-A" value="A" <?php echo ($responseUserP
rofile
['blood_group'] == 'A') ? 'checked="checked"' : null; ?>> <?php echo __('A'); ?>
<input type="radio" name="UserPersonals[blood_group]" id="blood-A" value="A" <?php echo ($responseUserP
ersonal
['blood_group'] == 'A') ? 'checked="checked"' : null; ?>> <?php echo __('A'); ?>
</label>
<label class="radio-inline">
<input type="radio" name="UserPersonals[blood_group]" id="blood-B" value="B" <?php echo ($responseUserP
rofile
['blood_group'] == 'B') ? 'checked="checked"' : null; ?>> <?php echo __('B'); ?>
<input type="radio" name="UserPersonals[blood_group]" id="blood-B" value="B" <?php echo ($responseUserP
ersonal
['blood_group'] == 'B') ? 'checked="checked"' : null; ?>> <?php echo __('B'); ?>
</label>
<label class="radio-inline">
<input type="radio" name="UserPersonals[blood_group]" id="blood-AB" value="AB" <?php echo ($responseUserP
rofile
['blood_group'] == 'AB') ? 'checked="checked"' : null; ?>> <?php echo __('AB'); ?>
<input type="radio" name="UserPersonals[blood_group]" id="blood-AB" value="AB" <?php echo ($responseUserP
ersonal
['blood_group'] == 'AB') ? 'checked="checked"' : null; ?>> <?php echo __('AB'); ?>
</label>
<label class="radio-inline">
<input type="radio" name="UserPersonals[blood_group]" id="blood-O" value="O" <?php echo ($responseUserP
rofile
['blood_group'] == 'O') ? 'checked="checked"' : null; ?>> <?php echo __('O'); ?>
<input type="radio" name="UserPersonals[blood_group]" id="blood-O" value="O" <?php echo ($responseUserP
ersonal
['blood_group'] == 'O') ? 'checked="checked"' : null; ?>> <?php echo __('O'); ?>
</label>
</div>
</div>
</div>
<div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12">
<?php echo $this->Form->input('UserPersonals.moblie_no', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'value' => $responseUserP
rofile
['moblie_no'], 'id' => 'moblieNo', 'type' => 'text', 'label' => __('เบอร์โทรศัพท์'), 'placeholder' => '000-000-0000']); ?>
<?php echo $this->Form->input('UserPersonals.moblie_no', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'value' => $responseUserP
ersonal
['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 class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12">
<?php echo $this->Form->input('UserPersonals.email', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'value' => $responseUserP
rofile
['email'], 'id' => 'email', 'type' => 'email', 'label' => __('Email'), 'placeholder' => 'mail@xxx.com']); ?>
<?php echo $this->Form->input('UserPersonals.email', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'value' => $responseUserP
ersonal
['email'], 'id' => 'email', 'type' => 'email', 'label' => __('Email'), 'placeholder' => 'mail@xxx.com']); ?>
<?php // echo $this->Form->input('email', ['class' => 'form-control-reg border-bottom-from label-text-sub', 'value' => $userProfiles->email, 'id' => 'email', 'type' => 'email', 'label' => __('Email'), 'placeholder' => 'mail@xxx.com']); ?>
</div>
</div>
<div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12">
<?php echo $this->Form->input('UserPersonals.address', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'value' => $responseUserP
rofile
['address'], 'id' => 'address', 'type' => 'text', 'label' => __('ที่อยู่อาศัย'), 'placeholder' => __('112/3 สุขุมวิท 22 ทองหล่อ กทม 10523')]); ?>
<?php echo $this->Form->input('UserPersonals.address', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'value' => $responseUserP
ersonal
['address'], 'id' => 'address', 'type' => 'text', 'label' => __('ที่อยู่อาศัย'), 'placeholder' => __('112/3 สุขุมวิท 22 ทองหล่อ กทม 10523')]); ?>
<?php // echo $this->Form->input('address', ['class' => 'form-control-reg border-bottom-from label-text-sub', 'value' => $userProfiles->address, 'id' => 'address', 'type' => 'text', 'label' => __('ที่อยู่อาศัย'), 'placeholder' => __('112/3 สุขุมวิท 22 ทองหล่อ กทม 10523')]); ?>
</div>
</div>
...
...
@@ -133,9 +139,9 @@ public function generate(){
'label' => false,
'type' => 'select',
'options' => $Country,
'value' => $responseUserP
rofile
['master_country_id'],
'value' => $responseUserP
ersonal
['master_country_id'],
'empty' => '---Select---',
'default' => !empty($responseUserP
rofile['master_country_id'])? $responseUserProfile
['master_country_id']:'',
'default' => !empty($responseUserP
ersonal['master_country_id'])? $responseUserPersonal
['master_country_id']:'',
'class' => 'form-control border-bottom-from label-text-sub required',
'style' => 'width:100%'
));
...
...
@@ -151,9 +157,9 @@ public function generate(){
'label' => false,
'type' => 'select',
'options' => $Province,
'value' => $responseUserP
rofile
['master_province_id'],
'value' => $responseUserP
ersonal
['master_province_id'],
'empty' => '---Select---',
'default' => !empty($responseUserP
rofile['master_province_id'])? $responseUserProfile
['master_province_id']:'',
'default' => !empty($responseUserP
ersonal['master_province_id'])? $responseUserPersonal
['master_province_id']:'',
'class' => 'form-control border-bottom-from label-text-sub required',
'style' => 'width:100%'
));
...
...
@@ -199,7 +205,7 @@ public function generate(){
</div>
</div>
</div>
<?php $this->append('scriptBottom'); ?>
<script type="text/javascript">
$(function () {
$('#moblieNo').inputmask('999-999-9999');
...
...
@@ -233,6 +239,7 @@ public function generate(){
});
</script>
<?php $this->end();?>
<style>
.box-arrow{
font-size:36px;
...
...
www/src/Template/UserCards/view_card.ctp
View file @
f2a1c246
...
...
@@ -50,7 +50,7 @@ use Cake\I18n\Time;
<?php
$now = new Time($value['date_expiry']);
$dateExpiry = $now->i18nFormat('yyyy-MM-dd');
echo $this->DateFormat->formatDateThai($date
Issued
);
echo $this->DateFormat->formatDateThai($date
Expiry
);
?>
</div>
</div>
...
...
@@ -122,7 +122,7 @@ use Cake\I18n\Time;
<?php
$now = new Time($value['date_expiry']);
$dateExpiry = $now->i18nFormat('yyyy-MM-dd');
echo $this->DateFormat->formatDateThai($date
Issued
);
echo $this->DateFormat->formatDateThai($date
Expiry
);
?>
</div>
</div>
...
...
@@ -141,12 +141,6 @@ use Cake\I18n\Time;
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<?php echo $this->Form->create('UserCards', ['id' => 'frmSignIn', 'type' => 'file', 'onsubmit' => 'return check();']); ?>
<!-- <div style="position: absolute;z-index: 2;">
<a href="profile_setting"><img src="/img/core/img/setting-icon@3x.png"/></a>
</div> -->
<!-- <div class="bg-profile"></div> -->
<!--<div class="col-xs-12 col-sm-12 col-md-12" style="padding-top: 20px;">-->
<div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12">
<?php echo $this->Form->hidden('UserCards.user_id', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'id' => 'userId', 'type' => 'text', 'placeholder' => 'USERNAME']); ?>
...
...
@@ -158,12 +152,12 @@ use Cake\I18n\Time;
</div>
<div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12">
<?php echo $this->Form->input('UserCards.employee', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'id' => 'employee', 'type' => 'text', 'label' => __('
รหัสพนักงาน / รหัสนักศึกษา
'), 'placeholder' => 'รหัสพนักงาน / รหัสนักศึกษา', 'disabled', 'required']); ?>
<?php echo $this->Form->input('UserCards.employee', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'id' => 'employee', 'type' => 'text', 'label' => __('
Ref 1
'), 'placeholder' => 'รหัสพนักงาน / รหัสนักศึกษา', 'disabled', 'required']); ?>
</div>
</div>
<div class="form-group has-feedback bootstrap-iso">
<div class="col-xs-12 col-sm-12 col-md-12">
<label class="label-text-sub"><?php echo __('
วันเกิด
');?></label>
<label class="label-text-sub"><?php echo __('
Ref 2
');?></label>
<input type="text" name="UserCards[birthdate]" id="date" placeholder="กรุณาระบุวันเดือนปีเกิด" value="" placeholder="DD-MM-YYYY" data-date-format="mm/dd/yyyy" class="form-control-reg border-bottom-from" disabled>
<span class="glyphicon glyphicon-calendar form-control-feedback"></span>
</div>
...
...
@@ -235,7 +229,6 @@ function callBack(){
if(data!='false'){
data = jQuery.parseJSON(data);
console.log(data);
employee.val('sssss');
if(data['chkuser'] == true){
$("#noorg_th").text('ลงทะเบียนกับ '+data[0]['org_name_th']+' แล้ว');
$("#nameorg_th").text('');
...
...
www/src/Template/Users/pin_codepassword.ctp
0 → 100644
View file @
f2a1c246
<div>
<div class=" row center">
<div class="title_header"><?php echo __('ยืนยันตัวตนด้วยรหัส PIN');?></div>
</div>
<div style="padding-top: 20px;"></div>
<div class="col-md-12">
<?php echo $this->Form->create(null, ['url' => ['controller' => 'Users', 'action' => 'pinCodepassword/'.$token],
'id' => 'PinCode', 'name' => 'PinCode', 'role' => 'form']);
?>
<?php echo $this->Flash->render(); ?>
<div class="row">
<div class="form-group has-feedback">
<div class="col-md-12">
<div class=" row center">
<?php echo __('รหัส PIN 4 หลัก ในอีเมลล์ที่ระบุเพื่อเข้าใช้งาน');?>
</div>
</div>
</div>
</div>
<div class="row">
<div class="form-group has-feedback">
<div class="col-md-12">
<div class="data-pin" style=" text-align: center;">
<input type="hidden" name="token" value="<?php echo $token;?>">
<?php for($i=1;$i<=4;$i++){?>
<input type="password" pattern="[0-9]*" maxlength="1" min="0" name="pin_code_<?php echo $i;?>" id="pin_code_<?php echo $i;?>" onkeyup="verifyPinCode('pin_code')">
<?php }?>
</div>
</div>
</div>
</div>
<?php echo $this->Form->end(); ?>
</div>
</div>
<!---------------------------------------------------------------------->
<style>
input[type="number"], input[type="password"] {
width: 50px;
height: 50px;
margin-right: 5px;
margin-bottom: 0;
text-align: center;
/* font-size: 81px;
padding: 0px 0px 30px 0px;*/
}
</style>
<script>
function verifyPinCode(obj) {
if ($('#'+obj+'_1').val() != '' && $('#'+obj+'_2').val() != '' && $('#'+obj+'_3').val() != '' && $('#'+obj+'_4').val() != '') {
$("#PinCode").submit();
}else{
if ($('#'+obj+'_1').val() != '') $('#'+obj+'_2').focus();
if ($('#'+obj+'_2').val() != '') $('#'+obj+'_3').focus();
if ($('#'+obj+'_3').val() != '') $('#'+obj+'_4').focus();
return false;
}
}
</script>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment