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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
19 deletions
+38
-19
www/src/Controller/ProfilesController.php
+19
-13
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
...
@@ -28,7 +28,6 @@ class ProfilesController extends AppController
'user_id'
=>
$id
]
'user_id'
=>
$id
]
])
->
first
();
])
->
first
();
//********DropdownCountry********
//********DropdownCountry********
$this
->
loadModel
(
'MasterCountries'
);
$this
->
loadModel
(
'MasterCountries'
);
$Country
=
$this
->
MasterCountries
->
find
(
'list'
,
[
$Country
=
$this
->
MasterCountries
->
find
(
'list'
,
[
...
@@ -56,7 +55,7 @@ class ProfilesController extends AppController
...
@@ -56,7 +55,7 @@ class ProfilesController extends AppController
$dateNow
=
$res
->
i18nFormat
(
'dd/MM/yyyy'
);
$dateNow
=
$res
->
i18nFormat
(
'dd/MM/yyyy'
);
if
(
$this
->
request
->
is
([
'patch'
,
'post'
,
'put'
]))
{
if
(
$this
->
request
->
is
([
'patch'
,
'post'
,
'put'
]))
{
// pr($this->request->data
()
);die;
// pr($this->request->data
['email']
);die;
$data
=
$this
->
request
->
data
;
$data
=
$this
->
request
->
data
;
...
@@ -70,23 +69,27 @@ class ProfilesController extends AppController
...
@@ -70,23 +69,27 @@ class ProfilesController extends AppController
]
]
]
]
)
->
first
();
)
->
first
();
// pr($this->request->data['email']);die;
if
(
$userPersonals
[
'email'
]
==
$this
->
request
->
data
[
'
UserPersonals'
][
'
email'
]){
if
(
$userPersonals
[
'email'
]
==
$this
->
request
->
data
[
'email'
]){
$chkemail
=
true
;
$chkemail
=
true
;
}
else
{
}
else
{
$user
Persona
ls
=
$this
->
UserPersonals
->
find
(
'all'
,
$user
emai
ls
=
$this
->
UserPersonals
->
find
(
'all'
,
[
[
'limit'
=>
1
,
'limit'
=>
1
,
'conditions'
=>
[
'conditions'
=>
[
'email'
=>
$data
[
'
UserPersonals'
][
'
email'
]
'email'
=>
$data
[
'email'
]
]
]
]
]
)
->
toArray
();
)
->
first
();
if
(
empty
(
$user
Persona
ls
)){
if
(
empty
(
$user
emai
ls
)){
$chkemail
=
true
;
$chkemail
=
true
;
// pr('true');die;
}
else
{
}
else
{
$chkemail
=
false
;
// pr('false');die;
$chkemail
=
false
;
}
}
}
}
...
@@ -94,17 +97,20 @@ class ProfilesController extends AppController
...
@@ -94,17 +97,20 @@ class ProfilesController extends AppController
$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
];
// pr($userPersonals);die;
$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
[
'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'
]
=
$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
))
{
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'
]);
...
@@ -115,7 +121,7 @@ class ProfilesController extends AppController
...
@@ -115,7 +121,7 @@ class ProfilesController extends AppController
$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'
));
$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 @@
...
@@ -120,8 +120,10 @@
</div>
</div>
<div class="form-group has-feedback">
<div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12">
<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']); ?>
<?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>
</div>
<div class="form-group has-feedback">
<div class="form-group has-feedback">
...
@@ -440,7 +442,7 @@
...
@@ -440,7 +442,7 @@
<!--
<?php $this->append('scriptBottom'); ?>
<?php $this->append('scriptBottom'); ?>
<script type="text/javascript">
<script type="text/javascript">
$(function () {
$(function () {
$('#moblieNo').inputmask('999-999-9999');
$('#moblieNo').inputmask('999-999-9999');
...
@@ -509,4 +511,4 @@
...
@@ -509,4 +511,4 @@
.box-ads .close-modal:hover{
.box-ads .close-modal:hover{
text-decoration: none;
text-decoration: none;
}
}
</style> -->
</style>
\ No newline at end of file
\ No newline at end of file
www/src/Template/Users/signup.ctp
View file @
1cf54a6a
...
@@ -92,7 +92,7 @@
...
@@ -92,7 +92,7 @@
<div class="form-group has-feedback">
<div class="form-group has-feedback">
<div class="col-md-12">
<div class="col-md-12">
<label class="label-text-sub"><?php echo __('เบอร์โทรศัพท์');?><em>* </em></label>
<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>
</div>
</div>
</div>
...
@@ -164,6 +164,17 @@
...
@@ -164,6 +164,17 @@
</div>
</div>
</div>
</div>
<!-- ------------------------------- popup ----------------------------------- -->
<!-- ------------------------------- popup ----------------------------------- -->
<script type="text/javascript">
$(function () {
$('#phone_no').inputmask('999-999-9999');
//==================================================
// CHANGE Date Times
//==================================================
$('#datepicker').datepicker({
format: 'dd/mm/yyyy'
});
});
</script>
<script>
<script>
$(document).ready(function() {
$(document).ready(function() {
...
@@ -224,7 +235,7 @@
...
@@ -224,7 +235,7 @@
alert("กรุณากรอก เบอร์โทรศัพท์ของท่าน");
alert("กรุณากรอก เบอร์โทรศัพท์ของท่าน");
return false;
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 หลัก');
alert('กรุณากรอกเบอร์โทรศัพท์ ให้ครบ 10 หลัก');
return false;
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