Commit 1cf0d336 by Prasong Putichanchai

Merge branch 'integration' into prasong

parents c50dfddf c5581a40
...@@ -24,8 +24,7 @@ class ProfilesController extends AppController ...@@ -24,8 +24,7 @@ class ProfilesController extends AppController
$this->loadModel('MasterCountries'); $this->loadModel('MasterCountries');
$Country = $this->MasterCountries->find('list', [ $Country = $this->MasterCountries->find('list', [
'conditions' => [ 'conditions' => [
'is_used' => true, 'is_used' => true],
'MasterCountries.id' => 1],
'keyField' => 'id', 'keyField' => 'id',
'valueField' => 'country_name_th' 'valueField' => 'country_name_th'
]); ]);
...@@ -35,8 +34,7 @@ class ProfilesController extends AppController ...@@ -35,8 +34,7 @@ class ProfilesController extends AppController
$this->loadModel('MasterProvinces'); $this->loadModel('MasterProvinces');
$Province = $this->MasterProvinces->find('list', [ $Province = $this->MasterProvinces->find('list', [
'conditions' => [ 'conditions' => [
'is_used' => true, 'is_used' => true],
'master_country_id' => 1],
'keyField' => 'id', 'keyField' => 'id',
'valueField' => 'province_name_th' 'valueField' => 'province_name_th'
]); ]);
...@@ -86,6 +84,7 @@ class ProfilesController extends AppController ...@@ -86,6 +84,7 @@ class ProfilesController extends AppController
$birthdate = explode("/", $this->request->data['UserPersonals']['birthdate']); $birthdate = explode("/", $this->request->data['UserPersonals']['birthdate']);
$birthdate = $birthdate[2].'-'.$birthdate[1].'-'.$birthdate[0]; $birthdate = $birthdate[2].'-'.$birthdate[1].'-'.$birthdate[0];
$userPersonals = $this->UserPersonals->patchEntity($userPersonals, $data['UserPersonals']); $userPersonals = $this->UserPersonals->patchEntity($userPersonals, $data['UserPersonals']);
$userPersonals['firstname_th'] = $this->request->data['UserPersonals']['firstname_th']; $userPersonals['firstname_th'] = $this->request->data['UserPersonals']['firstname_th'];
$userPersonals['lastname_th'] = $this->request->data['UserPersonals']['lastname_th']; $userPersonals['lastname_th'] = $this->request->data['UserPersonals']['lastname_th'];
...@@ -110,9 +109,6 @@ class ProfilesController extends AppController ...@@ -110,9 +109,6 @@ class ProfilesController extends AppController
} }
/*****************************************************************************/ /*****************************************************************************/
/*****************************************************************************/
public function settingProfile() public function settingProfile()
{ {
//prr($this->request->getHeaderLine('Accept-Language')); //prr($this->request->getHeaderLine('Accept-Language'));
...@@ -593,30 +589,4 @@ if (!empty($SubjectEnrolls)) { ...@@ -593,30 +589,4 @@ if (!empty($SubjectEnrolls)) {
$this->viewBuilder()->layout('blank'); $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 ...@@ -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
<?php <?php
namespace App\Controller; namespace App\Controller;
use App\Controller\AppController; use App\Controller\AppController;
use Cake\Auth\DefaultPasswordHasher;
use Cake\Core\Configure; use Cake\Core\Configure;
use Cake\Http\Client; use Cake\Http\Client;
use Cake\Routing\Router; use Cake\Routing\Router;
use Cake\I18n\Time;
use Cake\Mailer\Email;
use Cake\Utility\Security;
use Cake\Auth\AbstractPasswordHasher;
class UsersController extends AppController class UsersController extends AppController
{ {
...@@ -25,7 +29,7 @@ class UsersController extends AppController ...@@ -25,7 +29,7 @@ class UsersController extends AppController
$this->viewBuilder()->layout('blank'); $this->viewBuilder()->layout('blank');
$data = $this->request->data(); $data = $this->request->data();
#$data['data']['ip'] = $this->request->clientIp(); #$data['data']['ip'] = $this->request->clientIp();
if(!empty($data)){ if(!empty($data)){
if(!empty($data['data']['username']) && !empty($data['data']['password'])){ if(!empty($data['data']['username']) && !empty($data['data']['password'])){
...@@ -85,49 +89,181 @@ class UsersController extends AppController ...@@ -85,49 +89,181 @@ class UsersController extends AppController
} }
public function signup() public function signup()
{ {
$this->loadModel('MasterCountries');
$this->loadModel('MasterProvinces');
$countries = $this->MasterCountries->find('list',
[
'conditions' => ['is_used' => true],
'keyField' => 'id',
'valueField' => ['country_name_th']
]
);
if(!empty($countries)) $countries = $countries->toArray();
$provinces = $this->MasterProvinces->find('list',
[
'conditions' => ['is_used' => true],
'keyField' => 'id',
'valueField' => 'province_name_th'
]
);
if(!empty($provinces)) $provinces = $provinces->toArray();
$this->set(compact('provinces','countries'));
$this->viewBuilder()->layout('blank'); $this->viewBuilder()->layout('blank');
} }
// public function getProvince() {
// $this->autoRender = false;
// $this->loadModel('MasterProvinces');
// $states = array();
// pr($this->request->$data);die;
// if (isset($this->request['data']['id'])) {
// $states = $this->MasterProvinces->find('list', array(
// 'keyField' => 'id',
// 'valueField' => ['country_name_th'],
// 'conditions' => array(
// 'State.countries_id' => $this->request['data']['id']
// )
// ));
// }
// header('Content-Type: application/json');
// pr($states);die;
// echo json_encode($states);
// exit();
// }
#--------------------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------
#Signup #Signup
public function createAccount() public function createAccount()
{ {
$this->viewBuilder()->layout('blank'); $this->loadModel('UserPersonals');
$data = $this->request->data(); $users = $this->Users->newEntity();
$user_personals = $this->UserPersonals->newEntity();
if(!empty($data)){
if($this->validateAccount($data)){ if ($this->request->is('post')) {
$data['data']['ip'] = $this->request->clientIp();#prr($data); // $username_check = $this->MasterProvinces->find('all')->toArray();
// pr($username_check);die;
// pr($this->request->data);die;
$today = Time::now();
$dateNow = $today->i18nFormat('yyyy-MM-dd HH:mm:ss');
$hasher = new DefaultPasswordHasher();
$firstname = $this->request->data['firstname'];
// $phone_no = $this->request->data['phone_no'];
$lastname = $this->request->data['lastname'];
$master_country_id = $this->request->data['master_country_id'];
$master_province_id = $this->request->data['master_province_id'];
$password = $this->request->data['password'];
$confirm_password = $this->request->data['confirm_password'];
$btn = $this->request->data['btn'];
if(!empty($this->request->data['birthdate'])){
$birthdate = explode("/", $this->request->data['birthdate']);
$birthdate = $birthdate[2].'-'.$birthdate[1].'-'.$birthdate[0];
$this->request->data['birthdate'] = $birthdate;
}else{
$birthdate = '2000-10-10';
}
$this->request->data['password'] = $hasher->hash($password);
$users['created_by'] = 0;
$users['is_used'] = true;
$users['created'] = $dateNow;
$users['dynamic_key'] = 'dynamic_key';
// $users['point'] = 0;
$users['dynamic_key_expiry'] = date('Y-m-d',strtotime('+3 day'));
$users['token'] = Security::hash($this->request->data['username'].date('Y-m-d h:i:s'), 'md5', true);
$users['token_expiry'] = date('Y-m-d',strtotime('+3 day'));
// $users['modified_by'] = $modified_by;
$digits = 4;
$users['pin_code'] = str_pad(rand(0, pow(10, $digits)-1), $digits, '0', STR_PAD_LEFT);
if(!empty($this->request->data['accept'])){
$username_check = $this->Users->find('all',[
'conditions' => [
'Users.username' => $this->request->data['username']
]
])->toArray();
$api_core_create_account = Configure::read('Config.apiCore.createAccount'); $email_check = $this->UserPersonals->find('all',[
$http = new Client(); 'conditions' => [
$response = $http->post($api_core_create_account,$data)->body();#prd($response); 'UserPersonals.email' => $this->request->data['email']
$response = json_decode($response,'_full'); ]
//debug($response);exit(); ])->toArray();
if(!empty($response)){
if(trim($response['status']) == 'Success'){ if((empty($username_check))&&(empty($email_check))){
$this->Flash->success(__('create Account completed.')); $users = $this->Users->patchEntity($users, $this->request->getData());
return $this->redirect(['controller' => 'Users', 'action' => 'pinCode/'.$response['result']['data']['token']]); // pr($users);die;
} elseif ($response['result']['message'] == 'Email Duplicate'){
$this->Flash->error(__('Email Duplicate')); //------------------------------ ส่งอีเมล์ -----------------------------------------------------
return $this->redirect(['controller' => 'Users', 'action' => 'signup']); // $data_notification = [];
}else{ // $data_notification['email'] = $this->request->data['email'];
$this->Flash->error(__('create Account Fail')); // $data_notification['pin_code'] = $users['pin_code'];
return $this->redirect(['controller' => 'Users', 'action' => 'signup']); // $this->notification($data_notification);
//----------------------------------------------------------------------------------------------
$this->Users->save($users);
$user_personals['master_country_id'] = $master_country_id;
$user_personals['master_province_id'] = $master_province_id;
$user_personals['user_id'] = $users['id'];
$user_personals['firstname_th'] = $firstname;
$user_personals['lastname_th'] = $lastname;
$user_personals['created_by'] = 1;
$user_personals['created'] = $dateNow;
$user_personals = $this->UserPersonals->patchEntity($user_personals, $this->request->getData());
$this->UserPersonals->save($user_personals);
// $this->Flash->success(__('The register success.'));
return $this->redirect(['controller' => 'Users', 'action' => 'pinCode/'.$users['token']]);
return $this->redirect(['action' => 'signin']);
} }
$this->Flash->error(__('Username or Email Address already used by others.'));
return $this->redirect(['action' => 'signup']);
}else if(empty($this->request->data['accept'])){
$this->Flash->error(__('please accept'));
return $this->redirect(['action' => 'signup']);
} }
$this->Flash->error(__('The article could not be saved. Please, try again.'));
}else{
$this->Flash->error(__('Data Empty'));
return $this->redirect(['controller' => 'Users', 'action' => 'signin']);
}
} }
die; }
public function notification($data = null)
{
if(!empty($data)){
$verify_code = $data['pin_code'];
$from_email = ['support@pakgon.com' => 'Support'];
$to_emails = [$data['email']];
$email = new Email();
$email->transport('gmail');
try {
$email->template('notification_signup', 'connect');
$email->from($from_email);
$email->to($to_emails);
$email->subject('Signup Connect Verify');
$email->emailFormat('html');
$email->viewVars(compact('verify_code'));
#$email->send($message);
$email->send();
} catch (Exception $e) {
echo 'Exception : ', $e->getMessage(), "\n";
}
#$this->httpStatusCode = 200;
#$this->apiResponse['message'] = 'Signup Connect Completed!!';
}
} }
#--------------------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------
function validateAccount($data = null) function validateAccount($data = null)
...@@ -144,10 +280,10 @@ class UsersController extends AppController ...@@ -144,10 +280,10 @@ class UsersController extends AppController
} }
public function notification() // public function notification()
{ // {
$this->viewBuilder()->layout('blank'); // $this->viewBuilder()->layout('blank');
} // }
#Verify Pin Code #Verify Pin Code
public function pinCode($token=null) public function pinCode($token=null)
...@@ -175,97 +311,160 @@ class UsersController extends AppController ...@@ -175,97 +311,160 @@ class UsersController extends AppController
return $this->redirect(['controller' => 'Users', 'action' => 'pinCode/'.$token]); return $this->redirect(['controller' => 'Users', 'action' => 'pinCode/'.$token]);
} }
} }
} }
$this->set(array('token' => $token, '_serialize' => array('token'))); $this->set(array('token' => $token, '_serialize' => array('token')));
} }
#--------------------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------
#Forgot Password #Forgot Password
public function forgotPassword() // public function forgotPassword()
{ // {
$this->viewBuilder()->layout('blank'); // $this->viewBuilder()->layout('blank');
$data = $this->request->data(); // $data = $this->request->data();
#$data['data']['ip'] = $this->request->clientIp(); // #$data['data']['ip'] = $this->request->clientIp();
if(!empty($data)){ // if(!empty($data)){
if(!empty($data['data']['username'])){ // if(!empty($data['data']['username'])){
$data['data']['ip'] = $this->request->clientIp();#prr($data); // $data['data']['ip'] = $this->request->clientIp();#prr($data);
$api_core_forgotPassword = Configure::read('Config.apiCore.forgotPassword'); // $api_core_forgotPassword = Configure::read('Config.apiCore.forgotPassword');
$http = new Client(); // $http = new Client();
$response = $http->post($api_core_forgotPassword,$data['data'])->body(); // $response = $http->post($api_core_forgotPassword,$data['data'])->body();
$response = json_decode($response,'_full');#debug($response); // $response = json_decode($response,'_full');#debug($response);
if(!empty($response)){ // if(!empty($response)){
if(trim($response['status']) == 'Success'){ // if(trim($response['status']) == 'Success'){
$this->Flash->success(__('Completed.')); // $this->Flash->success(__('Completed.'));
return $this->redirect(['controller' => 'Users', 'action' => 'signin']); // return $this->redirect(['controller' => 'Users', 'action' => 'signin']);
}else{ // }else{
$this->Flash->error(__('Forgot Password Fail')); // $this->Flash->error(__('Forgot Password Fail'));
return $this->redirect(['controller' => 'Users', 'action' => 'forgotPassword']); // return $this->redirect(['controller' => 'Users', 'action' => 'forgotPassword']);
} // }
// }else{
// $this->Flash->error(__('Forgot Password Fail'));
// return $this->redirect(['controller' => 'Users', 'action' => 'forgotPassword']);
// }
// }else{
// $this->Flash->error(__('Data Empty'));
// return $this->redirect(['controller' => 'Users', 'action' => 'forgotPassword']);
// }
// }
// }
public function forgotPassword()
{
$this->viewBuilder()->layout('blank');
$this->loadModel('UserPersonals');
if ($this->request->is('post')) {
$hasher = new DefaultPasswordHasher();
$email = $this->request->data['email'];
//-------------------Random---------------------------------------------------------------
$alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
$pass = array();
$alphaLength = strlen($alphabet) - 1;
for ($i = 0; $i < 8; $i++) {
$n = rand(0, $alphaLength);
$pass[] = $alphabet[$n];
}
$password = implode($pass);
//------------------------------------------------------------------------------------------
$users['password'] = $hasher->hash($password);
$user_personals = $this->UserPersonals->find('all',[
'conditions' => [
'UserPersonals.email' => $email
]
])->first();
pr($password);
if(!empty($user_personals)){
//--------------------ตัวส่ง Email ---------------------------------------------------------
// pr($user_personals);die;
// $data_notification = [];
// $data_notification['email'] = $this->request->data['email'];
// $data_notification['pin_code'] = $password;
// $this->notification($data_notification);
//----------------------------------------------------------------------------------------
$users = $this->Users->find('all',[
'conditions' => [
'Users.id' => $user_personals['user_id']
]
])->first();
pr($users);die;
$users = $this->Users->patchEntity($users, $this->request->getData());
$this->Users->save($users);
$this->Flash->success(__('send password to email success'));
return $this->redirect(['action' => 'signin']);
}else{ }else{
$this->Flash->error(__('Forgot Password Fail')); $this->Flash->error(__('Invalid Email.'));
return $this->redirect(['controller' => 'Users', 'action' => 'forgotPassword']); return $this->redirect(['action' => 'forgot-password']);
} }
}
}else{
$this->Flash->error(__('Data Empty'));
return $this->redirect(['controller' => 'Users', 'action' => 'forgotPassword']);
}
}
} }
#---------------------------------------------------------------------------------------------------
#Change Password #---------------------------------------------------------------------------------------------------
public function changePassword()
public function changePassword()
{ {
$this->viewBuilder()->layout('blank'); $this->viewBuilder()->layout('blank');
if ($this->request->is('post')) {
$data = $this->request->data();#debug($data);exit(); $hasher = new DefaultPasswordHasher();
if(!empty($data)){ $password = $this->request->data['password'];
if($this->validateAccount($data)){ $confirm_password = $this->request->data['confirm_password'];
$data['data']['ip'] = $this->request->clientIp();#debug($data);exit(); $oldpassword = $this->request->data['oldpassword'];
$this->request->data['password'] = $hasher->hash($this->request->data['password']);
$api_core_change_password = Configure::read('Config.apiCore.changePassword');#debug($api_core_change_password);exit(); $userid = 59445;
$http = new Client(); $users = $this->Users->find('all',[
#$response = json_decode($http->post($api_core_change_password,$data)->body(),'_full'); 'conditions' => [
$response = $http->post($api_core_change_password,$data)->body(); 'Users.id' => $userid
#debug($response);exit(); ]
$response = json_decode($response,'_full'); ])->first();
#debug($response);exit(); //------- เทียบ password ที่เข้ารหัส ---------------password_verify($password,hashed_password)---------------------------
if (password_verify($oldpassword, $users['password'])) {
if(!empty($response)){ if($password==$confirm_password){
#if(trim($response['status']) == 'Success' && !empty($response['result']['type'])){ $users = $this->Users->patchEntity($users, $this->request->getData());
if(trim($response['status']) == 'Success'){ $this->Users->save($users);
#$this->response->withHeader('Authorization', 'Bearer '.$response['result']['token']); $this->Flash->success(__('change password success'));
#$url = $this->Url->build(['controller' => 'Homes', 'action' => 'index'], true); return $this->redirect(['action' => 'signin']);
$url = Router::url(['controller' => 'Users', 'action' => 'signup'], true);
#echo "<script>Login.onLogin('".$response['result']['token']."','".$url."');</script>";die;
$this->Flash->success(__('change Password completed.'));
return $this->redirect(['controller' => 'Users', 'action' => 'signin']);
}else{
$this->Flash->error(__('change Password Fail'));
return $this->redirect(['controller' => 'Users', 'action' => 'signup']);
} }
} else {
$this->Flash->error(__('Invalid password.'));
return $this->redirect(['action' => 'change-password']);
} }
}
}else{ }
$this->Flash->error(__('Data Empty'));
return $this->redirect(['controller' => 'Users', 'action' => 'signin']);
}
}
}
#--------------------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------
public function signout() public function signout()
{ {
$this->checkToken(); $this->checkToken();
} }
public function getProvince() {
$this->autoRender = false;
$this->loadModel('MasterProvinces');
$states = array();
$id = $this->request->data('id');
$states = $this->MasterProvinces->find('list', array(
'keyField' => 'id',
'valueField' => 'province_name_th',
'conditions' => array(
'master_country_id' =>$id
)
))->toArray();
$arr = array();
if(!empty($states)){
echo '<option value=""> ---Select--- </option>';
foreach($states as $key => $val){
echo '<option value="' . $key . '">' . $val. '</option>';
}
}else{
return false;
}
}
} }
...@@ -158,4 +158,15 @@ class UserCardsTable extends Table ...@@ -158,4 +158,15 @@ class UserCardsTable extends Table
return $rules; 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 { ...@@ -71,51 +71,51 @@ class UsersTable extends Table {
* @return \Cake\Validation\Validator * @return \Cake\Validation\Validator
*/ */
public function validationDefault(Validator $validator) { public function validationDefault(Validator $validator) {
$validator // $validator
->allowEmpty('id', 'create'); // ->allowEmpty('id', 'create');
$validator // $validator
->scalar('username') // ->scalar('username')
->allowEmpty('username'); // ->allowEmpty('username');
$validator // $validator
->scalar('password') // ->scalar('password')
->allowEmpty('password'); // ->allowEmpty('password');
$validator // $validator
->integer('point') // ->integer('point')
->allowEmpty('point'); // ->allowEmpty('point');
$validator // $validator
->boolean('is_used') // ->boolean('is_used')
->allowEmpty('is_used'); // ->allowEmpty('is_used');
$validator // $validator
->scalar('dynamic_key') // ->scalar('dynamic_key')
->allowEmpty('dynamic_key'); // ->allowEmpty('dynamic_key');
$validator // $validator
->date('dynamic_key_expiry') // ->date('dynamic_key_expiry')
->allowEmpty('dynamic_key_expiry'); // ->allowEmpty('dynamic_key_expiry');
$validator // $validator
->scalar('token') // ->scalar('token')
->allowEmpty('token'); // ->allowEmpty('token');
$validator // $validator
->date('token_expiry') // ->date('token_expiry')
->allowEmpty('token_expiry'); // ->allowEmpty('token_expiry');
$validator // $validator
->requirePresence('created_by', 'create') // ->requirePresence('created_by', 'create')
->notEmpty('created_by'); // ->notEmpty('created_by');
$validator // $validator
->allowEmpty('modified_by'); // ->allowEmpty('modified_by');
$validator // $validator
->scalar('pin_code') // ->scalar('pin_code')
->allowEmpty('pin_code'); // ->allowEmpty('pin_code');
return $validator; return $validator;
} }
...@@ -132,6 +132,7 @@ class UsersTable extends Table { ...@@ -132,6 +132,7 @@ class UsersTable extends Table {
return $rules; return $rules;
} }
/** /**
* *
......
<?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="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 style="position: absolute;z-index: 2;">
<a href="profile_setting"><img src="/img/core/img/setting-icon@3x.png"/></a> <div class="col-xs-10 col-sm-10 col-md-10">
</div> <div data-toggle="modal" data-target="#defaultModal" style="text-align: center;">
<div class="box"> <img src="/img/core/img/card-bg-front@3x-V2.png" class="img-responsive" id="img-upload" alt="Profile picture">
<div class="absolute-right"><img src="/img/core/img/location-profile-icon@3x.png"/> สีลม ,บางรัก</div>
</div> </div>
<div style="text-align: center;"> </div>
<!--<div class="">-->
<?php //echo @$this->Html->image($responseUserProfile['UserProfiles']['img_path'], ['class' => 'imgCircle profile-img', 'id' => 'img-upload', 'alt' => 'Profile picture']); ?> <div class="col-xs-1 col-sm-1 col-md-1" style="font-size:36px; height: 200px; padding-top:20%;" >
<!-- <img src="/porto/core/img/profile-img@3x.png" class="imgCircle profile-img" id="img-upload" alt="Profile picture"> --> <div >
<img src="/img/core/img/profile-img@3x.png" class="imgCircle profile-img" id="img-upload" alt="Profile picture"> <i class = "fa fa-angle-right">
<!--</div>--> </i>
<input type="file" id="uploadProfile" class="profile-img form-control form-input Profile-input-file" name="data[UserProfiles][img_path]" >
</div> </div>
<div class="bg-profile"></div> </div>
<!--<div class="col-xs-12 col-sm-12 col-md-12" style="padding-top: 20px;">--> <div style="clear: both"></div>
</div><!--/col-xs-12-->
</div><!--/row--> </div><!--/row-->
<br><br>
<div class="row"> <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->Form->create('UserProfiles', ['id' => 'frmSignIn', 'type' => 'file']); ?>
<?php echo $this->Flash->render() ?> <?php echo $this->Flash->render() ?>
<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->hidden('Users.user_id', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'value' => $responseUserProfile['id'], 'id' => 'userId', 'type' => 'text', 'label' => __('ชื่อผู้ใช้งาน'), 'placeholder' => 'USERNAME']); ?> <?php echo $this->Form->hidden('Users.user_id', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'value' => $responseUserProfile['id'], 'id' => 'userId', 'type' => 'text', 'label' => __('ชื่อผู้ใช้งาน'), 'placeholder' => 'USERNAME']); ?>
<?php echo $this->Form->input('Users.username', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'value' => $username, 'id' => 'username', 'type' => 'text', 'label' => __('ชื่อผู้ใช้งาน'), 'placeholder' => 'USERNAME', 'readonly']); ?> <?php echo $this->Form->input('Users.username', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'value' => $username, 'id' => 'username', 'type' => 'text', 'label' => __('ชื่อผู้ใช้งาน'), 'placeholder' => 'USERNAME', 'readonly']); ?>
<?php // echo $this->Form->input('user_id', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'value' => $userProfile->username, 'id' => 'userId', 'type' => 'text', 'label' => __('ชื่อผู้ใช้งาน'), 'placeholder' => 'USERNAME']); ?> <?php // echo $this->Form->input('user_id', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'value' => $userProfile->username, 'id' => 'userId', 'type' => 'text', 'label' => __('ชื่อผู้ใช้งาน'), 'placeholder' => 'USERNAME']); ?>
</div>
</div> </div>
</div>
<?php // foreach ($userProfile->user['user_personals'] as $k => $userProfiles): ?> <?php // foreach ($userProfile->user['user_personals'] as $k => $userProfiles): ?>
<?php // debug($userProfiles); exit;?> <?php // debug($userProfiles); exit;?>
<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">
<!--<label class="label-text-sub">เพศ</label>--> <!--<label class="label-text-sub">เพศ</label>-->
<?php echo __('เพศ'); ?> <?php echo __('เพศ'); ?>
<div class="radio-group"> <div class="radio-group">
<label class="radio-inline"> <label class="radio-inline">
<input type="radio" name="UserPersonals[gender]" id="male" value="M" <?php echo ($responseUserProfile['gender'] == 'M') ? 'checked="checked"' : null; ?>> <?php echo __('ชาย'); ?> <input type="radio" name="UserPersonals[gender]" id="male" value="M" <?php echo ($responseUserProfile['gender'] == 'M') ? 'checked="checked"' : null; ?>> <?php echo __('ชาย'); ?>
</label> </label>
<label class="radio-inline"> <label class="radio-inline">
<input type="radio" name="UserPersonals[gender]" id="female" value="F" <?php echo ($responseUserProfile['gender'] == 'F') ? 'checked="checked"' : null; ?>> <?php echo __('หญิง'); ?> <input type="radio" name="UserPersonals[gender]" id="female" value="F" <?php echo ($responseUserProfile['gender'] == 'F') ? 'checked="checked"' : null; ?>> <?php echo __('หญิง'); ?>
</label> </label>
</div>
</div> </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('UserPersonals.firstname_th', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'value' => $responseUserProfile['firstname_th'], 'id' => 'firstname_th', 'type' => 'text', 'label' => __('ชื่อ'), 'placeholder' => 'ชื่อ', 'required']); ?>
<?php echo $this->Form->input('UserPersonals.firstname_th', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'value' => $responseUserProfile['firstname_th'], 'id' => 'firstname_th', 'type' => 'text', 'label' => __('ชื่อ'), 'placeholder' => 'ชื่อ', 'required']); ?> <?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' => 'ชื่อ - นามสกุล', 'required']); ?>
<?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' => 'ชื่อ - นามสกุล', 'required']); ?> </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('UserPersonals.lastname_th', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'value' => $responseUserProfile['lastname_th'], 'id' => 'lastname_th', 'type' => 'text', 'label' => __('นามสกุล'), 'placeholder' => 'นามสกุล', 'required']); ?>
<?php echo $this->Form->input('UserPersonals.lastname_th', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'value' => $responseUserProfile['lastname_th'], 'id' => 'lastname_th', 'type' => 'text', 'label' => __('นามสกุล'), 'placeholder' => 'นามสกุล', 'required']); ?> <?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' => 'ชื่อ - นามสกุล', 'required']); ?>
<?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' => 'ชื่อ - นามสกุล', 'required']); ?> </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('UserPersonals.birthdate', ['class' => 'form-control-reg border-bottom-from required', 'value' => $dateNow, 'id' => 'datepicker', 'type' => 'text', 'label' => __('วันเดือนปีเกิด'), 'placeholder' => 'DD-MM-YYYY', 'required']); ?>
<?php echo $this->Form->input('UserPersonals.birthdate', ['class' => 'form-control-reg border-bottom-from required', 'value' => $dateNow, 'id' => 'datepicker', 'type' => 'text', 'label' => __('วันเดือนปีเกิด'), 'placeholder' => 'DD-MM-YYYY', 'required']); ?> <span class="glyphicon glyphicon-calendar form-control-feedback datepicker"></span>
<span class="glyphicon glyphicon-calendar form-control-feedback datepicker"></span> </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 __('กรุ๊ปเลือด'); ?>
<?php echo __('กรุ๊ปเลือด'); ?> <div class="radio-group">
<div class="radio-group"> <label class="radio-inline">
<label class="radio-inline"> <input type="radio" name="UserPersonals[blood_group]" id="blood-A" value="A" <?php echo ($responseUserProfile['blood_group'] == 'A') ? 'checked="checked"' : null; ?>> <?php echo __('A'); ?>
<input type="radio" name="UserPersonals[blood_group]" id="blood-A" value="A" <?php echo ($responseUserProfile['blood_group'] == 'A') ? 'checked="checked"' : null; ?>> <?php echo __('A'); ?> </label>
</label> <label class="radio-inline">
<label class="radio-inline"> <input type="radio" name="UserPersonals[blood_group]" id="blood-B" value="B" <?php echo ($responseUserProfile['blood_group'] == 'B') ? 'checked="checked"' : null; ?>> <?php echo __('B'); ?>
<input type="radio" name="UserPersonals[blood_group]" id="blood-B" value="B" <?php echo ($responseUserProfile['blood_group'] == 'B') ? 'checked="checked"' : null; ?>> <?php echo __('B'); ?> </label>
</label> <label class="radio-inline">
<label class="radio-inline"> <input type="radio" name="UserPersonals[blood_group]" id="blood-AB" value="AB" <?php echo ($responseUserProfile['blood_group'] == 'AB') ? 'checked="checked"' : null; ?>> <?php echo __('AB'); ?>
<input type="radio" name="UserPersonals[blood_group]" id="blood-AB" value="AB" <?php echo ($responseUserProfile['blood_group'] == 'AB') ? 'checked="checked"' : null; ?>> <?php echo __('AB'); ?> </label>
</label> <label class="radio-inline">
<label class="radio-inline"> <input type="radio" name="UserPersonals[blood_group]" id="blood-O" value="O" <?php echo ($responseUserProfile['blood_group'] == 'O') ? 'checked="checked"' : null; ?>> <?php echo __('O'); ?>
<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>
</label> </div>
</div> </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('UserPersonals.moblie_no', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'value' => $responseUserProfile['moblie_no'], 'id' => 'moblieNo', 'type' => 'text', 'label' => __('เบอร์โทรศัพท์'), 'placeholder' => '000-000-0000']); ?>
<?php echo $this->Form->input('UserPersonals.moblie_no', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'value' => $responseUserProfile['moblie_no'], 'id' => 'moblieNo', 'type' => 'text', 'label' => __('เบอร์โทรศัพท์'), 'placeholder' => '000-000-0000']); ?> <?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']); ?>
<?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> </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('UserPersonals.email', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'value' => $responseUserProfile['email'], 'id' => 'email', 'type' => 'email', 'label' => __('Email'), 'placeholder' => 'mail@xxx.com']); ?>
<?php echo $this->Form->input('UserPersonals.email', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'value' => $responseUserProfile['email'], 'id' => 'email', 'type' => 'email', 'label' => __('Email'), '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']); ?>
<?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']); ?> </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('UserPersonals.address', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'value' => $responseUserProfile['address'], 'id' => 'address', 'type' => 'text', 'label' => __('ที่อยู่อาศัย'), 'placeholder' => __('112/3 สุขุมวิท 22 ทองหล่อ กทม 10523')]); ?>
<?php echo $this->Form->input('UserPersonals.address', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'value' => $responseUserProfile['address'], 'id' => 'address', 'type' => 'text', 'label' => __('ที่อยู่อาศัย'), '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')]); ?>
<?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> </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 __('ประเทศ'); ?>
<?php echo __('ประเทศ'); ?> <?php
<?php echo $this->Form->input( 'master_country_id', array(
echo $this->Form->input( 'master_country_id', array( 'id' => 'master_country_id',
'id' => 'master_country_id', 'label' => false,
'label' => false, 'type' => 'select',
'type' => 'select', 'options' => $Country,
'options' => $Country, 'value' => $responseUserProfile['master_country_id'],
'value' => $responseUserProfile['master_country_id'], 'empty' => '---Select---',
'empty' => '---Select---', 'default' => !empty($responseUserProfile['master_country_id'])? $responseUserProfile['master_country_id']:'',
'default' => !empty($responseUserProfile['master_country_id'])? $responseUserProfile['master_country_id']:'', 'class' => 'form-control border-bottom-from label-text-sub required',
'class' => 'form-control border-bottom-from label-text-sub required', 'style' => 'width:100%'
'style' => 'width:100%' ));
)); ?>
?> </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 __('จังหวัด'); ?>
<?php echo __('จังหวัด'); ?> <?php
<?php echo $this->Form->input( 'master_province_id', array(
echo $this->Form->input( 'master_province_id', array( 'id' => 'master_province_id',
'id' => 'master_province_id', 'label' => false,
'label' => false, 'type' => 'select',
'type' => 'select', 'options' => $Province,
'options' => $Province, 'value' => $responseUserProfile['master_province_id'],
'value' => $responseUserProfile['master_province_id'], 'empty' => '---Select---',
'empty' => '---Select---', 'default' => !empty($responseUserProfile['master_province_id'])? $responseUserProfile['master_province_id']:'',
'default' => !empty($responseUserProfile['master_province_id'])? $responseUserProfile['master_province_id']:'', 'class' => 'form-control border-bottom-from label-text-sub required',
'class' => 'form-control border-bottom-from label-text-sub required', 'style' => 'width:100%'
'style' => 'width:100%' ));
)); ?>
?> </div>
</div> </div>
</div>
<?php // endforeach; ?> <?php // endforeach; ?>
<div> <div>
<?php // echo $this->Form->submit(__('SAVE')) ?> <?php // echo $this->Form->submit(__('SAVE')) ?>
...@@ -146,6 +173,40 @@ ...@@ -146,6 +173,40 @@
<?php echo $this->Form->end(); ?> <?php echo $this->Form->end(); ?>
</div> </div>
</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"> <script type="text/javascript">
$(function () { $(function () {
$('#moblieNo').inputmask('999-999-9999'); $('#moblieNo').inputmask('999-999-9999');
...@@ -206,25 +267,23 @@ ...@@ -206,25 +267,23 @@
//================================================== //==================================================
// CHANGE Province According Country // CHANGE Province According Country
//================================================== //==================================================
// $(document).ready(function() {
// $("#loding1").hide(); $(document).ready(function () {
// $("#loding2").hide(); $("#master_country_id").on('change', function () {
// $("#master_country_id").on('change',function() { var id = $(this).val();
// var id = $(this).val(); if (id) {
// // alert('dddd'); var dataString = 'id=' + id;
// $("#loding1").show(); $.ajax({
// $("#master_province_id").find('option').remove(); type: "POST",
// if (id) { url: '/users/getProvince',
// var dataString = 'id='+ id; data: dataString,
// alert(dataString); cache: false,
// $.post("/Profiles/getProvince", {id: id}, function(data) { success: function (html) {
// console.log(data); $("#master_province_id").html(html);
// data = jQuery.parseJSON(data); }
// console.log(data); });
// }); }
// // $('<option>').val('').text('---Select---'); });
// // $('<option>').val(key).text(value).appendTo($("#master_province_id")); });
// }
// });
// });
</script> </script>
\ No newline at end of file
<div class="row"> <div class="row">
<!--
<div style="position: absolute;z-index: 2;"> <div style="position: absolute;z-index: 2;">
<a href="settingProfile"><img src="webroot/porto/core/img/setting-icon@3x.png"/></a> <a href="../core/Profiles/settingProfile">
<?php echo $this->Html->image('/img/core/img/setting-icon@3x.png', ['alt' => 'setting-icon']); ?>
</a>
</div> </div>
-->
<div class="box"> <!------------------------------->
<div class="absolute-right"><img src="webroot/porto/core/img/location-profile-icon@3x.png"/> สีลม ,บางรัก</div>
<?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="box">
<div class="absolute-right">
<?php echo $this->Html->image('/img/core/img/location-profile-icon@3x.png', ['alt' => 'location-profile-icon']); ?> สีลม ,บางรัก</div>
</div> </div>
<div style="text-align: center;"> <div style="text-align: center;">
<img src="<?php echo !empty($Profiles['UserProfiles']['img_path'])? $Profiles['UserProfiles']['img_path']:'http://connect06.pakgon.com/core/webroot/img/user/user128x128.png'?>" class="profile-img"/> <?php if (empty($Profiles['UserProfiles'][0]['img_path'])) { ?>
<?php echo $this->Html->image('/img/core/img/user-profile@3x.png', array('div' => false, 'class' => 'profile-img','id'=>'output','style'=>'width: 169px;height: 169px;-webkit-border-radius: 85px;
-moz-border-radius: 85px;
border-radius: 85px;')); ?>
<?php }else{ ?>
<img src="<?php echo $Profiles['UserProfiles'][0]['img_path'];?>" class="profile-img" id="output" style="width: 169px;height: 169px;-webkit-border-radius: 85px;-moz-border-radius: 85px;border-radius: 85px;"/>
<?php }?>
</div> </div>
<div data-toggle="modal" data-target="#defaultModal" style="text-align: center;"> <div data-toggle="modal" data-target="#defaultModal" style="text-align: center;">
<a href="#"><img src="webroot/porto/core/img/id-card-button@3x.png" class="id-card-button"/></a> <a href="#">
<?php echo $this->Html->image('/img/core/img/id-card-button@3x.png', array('div' => false, 'class' => 'id-card-button')); ?>
</a>
</div> </div>
<div class="bg-profile"></div>
<div class="bg-profile"></div>
<div style="margin: 11% 0% -12% 0%;text-align: center;position: relative;"><?php echo $this->Flash->render() ?></div>
<div style="padding: 40px 20px 0px 20px;"> <div style="padding: 40px 20px 0px 20px;">
<ul class="list list-icons list-primary list-borders"> <ul class="list list-icons list-primary list-borders">
<li class="promotion-li"> <li class="promotion-li">
<a href="../Homes/promotion"> <a href="#">
<div class="row"> <div class="row">
<div class="col-xs-6 col-sm-7 color-profile"> <div class="col-xs-6 col-sm-7 color-profile">
<!--<img src="webroot/porto/core/img/View-the-latest-icon@3x.png" width="53" height="53" style="vertical-align: middle;"/> --> <!--<img src="../img/core/img/eWallet-icon@3x.png" width="53" height="53" style="vertical-align: middle;"/> -->
<?php echo __('ดูล่าสุด'); ?>
</div>
<div class="col-xs-6 col-sm-5 right-icon-view">
ที่เคยดูล่าสุด <img src="webroot/porto/core/img/next-icon-profile@3x.png" style="vertical-align: middle;"/>
</div>
</div>
</a>
</li>
<li class="promotion-li">
<a href="../Homes/promotion">
<div class="row">
<div class="col-xs-6 col-sm-7 color-profile">
<!--<img src="webroot/porto/core/img/eWallet-icon@3x.png" width="53" height="53" style="vertical-align: middle;"/> -->
My eWallet by Connect My eWallet by Connect
</div> </div>
<div class="col-xs-6 col-sm-5 right-icon-view"> <div class="col-xs-6 col-sm-5 right-icon-view">
$150 <img src="webroot/porto/core/img/next-icon-profile@3x.png" style="vertical-align: middle;"/> $150 <?php echo $this->Html->image('/img/core/img/next-icon-profile@3x.png', array('div' => false, 'style' => 'vertical-align: middle;')); ?>
<!--<img src="../img/core/img/next-icon-profile@3x.png" style="vertical-align: middle;"/>-->
</div> </div>
</div> </div>
</a> </a>
</li> </li>
<li class="promotion-li"> <li class="promotion-li">
<a href="../Homes/promotion"> <a href="#">
<div class="row"> <div class="row">
<div class="col-xs-6 col-sm-7 color-profile"> <div class="col-xs-6 col-sm-7 color-profile">
<!--<img src="webroot/porto/core/img/point-icon@3x.png" width="53" height="53" style="vertical-align: middle;"/> --> <!--<img src="../img/core/img/point-icon@3x.png" width="53" height="53" style="vertical-align: middle;"/> -->
Point ของฉัน Point ของฉัน
</div> </div>
<div class="col-xs-6 col-sm-5 right-icon-view"> <div class="col-xs-6 col-sm-5 right-icon-view">
P200 <img src="webroot/porto/core/img/next-icon-profile@3x.png" style="vertical-align: middle;"/> P200 <?php echo $this->Html->image('/img/core/img/next-icon-profile@3x.png', array('div' => false, 'style' => 'vertical-align: middle;')); ?>
</div> <!--<img src="../img/core/img/next-icon-profile@3x.png" style="vertical-align: middle;"/>-->
</div>
</a>
</li>
<li class="promotion-li">
<a href="../Homes/promotion">
<div class="row">
<div class="col-xs-6 col-sm-7 color-profile">
<!--<img src="webroot/porto/core/img/Transcript@3x.png" width="53" height="53" style="vertical-align: middle;"/> -->
ผลการศึกษา
</div>
<div class="col-xs-6 col-sm-5 right-icon-view">
<img src="webroot/porto/core/img/next-icon-profile@3x.png" style="vertical-align: middle;"/>
</div>
</div>
</a>
</li>
<li class="promotion-li">
<a href="../Homes/promotion">
<div class="row">
<div class="col-xs-6 col-sm-7 color-profile">
<!--<img src="webroot/porto/core/img/Talent-icon@3x.png" width="53" height="53" style="vertical-align: middle;"/> -->
แบบทดสอบพรสวรรค์
</div>
<div class="col-xs-6 col-sm-5 right-icon-view">
<img src="webroot/porto/core/img/next-icon-profile@3x.png" style="vertical-align: middle;"/>
</div>
</div>
</a>
</li>
<li class="promotion-li">
<a href="../Homes/promotion">
<div class="row">
<div class="col-xs-6 col-sm-7 color-profile">
<!--<img src="webroot/porto/core/img/graph-icon@3x.png" width="53" height="53" style="vertical-align: middle;"/> -->
ผลกราฟพรสวรรค์
</div>
<div class="col-xs-6 col-sm-5 right-icon-view">
<img src="webroot/porto/core/img/next-icon-profile@3x.png" style="vertical-align: middle;"/>
</div> </div>
</div> </div>
</a> </a>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
<!---------------------------------------------------------> <!--------------------------------------------------------->
<style type="text/css">
</style>
<!--------------------------------------------------------->
<style type="text/css">
</style>
<?php //debug($Profiles);?>
<div class="modal fade" id="defaultModal" tabindex="-1" role="dialog" aria-labelledby="defaultModalLabel" aria-hidden="true"> <div class="modal fade" id="defaultModal" tabindex="-1" role="dialog" aria-labelledby="defaultModalLabel" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<div class=""> <div class="">
...@@ -108,10 +112,63 @@ ...@@ -108,10 +112,63 @@
<div class="col-md-6"> <div class="col-md-6">
<div class="owl-carousel owl-theme" data-plugin-options="{'items': 1, 'margin': 10}"> <div class="owl-carousel owl-theme" data-plugin-options="{'items': 1, 'margin': 10}">
<div> <div>
<img alt="" class="img-responsive img-rounded" src="webroot/porto/core/img/crad01@3x.png">
<div class="idcard-profile"><?php echo __('ID Card');?></div>
<?php echo $this->Html->image('/img/core/img/card-bg-front@3x.png', array('div' => false, 'class' => 'img-responsive img-rounded','style' => 'position: absolute;')); ?>
<?php if (empty($Profiles['UserProfiles'][0]['img_path'])) { ?>
<?php echo $this->Html->image('/img/core/img/user-profile@3x.png', array('div' => false, 'class' => '','style' => 'position: absolute;width: 150px; margin: 85% 0% 0% 20%; -webkit-transform: rotate(270deg);
-moz-transform: rotate(270deg); -o-transform: rotate(270deg);')); ?>
<?php }else{ ?>
<img src="<?php echo $Profiles['UserProfiles'][0]['img_path'];?>" class="" id="" style="position: absolute;width: 150px; height: 150px; margin: 85% 0% 0% 20%; -webkit-border-radius: 85px;-moz-border-radius: 85px;border-radius: 85px; -webkit-transform: rotate(270deg);
-moz-transform: rotate(270deg); -o-transform: rotate(270deg);"/>
<?php }?>
<div class="idcard-text"><?php echo __('เลขบัตรประจำตัว');?></div>
<div class="idcard-number"><?php echo $Profiles['UserProfiles'][0]['card_code'];?></div>
<div class="idcard-name-th"><?php echo $Profiles['UserPersonals']['firstname_th'];?> <?php echo $Profiles['UserPersonals']['lastname_th'];?></div>
<div class="idcard-name-en"><?php echo $Profiles['UserPersonals']['firstname_en'];?> <?php echo $Profiles['UserPersonals']['lastname_en'];?></div>
<?php if (!empty($Profiles['UserProfiles'][0]['dept_id'])) { ?>
<div class="idcard-faculty"><b><?php echo __('คณะ');?></b> <?php echo $MasterDepartments_v[0]['dept_name_th'];?></div>
<?php }else{?>
<div class="idcard-faculty"><b><?php echo __('คณะ');?></b> <?php echo __('-');?></div>
<?php }?>
<?php if (!empty($Profiles['UserProfiles'][0]['section_id'])) { ?>
<div class="idcard-branch"><b><?php echo __('สาขา');?></b> <?php echo $MasterSections_v[0]['section_name_th'];?></div>
<?php }else{?>
<div class="idcard-branch"><b><?php echo __('สาขา');?></b> <?php echo __('-');?></div>
<?php }?>
<!-- <div class="idcard-faculty"><b><?php //echo __('คณะ');?></b> <?php //echo __('วิทยาการจัดการ');?></div>
<div class="idcard-branch"><b><?php //echo __('สาขา');?></b> <?php //echo __('คอมพิวเตอร์ธุรกิจ');?></div>-->
<div class="idcard-tel"><b><?php echo __('เบอร์');?></b> <?php echo $Profiles['UserProfiles'][0]['phone_no'];?></div>
<div class="idcard-email"><b><?php echo __('email');?></b> <?php echo $Profiles['UserPersonals']['email'];?></div>
<?php echo $this->Html->image('/img/core/img/thumbs-id@3x.png', array('div' => false, 'class' => '','style' => 'width:78px;height:78px;position: absolute;margin: -4px 0px 0px 96px;')); ?>
</div> </div>
<div> <div>
<img alt="" class="img-responsive img-rounded" src="webroot/porto/core/img/crad02@3x.png"> <div class="qrcode-profile"><?php echo __('แสดง QR Code เพื่อรับสิทธิ์');?></div>
<?php echo $this->Html->image('/img/core/img/card-bg-back@3x.png', array('div' => false, 'class' => 'img-responsive img-rounded','style' => '3position: absolute;')); ?>
<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 class="qrcode-faculty"><?php echo __('Date of Issue');?> <?php echo date("m/Y",strtotime($Profiles['Users']['created']));?></div>
<div class="qrcode-branch">| &nbsp;&nbsp;<?php echo __('Date of Expire');?> <?php echo date("m/Y",strtotime($Profiles['Users']['token_expiry'])); ?></div>
<?php echo $this->Html->image('/img/core/img/card-university-logo.png', array('div' => false, 'class' => '','style' => 'width: 25px;position: absolute;margin: -17% 0% 0% 86%;')); ?>
<?php if (!empty($Profiles['UserProfiles'][0]['organize_id'])) { ?>
<div class="qrcode-university"><?php echo $MasterDepartmentEducations[0]['org_name_th'];?></div>
<?php }else{?>
<div class="qrcode-university"><?php echo __('-');?></div>
<?php }?>
<?php //echo __('มหาวิทยาลัยราชภัฏจันทรเกษม');?>
<?php echo $this->Html->image('/img/core/img/card-logo-connect.png', array('div' => false, 'class' => '','style' => 'width: 26px;position: absolute;margin: -114% 0% 0% 86%;')); ?>
<div class="qrcode-connect"><?php echo __('connect');?></div>
<?php echo $this->Html->image('/img/core/img/thumbs-id2@3x.png', array('div' => false, 'class' => '','style' => 'width:78px;height:78px;position: absolute;margin: -152% 0% 0% 28%;')); ?>
</div> </div>
</div> </div>
</div> </div>
...@@ -120,3 +177,4 @@ ...@@ -120,3 +177,4 @@
</div> </div>
</div> </div>
</div> </div>
<!------------------------------------------------------------------------------->
\ No newline at end of file
<div class="row"> <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"> <div class="col-xs-12 col-sm-12 col-md-12">
<?php echo $this->Form->create('UserCrads', ['id' => 'frmSignIn', 'type' => 'file', 'onsubmit' => 'return check();']); ?> <?php echo $this->Form->create('UserCards', ['id' => 'frmSignIn', 'type' => 'file', 'onsubmit' => 'return check();']); ?>
<div style="position: absolute;z-index: 2;"> <!-- <div style="position: absolute;z-index: 2;">
<a href="profile_setting"><img src="/img/core/img/setting-icon@3x.png"/></a> <a href="profile_setting"><img src="/img/core/img/setting-icon@3x.png"/></a>
</div> </div> -->
<div class="bg-profile"></div>
<?php echo $this->Flash->render() ?> <!-- <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="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->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']); ?>
...@@ -23,12 +33,12 @@ ...@@ -23,12 +33,12 @@
<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"><?php echo __('วันเกิด');?></label> <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> <span class="glyphicon glyphicon-calendar form-control-feedback"></span>
</div> </div>
</div> </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> </div>
<?php echo $this->Form->end(); ?> <?php echo $this->Form->end(); ?>
</div> </div>
...@@ -45,11 +55,21 @@ ...@@ -45,11 +55,21 @@
if(data!='false'){ if(data!='false'){
data = jQuery.parseJSON(data); data = jQuery.parseJSON(data);
console.log(data); console.log(data);
$("#nameorg_th").text(data[0]['org_name_th']); if(data['chkuser'] == true){
$("#noorg_th").text(''); $("#noorg_th").text('ลงทะเบียนกับ '+data[0]['org_name_th']+' แล้ว');
$("#employee").removeAttr("disabled"); $("#nameorg_th").text('');
$("#date").removeAttr("disabled"); $('#employee').attr("disabled",true);
organize_id.value = data[0]['id']; $('#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{ }else{
$("#noorg_th").text('ไม่พบข้อมูล'); $("#noorg_th").text('ไม่พบข้อมูล');
$("#nameorg_th").text(''); $("#nameorg_th").text('');
...@@ -70,8 +90,8 @@ ...@@ -70,8 +90,8 @@
} }
if (date.value == '') { if (date.value == '') {
alert("วันเกิด"); alert("วันเกิด");
date.focus();
return false; return false;
date.focus();
} }
} }
</script> </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="row">
<div class="center"> <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>
<div class="col-md-12"> <div class="col-md-12">
<!-- <div class="alert alert-warning" role="alert" style="margin: 10px 0px 10px 0px;font-size: 17px;text-align: center;"> <!-- <div class="alert alert-warning" role="alert" style="margin: 10px 0px 10px 0px;font-size: 17px;text-align: center;">
...@@ -8,20 +8,21 @@ ...@@ -8,20 +8,21 @@
</div>--> </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->Form->create(null, ['url' => ['controller' => 'Users','action' => 'changePassword'],'class' => 'form-horizontal','id' => '','name' => 'changePressword','role' => 'form', 'onsubmit' => 'return validateForm()']);?>
<?php echo $this->Flash->render(); ?> <?php echo $this->Flash->render(); ?>
<!-- <div>
<div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-md-12"> <div class="col-md-12">
<label class="label-text-sub"><?php echo __('ยืนยันรหัส จากอีเมลล์');?></label> <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"> <input type="password" value="" name="oldpassword" placeholder="********" class="form-control-reg border-bottom-from" id="oldpassword" onkeyup='check();'>
<span class="glyphicon glyphicon-lock form-control-feedback"></span> <span class="glyphicon glyphicon-eye-close form-control-feedback" id='message'></span>
</div> </div>
</div> </div>
</div>--> </div>
<div> <div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-md-12"> <div class="col-md-12">
<label class="label-text-sub"><?php echo __('รหัสผ่านใหม่');?></label> <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> <span class="glyphicon glyphicon-eye-open form-control-feedback"></span>
</div> </div>
</div> </div>
...@@ -30,7 +31,7 @@ ...@@ -30,7 +31,7 @@
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-md-12"> <div class="col-md-12">
<label class="label-text-sub"><?php echo __('ยืนยันรหัสผ่าน');?></label> <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> <span class="glyphicon glyphicon-eye-close form-control-feedback" id='message'></span>
</div> </div>
</div> </div>
...@@ -51,24 +52,46 @@ ...@@ -51,24 +52,46 @@
</div> </div>
<!--------------------------------- popup -------------------------------------> <!-- ------------------------------- popup ----------------------------------- -->
<script> <script>
function validateForm() { function validateForm() {
var confirm_email = document.forms["changePressword"]["data[confirm_email]"].value;
if (confirm_email == null || confirm_email == "") { var password = document.forms["changePressword"]["oldpassword"].value;
alert("กรุณากรอกรหัสจากอีเมลล์ของท่าน 4 หลัก"); if (password == null || password == "") {
alert("กรุณากรอก รหัสผ่านเก่า");
return false; 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 == "") { if (password == null || password == "") {
alert("กรุณากรอก password"); alert("กรุณากรอก รหัสผ่านใหม่");
return false; return false;
} }
var confirm_password = document.forms["changePressword"]["data[confirm_password]"].value; if(document.forms["changePressword"]["password"].value.length < 8)
{
alert('กรุณาระบุรหัสผ่านใหม่อย่างน้อย 8 ตัวอักษร');
return false;
}
var confirm_password = document.forms["changePressword"][["confirm_password"]].value;
if (confirm_password == null || confirm_password == "") { if (confirm_password == null || confirm_password == "") {
alert("กรุณากรอก confirm_password"); alert("กรุณากรอก ยืนยันรหัสผ่าน");
return false; 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> </script>
<style> <style>
...@@ -177,72 +200,3 @@ ...@@ -177,72 +200,3 @@
color:green; color:green;
} }
</style> </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 @@ ...@@ -11,27 +11,8 @@
<div> <div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-md-12"> <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> <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>
</div> </div>
...@@ -49,26 +30,10 @@ ...@@ -49,26 +30,10 @@
<?php echo $this->Form->end(); ?> <?php echo $this->Form->end(); ?>
</div> </div>
</div> </div>
<!--------------------------------- popup -------------------------------------> <!-- ------------------------------- popup ----------------------------------- -->
<script> <script>
function validateForm() { function validateForm() {
var username = document.forms["forgotPressword"]["data[username]"].value; var email = document.forms["forgotPressword"]["email"].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;
if (email == null || email == "") { if (email == null || email == "") {
alert("กรุณากรอกอีเมลล์"); alert("กรุณากรอกอีเมลล์");
return false; return false;
...@@ -188,61 +153,6 @@ ...@@ -188,61 +153,6 @@
} }
</style> </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 -------------------------------------> <!--------------------------------- date ------------------------------------->
<script> <script>
$(document).ready(function(){ $(document).ready(function(){
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-md-12"> <div class="col-md-12">
<div class=" row center"> <div class=" row center">
<?php echo __('รหัส PIN 4 หลัก เพื่อเข้าใช้งาน Connect App');?> <?php echo __('รหัส PIN 4 หลัก ในอีเมลล์ที่ระบุเพื่อเข้าใช้งาน');?>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-md-12"> <div class="col-md-12">
<label class="label-text-sub"><?php echo __('ชื่อ');?><em>* </em></label> <label class="label-text-sub"><?php echo __('ชื่อ');?><em>* </em></label>
<input type="text" name="data[firstname]" value="" placeholder="FIRSTNAME" class="form-control-reg border-bottom-from" id="inputSuccess"> <input type="text" name="firstname" value="" placeholder="FIRSTNAME" class="form-control-reg border-bottom-from" id="inputSuccess">
</div> </div>
</div> </div>
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-md-12"> <div class="col-md-12">
<label class="label-text-sub"><?php echo __('นามสกุล');?><em>* </em></label> <label class="label-text-sub"><?php echo __('นามสกุล');?><em>* </em></label>
<input type="text" name="data[lastname]" value="" placeholder="LASTNAME" class="form-control-reg border-bottom-from" id="inputSuccess"> <input type="text" name="lastname" value="" placeholder="LASTNAME" class="form-control-reg border-bottom-from" id="inputSuccess">
</div> </div>
</div> </div>
...@@ -29,16 +29,60 @@ ...@@ -29,16 +29,60 @@
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-md-12"> <div class="col-md-12">
<label class="label-text-sub"><?php echo __('ชื่อผู้ใช้งาน');?><em>* </em></label> <label class="label-text-sub"><?php echo __('ชื่อผู้ใช้งาน');?><em>* </em></label>
<input type="text" name="data[username]" value="" placeholder="USERNAME" class="form-control-reg border-bottom-from" id="inputSuccess"> <input type="text" name="username" value="" placeholder="USERNAME" class="form-control-reg border-bottom-from" id="inputSuccess">
</div> </div>
</div> </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>
<?php
echo $this->Form->input( 'master_country_id', array(
'name'=>'master_country_id',
'id'=>'master_country_id',
'label' => false,
'type' => 'select',
'options' => $countries,
'empty' => '---Select---',
'default' => '',
'class' => 'form-control border-bottom-from label-text-sub required',
'style' => 'width:100%'
));
?>
</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>
<?php
echo $this->Form->input( 'master_province_id', [
'name'=>'master_province_id',
// 'id'=>'master_province_id',
'label' => false,
'type' => 'select',
'options' => $provinces,
'empty' => '---Select---',
'default' => '',
'class' => 'form-control border-bottom-from label-text-sub required',
'style' => 'width:100%'
]);
?>
</div>
</div>
</div>
<div> <div>
<div class="form-group has-feedback bootstrap-iso"> <div class="form-group has-feedback bootstrap-iso">
<div class="col-md-12"> <div class="col-md-12">
<label class="label-text-sub"><?php echo __('วันเกิด');?></label> <label class="label-text-sub"><?php echo __('วันเกิด');?></label>
<input type="text" name="data[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="birthdate" id="date" placeholder="กรุณาระบุวันเดือนปีเกิด" value="" placeholder="DD-MM-YYYY" data-date-format="mm/dd/yyyy" class="form-control-reg border-bottom-from">
<span class="glyphicon glyphicon-calendar form-control-feedback"></span> <span class="glyphicon glyphicon-calendar form-control-feedback"></span>
</div> </div>
</div> </div>
...@@ -47,8 +91,8 @@ ...@@ -47,8 +91,8 @@
<div> <div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-md-12"> <div class="col-md-12">
<label class="label-text-sub"><?php echo __('เบอร์โทรศัพท์');?></label> <label class="label-text-sub"><?php echo __('เบอร์โทรศัพท์');?><em>* </em></label>
<input type="text" name="data[phone_no]" onkeypress="check_phone();" value="" maxlength="10" placeholder="0000000000" class="mask form-control-reg border-bottom-from" id="inputSuccess"> <input type="text" name="phone_no" onkeypress="check_phone();" value="" maxlength="10" placeholder="0000000000" class="mask form-control-reg border-bottom-from" id="inputSuccess">
</div> </div>
</div> </div>
...@@ -57,7 +101,7 @@ ...@@ -57,7 +101,7 @@
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-md-12"> <div class="col-md-12">
<label class="label-text-sub"><?php echo __('อีเมลล์');?><em>* </em></label> <label class="label-text-sub"><?php echo __('อีเมลล์');?><em>* </em></label>
<input type="text" name="data[email]" id="fremail" value="" placeholder="mail@xxx.com" class="form-control-reg border-bottom-from" id="inputSuccess"> <input type="text" name="email" id="fremail" value="" placeholder="mail@xxx.com" class="form-control-reg border-bottom-from" id="inputSuccess">
</div> </div>
</div> </div>
...@@ -65,8 +109,8 @@ ...@@ -65,8 +109,8 @@
<div> <div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-md-12"> <div class="col-md-12">
<label class="label-text-sub"><?php echo __('รหัสผ่าน');?></label> <label class="label-text-sub"><?php echo __('รหัสผ่าน');?><em>* </em></label>
<input data-toggle="password" data-placement="before" type="password" name="data[password]" value="" placeholder="********" class="form-control input-lg color-button-border border-bottom-from" id="FALSE" style="padding:0px 0px !important;"> <input data-toggle="password" data-placement="before" type="password" name="password" value="" placeholder="********" class="form-control input-lg color-button-border border-bottom-from" id="FALSE" style="padding:0px 0px !important;">
<!--<input type="password" name="data[password]" id="password" value="" placeholder="********" class="form-control-reg border-bottom-from" onkeyup='check();'>--> <!--<input type="password" name="data[password]" id="password" value="" placeholder="********" class="form-control-reg border-bottom-from" onkeyup='check();'>-->
<!--<span class="glyphicon glyphicon-eye-close form-control-feedback"></span>--> <!--<span class="glyphicon glyphicon-eye-close form-control-feedback"></span>-->
</div> </div>
...@@ -76,7 +120,7 @@ ...@@ -76,7 +120,7 @@
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-md-12"> <div class="col-md-12">
<label class="label-text-sub"><?php echo __('ยืนยันรหัสผ่าน');?><em>* </em></label> <label class="label-text-sub"><?php echo __('ยืนยันรหัสผ่าน');?><em>* </em></label>
<input data-toggle="password" data-placement="before" type="password" name="data[confirm_password]" value="" placeholder="********" class="form-control input-lg color-button-border border-bottom-from" id="FALSE" style="padding:0px 0px !important;"> <input data-toggle="password" data-placement="before" type="password" name="confirm_password" value="" placeholder="********" class="form-control input-lg color-button-border border-bottom-from" id="FALSE" style="padding:0px 0px !important;">
<!--<input type="password" id="confirm_password" name="data[confirm_password]" value="" placeholder="********" class="form-control-reg border-bottom-from" onkeyup='check();'>--> <!--<input type="password" id="confirm_password" name="data[confirm_password]" value="" placeholder="********" class="form-control-reg border-bottom-from" onkeyup='check();'>-->
<!--<span class="glyphicon glyphicon-eye-close form-control-feedback" id='message'></span>--> <!--<span class="glyphicon glyphicon-eye-close form-control-feedback" id='message'></span>-->
<span id='message'></span> <span id='message'></span>
...@@ -106,7 +150,7 @@ ...@@ -106,7 +150,7 @@
</div> </div>
<!------------------Exit Model----------------------> <!------------------Exit Model---------------------->
<div class="switch switch-lg switch-warning" style="padding: 10px 0px 30px 0px;"> <div class="switch switch-lg switch-warning" style="padding: 10px 0px 30px 0px;">
<input type="checkbox" name="data[accept]" data-plugin-ios-switch data-toggle="modal" data-target="#largeModal"/> <input type="checkbox" id="accept" name="accept" data-plugin-ios-switch data-toggle="modal" data-target="#largeModal"/>
<span style="font-size: 17px;"><?php echo __('กรุณายอมรับ <b>เงื่อนไขการใช้งาน</b>');?></span> <span style="font-size: 17px;"><?php echo __('กรุณายอมรับ <b>เงื่อนไขการใช้งาน</b>');?></span>
</div> </div>
...@@ -120,63 +164,65 @@ ...@@ -120,63 +164,65 @@
<?php echo $this->Form->end(); ?> <?php echo $this->Form->end(); ?>
</div> </div>
</div> </div>
<!--------------------------------- popup -------------------------------------> <!-- ------------------------------- popup ----------------------------------- -->
<script> <script>
function validateForm() { function validateForm() {
var firstname = document.forms["createAccount"]["data[firstname]"].value; var firstname = document.forms["createAccount"]["firstname"].value;
if (firstname == null || firstname == "") { if (firstname == null || firstname == "") {
alert("กรุณากรอกชื่อ"); alert("กรุณากรอกชื่อ");
return false; return false;
} }
var lastname = document.forms["createAccount"]["data[lastname]"].value; var lastname = document.forms["createAccount"]["lastname"].value;
if (lastname == null || lastname == "") { if (lastname == null || lastname == "") {
alert("กรุณากรอกนามสกุล"); alert("กรุณากรอกนามสกุล");
return false; return false;
} }
var username = document.forms["createAccount"]["data[username]"].value; var username = document.forms["createAccount"]["username"].value;
if (username == null || username == "") { if (username == null || username == "") {
alert("กรุณากรอกชื่อผู้ใช้งานของท่าน"); alert("กรุณากรอกชื่อผู้ใช้งานของท่าน");
return false; return false;
} }
if(document.forms["createAccount"]["data[username]"].value.length < 5) if(document.forms["createAccount"]["username"].value.length < 5)
{ {
alert('กรุณาระบุชื่อผู้ใช้งานอย่างน้อย 5 ตัวอักษร'); alert('กรุณาระบุชื่อผู้ใช้งานอย่างน้อย 5 ตัวอักษร');
return false; return false;
} }
/*
var birthdate = document.forms["createAccount"]["data[birthdate]"].value;
if (birthdate == null || birthdate == "") {
alert("กรุณากรอก วันเดือนปีเกิดของท่าน"); // var birthdate = document.forms["createAccount"]["birthdate"].value;
return false; // if (birthdate == null || birthdate == "") {
} // alert("กรุณากรอก วันเดือนปีเกิดของท่าน");
var person_card_no = document.forms["createAccount"]["data[person_card_no]"].value; // return false;
if (person_card_no == null || person_card_no == "") { // }
alert("กรุณากรอกเลขบัตรประชาชน"); // var person_card_no = document.forms["createAccount"]["person_card_no"].value;
return false; // if (person_card_no == null || person_card_no == "") {
} // alert("กรุณากรอกเลขบัตรประชาชน");
if(document.forms["createAccount"]["data[person_card_no]"].value.length < 13 || document.forms["createAccount"]["data[person_card_no]"].value.length > 13) // return false;
{ // }
alert('กรุณากรอกเลขบัตรประชาชนให้ครบ 13 หลัก'); // if(document.forms["createAccount"]["data[person_card_no]"].value.length < 13 || document.forms["createAccount"]["data[person_card_no]"].value.length > 13)
return false; // {
} // alert('กรุณากรอกเลขบัตรประชาชนให้ครบ 13 หลัก');
var phone_no = document.forms["createAccount"]["data[phone_no]"].value; // return false;
// }
var phone_no = document.forms["createAccount"]["phone_no"].value;
if (phone_no == null || phone_no == "") { if (phone_no == null || phone_no == "") {
alert("กรุณากรอกเบอร์โทรศัพท์ของท่าน"); alert("กรุณากรอก เบอร์โทรศัพท์ของท่าน");
return false; return false;
} }
if(document.forms["createAccount"]["data[phone_no]"].value.length < 10 || document.forms["createAccount"]["data[phone_no]"].value.length > 10) if(document.forms["createAccount"]["phone_no"].value.length < 10 || document.forms["createAccount"]["phone_no"].value.length > 10)
{ {
alert('กรุณากรอกเบอร์โทรศัพท์ ให้ครบ 10 หลัก'); alert('กรุณากรอกเบอร์โทรศัพท์ ให้ครบ 10 หลัก');
return false;
}
*/
/*var lastname = document.forms["createAccount"]["data[lastname]"].value;
if (lastname == null || lastname == "") {
alert("กรุณากรอกรหัสผ่าน");
return false; return false;
}*/ }
var email = document.forms["createAccount"]["data[email]"].value;
// var lastname = document.forms["createAccount"]["data[lastname]"].value;
// if (lastname == null || lastname == "") {
// alert("กรุณากรอกรหัสผ่าน");
// return false;
// }
var email = document.forms["createAccount"]["email"].value;
if (email == null || email == "") { if (email == null || email == "") {
alert("กรุณากรอกอีเมลล์"); alert("กรุณากรอกอีเมลล์");
return false; return false;
...@@ -187,28 +233,40 @@ ...@@ -187,28 +233,40 @@
alert("รูปแบบที่อยู่อีเมลล์ผิด กรุณากรอกให้ถูกต้อง"); alert("รูปแบบที่อยู่อีเมลล์ผิด กรุณากรอกให้ถูกต้อง");
return false; return false;
} }
var password = document.forms["createAccount"]["data[password]"].value; var password = document.forms["createAccount"]["password"].value;
if (password == null || password == "") { if (password == null || password == "") {
alert("กรุณากรอกรหัสผ่าน"); alert("กรุณากรอกรหัสผ่าน");
return false; return false;
} }
if(document.forms["createAccount"]["data[password]"].value.length < 8) if(document.forms["createAccount"]["password"].value.length < 8)
{ {
alert('กรุณาระบุรหัสผ่านอย่างน้อย 8 ตัวอักษร'); alert('กรุณาระบุรหัสผ่านอย่างน้อย 8 ตัวอักษร');
return false; return false;
} }
var confirm_password = document.forms["createAccount"]["data[confirm_password]"].value; var confirm_password = document.forms["createAccount"]["confirm_password"].value;
if (confirm_password == null || confirm_password == "") { if (confirm_password == null || confirm_password == "") {
alert("กรุณายืนยันรหัสผ่าน"); alert("กรุณายืนยันรหัสผ่าน");
return false; return false;
} }
if(document.forms["createAccount"]["data[password]"].value != document.forms["createAccount"]["data[confirm_password]"].value){ if(document.forms["createAccount"]["password"].value != document.forms["createAccount"]["confirm_password"].value){
alert('กรุณาระบุรหัสผ่านให้ตรงกัน'); alert('กรุณาระบุรหัสผ่านให้ตรงกัน');
//document.createAccount.confirm_password.focus(); //document.createAccount.confirm_password.focus();
return false; return false;
} }
$("body").delegate(".is_active", "click", function () {
$('.is_active').not(this).prop('checked', false);
return true;
// var id = $(this).closest('td').find('#idAddresses').val();
// var id_card13 = $(this).closest('td').find('#idCard13Addresses').val();
// console.log(id);
// $.post("/Addresses/currentAddress", {id: id, id_card13 : id_card13}, function(data) {
// location.reload();
// });
});
} }
</script> </script>
<style> <style>
#alertBox { #alertBox {
...@@ -371,16 +429,31 @@ ...@@ -371,16 +429,31 @@
alert('Alert this pages'); alert('Alert this pages');
} }
</script> </script>
<!--------------------------------- confirm password -------------------------------->
<script type="text/javascript">
$(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>
<!--------------------------------- confirm password ------------------------------ -->
<script> <script>
function check_number() {
e_k=event.keyCode
//if (((e_k < 48) || (e_k > 57)) && e_k != 46 ) {
if (e_k = 13 && (e_k < 48) || (e_k > 57)) {
event.returnValue = false;
alert("ขออภัยหมายเลขบัตรประจำตัวประชาชน ต้องเป็นตัวเลขเท่านั้น");
}
}
function check_phone() { function check_phone() {
e_k=event.keyCode e_k=event.keyCode
......
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