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
88e3c9fb
authored
May 30, 2018
by
Zen-PC\Zen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Zen : update Profiles
parent
c818f456
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
10 deletions
+20
-10
www/src/Controller/ProfilesController.php
+2
-0
www/src/Template/Profiles/index.ctp
+16
-9
www/src/Template/UserCards/view_card.ctp
+2
-1
No files found.
www/src/Controller/ProfilesController.php
View file @
88e3c9fb
...
...
@@ -105,6 +105,8 @@ class ProfilesController extends AppController
$userPersonals
=
$this
->
UserPersonals
->
patchEntity
(
$userPersonals
,
$data
[
'UserPersonals'
]);
$userPersonals
[
'firstname_th'
]
=
$this
->
request
->
data
[
'UserPersonals'
][
'firstname_th'
];
$userPersonals
[
'lastname_th'
]
=
$this
->
request
->
data
[
'UserPersonals'
][
'lastname_th'
];
$userPersonals
[
'firstname_en'
]
=
$this
->
request
->
data
[
'UserPersonals'
][
'firstname_th'
];
$userPersonals
[
'lastname_en'
]
=
$this
->
request
->
data
[
'UserPersonals'
][
'lastname_th'
];
$userPersonals
[
'email'
]
=
$this
->
request
->
data
[
'email'
];
$userPersonals
[
'birthdate'
]
=
$birthdate
;
$userPersonals
[
'user_id'
]
=
$data
[
'Users'
][
'user_id'
];
...
...
www/src/Template/Profiles/index.ctp
View file @
88e3c9fb
...
...
@@ -50,14 +50,14 @@
<br><br>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<?php echo $this->Form->create('UserProfiles', ['id' => 'frmSignIn', 'type' => 'file','name' => 'frmSignIn','role' => 'form', 'onsubmit' => 'return validateForm()']); ?>
<?php echo $this->Flash->render() ?>
<div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12">
<h2>ข้อมูลสมาชิก</h2
>
<h3> <?php echo __('ข้อมูลสมาชิก');?></h3
>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-12">
<?php echo $this->Form->create('UserProfiles', ['id' => 'frmSignIn', 'type' => 'file','name' => 'frmSignIn','role' => 'form', 'onsubmit' => 'return validateForm()']); ?>
<?php echo $this->Flash->render() ?>
<div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12">
<?php echo $this->Form->hidden('Users.user_id', ['class' => 'form-control-reg border-bottom-from label-text-sub', 'value' => $responseUserProfile['id'], 'id' => 'userId', 'type' => 'text', 'label' => __('ชื่อผู้ใช้งาน'), 'placeholder' => 'USERNAME']); ?>
...
...
@@ -124,7 +124,7 @@
<div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12">
<?php echo __('เบอร์โทรศัพท์(มือถือ)');?><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, '
placeholder' => '000-000-0000
']); ?>
<?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' => 'หมายเลขโทรศัพท์(มือถือ)
']); ?>
<?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>
...
...
@@ -228,12 +228,21 @@
// console.log(data);
data = jQuery.parseJSON(data);
if(data['chk'] == 'false'){
alert("อีเมล
ล์
นี้มีในระบบแล้ว");
alert("อีเมลนี้มีในระบบแล้ว");
return false;
}
});
});
$("#moblieNo").on('change',function(){
var elem = document.getElementById('moblieNo').value;
// console.log(elem);
if(!elem.match(/^([A-Za-zก-๙])+$/i)){
alert("กรอกเฉพาะตัวเลข");
return false;
}
})
});
function validateForm() {
var firstname_th = document.getElementById("firstname_th").value;
if (firstname_th == null || firstname_th == "") {
...
...
@@ -257,7 +266,7 @@
alert("กรุณากรอก เบอร์โทรศัพท์ของท่าน");
return false;
}
if(document.getElementById("moblieNo").value.length != 1
2
)
if(document.getElementById("moblieNo").value.length != 1
0
)
{
alert('กรุณากรอกเบอร์โทรศัพท์ ให้ครบ 10 หลัก');
return false;
...
...
@@ -467,8 +476,6 @@
<?php $this->append('scriptBottom'); ?>
<script type="text/javascript">
$(function () {
$('#moblieNo').inputmask('999-999-9999');
$('#officePhone').inputmask('99-999-9999');
//==================================================
// CHANGE Date Times
//==================================================
...
...
www/src/Template/UserCards/view_card.ctp
View file @
88e3c9fb
...
...
@@ -141,12 +141,13 @@ use Cake\I18n\Time;
<img src="/img/core/img/bloc-plus@3x.png" class="img-responsive" style="width: 100%">
</div>
<div class="col-xs-1 col-sm-1 col-md-1 box-arrow"></div>
<?php echo $this->Flash->render(); ?>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<?php echo $this->Form->create('UserCards', ['id' => 'frmSignIn', 'type' => 'file', 'onsubmit' => 'return check();']); ?>
<div class="form-group has-feedback">
<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']); ?>
...
...
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