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
c3791942
authored
May 31, 2018
by
Prasong Putichanchai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update view card
parent
5da775bb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
131 additions
and
89 deletions
+131
-89
www/src/Controller/UsersController.php
+44
-15
www/src/Template/Element/card_from/from_0.ctp
+76
-0
www/src/Template/UserCards/view_card.ctp
+11
-74
No files found.
www/src/Controller/UsersController.php
View file @
c3791942
...
...
@@ -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
()
{
$this
->
loadModel
(
'MasterCountries'
);
$this
->
loadModel
(
'MasterProvinces'
);
...
...
@@ -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
)
{
$this
->
loadModel
(
'UserPersonals'
);
...
...
@@ -568,4 +580,21 @@ class UsersController extends AppController {
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
());
}
}
www/src/Template/Element/card_from/from_0.ctp
0 → 100644
View file @
c3791942
<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>
www/src/Template/UserCards/view_card.ctp
View file @
c3791942
...
...
@@ -13,7 +13,7 @@ use Cake\I18n\Time;
</div>
<div class="col-xs-10 col-sm-10 col-md-10">
<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="col-xs-8">
<div style="font-size: 17px">
...
...
@@ -128,6 +128,7 @@ use Cake\I18n\Time;
</div>
</div>
<!--/.col-xs-12 -->
</div>
<!--/.row -->
...
...
@@ -190,82 +191,17 @@ use Cake\I18n\Time;
<!--/.row -->
</div>
<!--/.owl-carousel -->
<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);
$i=0;
foreach ($UserCards as $value) {
echo $this->element('card_from/from_0',array('value' => $value,'i'=> $i));
$i++;
}
?>
</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>
<style>
#alertBox {
position: relative;
...
...
@@ -661,3 +597,4 @@ use Cake\I18n\Time;
</script>
<?php $this->end();?>
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