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
bfaab62b
authored
May 22, 2018
by
Teeradone-PIM
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
teeradone: script
parent
c9ff32ad
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
48 deletions
+58
-48
www/src/Controller/UserCardsController.php
+3
-3
www/src/Template/Profiles/index.ctp
+21
-17
www/src/Template/Users/signup.ctp
+34
-28
No files found.
www/src/Controller/UserCardsController.php
View file @
bfaab62b
...
...
@@ -231,7 +231,7 @@ class UserCardsController extends AppController
}
public
function
viewCard
(
$user_id
=
null
){
$this
->
viewBuilder
()
->
layout
(
'blank'
);
$user_id
=
$this
->
Auth
->
user
(
'id'
);
// $user = $this->Auth(
);
$this
->
loadModel
(
'UserCards'
);
$UserCards
=
$this
->
UserCards
->
find
(
'all'
)
->
select
(
$this
->
UserCards
)
...
...
@@ -301,8 +301,8 @@ class UserCardsController extends AppController
$userCard
[
'date_expiry'
]
=
$TempUserCards
[
'date_expiry'
];
$userCard
[
'signature'
]
=
$TempUserCards
[
'signature'
];
$userCard
[
'is_used'
]
=
$TempUserCards
[
'is_used'
];
$userCard
[
'created_by'
]
=
$this
->
Auth
->
user
(
'id'
)
;
$userCard
[
'user_id'
]
=
$this
->
Auth
->
user
(
'id'
)
;
$userCard
[
'created_by'
]
=
1
;
$userCard
[
'user_id'
]
=
1
;
// pr($userCard);die;
if
(
$this
->
UserCards
->
save
(
$userCard
))
{
$TempUserCards
[
'is_used'
]
=
0
;
...
...
www/src/Template/Profiles/index.ctp
View file @
bfaab62b
...
...
@@ -63,7 +63,7 @@
<?php // debug($userProfiles); exit;?>
<div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12">
<?php echo $this->Form->input('firstname_th', ['class' => 'form-control-reg border-bottom-from label-text-sub', 'value' => $responseUserPersonal['firstname_th'], 'id' => 'firstname_th', 'type' => 'text', 'label' => __('ชื่อ'), 'placeholder' => 'ชื่อ']); ?>
<?php echo $this->Form->input('
UserPersonals.
firstname_th', ['class' => 'form-control-reg border-bottom-from label-text-sub', 'value' => $responseUserPersonal['firstname_th'], 'id' => 'firstname_th', 'type' => 'text', 'label' => __('ชื่อ'), 'placeholder' => 'ชื่อ']); ?>
<?php // echo $this->Form->input('fullname', ['class' => 'form-control-reg border-bottom-from label-text-sub', 'value' => $userProfiles->firstname_th . ' ' . $userProfiles->lastname_th, 'id' => 'fullName', 'type' => 'text', 'label' => __('ชื่อ - นามสกุล'), 'placeholder' => 'ชื่อ - นามสกุล']); ?>
</div>
</div>
...
...
@@ -206,20 +206,20 @@
</div>
<script>
//
$(document).ready(function() {
// $("#fr
email").on('change',function(){
// var email = document.getElementById("fremail")
;
// alert("sssss")
;
// $.post("/Checkemails/checkemail", {email: 'email'
}, function(data) {
// if(data == false){
// alert("sssss"
);
// return false;
// } else {
// return tru
e;
//
}
//
});
//
});
//
});
$(document).ready(function() {
$("#
email").on('change',function(){
var userId = document.getElementById("userId").value
;
var email = document.getElementById("email").value
;
$.post("/Checkemails/checkemailedit", {email: email,userId: userId
}, function(data) {
// console.log(data);
data = jQuery.parseJSON(data
);
if(data['chk'] == 'false'){
alert("อีเมลล์นี้มีในระบบแล้ว");
return fals
e;
}
});
});
});
function validateForm() {
var firstname_th = document.getElementById("firstname_th").value;
if (firstname_th == null || firstname_th == "") {
...
...
@@ -260,10 +260,14 @@
alert("รูปแบบที่อยู่อีเมลล์ผิด กรุณากรอกให้ถูกต้อง");
return false;
}
// if (email=="stratos0231@gmail.com") { } else {
// alert("aaaaaaaaaaaaaaaaaaaa");
// var email = document.getElementById("email").value;
// $.post("/Checkemails/checkemail", {email: email}, function(data) {
// data = jQuery.parseJSON(data);
// if(data['chk'] == 'false'){
// alert("อีเมลล์นี้มีในระบบแล้ว");
// return false;
// }
// });
$("body").delegate(".is_active", "click", function () {
$('.is_active').not(this).prop('checked', false);
...
...
www/src/Template/Users/signup.ctp
View file @
bfaab62b
...
...
@@ -29,7 +29,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="username" id="
first
name" value="" placeholder="USERNAME" class="form-control-reg border-bottom-from">
<input type="text" name="username" id="
user
name" value="" placeholder="USERNAME" class="form-control-reg border-bottom-from">
</div>
</div>
...
...
@@ -165,23 +165,21 @@
</div>
<!-- ------------------------------- popup ----------------------------------- -->
<script>
// $(document).ready(function() {
// $("#fremail").on('change',function(){
// var email = document.getElementById("fremail");
// // alert('email');
// $.post("/Checkemails/checkemail", {email: 'email'}, function(data) {
// alert('data');
$(document).ready(function() {
$("#fremail").on('change',function(){
var email = document.getElementById("fremail").value;
$.post("/Checkemails/checkemailregister", {email: email}, function(data) {
// console.log(data);
// if(data == 'false'){
// alert("ddddddd");
// return false;
// } else {
// alert("aaaaaaa");
// return true;
// }
// });
// });
// });
data = jQuery.parseJSON(data);
if(data['chk'] == 'false'){
alert("อีเมลล์นี้มีในระบบแล้ว");
return false;
}
});
});
});
function validateForm() {
var firstname = document.getElementById("firstname").value;
if (firstname == null || firstname == "") {
...
...
@@ -203,7 +201,16 @@
alert('กรุณาระบุชื่อผู้ใช้งานอย่างน้อย 5 ตัวอักษร');
return false;
}
var master_country_id = document.getElementById("master_country_id").value;
if (master_country_id == null || master_country_id == "") {
alert("กรุณาระบุประเทศ");
return false;
}
var master_province_id = document.getElementById("master_province_id").value;
if (master_province_id == null || master_province_id == "") {
alert("กรุณาระบุจังหวัด");
return false;
}
var birthdate = document.getElementById("date").value;
...
...
@@ -234,18 +241,17 @@
alert("รูปแบบที่อยู่อีเมลล์ผิด กรุณากรอกให้ถูกต้อง");
return false;
}
// var email = document.forms["createAccount"]["email"].value;
// $.post("/Checkemails/checkemail", {email: 'email'}, function(data){
// alert('sadasd');
// if(data=='false'){
// alert("อีเมลล์นี้มีอยู่ในระบบแล้ว");
// return false;
// }
// }
// if (email=="stratos0231@gmail.com") { } else {
// alert(email);
// var email = document.getElementById("fremail").value;
// $.post("/Checkemails/checkemailregister", {email: email}, function(data) {
// data = jQuery.parseJSON(data);
// if(data['chk'] == 'false'){
// alert("อีเมลล์นี้มีในระบบแล้ว");
// return false;
// } else {
// alert("ssss");
// return true;
// }
// });
...
...
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