Commit 7cd84950 by Teeradone Darunnat

Merge branch 'integration' into teeradone

parents 870bef27 947fa85b
...@@ -18,13 +18,11 @@ class UsersController extends AppController { ...@@ -18,13 +18,11 @@ class UsersController extends AppController {
*/ */
public function initialize() { public function initialize() {
parent::initialize(); parent::initialize();
// $this->Auth->allow(['signin', 'signout', 'signup', 'verify', 'forgotPassword', 'createAccount', 'pinCode', 'pinCodepassword', 'changeForgotpassword']);
// $this->Auth->allow(['signin', 'signout', 'signup', 'verify', 'forgotPassword', 'createAccount', 'pinCode', 'pinCodepassword', 'changeForgotpassword']); $this->Auth->allow(['signin', 'signout', 'signup', 'verify', 'forgotPassword', 'createAccount', 'pinCode', 'pinCodepassword', 'registersendpin', 'forgotsendpin', 'changeForgotpassword', 'reautorize']);
$this->Auth->allow(['signin', 'signout', 'signup', 'verify','forgotPassword','createAccount','pinCode','pinCodepassword','registersendpin','forgotsendpin','changeForgotpassword']);
} }
public function index() { public function index() {
return $this->redirect(['controller' => 'Users', 'action' => 'signin']); return $this->redirect(['controller' => 'Users', 'action' => 'signin']);
} }
......
<?php
use Cake\I18n\Time;
?>
<div class="row"> <div class="row">
<div class="col-xs-12 col-sm-12 col-md-12"> <div class="col-xs-12 col-sm-12 col-md-12">
<div class="modal fade" id="defaultModal_<?php echo $i;?>" tabindex="-1" role="dialog" aria-labelledby="defaultModalLabel" <div class="modal " id="card_<?php echo $i;?>" tabindex="-1" role="dialog" aria-labelledby=""
aria-hidden="true"> aria-hidden="true">
<div class="modal-dialog box-ads"> <div class="modal-dialog box-ads">
<a class="close-modal" data-dismiss="modal">X </a> <a class="close-modal" data-dismiss="modal">X </a>
......
...@@ -158,8 +158,8 @@ use Cake\I18n\Time; ...@@ -158,8 +158,8 @@ use Cake\I18n\Time;
<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->Flash->render(); ?> <?php echo $this->Flash->render(); ?>
<?php echo $this->Form->hidden('UserCards.user_id', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'id' => 'userId', 'type' => 'text', 'placeholder' => 'USERNAME']); ?> <?php echo $this->Form->hidden('UserCards.user_id', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'id' => 'userId', 'type' => 'text', 'placeholder' => 'USERNAME']); ?>
<?php echo $this->Form->hidden('UserCards.organize_id', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'id' => 'organize_id', 'type' => 'text', 'label' => __('ไอดีใช้งาน'), 'placeholder' => 'USERNAME', 'required']); ?> <?php echo $this->Form->hidden('UserCards.organize_id', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'id' => 'organize_id', 'type' => 'text', 'label' => __('ไอดีใช้งาน'), 'placeholder' => 'USERNAME']); ?>
<?php echo $this->Form->input('UserCards.organize_code', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'id' => 'organize_code', 'type' => 'text', 'label' => __('Company Code'), 'placeholder' => 'Company Code', 'required']); ?> <?php echo $this->Form->input('UserCards.organize_code', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'id' => 'organize_code', 'type' => 'text', 'label' => __('Company Code'), 'placeholder' => 'Company Code']); ?>
<label id="nameorg_th" style="color: green"></label> <label id="nameorg_th" style="color: green"></label>
<label id="noorg_th" style="color: red"></label> <label id="noorg_th" style="color: red"></label>
</div> </div>
...@@ -499,7 +499,6 @@ use Cake\I18n\Time; ...@@ -499,7 +499,6 @@ use Cake\I18n\Time;
var date = $("#date"); var date = $("#date");
$(document).ready(function () { $(document).ready(function () {
$("#organize_code").on('change', function () { $("#organize_code").on('change', function () {
// alert(moment("05/22/2012", 'MM/DD/YYYY',true).isValid()); //true
var organize_code = $("#organize_code").val(); var organize_code = $("#organize_code").val();
$('#employee').attr("disabled", true); $('#employee').attr("disabled", true);
$('#date').attr("disabled", true); $('#date').attr("disabled", true);
...@@ -513,6 +512,7 @@ use Cake\I18n\Time; ...@@ -513,6 +512,7 @@ use Cake\I18n\Time;
if (data != 'false') { if (data != 'false') {
data = jQuery.parseJSON(data); data = jQuery.parseJSON(data);
if (data['chkuser'] == true) { if (data['chkuser'] == true) {
$("#noorg_th").text('');
$("#noorg_th").text('ลงทะเบียนกับ ' + data[0]['org_name_th'] + $("#noorg_th").text('ลงทะเบียนกับ ' + data[0]['org_name_th'] +
' แล้ว'); ' แล้ว');
$("#nameorg_th").text(''); $("#nameorg_th").text('');
...@@ -520,6 +520,7 @@ use Cake\I18n\Time; ...@@ -520,6 +520,7 @@ use Cake\I18n\Time;
organize_id.val(''); organize_id.val('');
employee.val(''); employee.val('');
} else if (data['chkuser'] == false) { } else if (data['chkuser'] == false) {
$("#nameorg_th").text('');
$("#nameorg_th").text(data[0]['org_name_th']); $("#nameorg_th").text(data[0]['org_name_th']);
$("#noorg_th").text(''); $("#noorg_th").text('');
$("#checkbutton").removeAttr("disabled"); $("#checkbutton").removeAttr("disabled");
...@@ -527,6 +528,7 @@ use Cake\I18n\Time; ...@@ -527,6 +528,7 @@ use Cake\I18n\Time;
organize_id.val(data[0]['id']); organize_id.val(data[0]['id']);
} }
} else { } else {
$("#noorg_th").text('');
$("#noorg_th").text('ไม่พบข้อมูล'); $("#noorg_th").text('ไม่พบข้อมูล');
$("#nameorg_th").text(''); $("#nameorg_th").text('');
$('#employee').attr("disabled", true); $('#employee').attr("disabled", true);
...@@ -547,17 +549,20 @@ use Cake\I18n\Time; ...@@ -547,17 +549,20 @@ use Cake\I18n\Time;
if (data != 'false') { if (data != 'false') {
data = jQuery.parseJSON(data); data = jQuery.parseJSON(data);
if (data['chkuser'] == true) { if (data['chkuser'] == true) {
$("#noepm_th").text('');
$("#noepm_th").text('ลงทะเบียนแล้ว'); $("#noepm_th").text('ลงทะเบียนแล้ว');
$("#nameemp_th").text(''); $("#nameemp_th").text('');
$('#date').attr("disabled", true); $('#date').attr("disabled", true);
date.val(''); date.val('');
} else if (data['chkuser'] == false) { } else if (data['chkuser'] == false) {
$("#nameemp_th").text('');
$("#nameemp_th").text(data['prefix_name_th'] + data['firstname_th'] + $("#nameemp_th").text(data['prefix_name_th'] + data['firstname_th'] +
' ' + data['lastname_th']); ' ' + data['lastname_th']);
$("#noepm_th").text(''); $("#noepm_th").text('');
$("#date").removeAttr("disabled"); $("#date").removeAttr("disabled");
} }
} else { } else {
$("#noepm_th").text('');
$("#noepm_th").text( $("#noepm_th").text(
'"ไม่พบข้อมูลที่ต้องการ" กรุณากรอกรหัสข้อมูลที่ถูกต้องและกดตรวจสอบ' '"ไม่พบข้อมูลที่ต้องการ" กรุณากรอกรหัสข้อมูลที่ถูกต้องและกดตรวจสอบ'
); );
...@@ -570,6 +575,11 @@ use Cake\I18n\Time; ...@@ -570,6 +575,11 @@ use Cake\I18n\Time;
}); });
function check() { function check() {
if ($("#organize_code").val() == '') {
alert('กรุณากรอก Company Code');
organize_id.focus();
return false;
}
if (employee.val() == '') { if (employee.val() == '') {
alert('กรุณากรอก Ref1'); alert('กรุณากรอก Ref1');
employee.focus(); employee.focus();
......
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