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
10bc3a38
authored
May 24, 2018
by
Teeradone-PIM
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
teeradone
parent
1cf54a6a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
26 deletions
+12
-26
www/src/Controller/CheckemailsController.php
+9
-23
www/src/Template/Profiles/index.ctp
+1
-1
www/src/Template/Users/signup.ctp
+2
-2
No files found.
www/src/Controller/CheckemailsController.php
View file @
10bc3a38
...
...
@@ -3,29 +3,11 @@ namespace App\Controller;
use
App\Controller\AppController
;
class
CheckemailsController
extends
AppController
{
public
function
checkemailregister
(){
// die('jjjjj');
$this
->
autoRender
=
false
;
if
(
$this
->
request
->
is
(
'post'
))
{
$this
->
loadModel
(
'UserPersonals'
);
$emails
=
$this
->
UserPersonals
->
find
(
'all'
,[
'conditions'
=>
[
'email'
=>
$this
->
request
->
data
[
'email'
]
]
])
->
first
();
if
(
!
empty
(
$emails
)
&&
$emails
[
'email'
]
!=
''
&&
$emails
[
'email'
]
!=
'-'
){
$emails
[
'chk'
]
=
'false'
;
$data
=
json_encode
(
$emails
);
echo
$data
;
}
else
{
$emails
[
'chk'
]
=
'true'
;
$data
=
json_encode
(
$emails
);
echo
$data
;
}
public
function
initialize
()
{
parent
::
initialize
();
$this
->
Auth
->
allow
(
'checkemail'
);
}
}
public
function
checkemailedit
(){
public
function
checkemail
(){
// die('jjjjj');
$this
->
autoRender
=
false
;
if
(
$this
->
request
->
is
(
'post'
))
{
...
...
@@ -36,15 +18,19 @@ class CheckemailsController extends AppController {
]
])
->
first
();
if
(
!
empty
(
$emails
)
&&
$emails
[
'email'
]
!=
''
&&
$emails
[
'email'
]
!=
'-'
){
if
(
!
empty
(
$this
->
request
->
data
[
'userId'
])){
if
(
$this
->
request
->
data
[
'userId'
]
==
$emails
[
'user_id'
]){
$emails
[
'chk'
]
=
'true'
;
$data
=
json_encode
(
$emails
);
echo
$data
;
}
else
{
}
$emails
[
'chk'
]
=
'false'
;
$data
=
json_encode
(
$emails
);
echo
$data
;
}
$emails
[
'chk'
]
=
'false'
;
$data
=
json_encode
(
$emails
);
echo
$data
;
}
else
{
$emails
[
'chk'
]
=
'true'
;
$data
=
json_encode
(
$emails
);
...
...
www/src/Template/Profiles/index.ctp
View file @
10bc3a38
...
...
@@ -212,7 +212,7 @@
$("#email").on('change',function(){
var userId = document.getElementById("userId").value;
var email = document.getElementById("email").value;
$.post("/Checkemails/checkemail
edit
", {email: email,userId: userId}, function(data) {
$.post("/Checkemails/checkemail", {email: email,userId: userId}, function(data) {
// console.log(data);
data = jQuery.parseJSON(data);
if(data['chk'] == 'false'){
...
...
www/src/Template/Users/signup.ctp
View file @
10bc3a38
...
...
@@ -180,8 +180,8 @@
$(document).ready(function() {
$("#fremail").on('change',function(){
var email = document.getElementById("fremail").value;
$.post("/Checkemails/checkemail
register
", {email: email}, function(data) {
//
console.log(data);
$.post("/Checkemails/checkemail", {email: email}, function(data) {
console.log(data);
data = jQuery.parseJSON(data);
if(data['chk'] == 'false'){
alert("อีเมลล์นี้มีในระบบแล้ว");
...
...
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