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
1cf54a6a
authored
May 23, 2018
by
Teeradone-PIM
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
teeradone 23/5/2561
parent
7e963e6a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
17 deletions
+36
-17
www/src/Controller/ProfilesController.php
+17
-11
www/src/Template/Profiles/index.ctp
+6
-4
www/src/Template/Users/signup.ctp
+13
-2
No files found.
www/src/Controller/ProfilesController.php
View file @
1cf54a6a
...
...
@@ -28,7 +28,6 @@ class ProfilesController extends AppController
'user_id'
=>
$id
]
])
->
first
();
//********DropdownCountry********
$this
->
loadModel
(
'MasterCountries'
);
$Country
=
$this
->
MasterCountries
->
find
(
'list'
,
[
...
...
@@ -56,7 +55,7 @@ class ProfilesController extends AppController
$dateNow
=
$res
->
i18nFormat
(
'dd/MM/yyyy'
);
if
(
$this
->
request
->
is
([
'patch'
,
'post'
,
'put'
]))
{
// pr($this->request->data
()
);die;
// pr($this->request->data
['email']
);die;
$data
=
$this
->
request
->
data
;
...
...
@@ -70,22 +69,26 @@ class ProfilesController extends AppController
]
]
)
->
first
();
// pr($this->request->data['email']);die;
if
(
$userPersonals
[
'email'
]
==
$this
->
request
->
data
[
'
UserPersonals'
][
'
email'
]){
if
(
$userPersonals
[
'email'
]
==
$this
->
request
->
data
[
'email'
]){
$chkemail
=
true
;
}
else
{
$user
Persona
ls
=
$this
->
UserPersonals
->
find
(
'all'
,
$user
emai
ls
=
$this
->
UserPersonals
->
find
(
'all'
,
[
'limit'
=>
1
,
'conditions'
=>
[
'email'
=>
$data
[
'
UserPersonals'
][
'
email'
]
'email'
=>
$data
[
'email'
]
]
]
)
->
toArray
();
)
->
first
();
if
(
empty
(
$user
Persona
ls
)){
if
(
empty
(
$user
emai
ls
)){
$chkemail
=
true
;
// pr('true');die;
}
else
{
// pr('false');die;
$chkemail
=
false
;
}
}
...
...
@@ -94,16 +97,19 @@ class ProfilesController extends AppController
$birthdate
=
explode
(
"/"
,
$this
->
request
->
data
[
'UserPersonals'
][
'birthdate'
]);
$birthdate
=
$birthdate
[
2
]
.
'-'
.
$birthdate
[
1
]
.
'-'
.
$birthdate
[
0
];
$userPersonals
=
$this
->
UserPersonals
->
patchEntity
(
$userPersonals
,
$data
[
'UserPersonals'
]);
// pr($userPersonals);die;
//
$userPersonals = $this->UserPersonals->patchEntity($userPersonals, $data['UserPersonals']);
$userPersonals
[
'firstname_th'
]
=
$this
->
request
->
data
[
'UserPersonals'
][
'firstname_th'
];
$userPersonals
[
'lastname_th'
]
=
$this
->
request
->
data
[
'UserPersonals'
][
'lastname_th'
];
$userPersonals
[
'email'
]
=
$this
->
request
->
data
[
'
UserPersonals'
][
'
email'
];
$userPersonals
[
'email'
]
=
$this
->
request
->
data
[
'email'
];
$userPersonals
[
'birthdate'
]
=
$birthdate
;
$userPersonals
[
'user_id'
]
=
$data
[
'Users'
][
'user_id'
];
$userPersonals
[
'master_country_id'
]
=
$this
->
request
->
data
[
'master_country_id'
];
$userPersonals
[
'master_province_id'
]
=
$this
->
request
->
data
[
'master_province_id'
];
$userPersonals
[
'modified_by'
]
=
$id
;
// $userPersonals = $this->UserPersonals->patchEntity($userPersonals, $data['UserPersonals']);
$userPersonals
=
$this
->
Users
->
patchEntity
(
$userPersonals
,
$this
->
request
->
getData
());
// pr($userPersonals);die;
if
(
$this
->
UserPersonals
->
save
(
$userPersonals
))
{
$this
->
Flash
->
success
(
__
(
'Update Complete.'
));
...
...
@@ -115,7 +121,7 @@ class ProfilesController extends AppController
$this
->
Flash
->
error
(
__
(
'Not update. Please, try again.'
));
}
$this
->
set
(
compact
(
'userPersonals'
,
'responseUserProfile'
,
'dateNow'
,
'username'
,
'Country'
,
'Province'
,
'responseUserPersonal'
));
$this
->
set
(
'_serialize'
,
[
'userPersonals'
,
'responseUserProfile'
,
'dateNow'
,
'username'
,
'Country'
,
'Province'
]);
$this
->
set
(
'_serialize'
,
[
'userPersonals'
,
'responseUserProfile'
,
'dateNow'
,
'username'
,
'Country'
,
'Province'
,
'responseUserPersonal'
]);
}
/*****************************************************************************/
...
...
www/src/Template/Profiles/index.ctp
View file @
1cf54a6a
...
...
@@ -120,8 +120,10 @@
</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', 'value' => $responseUserPersonal['email'], 'id' => 'email', 'label' => __('Email'), 'placeholder' => 'mail@xxx.com']); ?
>
<
!-- <?php echo $this->Form->input('UserPersonals.email', ['class' => 'form-control-reg border-bottom-from label-text-sub', 'value' => $responseUserPersonal['email'], 'id' => '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']); ?>
<label class="label-text-sub" style="font-size: 14px"><?php echo __('อีเมลล์');?></label>
<input type="text" name="email" id="email" value="<?php echo $responseUserPersonal['email'] ?>" placeholder="mail@xxx.com" class="form-control-reg border-bottom-from">
</div>
</div>
<div class="form-group has-feedback">
...
...
@@ -440,7 +442,7 @@
<!--
<?php $this->append('scriptBottom'); ?>
<?php $this->append('scriptBottom'); ?>
<script type="text/javascript">
$(function () {
$('#moblieNo').inputmask('999-999-9999');
...
...
@@ -509,4 +511,4 @@
.box-ads .close-modal:hover{
text-decoration: none;
}
</style> -->
\ No newline at end of file
</style>
\ No newline at end of file
www/src/Template/Users/signup.ctp
View file @
1cf54a6a
...
...
@@ -92,7 +92,7 @@
<div class="form-group has-feedback">
<div class="col-md-12">
<label class="label-text-sub"><?php echo __('เบอร์โทรศัพท์');?><em>* </em></label>
<input type="text" name="phone_no" id="phone_no" onkeypress="check_phone();" value="" maxlength="1
0
" placeholder="000-000-0000" class="mask form-control-reg border-bottom-from">
<input type="text" name="phone_no" id="phone_no" onkeypress="check_phone();" value="" maxlength="1
2
" placeholder="000-000-0000" class="mask form-control-reg border-bottom-from">
</div>
</div>
</div>
...
...
@@ -164,6 +164,17 @@
</div>
</div>
<!-- ------------------------------- popup ----------------------------------- -->
<script type="text/javascript">
$(function () {
$('#phone_no').inputmask('999-999-9999');
//==================================================
// CHANGE Date Times
//==================================================
$('#datepicker').datepicker({
format: 'dd/mm/yyyy'
});
});
</script>
<script>
$(document).ready(function() {
...
...
@@ -224,7 +235,7 @@
alert("กรุณากรอก เบอร์โทรศัพท์ของท่าน");
return false;
}
if(document.getElementById("phone_no").value.length
< 10 || document.getElementById("phone_no").value.length > 10
)
if(document.getElementById("phone_no").value.length
!= 12
)
{
alert('กรุณากรอกเบอร์โทรศัพท์ ให้ครบ 10 หลัก');
return false;
...
...
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