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
eb9aa688
authored
Jun 01, 2018
by
Prasong Putichanchai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update profile
parent
3fe2815c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
125 additions
and
35 deletions
+125
-35
www/src/Controller/ProfilesController.php
+37
-3
www/src/Controller/UserCardsController.php
+28
-26
www/src/Template/Element/card_from/from_0.ctp
+60
-6
www/src/Template/Element/card_from/from_add_card.ctp
+0
-0
www/src/Template/Profiles/index.ctp
+0
-0
No files found.
www/src/Controller/ProfilesController.php
View file @
eb9aa688
...
@@ -58,8 +58,42 @@ class ProfilesController extends AppController
...
@@ -58,8 +58,42 @@ class ProfilesController extends AppController
}
else
{
}
else
{
$dateNow
=
""
;
$dateNow
=
""
;
}
}
/**
*
* Function show user card
* @Data 01/06/2018
* @author Prasong.p
*
*/
$this
->
loadModel
(
'UserCards'
);
$UserCards
=
$this
->
UserCards
->
find
(
'all'
)
->
select
(
$this
->
UserCards
)
->
select
(
'morg.org_name_th'
)
->
join
([
'morg'
=>
[
'table'
=>
'master.master_organizations'
,
'type'
=>
'INNER'
,
'conditions'
=>
[
'morg.id = userCards.organize_id'
],
]
])
->
where
([
'userCards.user_id'
=>
$id
])
->
order
([
'userCards.id'
=>
'ASC'
])
->
toArray
();
//$this->set(compact('UserCards'));
//------- save update ----
//------- save update
profile
----
if
(
$this
->
request
->
is
([
'patch'
,
'post'
,
'put'
]))
{
if
(
$this
->
request
->
is
([
'patch'
,
'post'
,
'put'
]))
{
$data
=
$this
->
request
->
data
;
$data
=
$this
->
request
->
data
;
...
@@ -123,8 +157,8 @@ class ProfilesController extends AppController
...
@@ -123,8 +157,8 @@ class ProfilesController extends AppController
}
}
//-------end save update ----
//-------end save update ----
$this
->
set
(
compact
(
'userPersonals'
,
'responseUserProfile'
,
'dateNow'
,
'username'
,
'Country'
,
'Province'
,
'responseUserPersonal'
));
$this
->
set
(
compact
(
'userPersonals'
,
'responseUserProfile'
,
'dateNow'
,
'username'
,
'Country'
,
'Province'
,
'responseUserPersonal'
,
'UserCards'
));
$this
->
set
(
'_serialize'
,
[
'userPersonals'
,
'responseUserProfile'
,
'dateNow'
,
'username'
,
'Country'
,
'Province'
,
'responseUserPersonal'
]);
$this
->
set
(
'_serialize'
,
[
'userPersonals'
,
'responseUserProfile'
,
'dateNow'
,
'username'
,
'Country'
,
'Province'
,
'responseUserPersonal'
,
'UserCards'
]);
}
}
...
...
www/src/Controller/UserCardsController.php
View file @
eb9aa688
...
@@ -208,33 +208,33 @@ class UserCardsController extends AppController
...
@@ -208,33 +208,33 @@ class UserCardsController extends AppController
}
}
public
function
viewCard
(
$user_id
=
null
){
public
function
viewCard
(
$user_id
=
null
){
$this
->
viewBuilder
()
->
layout
(
'blank'
);
$this
->
viewBuilder
()
->
layout
(
'blank'
);
$user_id
=
$this
->
Auth
->
user
(
'id'
);
//
$user_id = $this->Auth->user('id');
$this
->
loadModel
(
'UserCards'
);
//
$this->loadModel('UserCards');
$UserCards
=
$this
->
UserCards
->
find
(
'all'
)
//
$UserCards = $this->UserCards->find('all')
->
select
(
$this
->
UserCards
)
//
->select($this->UserCards)
->
select
(
//
->select(
'morg.org_name_th'
//
'morg.org_name_th'
)
//
)
->
join
([
//
->join([
'morg'
=>
[
//
'morg' => [
'table'
=>
'master.master_organizations'
,
//
'table' => 'master.master_organizations',
'type'
=>
'INNER'
,
//
'type' => 'INNER',
'conditions'
=>
[
//
'conditions' => [
'morg.id = userCards.organize_id'
//
'morg.id = userCards.organize_id'
],
//
],
]
//
]
])
//
])
->
where
([
//
->where([
'userCards.user_id'
=>
$user_id
//
'userCards.user_id' => $user_id
])
//
])
->
order
([
'userCards.id'
=>
'ASC'
])
//
->order(['userCards.id' => 'ASC'])
->
toArray
();
//
->toArray();
// pr($UserCards);die;
//
//
pr($UserCards);die;
$this
->
set
(
compact
(
'UserCards'
));
//
$this->set(compact('UserCards'));
// -----------------------------ในส่วนของการ add-------------------------
// -----------------------------ในส่วนของการ add-------------------------
$this
->
autoRender
=
false
;
$this
->
loadModel
(
'TempUserCards'
);
$this
->
loadModel
(
'TempUserCards'
);
$this
->
loadModel
(
'MasterOrganizations'
);
$this
->
loadModel
(
'MasterOrganizations'
);
if
(
$this
->
request
->
is
(
'post'
))
{
if
(
$this
->
request
->
is
(
'post'
))
{
...
@@ -307,11 +307,13 @@ class UserCardsController extends AppController
...
@@ -307,11 +307,13 @@ class UserCardsController extends AppController
}
}
}
else
{
}
else
{
$this
->
Flash
->
error
(
__
(
'ลงทะเบียนไว้อยู่แล้ว'
));
$this
->
Flash
->
error
(
__
(
'ลงทะเบียนไว้อยู่แล้ว'
));
return
$this
->
redirect
([
'controller'
=>
'UserCards'
,
'action'
=>
'viewCard'
]);
// return $this->redirect(['controller' => 'UserCards', 'action' => 'viewCard']);
return
$this
->
redirect
([
'controller'
=>
'Profiles'
,
'action'
=>
'index#box-add-card'
]);
}
}
}
else
{
}
else
{
$this
->
Flash
->
error
(
__
(
'ไม่พบข้อมูล'
));
$this
->
Flash
->
error
(
__
(
'ไม่พบข้อมูล'
));
return
$this
->
redirect
([
'controller'
=>
'UserCards'
,
'action'
=>
'viewCard'
]);
// return $this->redirect(['controller' => 'UserCards', 'action' => 'viewCard']);
return
$this
->
redirect
([
'controller'
=>
'Profiles'
,
'action'
=>
'index#box-add-card'
]);
}
}
}
}
}
}
...
...
www/src/Template/Element/card_from/from_0.ctp
View file @
eb9aa688
...
@@ -3,15 +3,16 @@ use Cake\I18n\Time;
...
@@ -3,15 +3,16 @@ 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">
<div class="modal " id="card_<?php echo $i;?>" tabindex="-1" role="dialog" aria-labelledby=""
<div class="modal fade" id="card_<?php echo $i;?>" tabindex="-1" role="dialog" aria-labelledby="defaultModalLabel" aria-hidden="true">
aria-hidden="true">
<div class="modal-dialog box-ads">
<div class="modal-dialog box-ads">
<a class="close-modal" data-dismiss="modal">X </a>
<a class="close-modal" data-dismiss="modal">X </a>
<div class="container login-container">
<div class="container login-container">
<div class="">
<div class="">
<div class="owl-carousel owl-theme" data-plugin-options="{'items': 1}">
<div class="owl-carousel owl-theme" data-plugin-options="{'items': 1}">
<div class="row rotate270 form_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="form_1-card-img">
<?php echo $this->Html->image('/img/core/img/card-bg-front@3x.png', array('div' => false, 'class' => 'img-responsive img-rounded','style' => '')); ?>
</div>
<div class="row date-name">
<div class="row date-name">
<div class="col-xs-8 ">
<div class="col-xs-8 ">
<br>
<br>
...
@@ -63,7 +64,7 @@ use Cake\I18n\Time;
...
@@ -63,7 +64,7 @@ use Cake\I18n\Time;
</div>
</div>
<!--/ .font-card-->
<!--/ .font-card-->
<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;
')); ?>
<?php echo $this->Html->image('/img/core/img/card-bg-back@3x.png', array('div' => false, 'class' => 'img-responsive img-rounded','style' => '')); ?>
</div>
</div>
<!--/ .back-card-->
<!--/ .back-card-->
</div>
</div>
...
@@ -78,4 +79,57 @@ use Cake\I18n\Time;
...
@@ -78,4 +79,57 @@ use Cake\I18n\Time;
</div>
</div>
<!--/.col-xs-12 -->
<!--/.col-xs-12 -->
</div>
</div>
<!--/row modal card-->
<!--/row modal card-->
\ No newline at end of file
<style>
.form_1 {
width: 100%;
height: 100%;
margin: auto;
padding: auto;
}
.form_1-card-img {
position: absolute;
width: 100%;
margin: auto;
padding: auto;
}
.form_1-card-img img {
position: relative;
width: 100%;
}
.form_1 .date-name {
width: 500px;
margin: 55% 0% 0% -40%;
border-bottom: 0px solid red;
position: absolute;
z-index: 9999;
display: block;
}
.date-name div div {
height: 35px;
}
.form_1 .date-position {
width: 500px;
margin: 70% 0% 0% -15%;
border-bottom: 0px solid #000;
}
.form_1 .date-time {
width: 500px;
margin: 70% 0% 0% 10%;
border-bottom: 0px solid #000;
}
.form_1 .date-label {
width: 500px;
margin: 70% 0% 0% 20%;
border-bottom: 0px solid #000;
}
</style>
\ No newline at end of file
www/src/Template/Element/card_from/from_add_card.ctp
0 → 100644
View file @
eb9aa688
This diff is collapsed.
Click to expand it.
www/src/Template/Profiles/index.ctp
View file @
eb9aa688
This diff is collapsed.
Click to expand it.
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