Commit 1cf0d336 by Prasong Putichanchai

Merge branch 'integration' into prasong

parents c50dfddf c5581a40
......@@ -24,8 +24,7 @@ class ProfilesController extends AppController
$this->loadModel('MasterCountries');
$Country = $this->MasterCountries->find('list', [
'conditions' => [
'is_used' => true,
'MasterCountries.id' => 1],
'is_used' => true],
'keyField' => 'id',
'valueField' => 'country_name_th'
]);
......@@ -35,8 +34,7 @@ class ProfilesController extends AppController
$this->loadModel('MasterProvinces');
$Province = $this->MasterProvinces->find('list', [
'conditions' => [
'is_used' => true,
'master_country_id' => 1],
'is_used' => true],
'keyField' => 'id',
'valueField' => 'province_name_th'
]);
......@@ -86,6 +84,7 @@ class ProfilesController extends AppController
$birthdate = explode("/", $this->request->data['UserPersonals']['birthdate']);
$birthdate = $birthdate[2].'-'.$birthdate[1].'-'.$birthdate[0];
$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'];
......@@ -110,9 +109,6 @@ class ProfilesController extends AppController
}
/*****************************************************************************/
/*****************************************************************************/
public function settingProfile()
{
//prr($this->request->getHeaderLine('Accept-Language'));
......@@ -593,30 +589,4 @@ if (!empty($SubjectEnrolls)) {
$this->viewBuilder()->layout('blank');
}
// public function getProvince() {
// $this->autoRender = false;
// $this->loadModel('MasterProvinces');
// $states = array();
// // pr($this->request->data);die;
// // echo 'jjjj';
// $states = $this->MasterProvinces->find('list', array(
// 'keyField' => 'id',
// 'valueField' => 'province_name_th',
// 'conditions' => array(
// 'master_country_id' => 2
// )
// ))->toArray();
// $arr = array();
// foreach($states as $key => $val){
// $arr[$key] = $val;
// }
// //pr($states);die;
// // $arr['1'] = "ไทยยยย";
// // $arr['2'] = "ไทยยยยยยยยยย";
// echo json_encode($arr);
// // $data = jQuery.parseJSON($f);
// // pr($data);die;
// }
}
......@@ -229,4 +229,30 @@ class UserCardsController extends AppController
}
}
}
public function viewCard($user_id = null){
$this->viewBuilder()->layout('blank');
$this->loadModel('UserCards');
$UserCards = $this->UserCards->find('all')
->select($this->UserCards)
->select(
'morg.org_name_th'
)
->join([
'morg' => [
'table' => 'master.master_organizations',
'type' => 'INNER',
'conditions' => [
'morg.id = userCards.organize_id'
],
]
])
->where([
'userCards.user_id' => $user_id
])
->order(['userCards.id' => 'ASC'])
->toArray();
// pr($UserCards);die;
$this->set(compact('UserCards'));
}
}
\ No newline at end of file
......@@ -158,4 +158,15 @@ class UserCardsTable extends Table
return $rules;
}
/**
* Returns the database connection name to use by default.
*
* @return string
*/
public static function defaultConnectionName()
{
return 'core';
}
}
......@@ -71,51 +71,51 @@ class UsersTable extends Table {
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator) {
$validator
->allowEmpty('id', 'create');
// $validator
// ->allowEmpty('id', 'create');
$validator
->scalar('username')
->allowEmpty('username');
// $validator
// ->scalar('username')
// ->allowEmpty('username');
$validator
->scalar('password')
->allowEmpty('password');
// $validator
// ->scalar('password')
// ->allowEmpty('password');
$validator
->integer('point')
->allowEmpty('point');
// $validator
// ->integer('point')
// ->allowEmpty('point');
$validator
->boolean('is_used')
->allowEmpty('is_used');
// $validator
// ->boolean('is_used')
// ->allowEmpty('is_used');
$validator
->scalar('dynamic_key')
->allowEmpty('dynamic_key');
// $validator
// ->scalar('dynamic_key')
// ->allowEmpty('dynamic_key');
$validator
->date('dynamic_key_expiry')
->allowEmpty('dynamic_key_expiry');
// $validator
// ->date('dynamic_key_expiry')
// ->allowEmpty('dynamic_key_expiry');
$validator
->scalar('token')
->allowEmpty('token');
// $validator
// ->scalar('token')
// ->allowEmpty('token');
$validator
->date('token_expiry')
->allowEmpty('token_expiry');
// $validator
// ->date('token_expiry')
// ->allowEmpty('token_expiry');
$validator
->requirePresence('created_by', 'create')
->notEmpty('created_by');
// $validator
// ->requirePresence('created_by', 'create')
// ->notEmpty('created_by');
$validator
->allowEmpty('modified_by');
// $validator
// ->allowEmpty('modified_by');
$validator
->scalar('pin_code')
->allowEmpty('pin_code');
// $validator
// ->scalar('pin_code')
// ->allowEmpty('pin_code');
return $validator;
}
......@@ -133,6 +133,7 @@ class UsersTable extends Table {
return $rules;
}
/**
*
* Returns the database connection name to use by default.
......
<?php
class QRGenerator {
protected $size;
protected $data;
protected $encoding;
protected $errorCorrectionLevel;
protected $marginInRows;
protected $debug;
public function __construct($data='1334554 5454 545',$size='300',$encoding='UTF-8',$errorCorrectionLevel='L',$marginInRows=4,$debug=false) {
$this->data=urlencode($data);
$this->size=($size>100 && $size<800)? $size : 300;
$this->encoding=($encoding == 'Shift_JIS' || $encoding == 'ISO-8859-1' || $encoding == 'UTF-8') ? $encoding : 'UTF-8';
$this->errorCorrectionLevel=($errorCorrectionLevel == 'L' || $errorCorrectionLevel == 'M' || $errorCorrectionLevel == 'Q' || $errorCorrectionLevel == 'H') ? $errorCorrectionLevel : 'L';
$this->marginInRows=($marginInRows>0 && $marginInRows<10) ? $marginInRows:4;
$this->debug = ($debug==true)? true:false;
}
public function generate(){
$QRLink = "https://chart.googleapis.com/chart?cht=qr&chs=".$this->size."x".$this->size. "&chl=" . $this->data .
"&choe=" . $this->encoding .
"&chld=" . $this->errorCorrectionLevel . "|" . $this->marginInRows;
if ($this->debug) echo $QRLink;
return $QRLink;
}
}
?>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<div class="col-xs-1 col-sm-1 col-md-1" style="font-size:36px; height: 200px; padding-top:20%;" >
</div>
<div class="col-xs-10 col-sm-10 col-md-10">
<div data-toggle="modal" data-target="#defaultModal" style="text-align: center;">
<img src="/img/core/img/card-bg-front@3x-V2.png" class="img-responsive" id="img-upload" alt="Profile picture">
</div>
</div>
<div style="position: absolute;z-index: 2;">
<a href="profile_setting"><img src="/img/core/img/setting-icon@3x.png"/></a>
</div>
<div class="box">
<div class="absolute-right"><img src="/img/core/img/location-profile-icon@3x.png"/> สีลม ,บางรัก</div>
</div>
<div style="text-align: center;">
<!--<div class="">-->
<?php //echo @$this->Html->image($responseUserProfile['UserProfiles']['img_path'], ['class' => 'imgCircle profile-img', 'id' => 'img-upload', 'alt' => 'Profile picture']); ?>
<!-- <img src="/porto/core/img/profile-img@3x.png" class="imgCircle profile-img" id="img-upload" alt="Profile picture"> -->
<img src="/img/core/img/profile-img@3x.png" class="imgCircle profile-img" id="img-upload" alt="Profile picture">
<!--</div>-->
<input type="file" id="uploadProfile" class="profile-img form-control form-input Profile-input-file" name="data[UserProfiles][img_path]" >
</div>
<div class="bg-profile"></div>
<!--<div class="col-xs-12 col-sm-12 col-md-12" style="padding-top: 20px;">-->
</div><!--/col-xs-12-->
<div class="col-xs-1 col-sm-1 col-md-1" style="font-size:36px; height: 200px; padding-top:20%;" >
<div >
<i class = "fa fa-angle-right">
</i>
</div>
</div>
<div style="clear: both"></div>
</div><!--/row-->
<br><br>
<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">
<?php echo $this->Form->create('UserProfiles', ['id' => 'frmSignIn', 'type' => 'file']); ?>
<?php echo $this->Flash->render() ?>
<div class="form-group has-feedback">
......@@ -81,7 +109,6 @@
<input type="radio" name="UserPersonals[blood_group]" id="blood-O" value="O" <?php echo ($responseUserProfile['blood_group'] == 'O') ? 'checked="checked"' : null; ?>> <?php echo __('O'); ?>
</label>
</div>
</div>
</div>
<div class="form-group has-feedback">
......@@ -146,6 +173,40 @@
<?php echo $this->Form->end(); ?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<div class="modal fade" id="defaultModal" tabindex="-1" role="dialog" aria-labelledby="defaultModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="">
<div class="">
<div class="container login-container">
<div class="owl-carousel owl-theme" data-plugin-options="{'items': 1}">
<div>
<img src="/img/core/img/card-bg-front@3x.png" class="img-responsive" id="img-upload" alt="Profile picture">
</div>
<div>
<div class="qrcode-profile"><br>
<?php echo __('แสดง QR Code เพื่อรับสิทธิ์');?>
</div>
<img src="/img/core/img/card-bg-back@3x.png" class="img-responsive" id="img-upload" alt="Profile picture">
<div class="qrcode-name">
<?php
$ex1 = new QRGenerator();
echo "<img src=".$ex1->generate()." style='position: absolute;width: 150px;border: solid 1px #000;' class='qrcode-name'>";
?>
<?php //echo $this->Html->image('/img/core/img/qr-code.jpg', array('div' => false, 'class' => 'qrcode-name','style' => 'position: absolute;width: 120px;')); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#moblieNo').inputmask('999-999-9999');
......@@ -206,25 +267,23 @@
//==================================================
// CHANGE Province According Country
//==================================================
// $(document).ready(function() {
// $("#loding1").hide();
// $("#loding2").hide();
// $("#master_country_id").on('change',function() {
// var id = $(this).val();
// // alert('dddd');
// $("#loding1").show();
// $("#master_province_id").find('option').remove();
// if (id) {
// var dataString = 'id='+ id;
// alert(dataString);
// $.post("/Profiles/getProvince", {id: id}, function(data) {
// console.log(data);
// data = jQuery.parseJSON(data);
// console.log(data);
// });
// // $('<option>').val('').text('---Select---');
// // $('<option>').val(key).text(value).appendTo($("#master_province_id"));
// }
// });
// });
$(document).ready(function () {
$("#master_country_id").on('change', function () {
var id = $(this).val();
if (id) {
var dataString = 'id=' + id;
$.ajax({
type: "POST",
url: '/users/getProvince',
data: dataString,
cache: false,
success: function (html) {
$("#master_province_id").html(html);
}
});
}
});
});
</script>
\ No newline at end of file
<div class="row">
<div class="col-xs-1 col-sm-1 col-md-1">
<
</div>
<div class="col-xs-10 col-sm-10 col-md-10">
<img src="/img/core/img/bloc-plus@3x.png" class="img-responsive" style="width: 100%">
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<?php echo $this->Form->create('UserCrads', ['id' => 'frmSignIn', 'type' => 'file', 'onsubmit' => 'return check();']); ?>
<div style="position: absolute;z-index: 2;">
<?php echo $this->Form->create('UserCards', ['id' => 'frmSignIn', 'type' => 'file', 'onsubmit' => 'return check();']); ?>
<!-- <div style="position: absolute;z-index: 2;">
<a href="profile_setting"><img src="/img/core/img/setting-icon@3x.png"/></a>
</div>
<div class="bg-profile"></div>
<?php echo $this->Flash->render() ?>
</div> -->
<!-- <div class="bg-profile"></div> -->
<!--<div class="col-xs-12 col-sm-12 col-md-12" style="padding-top: 20px;">-->
<div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12">
<?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']); ?>
......@@ -23,12 +33,12 @@
<div class="form-group has-feedback bootstrap-iso">
<div class="col-xs-12 col-sm-12 col-md-12">
<label class="label-text-sub"><?php echo __('วันเกิด');?></label>
<input type="text" name="UserCards[birthdate]" id="date" placeholder="กรุณาระบุวันเดือนปีเกิด" value="" placeholder="DD-MM-YYYY" data-date-format="mm/dd/yyyy" class="form-control-reg border-bottom-from">
<input type="text" name="UserCards[birthdate]" id="date" placeholder="กรุณาระบุวันเดือนปีเกิด" value="" 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>
</div>
</div>
<div>
<button type="submit" class="btn btn-quaternary mr-xs mb-sm button-text-profile">บันทึก</button>
<button type="submit" class="btn btn-quaternary mr-xs mb-sm button-text-profile">ตรวจสอบ</button>
</div>
<?php echo $this->Form->end(); ?>
</div>
......@@ -45,11 +55,21 @@
if(data!='false'){
data = jQuery.parseJSON(data);
console.log(data);
if(data['chkuser'] == true){
$("#noorg_th").text('ลงทะเบียนกับ '+data[0]['org_name_th']+' แล้ว');
$("#nameorg_th").text('');
$('#employee').attr("disabled",true);
$('#date').attr("disabled",true);
organize_id.value = '';
employee.value = '';
date.value = '';
}else if(data['chkuser'] == false){
$("#nameorg_th").text(data[0]['org_name_th']);
$("#noorg_th").text('');
$("#employee").removeAttr("disabled");
$("#date").removeAttr("disabled");
organize_id.value = data[0]['id'];
}
}else{
$("#noorg_th").text('ไม่พบข้อมูล');
$("#nameorg_th").text('');
......@@ -70,8 +90,8 @@
}
if (date.value == '') {
alert("วันเกิด");
date.focus();
return false;
date.focus();
}
}
</script>
......
<div class="owl-carousel owl-theme" data-plugin-options="{'items': 1}">
<?php foreach ($UserCards as $value) { #pr($value);die;?>
<div class="row">
<div class="col-xs-1 col-sm-1 col-md-1" style="font-size:36px; height: 200px; padding-top:20%;">
<div>
<i class = "fa fa-angle-left" >
</i>
</div>
</div>
<div class="col-xs-9 col-sm-9 col-md-9" style=" border: 1px solid red; height: 200px; margin-top: 10px;">
<div class="row">
<div class="col-xs-1">
</div>
<div class="col-xs-6">
<div style="font-size: 17px">
<br>
<label>id<label>
</div>
<div>
<?php echo $value['card_code'] ?>
</div>
<div>
<label style="font-size: 17px">ชื่อ</label> <?php echo $value['prefix_name_th'].$value['firstname_th'].' '.$value['lastname_th'] ?>
</div>
</div>
<div class="col-xs-4">
<img src="/img/core/img/user-profile@3x.png" class="img-responsive">
</div>
</div>
<div class="row">
<div class="col-xs-1">
</div>
<div class="col-xs-10">
<label style="font-size: 17px">ตำแหน่ง</label> <?php echo $value['position_name'] ?>
</div>
</div>
<div class="row">
<div class="col-xs-1">
</div>
<div class="col-xs-5">
<?php echo $value['date_issued'] ?>
</div>
<div class="col-xs-5">
<?php echo $value['date_expiry'] ?>
</div>
</div>
<div class="row">
<div class="col-xs-1">
</div>
<div class="col-xs-5">
<label style="font-size: 17px">วันออกบัตร</label>
</div>
<div class="col-xs-5">
<label style="font-size: 17px">วันหมดออายุ</label>
</div>
</div>
</div>
<div class="col-xs-1 col-sm-1 col-md-1" style="font-size:36px; height: 200px; padding-top:20%;">
<div>
<i class = "fa fa-angle-right" >
</i>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-12">
<div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12">
<h4>ข้อมูลบริษัท</h4>
</div>
</div>
<div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12">
<label style="font-size: 17px" class="col-xs-4 col-sm-4 col-md-4">ชื่อ</label>
<?php echo $value['prefix_name_th'].$value['firstname_th'] ?>
</div>
</div>
<div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12">
<label style="font-size: 17px" class="col-xs-4 col-sm-4 col-md-4">นามสกุล</label>
<?php echo $value['lastname_th'] ?>
</div>
</div>
<div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12">
<label style="font-size: 17px" class="col-xs-4 col-sm-4 col-md-4">ชื่อบริษัท</label>
<?php echo $value['morg']['org_name_th'] ?>
</div>
</div>
<div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12">
<label style="font-size: 17px" class="col-xs-4 col-sm-4 col-md-4">แผนก</label>
<?php echo $value['section_name'] ?>
</div>
</div>
<div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12">
<label style="font-size: 17px" class="col-xs-4 col-sm-4 col-md-4">ตำแหน่ง</label>
<?php echo $value['position_name'] ?>
</div>
</div>
<div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12">
<label style="font-size: 17px" class="col-xs-4 col-sm-4 col-md-4">วันที่ออกบัตร</label>
<?php echo $value['date_issued'] ?>
</div>
</div>
<div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12">
<label style="font-size: 17px" class="col-xs-4 col-sm-4 col-md-4">วันที่หมดอายุ</label>
<?php echo $value['date_expiry'] ?>
</div>
</div>
</div>
</div>
<?php } ?>
</div>
\ No newline at end of file
<div class="row">
<div class="center">
<div class="title_header" style="padding-top: 20px;"><a href="javascript:history.go(-1)"><?php echo $this->Html->image('/img/core/img/back-icon@3x.png', ['style' => 'float: left;padding-left: 15px;padding-top: 5px;']); ?></a><?php echo __('สร้างรหัสผ่าน');?></div>
<div class="title_header" style="padding-top: 20px;"><a href="javascript:history.go(-1)"><?php echo $this->Html->image('/img/core/img/back-icon@3x.png', ['style' => 'float: left;padding-left: 15px;padding-top: 5px;']); ?></a><?php echo __('เปลี่ยนรหัสผ่าน');?></div>
</div>
<div class="col-md-12">
<!-- <div class="alert alert-warning" role="alert" style="margin: 10px 0px 10px 0px;font-size: 17px;text-align: center;">
......@@ -8,20 +8,21 @@
</div>-->
<?php echo $this->Form->create(null, ['url' => ['controller' => 'Users','action' => 'changePassword'],'class' => 'form-horizontal','id' => '','name' => 'changePressword','role' => 'form', 'onsubmit' => 'return validateForm()']);?>
<?php echo $this->Flash->render(); ?>
<!-- <div>
<div>
<div class="form-group has-feedback">
<div class="col-md-12">
<label class="label-text-sub"><?php echo __('ยืนยันรหัส จากอีเมลล์');?></label>
<input type="text" value="" name="data[confirm_email]" maxlength="4" pattern="\d{4}" placeholder="********" class="form-control-reg border-bottom-from" id="inputSuccess">
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
<label class="label-text-sub"><?php echo __('รหัสผ่านเก่า');?></label>
<input type="password" value="" name="oldpassword" placeholder="********" class="form-control-reg border-bottom-from" id="oldpassword" onkeyup='check();'>
<span class="glyphicon glyphicon-eye-close form-control-feedback" id='message'></span>
</div>
</div>
</div>
</div>-->
<div>
<div class="form-group has-feedback">
<div class="col-md-12">
<label class="label-text-sub"><?php echo __('รหัสผ่านใหม่');?></label>
<input type="text" value="" name="data[password]" placeholder="********" class="form-control-reg border-bottom-from" id="password" onkeyup='check();'>
<input type="text" value="" name="password" placeholder="********" class="form-control-reg border-bottom-from" id="password" onkeyup='check();'>
<span class="glyphicon glyphicon-eye-open form-control-feedback"></span>
</div>
</div>
......@@ -30,7 +31,7 @@
<div class="form-group has-feedback">
<div class="col-md-12">
<label class="label-text-sub"><?php echo __('ยืนยันรหัสผ่าน');?></label>
<input type="password" value="" name="data[confirm_password]" placeholder="********" class="form-control-reg border-bottom-from" id="confirm_password" onkeyup='check();'>
<input type="password" value="" name="confirm_password" placeholder="********" class="form-control-reg border-bottom-from" id="confirm_password" onkeyup='check();'>
<span class="glyphicon glyphicon-eye-close form-control-feedback" id='message'></span>
</div>
</div>
......@@ -51,24 +52,46 @@
</div>
<!--------------------------------- popup ------------------------------------->
<!-- ------------------------------- popup ----------------------------------- -->
<script>
function validateForm() {
var confirm_email = document.forms["changePressword"]["data[confirm_email]"].value;
if (confirm_email == null || confirm_email == "") {
alert("กรุณากรอกรหัสจากอีเมลล์ของท่าน 4 หลัก");
var password = document.forms["changePressword"]["oldpassword"].value;
if (password == null || password == "") {
alert("กรุณากรอก รหัสผ่านเก่า");
return false;
}
var password = document.forms["changePressword"]["data[password]"].value;
if(document.forms["changePressword"]["oldpassword"].value.length < 8)
{
alert('กรุณาระบุรหัสผ่านเก่าอย่างน้อย 8 ตัวอักษร');
return false;
}
var password = document.forms["changePressword"]["password"].value;
if (password == null || password == "") {
alert("กรุณากรอก password");
alert("กรุณากรอก รหัสผ่านใหม่");
return false;
}
if(document.forms["changePressword"]["password"].value.length < 8)
{
alert('กรุณาระบุรหัสผ่านใหม่อย่างน้อย 8 ตัวอักษร');
return false;
}
var confirm_password = document.forms["changePressword"]["data[confirm_password]"].value;
var confirm_password = document.forms["changePressword"][["confirm_password"]].value;
if (confirm_password == null || confirm_password == "") {
alert("กรุณากรอก confirm_password");
alert("กรุณากรอก ยืนยันรหัสผ่าน");
return false;
}
if(document.forms["changePressword"]["confirm_password"].value.length < 8)
{
alert('กรุณาระบุยืนยันรหัสผ่านอย่างน้อย 8 ตัวอักษร');
return false;
}
if(document.forms["changePressword"]["password"].value != document.forms["changePressword"]["confirm_password"].value){
alert('กรุณาระบุรหัสผ่านให้ตรงกัน');
//document.createAccount.confirm_password.focus();
return false;
}
}
</script>
<style>
......@@ -177,72 +200,3 @@
color:green;
}
</style>
<script>
var ALERT_TITLE = "";
var ALERT_BUTTON_TEXT = "Ok";
if (document.getElementById) {
window.alert = function (txt) {
createCustomAlert(txt);
}
}
function createCustomAlert(txt) {
d = document;
if (d.getElementById("modalContainer"))
return;
mObj = d.getElementsByTagName("body")[0].appendChild(d.createElement("div"));
mObj.id = "modalContainer";
mObj.style.height = d.documentElement.scrollHeight + "px";
alertObj = mObj.appendChild(d.createElement("div"));
alertObj.id = "alertBox";
if (d.all && !window.opera)
alertObj.style.top = document.documentElement.scrollTop + "px";
alertObj.style.left = (d.documentElement.scrollWidth - alertObj.offsetWidth) / 2 + "px";
alertObj.style.visiblity = "visible";
h1 = alertObj.appendChild(d.createElement("h1"));
h1.appendChild(d.createTextNode(ALERT_TITLE));
msg = alertObj.appendChild(d.createElement("p"));
//msg.appendChild(d.createTextNode(txt));
msg.innerHTML = txt;
btn = alertObj.appendChild(d.createElement("a"));
btn.id = "closeBtn";
btn.appendChild(d.createTextNode(ALERT_BUTTON_TEXT));
btn.href = "#";
btn.focus();
btn.onclick = function () {
removeCustomAlert();
return false;
}
alertObj.style.display = "block";
}
function removeCustomAlert() {
document.getElementsByTagName("body")[0].removeChild(document.getElementById("modalContainer"));
}
function ful() {
alert('Alert this pages');
}
</script>
<!--------------------------------- confirm password -------------------------------->
<script>
var check = function() {
if (document.getElementById('password').value ==
document.getElementById('confirm_password').value) {
document.getElementById('message').style.color = 'green';
document.getElementById('message').innerHTML = '';
} else {
document.getElementById('message').style.color = 'red';
document.getElementById('message').innerHTML = '';
}
}
</script>
\ No newline at end of file
......@@ -11,27 +11,8 @@
<div>
<div class="form-group has-feedback">
<div class="col-md-12">
<label class="label-text-sub"><?php echo __('ชื่อผู้ใช้งาน');?><em>* </em></label>
<input type="text" value="" name="data[username]" placeholder="USERNAME" class="form-control-reg border-bottom-from" id="inputSuccess">
</div>
</div>
</div>
<div>
<div class="form-group has-feedback">
<div class="col-md-12">
<label class="label-text-sub"><?php echo __('วันเกิด');?><em>* </em></label>
<input type="text" value="" name="data[birthdate]" placeholder="กรุณาระบุวันเดือนปีเกิด" class="form-control-reg border-bottom-from" id="date">
<span class="glyphicon glyphicon-calendar form-control-feedback"></span>
</div>
</div>
</div>
<div>
<div class="form-group has-feedback">
<div class="col-md-12">
<label class="label-text-sub"><?php echo __('อีเมลล์');?><em>* </em></label>
<input type="text" value="" name="data[email]" placeholder="mail@xxx.com" class="form-control-reg border-bottom-from" id="fremail">
<input type="text" value="" name="email" placeholder="mail@xxx.com" class="form-control-reg border-bottom-from" id="fremail">
</div>
</div>
......@@ -49,26 +30,10 @@
<?php echo $this->Form->end(); ?>
</div>
</div>
<!--------------------------------- popup ------------------------------------->
<!-- ------------------------------- popup ----------------------------------- -->
<script>
function validateForm() {
var username = document.forms["forgotPressword"]["data[username]"].value;
if (username == null || username == "") {
alert("กรุณากรอกชื่อผู้ใช้งานของท่าน");
return false;
}
if(document.forms["forgotPressword"]["data[username]"].value.length < 5)
{
alert('กรุณาระบุชื่อผู้ใช้งานอย่างน้อย 5 ตัวอักษร');
return false;
}
var birthdate = document.forms["forgotPressword"]["data[birthdate]"].value;
if (birthdate == null || birthdate == "") {
alert("กรุณากรอก วันเดือนปีเกิดของท่าน");
return false;
}
var email = document.forms["forgotPressword"]["data[email]"].value;
var email = document.forms["forgotPressword"]["email"].value;
if (email == null || email == "") {
alert("กรุณากรอกอีเมลล์");
return false;
......@@ -188,61 +153,6 @@
}
</style>
<script>
var ALERT_TITLE = "";
var ALERT_BUTTON_TEXT = "Ok";
if (document.getElementById) {
window.alert = function (txt) {
createCustomAlert(txt);
}
}
function createCustomAlert(txt) {
d = document;
if (d.getElementById("modalContainer"))
return;
mObj = d.getElementsByTagName("body")[0].appendChild(d.createElement("div"));
mObj.id = "modalContainer";
mObj.style.height = d.documentElement.scrollHeight + "px";
alertObj = mObj.appendChild(d.createElement("div"));
alertObj.id = "alertBox";
if (d.all && !window.opera)
alertObj.style.top = document.documentElement.scrollTop + "px";
alertObj.style.left = (d.documentElement.scrollWidth - alertObj.offsetWidth) / 2 + "px";
alertObj.style.visiblity = "visible";
h1 = alertObj.appendChild(d.createElement("h1"));
h1.appendChild(d.createTextNode(ALERT_TITLE));
msg = alertObj.appendChild(d.createElement("p"));
//msg.appendChild(d.createTextNode(txt));
msg.innerHTML = txt;
btn = alertObj.appendChild(d.createElement("a"));
btn.id = "closeBtn";
btn.appendChild(d.createTextNode(ALERT_BUTTON_TEXT));
btn.href = "#";
btn.focus();
btn.onclick = function () {
removeCustomAlert();
return false;
}
alertObj.style.display = "block";
}
function removeCustomAlert() {
document.getElementsByTagName("body")[0].removeChild(document.getElementById("modalContainer"));
}
function ful() {
alert('Alert this pages');
}
</script>
<!--------------------------------- date ------------------------------------->
<script>
$(document).ready(function(){
......
......@@ -13,7 +13,7 @@
<div class="form-group has-feedback">
<div class="col-md-12">
<div class=" row center">
<?php echo __('รหัส PIN 4 หลัก เพื่อเข้าใช้งาน Connect App');?>
<?php echo __('รหัส PIN 4 หลัก ในอีเมลล์ที่ระบุเพื่อเข้าใช้งาน');?>
</div>
</div>
</div>
......
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