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
1de13390
authored
May 21, 2018
by
Zen-PC\Zen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zen : update
parent
17699c43
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
101 additions
and
36 deletions
+101
-36
www/src/Controller/ProfilesController.php
+23
-21
www/src/Template/UserCards/view_card.ctp
+78
-15
No files found.
www/src/Controller/ProfilesController.php
View file @
1de13390
...
@@ -21,9 +21,11 @@ class ProfilesController extends AppController
...
@@ -21,9 +21,11 @@ class ProfilesController extends AppController
$username
=
$responseUserProfile
[
'username'
];
$username
=
$responseUserProfile
[
'username'
];
$this
->
loadModel
(
'UserPersonals'
);
$this
->
loadModel
(
'UserPersonals'
);
$responseUserPersonal
=
$this
->
UserPersonals
->
get
(
$id
,
[
$responseUserPersonal
=
$this
->
UserPersonals
->
find
(
'all'
,
[
'contain'
=>
[]
'conditions'
=>
[
]);
'is_used'
=>
true
,
'user_id'
=>
$id
]
])
->
first
();
//********DropdownCountry********
//********DropdownCountry********
$this
->
loadModel
(
'MasterCountries'
);
$this
->
loadModel
(
'MasterCountries'
);
...
@@ -85,26 +87,26 @@ class ProfilesController extends AppController
...
@@ -85,26 +87,26 @@ class ProfilesController extends AppController
if
(
$chkemail
==
true
){
if
(
$chkemail
==
true
){
$birthdate
=
explode
(
"/"
,
$this
->
request
->
data
[
'UserPersonals'
][
'birthdate'
]);
$birthdate
=
explode
(
"/"
,
$this
->
request
->
data
[
'UserPersonals'
][
'birthdate'
]);
$birthdate
=
$birthdate
[
2
]
.
'-'
.
$birthdate
[
1
]
.
'-'
.
$birthdate
[
0
];
$birthdate
=
$birthdate
[
2
]
.
'-'
.
$birthdate
[
1
]
.
'-'
.
$birthdate
[
0
];
$userPersonals
=
$this
->
UserPersonals
->
patchEntity
(
$userPersonals
,
$data
[
'UserPersonals'
]);
$userPersonals
=
$this
->
UserPersonals
->
patchEntity
(
$userPersonals
,
$data
[
'UserPersonals'
]);
$userPersonals
[
'firstname_th'
]
=
$this
->
request
->
data
[
'UserPersonals'
][
'firstname_th'
];
$userPersonals
[
'firstname_th'
]
=
$this
->
request
->
data
[
'UserPersonals'
][
'firstname_th'
];
$userPersonals
[
'lastname_th'
]
=
$this
->
request
->
data
[
'UserPersonals'
][
'lastname_th'
];
$userPersonals
[
'lastname_th'
]
=
$this
->
request
->
data
[
'UserPersonals'
][
'lastname_th'
];
$userPersonals
[
'email'
]
=
$this
->
request
->
data
[
'UserPersonals'
][
'email'
];
$userPersonals
[
'email'
]
=
$this
->
request
->
data
[
'UserPersonals'
][
'email'
];
$userPersonals
[
'birthdate'
]
=
$birthdate
;
$userPersonals
[
'birthdate'
]
=
$birthdate
;
$userPersonals
[
'user_id'
]
=
$data
[
'Users'
][
'user_id'
];
$userPersonals
[
'user_id'
]
=
$data
[
'Users'
][
'user_id'
];
$userPersonals
[
'master_country_id'
]
=
$this
->
request
->
data
[
'master_country_id'
];
$userPersonals
[
'master_country_id'
]
=
$this
->
request
->
data
[
'master_country_id'
];
$userPersonals
[
'master_province_id'
]
=
$this
->
request
->
data
[
'master_province_id'
];
$userPersonals
[
'master_province_id'
]
=
$this
->
request
->
data
[
'master_province_id'
];
$userPersonals
[
'modified_by'
]
=
''
;
$userPersonals
[
'modified_by'
]
=
''
;
if
(
$this
->
UserPersonals
->
save
(
$userPersonals
))
{
if
(
$this
->
UserPersonals
->
save
(
$userPersonals
))
{
$this
->
Flash
->
success
(
__
(
'Update Complete.'
));
$this
->
Flash
->
success
(
__
(
'Update Complete.'
));
return
$this
->
redirect
([
'action'
=>
'index'
]);
return
$this
->
redirect
([
'action'
=>
'index'
]);
}
}
else
{
$this
->
Flash
->
error
(
__
(
'Email Address already used by others.'
));
}
}
}
else
{
$this
->
Flash
->
error
(
__
(
'Email Address already used by others.'
));
}
$this
->
Flash
->
error
(
__
(
'Not update. Please, try again.'
));
$this
->
Flash
->
error
(
__
(
'Not update. Please, try again.'
));
}
}
$this
->
set
(
compact
(
'userPersonals'
,
'responseUserProfile'
,
'dateNow'
,
'username'
,
'Country'
,
'Province'
,
'responseUserPersonal'
));
$this
->
set
(
compact
(
'userPersonals'
,
'responseUserProfile'
,
'dateNow'
,
'username'
,
'Country'
,
'Province'
,
'responseUserPersonal'
));
...
...
www/src/Template/UserCards/view_card.ctp
View file @
1de13390
...
@@ -176,21 +176,73 @@ use Cake\I18n\Time;
...
@@ -176,21 +176,73 @@ use Cake\I18n\Time;
<div class="col-xs-12 col-sm-12 col-md-12">
<div class="col-xs-12 col-sm-12 col-md-12">
<div class="modal fade" id="defaultModal" tabindex="-1" role="dialog" aria-labelledby="defaultModalLabel" aria-hidden="true">
<div class="modal fade" id="defaultModal" tabindex="-1" role="dialog" aria-labelledby="defaultModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-dialog">
<div class="">
<div class="col-md-6">
<div class="">
<div class = "row rotate270 form_1"
<div class="col-md-6">
<div class="owl-carousel owl-theme" data-plugin-options="{'items': 1, 'margin': 10}">
<div class="owl-carousel owl-theme" data-plugin-options="{'items': 1, 'margin': 10}">
<div>
<div>
<?php echo $this->Html->image('/img/core/img/card-bg-front@3x.png', array('div' => false, 'class' => 'img-responsive img-rounded','style' => 'position: absolute;')); ?>
<?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">
<div class="idcard-profile"><?php echo __('ID Card');?></div>
<div class="col-xs-1">
</div>
</div>
<div>
<div class="col-xs-6">
<?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 style="font-size: 17px">
</div>
<br>
</div>
<label>id<label>
</div>
</div>
</div>
<div>
</div>
<?php echo $value['card_code'] ?>
</div>
<div>
<label style="font-size: 17px">ชื่อ</label> <?php echo $value['prefix_name_th'].$value['firstname_th'].' '.$value['lastname_th'] ?>
</div>
</div>
<div class="col-xs-4">
<div data-toggle="modal" data-target="#defaultModal" style="text-align: center; cursor: pointer;">
<img src="/img/core/img/user-profile@3x.png" class="img-responsive">
</div>
</div>
</div>
<div class="row date-position">
<div class="col-xs-1">
</div>
<div class="col-xs-10">
<label style="font-size: 17px">ตำแหน่ง</label> <?php echo $value['position_name'] ?>
</div>
</div>
<div class="row date-date">
<div class="col-xs-1">
</div>
<div class="col-xs-5">
<?php
$now = new Time($value['date_issued']);
$dateIssued = $now->i18nFormat('yyyy-MM-dd');
echo $this->DateFormat->formatDateThai($dateIssued);
?>
</div>
<div class="col-xs-5">
<?php
$now = new Time($value['date_expiry']);
$dateExpiry = $now->i18nFormat('yyyy-MM-dd');
echo $this->DateFormat->formatDateThai($dateExpiry);
?>
</div>
</div>
<div class="row date-label">
<div class="col-xs-1">
</div>
<div class="col-xs-5">
<label style="font-size: 17px">วันออกบัตร</label>
</div>
<div class="col-xs-5">
<label style="font-size: 17px">วันหมดออายุ</label>
</div>
</div>
<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>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -212,6 +264,17 @@ use Cake\I18n\Time;
...
@@ -212,6 +264,17 @@ use Cake\I18n\Time;
cursor: pointer;
cursor: pointer;
}
}
.rotate270 .row{
-webkit-transform: rotate(270deg);
-moz-transform: rotate(270deg);
-o-transform: rotate(270deg);
writing-mode: rl-tb;
position: absolute;
}
.form_1 .date-label{
width: 150px;
margin: 100% 0% 0% 62%;
}
</style>
</style>
<?php $this->append('scriptBottom'); ?>
<?php $this->append('scriptBottom'); ?>
<script type="text/javascript">
<script type="text/javascript">
...
...
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