Commit bfaab62b by Teeradone-PIM

teeradone: script

parent c9ff32ad
......@@ -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;
......
......@@ -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() {
// $("#fremail").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 true;
// }
// });
// });
// });
$(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 false;
}
});
});
});
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);
......
......@@ -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="firstname" value="" placeholder="USERNAME" class="form-control-reg border-bottom-from">
<input type="text" name="username" id="username" 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;
// }
// });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment