Commit 7cd84950 by Teeradone Darunnat

Merge branch 'integration' into teeradone

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