Commit be304415 by Teeradone Darunnat

Merge branch 'integration' into teeradone

parents 1e7da6e4 73b7189a
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
<?php echo $this->Form->create('UserCards', [ <?php echo $this->Form->create('UserCards', [
'id' => 'frmSignIn', 'id' => 'frmSignIn',
'type' => 'file', 'type' => 'file',
'onsubmit' => 'return check();',
'url' => ['controller' => 'user-cards', 'action' => 'view-card'] 'url' => ['controller' => 'user-cards', 'action' => 'view-card']
]); ?> ]); ?>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
...@@ -20,25 +19,22 @@ ...@@ -20,25 +19,22 @@
<?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']); ?> <?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']); ?> <?php echo $this->Form->input('UserCards.organize_code', ['class' => 'form-control-reg border-bottom-from label-text-sub required alphanumeric', '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>
</div> </div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<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->Form->input('UserCards.employee', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'id' => 'employee', 'type' => 'text', 'label' => __('Ref 1'), 'placeholder' => 'Ref 1', 'disabled']); ?> <?php echo $this->Form->input('UserCards.employee', ['class' => 'form-control-reg border-bottom-from label-text-sub required alphanumeric', 'id' => 'employee', 'type' => 'text', 'label' => __('Ref 1'), 'placeholder' => 'Ref 1', 'disabled']); ?>
<label id="nameemp_th" style="color: green"></label> <label id="nameemp_th" style="color: green"></label>
<label id="noepm_th" style="color: red"></label> <label id="noepm_th" style="color: red"></label>
</div> </div>
</div> </div>
<div class="form-group has-feedback bootstrap-iso"> <div class="form-group has-feedback bootstrap-iso">
<div class="col-xs-12 col-sm-12 col-md-12"> <div class="col-xs-12 col-sm-12 col-md-12">
<label class="label-text-sub"> <label class="label-text-sub"><?php echo __('Ref 2');?></label>
<?php echo __('Ref 2');?> <input type="text" name="UserCards[birthdate]" id="date" placeholder="Ref 2" value="" readonly placeholder="DD-MM-YYYY" data-date-format="mm/dd/yyyy" class="form-control-reg border-bottom-from required" disabled>
</label>
<input type="text" name="UserCards[birthdate]" id="date" placeholder="Ref 2" value="" readonly placeholder="DD-MM-YYYY" data-date-format="mm/dd/yyyy"
class="form-control-reg border-bottom-from" disabled>
<span class="glyphicon glyphicon-calendar form-control-feedback"></span> <span class="glyphicon glyphicon-calendar form-control-feedback"></span>
</div> </div>
</div> </div>
...@@ -53,9 +49,6 @@ ...@@ -53,9 +49,6 @@
</div> </div>
<!--/.col-xs-12 --> <!--/.col-xs-12 -->
<?php $this->append('scriptBottom'); ?> <?php $this->append('scriptBottom'); ?>
<script type="text/javascript"> <script type="text/javascript">
var organize_id = $("#organize_id"); var organize_id = $("#organize_id");
...@@ -147,24 +140,6 @@ ...@@ -147,24 +140,6 @@
date_input.datepicker(options); date_input.datepicker(options);
}); });
function check() {
if ($("#organize_code").val() == '') {
alert("<?php echo __('Please enter Company Code') ?>");
organize_id.focus();
return false;
}
if (employee.val() == '') {
alert("<?php echo __('Please enter Ref1') ?>");
employee.focus();
return false;
}
if (date.val() == '') {
alert("<?php echo __('Please enter Ref2') ?>");
date.focus();
return false;
}
}
</script> </script>
<style> <style>
#alertBox { #alertBox {
......
...@@ -66,8 +66,9 @@ use Cake\I18n\Time; ...@@ -66,8 +66,9 @@ use Cake\I18n\Time;
<?php echo __('firstname');?> <?php echo __('firstname');?>
<em>* </em> <em>* </em>
<?php echo $this->Form->input('UserPersonals.firstname_th', [ <?php echo $this->Form->input('UserPersonals.firstname_th', [
'class' => 'form-control-reg border-bottom-from label-text-sub required', 'class' => 'form-control-reg border-bottom-from label-text-sub required letterthai',
'value' => $responseUserPersonal['firstname_th'], 'id' => 'firstname_th', 'value' => $responseUserPersonal['firstname_th'],
'id' => 'firstname_th',
'type' => 'text', 'label' => false, 'type' => 'text', 'label' => false,
'minlength' => '4', 'minlength' => '4',
'placeholder' => 'firstname' 'placeholder' => 'firstname'
...@@ -80,8 +81,9 @@ use Cake\I18n\Time; ...@@ -80,8 +81,9 @@ use Cake\I18n\Time;
<?php echo __('lastname');?> <?php echo __('lastname');?>
<em>* </em> <em>* </em>
<?php echo $this->Form->input('UserPersonals.lastname_th', [ <?php echo $this->Form->input('UserPersonals.lastname_th', [
'class' => 'form-control-reg border-bottom-from label-text-sub required', 'class' => 'form-control-reg border-bottom-from label-text-sub required letterthai',
'value' => $responseUserPersonal['lastname_th'], 'id' => 'lastname_th', 'value' => $responseUserPersonal['lastname_th'],
'id' => 'lastname_th',
'type' => 'text', 'label' => false, 'type' => 'text', 'label' => false,
'minlength' => '4', 'minlength' => '4',
'placeholder' => 'lastname' 'placeholder' => 'lastname'
...@@ -157,7 +159,8 @@ use Cake\I18n\Time; ...@@ -157,7 +159,8 @@ use Cake\I18n\Time;
<?php echo $this->Form->input('UserPersonals.moblie_no', [ <?php echo $this->Form->input('UserPersonals.moblie_no', [
'class' => 'form-control-reg border-bottom-from label-text-sub required digits', 'class' => 'form-control-reg border-bottom-from label-text-sub required digits',
'value' => $responseUserPersonal['moblie_no'], 'value' => $responseUserPersonal['moblie_no'],
'id' => 'moblieNo', 'type' => 'text', 'id' => 'moblieNo',
'type' => 'text',
'label' => false, 'label' => false,
'maxlength' => '10', 'maxlength' => '10',
'minlength' => '10', 'minlength' => '10',
...@@ -171,7 +174,7 @@ use Cake\I18n\Time; ...@@ -171,7 +174,7 @@ use Cake\I18n\Time;
<?php echo __('email');?> <?php echo __('email');?>
<em>* </em> <em>* </em>
<?php echo $this->Form->input('UserPersonals.email', [ <?php echo $this->Form->input('UserPersonals.email', [
'class' => 'form-control-reg border-bottom-from label-text-sub required email', 'class' => 'form-control-reg border-bottom-from label-text-sub required email emailtext',
'value' => $responseUserPersonal['email'], 'value' => $responseUserPersonal['email'],
'id' => 'email', 'id' => 'email',
'name' => 'email', 'name' => 'email',
...@@ -652,14 +655,14 @@ use Cake\I18n\Time; ...@@ -652,14 +655,14 @@ use Cake\I18n\Time;
}); });
}); });
$("#moblieNo").on('change',function(){ // $("#moblieNo").on('change',function(){
var elem = document.getElementById('moblieNo').value; // var elem = document.getElementById('moblieNo').value;
// console.log(elem); // // console.log(elem);
if(!elem.match(/^([A-Za-zก-๙])+$/i)){ // if(!elem.match(/^([A-Za-zก-๙])+$/i)){
alert("<?php echo __('only numbers'); ?>"); // alert("<?php echo __('only numbers'); ?>");
return false; // return false;
} // }
}); // });
//================================================== //==================================================
// CHANGE Province According Country // CHANGE Province According Country
......
...@@ -27,14 +27,11 @@ ...@@ -27,14 +27,11 @@
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------
*/ */
jQuery.validator.addMethod("emailtext", function (value, element) { jQuery.validator.addMethod("emailtext", function (value, element) {
return this.optional(element) || /^([a-zA-Z@_.])+$/.test(value); return this.optional(element) || /^([a-zA-Z0-9@_.])+$/.test(value);
}, "โปรดระบุที่อยู่อีเมล์ที่ถูกต้อง."); }, "โปรดระบุที่อยู่อีเมล์ที่ถูกต้อง.");
jQuery.validator.addMethod("letterthai", function (value, element) { jQuery.validator.addMethod("letterthai", function (value, element) {
return this.optional(element) || /^([a-zA-Zก-๙])+$/.test(value); return this.optional(element) || /^([a-zA-Zก-๙])+$/.test(value);
}, "เฉพาะตัวอักษรเท่านั้น."); }, "เฉพาะตัวอักษรเท่านั้น.");
jQuery.validator.addMethod("letterthai", function (value, element) {
return this.optional(element) || /^([a-zA-Zก-๙])+$/.test(value);
}, "เฉพาะตัวอักษรเท่านั้น.");
jQuery.validator.addMethod("letters", function (value, element) { jQuery.validator.addMethod("letters", function (value, element) {
return this.optional(element) || /^[a-zA-Z]+$/i.test(value); return this.optional(element) || /^[a-zA-Z]+$/i.test(value);
}, "เฉพาะตัวอักษรเท่านั้น."); }, "เฉพาะตัวอักษรเท่านั้น.");
......
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