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
27609774
authored
Jun 05, 2018
by
Teeradone Darunnat
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'integration' into teeradone
parents
35b2d996
fbc32248
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
113 additions
and
71 deletions
+113
-71
www/src/Controller/UserCardsController.php
+1
-1
www/src/Template/Element/card_from/from_add_card.ctp
+0
-1
www/src/Template/Profiles/index.ctp
+110
-67
www/webroot/js/validate/jQuery.validate.addValidate.js
+2
-2
No files found.
www/src/Controller/UserCardsController.php
View file @
27609774
...
...
@@ -289,7 +289,7 @@ class UserCardsController extends AppController
$UserEntities
=
$this
->
UserEntities
->
find
(
'all'
,
[
'conditions'
=>
[
'user_id'
=>
$this
->
Auth
->
user
(
'id'
),
'entity_code'
=>
$
TempUserCards
[
'organize_id
'
]
'entity_code'
=>
$
this
->
request
->
data
[
'UserCards'
][
'organize_code
'
]
]
])
->
first
();
if
(
empty
(
$UserEntities
)){
...
...
www/src/Template/Element/card_from/from_add_card.ctp
View file @
27609774
...
...
@@ -62,7 +62,6 @@
var employee = $("#employee");
var date = $("#date");
$(document).ready(function () {
$("#organize_code").on('change', function () {
var organize_code = $("#organize_code").val();
$('#employee').attr("disabled", true);
...
...
www/src/Template/Profiles/index.ctp
View file @
27609774
...
...
@@ -65,7 +65,13 @@ use Cake\I18n\Time;
<div class="col-xs-12 col-sm-12 col-md-12">
<?php echo __('firstname');?>
<em>* </em>
<?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' => false, 'placeholder' => 'firstname']); ?>
<?php echo $this->Form->input('UserPersonals.firstname_th', [
'class' => 'form-control-reg border-bottom-from label-text-sub required',
'value' => $responseUserPersonal['firstname_th'], 'id' => 'firstname_th',
'type' => 'text', 'label' => false,
'minlength' => '4',
'placeholder' => 'firstname'
]); ?>
<?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>
...
...
@@ -73,7 +79,13 @@ use Cake\I18n\Time;
<div class="col-xs-12 col-sm-12 col-md-12">
<?php echo __('lastname');?>
<em>* </em>
<?php echo $this->Form->input('UserPersonals.lastname_th', ['class' => 'form-control-reg border-bottom-from label-text-sub', 'value' => $responseUserPersonal['lastname_th'], 'id' => 'lastname_th', 'type' => 'text', 'label' => false, 'placeholder' => 'lastname']); ?>
<?php echo $this->Form->input('UserPersonals.lastname_th', [
'class' => 'form-control-reg border-bottom-from label-text-sub required',
'value' => $responseUserPersonal['lastname_th'], 'id' => 'lastname_th',
'type' => 'text', 'label' => false,
'minlength' => '4',
'placeholder' => 'lastname'
]); ?>
<?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>
...
...
@@ -81,7 +93,15 @@ use Cake\I18n\Time;
<div class="col-xs-12 col-sm-12 col-md-12">
<?php echo __('birthdate');?>
<em>* </em>
<?php echo $this->Form->input('UserPersonals.birthdate', ['class' => 'form-control-reg border-bottom-from', 'value' => $dateNow, 'id' => 'datepicker', 'type' => 'text', 'label' => false, 'placeholder' => 'DD-MM-YYYY','readonly'=>'readonly']); ?>
<?php echo $this->Form->input('UserPersonals.birthdate', [
'class' => 'form-control-reg border-bottom-from required datepicker',
'value' => $dateNow,
'id' => 'datepicker',
'type' => 'text',
'label' => false,
'placeholder' => 'DD-MM-YYYY',
'readonly'=>'readonly'
]); ?>
<span class="glyphicon glyphicon-calendar form-control-feedback datepicker"></span>
</div>
</div>
...
...
@@ -134,7 +154,15 @@ use Cake\I18n\Time;
<div class="col-xs-12 col-sm-12 col-md-12">
<?php echo __('mobile');?>
<em>* </em>
<?php echo $this->Form->input('UserPersonals.moblie_no', ['class' => 'form-control-reg border-bottom-from label-text-sub', 'value' => $responseUserPersonal['moblie_no'], 'id' => 'moblieNo', 'type' => 'text', 'label' => false, 'maxlength' => '10', 'placeholder' => 'mobile']); ?>
<?php echo $this->Form->input('UserPersonals.moblie_no', [
'class' => 'form-control-reg border-bottom-from label-text-sub required digits',
'value' => $responseUserPersonal['moblie_no'],
'id' => 'moblieNo', 'type' => 'text',
'label' => false,
'maxlength' => '10',
'minlength' => '10',
'placeholder' => 'mobile'
]); ?>
<?php // echo $this->Form->input('moblie_no', ['class' => 'form-control-reg border-bottom-from label-text-sub', 'value' => $userProfiles->moblie_no, 'id' => 'moblieNo', 'type' => 'text', 'label' => __('เบอร์โทรศัพท์'), 'placeholder' => '000-000-0000']); ?>
</div>
</div>
...
...
@@ -142,15 +170,30 @@ use Cake\I18n\Time;
<div class="col-xs-12 col-sm-12 col-md-12">
<?php echo __('email');?>
<em>* </em>
<!-- <?php echo $this->Form->input('UserPersonals.email', ['class' => 'form-control-reg border-bottom-from label-text-sub', 'value' => $responseUserPersonal['email'], 'id' => 'email', 'label' => false, 'placeholder' => 'mail@xxx.com']); ?> -->
<?php echo $this->Form->input('UserPersonals.email', [
'class' => 'form-control-reg border-bottom-from label-text-sub required email',
'value' => $responseUserPersonal['email'],
'id' => 'email',
'name' => 'email',
'label' => false,
'placeholder' =>
'mail@xxx.com'
]); ?>
<?php // echo $this->Form->input('email', ['class' => 'form-control-reg border-bottom-from label-text-sub', 'value' => $userProfiles->email, 'id' => 'email', 'type' => 'email', 'label' => __('Email'), 'placeholder' => 'mail@xxx.com']); ?>
<input type="text" name="email" id="email" value="<?php echo $responseUserPersonal['email'] ?>" placeholder="mail@xxx.com"
class="form-control-reg border-bottom-from">
<
!-- <
input type="text" name="email" id="email" value="<?php echo $responseUserPersonal['email'] ?>" placeholder="mail@xxx.com"
class="form-control-reg border-bottom-from">
-->
</div>
</div>
<div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12">
<?php echo $this->Form->input('UserPersonals.address', ['class' => 'form-control-reg border-bottom-from label-text-sub', 'value' => $responseUserPersonal['address'], 'id' => 'address', 'type' => 'text', 'label' => __('address'), 'placeholder' => __('112/3 สุขุมวิท 22 ทองหล่อ กทม 10523')]); ?>
<?php echo $this->Form->input('UserPersonals.address', [
'class' => 'form-control-reg border-bottom-from label-text-sub',
'value' => $responseUserPersonal['address'],
'id' => 'address',
'type' => 'text',
'label' => __('address'),
'placeholder' => __('112/3 สุขุมวิท 22 ทองหล่อ กทม 10523')
]); ?>
<?php // echo $this->Form->input('address', ['class' => 'form-control-reg border-bottom-from label-text-sub', 'value' => $userProfiles->address, 'id' => 'address', 'type' => 'text', 'label' => __('ที่อยู่อาศัย'), 'placeholder' => __('112/3 สุขุมวิท 22 ทองหล่อ กทม 10523')]); ?>
</div>
</div>
...
...
@@ -168,7 +211,7 @@ use Cake\I18n\Time;
'value' => $responseUserPersonal['master_country_id'],
'empty' => '---Select---',
'default' => !empty($responseUserPersonal['master_country_id'])? $responseUserPersonal['master_country_id']:'',
'class' => 'form-control border-bottom-from label-text-sub require',
'class' => 'form-control border-bottom-from label-text-sub require
required
',
'style' => 'width:100%'
));
?>
...
...
@@ -188,7 +231,7 @@ use Cake\I18n\Time;
'value' => $responseUserPersonal['master_province_id'],
'empty' => '---Select---',
'default' => !empty($responseUserPersonal['master_province_id'])? $responseUserPersonal['master_province_id']:'',
'class' => 'form-control border-bottom-from label-text-sub require',
'class' => 'form-control border-bottom-from label-text-sub require
required
',
'style' => 'width:100%'
));
?>
...
...
@@ -654,63 +697,63 @@ use Cake\I18n\Time;
owl.trigger('next.owl.carousel');
});
function validateForm() {
var firstname_th = document.getElementById("firstname_th").value;
if (firstname_th == null || firstname_th == "") {
alert("<?php echo __('Please enter your firstname.'); ?>");
return false;
}
var lastname_th = document.getElementById("lastname_th").value;
if (lastname_th == null || lastname_th == "") {
alert("<?php echo __('Please enter your lastname.'); ?>");
return false;
}
var birthdate = document.getElementById("datepicker").value;
if (birthdate == null || birthdate == "") {
alert("<?php echo __('Please enter your birthdate.'); ?>");
return false;
}
var moblieNo = document.getElementById("moblieNo").value;
if (moblieNo == null || moblieNo == "") {
alert("<?php echo __('Please enter your mobile.'); ?>");
return false;
}
if(document.getElementById("moblieNo").value.length != 10)
{
alert("<?php echo __('Please enter a 10 digit mobile number.'); ?>");
return false;
}
var email = document.getElementById("email").value;
if (email == null || email == "") {
alert("<?php echo __('Please enter your email address.'); ?>");
return false;
}
var email = $("#email").val();
if (/(.+)@(.+){2,}\.(.+){2,}/.test(email)) { } else {
alert("<?php echo __('Email address format wrong, Please enter the correct number.'); ?>");
return false;
}
var master_country_id = document.getElementById("master_country_id").value;
if (master_country_id == null || master_country_id == "") {
alert("<?php echo __('Please specify country') ?>");
return false;
}
var master_province_id = document.getElementById("master_province_id").value;
if (master_province_id == null || master_province_id == "") {
alert("<?php echo __('Please specify province') ?>");
return false;
}
$("body").delegate(".is_active", "click", function () {
$('.is_active').not(this).prop('checked', false);
return true;
});
}
//
function validateForm() {
//
var firstname_th = document.getElementById("firstname_th").value;
//
if (firstname_th == null || firstname_th == "") {
//
alert("<?php echo __('Please enter your firstname.'); ?>");
//
return false;
//
}
//
var lastname_th = document.getElementById("lastname_th").value;
//
if (lastname_th == null || lastname_th == "") {
//
alert("<?php echo __('Please enter your lastname.'); ?>");
//
return false;
//
}
//
var birthdate = document.getElementById("datepicker").value;
//
if (birthdate == null || birthdate == "") {
//
alert("<?php echo __('Please enter your birthdate.'); ?>");
//
return false;
//
}
//
var moblieNo = document.getElementById("moblieNo").value;
//
if (moblieNo == null || moblieNo == "") {
//
alert("<?php echo __('Please enter your mobile.'); ?>");
//
return false;
//
}
//
if(document.getElementById("moblieNo").value.length != 10)
//
{
//
alert("<?php echo __('Please enter a 10 digit mobile number.'); ?>");
//
return false;
//
}
//
var email = document.getElementById("email").value;
//
if (email == null || email == "") {
//
alert("<?php echo __('Please enter your email address.'); ?>");
//
return false;
//
}
//
var email = $("#email").val();
//
if (/(.+)@(.+){2,}\.(.+){2,}/.test(email)) { } else {
//
alert("<?php echo __('Email address format wrong, Please enter the correct number.'); ?>");
//
return false;
//
}
//
var master_country_id = document.getElementById("master_country_id").value;
//
if (master_country_id == null || master_country_id == "") {
//
alert("<?php echo __('Please specify country') ?>");
//
return false;
//
}
//
var master_province_id = document.getElementById("master_province_id").value;
//
if (master_province_id == null || master_province_id == "") {
//
alert("<?php echo __('Please specify province') ?>");
//
return false;
//
}
//
$("body").delegate(".is_active", "click", function () {
//
$('.is_active').not(this).prop('checked', false);
//
return true;
//
});
//
}
$(function () {
//==================================================
...
...
www/webroot/js/validate/jQuery.validate.addValidate.js
View file @
27609774
...
...
@@ -71,7 +71,7 @@ jQuery.validator.addMethod('filesize', function (value, element, param) {
jQuery
.
validator
.
addMethod
(
"extension"
,
function
(
value
,
element
,
param
)
{
param
=
typeof
(
param
===
"string"
)
?
param
.
replace
(
/,/g
,
'|'
)
:
"png|jpe?g|gif"
;
return
this
.
optional
(
element
)
||
value
.
match
(
new
RegExp
(
".("
+
param
+
")$"
,
"i"
));
},
jQuery
.
format
(
"นามสกุลของไฟล์แนบต้องเป็น {0} เท่านั้น."
));
},
jQuery
.
validator
.
format
(
"นามสกุลของไฟล์แนบต้องเป็น {0} เท่านั้น."
));
jQuery
.
validator
.
addMethod
(
"accept"
,
function
(
value
,
element
,
param
)
{
var
typeParam
=
typeof
(
param
===
"string"
)
?
param
.
replace
(
/
\s
/g
,
''
).
replace
(
/,/g
,
'|'
)
:
"image/*"
,
optionalValue
=
this
.
optional
(
element
),
...
...
@@ -92,7 +92,7 @@ jQuery.validator.addMethod("accept", function (value, element, param) {
}
}
return
true
;
},
jQuery
.
format
(
"ประเภทของไฟล์แนบต้องเป็น {0} เท่านั้น"
));
},
jQuery
.
validator
.
format
(
"ประเภทของไฟล์แนบต้องเป็น {0} เท่านั้น"
));
jQuery
.
validator
.
addMethod
(
"alphanumeric"
,
function
(
value
,
element
)
{
return
this
.
optional
(
element
)
||
/^
\w
+$/i
.
test
(
value
);
},
"ตัวอักษร หรือตัวเลขเท่านั้น"
);
...
...
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