Commit 638cb0bb by Teeradone-PIM

Merge branch 'integration' into teeradone

parents 6a12e1b3 24bf50f3
...@@ -217,3 +217,4 @@ if (Configure::read('debug')) { ...@@ -217,3 +217,4 @@ if (Configure::read('debug')) {
//Plugin::load('AdminLTE', ['bootstrap' => true, 'routes' => true]); //Plugin::load('AdminLTE', ['bootstrap' => true, 'routes' => true]);
//Plugin::load('Porto',['bootstrap' => true,'routes' => true ]); //Plugin::load('Porto',['bootstrap' => true,'routes' => true ]);
} }
Plugin::load('Muffin/OAuth2');
\ No newline at end of file
...@@ -49,12 +49,16 @@ Router::scope('/', function (RouteBuilder $routes) { ...@@ -49,12 +49,16 @@ Router::scope('/', function (RouteBuilder $routes) {
* its action called 'display', and we pass a param to select the view file * its action called 'display', and we pass a param to select the view file
* to use (in this case, src/Template/Pages/home.ctp)... * to use (in this case, src/Template/Pages/home.ctp)...
*/ */
$routes->connect('/', ['controller' => 'Users', 'action' => 'signin']); // $routes->connect('/', ['controller' => 'Users', 'action' => 'signin']);
$routes->connect('/', ['controller' => 'homes', 'action' => 'index']);
/** /**
* ...and connect the rest of 'Pages' controller's URLs. * ...and connect the rest of 'Pages' controller's URLs.
*/ */
////$routes->connect('/pages/*', ['controller' => 'Pages', 'action' => 'display']); $routes->connect('/pages/*', ['controller' => 'Pages', 'action' => 'display']);
//Adding by sarawutt.b for oauth2 authenticatio
//$routes->connect('/oauth/:provider', ['controller' => 'users', 'action' => 'login'], ['provider' => 'generic']);
$routes->setExtensions(['json', 'xml', 'html']);
/** /**
* Connect catchall routes for all controllers. * Connect catchall routes for all controllers.
......
<?php <?php
/** /**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org) * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
...@@ -12,10 +13,13 @@ ...@@ -12,10 +13,13 @@
* @since 0.2.9 * @since 0.2.9
* @license https://opensource.org/licenses/mit-license.php MIT License * @license https://opensource.org/licenses/mit-license.php MIT License
*/ */
namespace App\Controller; namespace App\Controller;
use Cake\Controller\Controller; use Cake\Controller\Controller;
use Cake\Event\Event; use Cake\Event\Event;
use Cake\I18n\I18n;
use Cake\Core\Configure;
/** /**
* Application Controller * Application Controller
...@@ -25,8 +29,9 @@ use Cake\Event\Event; ...@@ -25,8 +29,9 @@ use Cake\Event\Event;
* *
* @link https://book.cakephp.org/3.0/en/controllers.html#the-app-controller * @link https://book.cakephp.org/3.0/en/controllers.html#the-app-controller
*/ */
class AppController extends Controller class AppController extends Controller {
{
protected $selectEmptyMsg = '---- please select ----';
/** /**
* Initialization hook method. * Initialization hook method.
...@@ -37,8 +42,7 @@ class AppController extends Controller ...@@ -37,8 +42,7 @@ class AppController extends Controller
* *
* @return void * @return void
*/ */
public function initialize() public function initialize() {
{
parent::initialize(); parent::initialize();
//$this->viewBuilder()->theme('Porto'); //$this->viewBuilder()->theme('Porto');
$this->loadComponent('RequestHandler'); $this->loadComponent('RequestHandler');
...@@ -48,42 +52,193 @@ class AppController extends Controller ...@@ -48,42 +52,193 @@ class AppController extends Controller
* Enable the following components for recommended CakePHP security settings. * Enable the following components for recommended CakePHP security settings.
* see https://book.cakephp.org/3.0/en/controllers/components/security.html * see https://book.cakephp.org/3.0/en/controllers/components/security.html
*/ */
$this->loadComponent('Auth', [
'loginRedirect' => ['controller' => 'Homes', 'action' => 'index'],
'logoutRedirect' => ['controller' => 'Users', 'action' => 'signin'],
'authenticate' => [
'Form' => [
'fields' => ['username' => 'username', 'password' => 'password'],
'userModel' => 'Users'
]
],
'loginAction' => ['controller' => 'Users', 'action' => 'signin'],
'authorize' => ['Controller'],
'unauthorizedRedirect' => $this->referer()// If unauthorized, return them to page they were just on
]);
//$this->loadComponent('Security'); //$this->loadComponent('Security');
//$this->loadComponent('Csrf'); //$this->loadComponent('Csrf');
} }
/** /**
*
* Function trigger before filter process
* @author sarawutt.b
* @param Event $event
*/
public function beforeFilter(Event $event) {
parent::beforeFilter($event);
/**
*
* Set appication language this can be thai|english
* @author Sarawutt.b
* @since 2018-02-28
* @return void
*/
if ($this->request->session()->check('SessionLanguage') == false) {
$this->request->session()->write('SessionLanguage', 'tha');
}
$this->Auth->allow(['signin', 'signout', 'signup', 'verify']);
}
/**
* Before render callback. * Before render callback.
* *
* @param \Cake\Event\Event $event The beforeRender event. * @param \Cake\Event\Event $event The beforeRender event.
* @return \Cake\Http\Response|null|void * @return \Cake\Http\Response|null|void
*/ */
public function beforeRender(Event $event) public function beforeRender(Event $event) {
{
//$this->viewBuilder()->theme('Gentelella'); //$this->viewBuilder()->theme('Gentelella');
//$this->viewBuilder()->theme('AdminLTE'); //$this->viewBuilder()->theme('AdminLTE');
//$this->viewBuilder()->theme('Porto'); //$this->viewBuilder()->theme('Porto');
//$this->viewBuilder()->className('AdminLTE.AdminLTE'); //$this->viewBuilder()->className('AdminLTE.AdminLTE');
//$this->viewBuilder()->theme('Porto'); //$this->viewBuilder()->theme('Porto');
//$this->viewBuilder()->className('Porto.Porto'); //$this->viewBuilder()->className('Porto.Porto');
// Note: These defaults are just to get started quickly with development // Note: These defaults are just to get started quickly with development
// and should not be used in production. You should instead set "_serialize" // and should not be used in production. You should instead set "_serialize"
// in each action as required. // in each action as required.
if (!array_key_exists('_serialize', $this->viewVars) && if (!array_key_exists('_serialize', $this->viewVars) &&
in_array($this->response->type(), ['application/json', 'application/xml']) in_array($this->response->type(), ['application/json', 'application/xml'])
) { ) {
$this->set('_serialize', true); $this->set('_serialize', true);
//$this->set('theme', Configure::read('Theme')); //$this->set('theme', Configure::read('Theme'));
} }
//$this->set('theme', Configure::read('Theme')); //$this->set('theme', Configure::read('Theme'));
} }
function checkToken(){
if(empty($this->request->getHeaderLine('Authorization'))){ /**
return $this->redirect(['controller' => 'Users', 'action' => 'signin']); *
} * Function check authorize
* @author sarawutt.b
* @param type $user
* @return boolean
*/
public function isAuthorized($user) {
return true;
}
/**
*
* Function check fore token
* @return type
*/
function checkToken() {
if (empty($this->request->getHeaderLine('Authorization'))) {
return $this->redirect(['controller' => 'Users', 'action' => 'signin']);
}
}
/**
* Set language used this in mutiple language application concept
* @author Sarawutt.b
* @since 2016/03/21 10:23:33
* @return void
*/
public function _setLanguage() {
$this->L10n = new L10n();
$language = $this->request->session()->read('SessionLanguage');
Configure::write('Config.language', $language);
$this->L10n->get($language);
}
/**
*
* Function get for current session user language
* @author sarawutt.b
* @return string
*/
public function getCurrentLanguage() {
return $this->request->session()->read('SessionLanguage');
} }
/**
*
* Function used fro generate _VERSION_
* @author sarawutt.b
* @return biginteger of the version number
*/
public function VERSION() {
$parts = explode(' ', microtime());
$micro = $parts[0] * 1000000;
return(substr(date('YmdHis'), 2) . sprintf("%06d", $micro));
}
/**
*
* Function used for generate UUID key patern
* @author sarawutt.b
* @return string uuid in version
*/
public function UUID() {
return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0x0fff) | 0x4000, mt_rand(0, 0x3fff) | 0x8000, mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff));
}
/**
*
* Function get for current session user authentication full name
* @author sarawutt.b
* @since 2018/02/06
* @return string of authentication user full name
*/
protected function getAuthFullname() {
return $this->readAuth('Auth.User.first_name') . ' ' . $this->readAuth('Auth.User.last_name');
}
/**
*
* Function get for current session user authentication user id
* @author sarawutt.b
* @since 2018/02/06
* @return string of authentication user id
*/
protected function getAuthUserId() {
return $this->readAuth('Auth.User.id');
}
/**
*
* Function get for current session user authentication role id
* @author sarawutt.b
* @since 2018/02/06
* @return string of authentication user id
*/
protected function getAuthUserRoleId() {
return $this->readAuth('Auth.User.role_id');
}
/**
*
* Function get for current session with user authentication
* @author sarawutt.b
* @since 2018/02/06
* @return string of authentication session info
*/
protected function readAuth($name = null) {
return $this->request->session()->read($name);
}
/**
* Function get for empty option in DDL
* @author sarawutt.b
* @return array() of empty select DDL
*/
public function getEmptySelect() {
return ['' => __($this->selectEmptyMsg)];
}
} }
...@@ -14,6 +14,8 @@ class ProfilesController extends AppController ...@@ -14,6 +14,8 @@ class ProfilesController extends AppController
/*******************************/ /*******************************/
$id = $this->Auth->user('id');
$this->loadModel('Users'); $this->loadModel('Users');
$responseUserProfile = $this->Users->get($id, [ $responseUserProfile = $this->Users->get($id, [
'contain' => [] 'contain' => []
...@@ -33,7 +35,6 @@ class ProfilesController extends AppController ...@@ -33,7 +35,6 @@ class ProfilesController extends AppController
'keyField' => 'id', 'keyField' => 'id',
'valueField' => 'country_name_th' 'valueField' => 'country_name_th'
]); ]);
// pr($responseUserPersonal['master_country_id']);die;
if(!empty($Country)) $Country = $Country->toArray(); if(!empty($Country)) $Country = $Country->toArray();
//********DropdownProvince******** //********DropdownProvince********
...@@ -43,7 +44,9 @@ class ProfilesController extends AppController ...@@ -43,7 +44,9 @@ class ProfilesController extends AppController
'is_used' => true], 'is_used' => true],
'keyField' => 'id', 'keyField' => 'id',
'valueField' => 'province_name_th' 'valueField' => 'province_name_th'
])->where(['master_country_id =' => $responseUserPersonal['master_country_id']]); ])
->where(['master_country_id =' => $responseUserPersonal['master_country_id']])
->order(['province_name_th']);
// pr($Province);die; // pr($Province);die;
if(!empty($Province)) $Province = $Province->toArray(); if(!empty($Province)) $Province = $Province->toArray();
...@@ -63,7 +66,7 @@ class ProfilesController extends AppController ...@@ -63,7 +66,7 @@ class ProfilesController extends AppController
] ]
] ]
)->first(); )->first();
// pr($userPersonals);die;
if($userPersonals['email'] == $this->request->data['UserPersonals']['email']){ if($userPersonals['email'] == $this->request->data['UserPersonals']['email']){
$chkemail = true; $chkemail = true;
}else{ }else{
...@@ -96,7 +99,7 @@ class ProfilesController extends AppController ...@@ -96,7 +99,7 @@ class ProfilesController extends AppController
$userPersonals['user_id'] = $data['Users']['user_id']; $userPersonals['user_id'] = $data['Users']['user_id'];
$userPersonals['master_country_id'] = $this->request->data['master_country_id']; $userPersonals['master_country_id'] = $this->request->data['master_country_id'];
$userPersonals['master_province_id'] = $this->request->data['master_province_id']; $userPersonals['master_province_id'] = $this->request->data['master_province_id'];
$userPersonals['modified_by'] = ''; $userPersonals['modified_by'] = $id;
if ($this->UserPersonals->save($userPersonals)) { if ($this->UserPersonals->save($userPersonals)) {
$this->Flash->success(__('Update Complete.')); $this->Flash->success(__('Update Complete.'));
...@@ -592,4 +595,5 @@ if (!empty($SubjectEnrolls)) { ...@@ -592,4 +595,5 @@ if (!empty($SubjectEnrolls)) {
$this->viewBuilder()->layout('blank'); $this->viewBuilder()->layout('blank');
} }
} }
<?php
namespace App\Controller;
use App\Controller\AppController;
class ProvincesController extends AppController
{
public function initialize() {
parent::initialize();
$this->Auth->allow();
}
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;
}
}
}
<table cellpadding="0" width="100%" cellspacing="0" border="0" id="backgroundTable" class='bgBody'>
<tr>
<td>
<table cellpadding="0" width="620" class="container" align="center" cellspacing="0" border="0">
<tr>
<td>
<!-- Tables are the most common way to format your email consistently. Set your table widths inside cells and in most cases reset cellpadding, cellspacing, and border to zero. Use nested tables as a way to space effectively in your message. -->
<table cellpadding="0" cellspacing="0" border="0" align="center" width="600" class="container">
<tr>
<td class='movableContentContainer bgItem'>
<div class='movableContent'>
<table cellpadding="0" cellspacing="0" border="0" align="center" width="600" class="container">
<tr height="40">
<td width="200">&nbsp;</td>
<td width="200">&nbsp;</td>
<td width="200">&nbsp;</td>
</tr>
<tr>
<td width="200" valign="top">&nbsp;</td>
<td width="200" valign="top" align="center">
<div class="contentEditableContainer contentImageEditable">
<div class="contentEditable" align='center' >
<img src="images/logo.png" width="155" height="155" alt='Logo' data-default="placeholder" />
</div>
</div>
</td>
<td width="200" valign="top">&nbsp;</td>
</tr>
<tr height="25">
<td width="200">&nbsp;</td>
<td width="200">&nbsp;</td>
<td width="200">&nbsp;</td>
</tr>
</table>
</div>
<div class='movableContent'>
<table cellpadding="0" cellspacing="0" border="0" align="center" width="600" class="container">
<tr>
<td width="100%" colspan="3" align="center" style="padding-bottom:10px;padding-top:25px;">
<div class="contentEditableContainer contentTextEditable">
<div class="contentEditable" align='center' >
<h2 >It's been a while...</h2>
</div>
</div>
</td>
</tr>
<tr>
<td width="100">&nbsp;</td>
<td width="400" align="center">
<div class="contentEditableContainer contentTextEditable">
<div class="contentEditable" align='left' >
<p >Hi [FirstName,there],
<br/>
<br/>
Click on the link below to update your profile. If you're no longer interested in hearing from us, simply click on unsubscribe below (or ignore this message) and we won't send you any more newsletters.</p>
</div>
</div>
</td>
<td width="100">&nbsp;</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" align="center" width="600" class="container">
<tr>
<td width="200">&nbsp;</td>
<td width="200" align="center" style="padding-top:25px;">
<table cellpadding="0" cellspacing="0" border="0" align="center" width="200" height="50">
<tr>
<td bgcolor="#ED006F" align="center" style="border-radius:4px;" width="200" height="50">
<div class="contentEditableContainer contentTextEditable">
<div class="contentEditable" align='center' >
<a target='_blank' href="#" class='link2'>Click here to reset it</a>
</div>
</div>
</td>
</tr>
</table>
</td>
<td width="200">&nbsp;</td>
</tr>
</table>
</div>
<div class='movableContent'>
<table cellpadding="0" cellspacing="0" border="0" align="center" width="600" class="container">
<tr>
<td width="100%" colspan="2" style="padding-top:65px;">
<hr style="height:1px;border:none;color:#333;background-color:#ddd;" />
</td>
</tr>
<tr>
<td width="60%" height="70" valign="middle" style="padding-bottom:20px;">
<div class="contentEditableContainer contentTextEditable">
<div class="contentEditable" align='left' >
<span style="font-size:13px;color:#181818;font-family:Helvetica, Arial, sans-serif;line-height:200%;">Sent to [email] by [CLIENTS.COMPANY_NAME]</span>
<br/>
<span style="font-size:11px;color:#555;font-family:Helvetica, Arial, sans-serif;line-height:200%;">[CLIENTS.ADDRESS] | [CLIENTS.PHONE]</span>
<br/>
<span style="font-size:13px;color:#181818;font-family:Helvetica, Arial, sans-serif;line-height:200%;">
<a target='_blank' href="[FORWARD]" style="text-decoration:none;color:#555">Forward to a friend</a>
</span>
<br/>
<span style="font-size:13px;color:#181818;font-family:Helvetica, Arial, sans-serif;line-height:200%;">
<a target='_blank' href="[UNSUBSCRIBE]" style="text-decoration:none;color:#555">click here to unsubscribe</a></span>
</div>
</div>
</td>
<td width="40%" height="70" align="right" valign="top" align='right' style="padding-bottom:20px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align='right'>
<tr>
<td width='57%'></td>
<td valign="top" width='34'>
<div class="contentEditableContainer contentFacebookEditable" style='display:inline;'>
<div class="contentEditable" >
<img src="images/facebook.png" data-default="placeholder" data-max-width='30' data-customIcon="true" width='30' height='30' alt='facebook' style='margin-right:40x;'>
</div>
</div>
</td>
<td valign="top" width='34'>
<div class="contentEditableContainer contentTwitterEditable" style='display:inline;'>
<div class="contentEditable" >
<img src="images/twitter.png" data-default="placeholder" data-max-width='30' data-customIcon="true" width='30' height='30' alt='twitter' style='margin-right:40x;'>
</div>
</div>
</td>
<td valign="top" width='34'>
<div class="contentEditableContainer contentImageEditable" style='display:inline;'>
<div class="contentEditable" >
<a target='_blank' href="#" data-default="placeholder" style="text-decoration:none;">
<img src="images/pinterest.png" width="30" height="30" data-max-width="30" alt='pinterest' style='margin-right:40x;' />
</a>
</div>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
\ No newline at end of file
<table cellpadding="0" width="100%" cellspacing="0" border="0" id="backgroundTable" class='bgBody'>
<tr>
<td>
<table cellpadding="0" width="620" class="container" align="center" cellspacing="0" border="0">
<tr>
<td>
<!-- Tables are the most common way to format your email consistently. Set your table widths inside cells and in most cases reset cellpadding, cellspacing, and border to zero. Use nested tables as a way to space effectively in your message. -->
<table cellpadding="0" cellspacing="0" border="0" align="center" width="600" class="container">
<tr>
<td class='movableContentContainer bgItem'>
<div class='movableContent'>
<table cellpadding="0" cellspacing="0" border="0" align="center" width="600" class="container">
<tr height="40">
<td width="200">&nbsp;</td>
<td width="200">&nbsp;</td>
<td width="200">&nbsp;</td>
</tr>
<tr>
<td width="200" valign="top">&nbsp;</td>
<td width="200" valign="top" align="center">
<div class="contentEditableContainer contentImageEditable">
<div class="contentEditable" align='center' >
<img src="images/logo.png" width="155" height="155" alt='Logo' data-default="placeholder" />
</div>
</div>
</td>
<td width="200" valign="top">&nbsp;</td>
</tr>
<tr height="25">
<td width="200">&nbsp;</td>
<td width="200">&nbsp;</td>
<td width="200">&nbsp;</td>
</tr>
</table>
</div>
<div class='movableContent'>
<table cellpadding="0" cellspacing="0" border="0" align="center" width="600" class="container">
<tr>
<td width="100%" colspan="3" align="center" style="padding-bottom:10px;padding-top:25px;">
<div class="contentEditableContainer contentTextEditable">
<div class="contentEditable" align='center' >
<h2 >It's been a while...</h2>
</div>
</div>
</td>
</tr>
<tr>
<td width="100">&nbsp;</td>
<td width="400" align="center">
<div class="contentEditableContainer contentTextEditable">
<div class="contentEditable" align='left' >
<p >Hi [FirstName,there],
<br/>
<br/>
Click on the link below to update your profile. If you're no longer interested in hearing from us, simply click on unsubscribe below (or ignore this message) and we won't send you any more newsletters.</p>
</div>
</div>
</td>
<td width="100">&nbsp;</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" align="center" width="600" class="container">
<tr>
<td width="200">&nbsp;</td>
<td width="200" align="center" style="padding-top:25px;">
<table cellpadding="0" cellspacing="0" border="0" align="center" width="200" height="50">
<tr>
<td bgcolor="#ED006F" align="center" style="border-radius:4px;" width="200" height="50">
<div class="contentEditableContainer contentTextEditable">
<div class="contentEditable" align='center' >
<a target='_blank' href="#" class='link2'>Click here to reset it</a>
</div>
</div>
</td>
</tr>
</table>
</td>
<td width="200">&nbsp;</td>
</tr>
</table>
</div>
<div class='movableContent'>
<table cellpadding="0" cellspacing="0" border="0" align="center" width="600" class="container">
<tr>
<td width="100%" colspan="2" style="padding-top:65px;">
<hr style="height:1px;border:none;color:#333;background-color:#ddd;" />
</td>
</tr>
<tr>
<td width="60%" height="70" valign="middle" style="padding-bottom:20px;">
<div class="contentEditableContainer contentTextEditable">
<div class="contentEditable" align='left' >
<span style="font-size:13px;color:#181818;font-family:Helvetica, Arial, sans-serif;line-height:200%;">Sent to [email] by [CLIENTS.COMPANY_NAME]</span>
<br/>
<span style="font-size:11px;color:#555;font-family:Helvetica, Arial, sans-serif;line-height:200%;">[CLIENTS.ADDRESS] | [CLIENTS.PHONE]</span>
<br/>
<span style="font-size:13px;color:#181818;font-family:Helvetica, Arial, sans-serif;line-height:200%;">
<a target='_blank' href="[FORWARD]" style="text-decoration:none;color:#555">Forward to a friend</a>
</span>
<br/>
<span style="font-size:13px;color:#181818;font-family:Helvetica, Arial, sans-serif;line-height:200%;">
<a target='_blank' href="[UNSUBSCRIBE]" style="text-decoration:none;color:#555">click here to unsubscribe</a></span>
</div>
</div>
</td>
<td width="40%" height="70" align="right" valign="top" align='right' style="padding-bottom:20px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align='right'>
<tr>
<td width='57%'></td>
<td valign="top" width='34'>
<div class="contentEditableContainer contentFacebookEditable" style='display:inline;'>
<div class="contentEditable" >
<img src="images/facebook.png" data-default="placeholder" data-max-width='30' data-customIcon="true" width='30' height='30' alt='facebook' style='margin-right:40x;'>
</div>
</div>
</td>
<td valign="top" width='34'>
<div class="contentEditableContainer contentTwitterEditable" style='display:inline;'>
<div class="contentEditable" >
<img src="images/twitter.png" data-default="placeholder" data-max-width='30' data-customIcon="true" width='30' height='30' alt='twitter' style='margin-right:40x;'>
</div>
</div>
</td>
<td valign="top" width='34'>
<div class="contentEditableContainer contentImageEditable" style='display:inline;'>
<div class="contentEditable" >
<a target='_blank' href="#" data-default="placeholder" style="text-decoration:none;">
<img src="images/pinterest.png" width="30" height="30" data-max-width="30" alt='pinterest' style='margin-right:40x;' />
</a>
</div>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
\ No newline at end of file
<table cellpadding="0" width="100%" cellspacing="0" border="0" id="backgroundTable" class='bgBody'>
<tr>
<td>
<table cellpadding="0" width="620" class="container" align="center" cellspacing="0" border="0">
<tr>
<td>
Verification code: <?php echo $verify_code;?>
</td>
</tr>
</table>
</td>
</tr>
</table>
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>[SUBJECT]</title>
<style type="text/css">
@media screen and (max-width: 600px) {
table[class="container"] {
width: 95% !important;
}
}
#outlook a {padding:0;}
body{width:100% !important; -webkit-text-size-adjust:100%; -ms-text-size-adjust:100%; margin:0; padding:0;}
.ExternalClass {width:100%;}
.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {line-height: 100%;}
#backgroundTable {margin:0; padding:0; width:100% !important; line-height: 100% !important;}
img {outline:none; text-decoration:none; -ms-interpolation-mode: bicubic;}
a img {border:none;}
.image_fix {display:block;}
p {margin: 1em 0;}
h1, h2, h3, h4, h5, h6 {color: black !important;}
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {color: blue !important;}
h1 a:active, h2 a:active, h3 a:active, h4 a:active, h5 a:active, h6 a:active {
color: red !important;
}
h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited {
color: purple !important;
}
table td {border-collapse: collapse;}
table { border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt; }
a {color: #000;}
@media only screen and (max-device-width: 480px) {
a[href^="tel"], a[href^="sms"] {
text-decoration: none;
color: black; /* or whatever your want */
pointer-events: none;
cursor: default;
}
.mobile_link a[href^="tel"], .mobile_link a[href^="sms"] {
text-decoration: default;
color: orange !important; /* or whatever your want */
pointer-events: auto;
cursor: default;
}
}
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
a[href^="tel"], a[href^="sms"] {
text-decoration: none;
color: blue; /* or whatever your want */
pointer-events: none;
cursor: default;
}
.mobile_link a[href^="tel"], .mobile_link a[href^="sms"] {
text-decoration: default;
color: orange !important;
pointer-events: auto;
cursor: default;
}
}
@media only screen and (-webkit-min-device-pixel-ratio: 2) {
/* Put your iPhone 4g styles in here */
}
@media only screen and (-webkit-device-pixel-ratio:.75){
/* Put CSS for low density (ldpi) Android layouts in here */
}
@media only screen and (-webkit-device-pixel-ratio:1){
/* Put CSS for medium density (mdpi) Android layouts in here */
}
@media only screen and (-webkit-device-pixel-ratio:1.5){
/* Put CSS for high density (hdpi) Android layouts in here */
}
/* end Android targeting */
h2{
color:#181818;
font-family:Helvetica, Arial, sans-serif;
font-size:22px;
line-height: 22px;
font-weight: normal;
}
a.link1{
}
a.link2{
color:#fff;
text-decoration:none;
font-family:Helvetica, Arial, sans-serif;
font-size:16px;
color:#fff;border-radius:4px;
}
p{
color:#555;
font-family:Helvetica, Arial, sans-serif;
font-size:16px;
line-height:160%;
}
</style>
<script type="colorScheme" class="swatch active">
{
"name":"Default",
"bgBody":"ffffff",
"link":"fff",
"color":"555555",
"bgItem":"ffffff",
"title":"181818"
}
</script>
</head>
<body>
<?php echo $this->fetch('content') ?>
</body>
</html>
\ No newline at end of file
...@@ -33,7 +33,7 @@ public function generate(){ ...@@ -33,7 +33,7 @@ public function generate(){
<div class="col-xs-10 col-sm-10 col-md-10"> <div class="col-xs-10 col-sm-10 col-md-10">
<div data-toggle="modal" data-target="#defaultModal" style="text-align: center; cursor: pointer;"> <div data-toggle="modal" data-target="#defaultModal" style="text-align: center; cursor: pointer;">
<img src="/img/core/img/card-bg-front@3x-V2.png" class="img-responsive" id="img-upload" alt="Profile picture"> <img src="/img/core/img/connect-card-v3.png" class="img-responsive" id="img-upload" alt="Profile picture">
</div> </div>
</div> </div>
...@@ -179,28 +179,27 @@ public function generate(){ ...@@ -179,28 +179,27 @@ public function generate(){
<div class="col-xs-12 col-sm-12 col-md-12"> <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 fade" id="defaultModal" tabindex="-1" role="dialog" aria-labelledby="defaultModalLabel" aria-hidden="true">
<div class="modal-dialog box-ads"> <div class="modal-dialog box-ads">
<a class="close-modal" data-dismiss="modal">X </a> <a class="close-modal" data-dismiss="modal">X </a>
<div class="container login-container">
<div class="container login-container"> <div class="owl-carousel owl-theme" data-plugin-options="{'items': 1}">
<div class="owl-carousel owl-theme" data-plugin-options="{'items': 1}"> <div>
<div> <img src="/img/core/img/connect-card-v2.png" class="img-responsive" id="img-upload" alt="Profile picture">
<img src="/img/core/img/card-bg-front@3x.png" class="img-responsive" id="img-upload" alt="Profile picture"> </div>
</div> <div>
<div> <div class="qrcode-profile"><br>
<div class="qrcode-profile"><br> <?php echo __('แสดง QR Code เพื่อรับสิทธิ์');?>
<?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> <img src="/img/core/img/connect-card-back.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>
...@@ -227,7 +226,7 @@ public function generate(){ ...@@ -227,7 +226,7 @@ public function generate(){
var dataString = 'id=' + id; var dataString = 'id=' + id;
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: '/users/getProvince', url: '/provinces/getProvince',
data: dataString, data: dataString,
cache: false, cache: false,
success: function (html) { success: function (html) {
......
...@@ -26,7 +26,9 @@ use Cake\I18n\Time; ...@@ -26,7 +26,9 @@ use Cake\I18n\Time;
</div> </div>
</div> </div>
<div class="col-xs-4"> <div class="col-xs-4">
<img src="/img/core/img/user-profile@3x.png" class="img-responsive"> <div data-toggle="modal" data-target="#defaultModal" style="text-align: center; cursor: pointer;">
<img src="/img/core/img/user-profile@3x.png" class="img-responsive">
</div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
...@@ -131,45 +133,66 @@ use Cake\I18n\Time; ...@@ -131,45 +133,66 @@ use Cake\I18n\Time;
<?php } ?> <?php } ?>
<div class="row"> <div class="row">
<div class="col-xs-1 col-sm-1 col-md-1 box-arrow"> <div class="col-xs-1 col-sm-1 col-md-1 box-arrow">
<i class = "fa fa-angle-left prev" > </i> <i class = "fa fa-angle-left prev" > </i>
</div> </div>
<div class="col-xs-9 col-sm-9 col-md-9"> <div class="col-xs-9 col-sm-9 col-md-9">
<img src="/img/core/img/bloc-plus@3x.png" class="img-responsive" style="width: 100%"> <img src="/img/core/img/bloc-plus@3x.png" class="img-responsive" style="width: 100%">
</div> </div>
<div class="col-xs-1 col-sm-1 col-md-1 box-arrow"></div> <div class="col-xs-1 col-sm-1 col-md-1 box-arrow"></div>
<!--- s --> <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('UserCards', ['id' => 'frmSignIn', 'type' => 'file', 'onsubmit' => 'return check();']); ?>
<?php echo $this->Form->create('UserCards', ['id' => 'frmSignIn', 'type' => 'file', 'onsubmit' => 'return check();']); ?> <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']); ?> <?php echo $this->Form->hidden('UserCards.organize_id', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'id' => 'organize_id', 'type' => 'text', 'label' => __('ไอดีใช้งาน'), 'placeholder' => 'USERNAME', 'required']); ?>
<?php echo $this->Form->hidden('UserCards.organize_id', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'id' => 'organize_id', 'type' => 'text', 'label' => __('ไอดีใช้งาน'), 'placeholder' => 'USERNAME', 'required']); ?> <?php echo $this->Form->input('UserCards.organize_code', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'id' => 'organize_code', 'type' => 'text', 'label' => __('Company Code'), 'placeholder' => 'Company Code', 'required']); ?>
<?php echo $this->Form->input('UserCards.organize_code', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'id' => 'organize_code', 'type' => 'text', 'label' => __('Company Code'), 'placeholder' => 'Company Code', 'required']); ?> <label id = "nameorg_th" style="color: green"></label>
<label id = "nameorg_th" style="color: green"></label> <label id = "noorg_th" style="color: red"></label>
<label id = "noorg_th" style="color: red"></label> </div>
</div> </div>
</div> <div class="form-group has-feedback">
<div class="form-group has-feedback"> <div class="col-xs-12 col-sm-12 col-md-12">
<div class="col-xs-12 col-sm-12 col-md-12"> <?php echo $this->Form->input('UserCards.employee', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'id' => 'employee', 'type' => 'text', 'label' => __('Ref 1'), 'placeholder' => 'รหัสพนักงาน / รหัสนักศึกษา', 'disabled', 'required']); ?>
<?php echo $this->Form->input('UserCards.employee', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'id' => 'employee', 'type' => 'text', 'label' => __('Ref 1'), 'placeholder' => 'รหัสพนักงาน / รหัสนักศึกษา', 'disabled', 'required']); ?> </div>
</div> </div>
</div> <div class="form-group has-feedback bootstrap-iso">
<div class="form-group has-feedback bootstrap-iso"> <div class="col-xs-12 col-sm-12 col-md-12">
<div class="col-xs-12 col-sm-12 col-md-12"> <label class="label-text-sub"><?php echo __('Ref 2');?></label>
<label class="label-text-sub"><?php echo __('Ref 2');?></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" disabled>
<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> </div>
</div> </div>
</div>
<!-- e --> <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="col-md-6">
<div class="owl-carousel owl-theme" data-plugin-options="{'items': 1, 'margin': 10}">
<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;')); ?>
<div class="idcard-profile"><?php echo __('ID Card');?></div>
</div>
<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>
</div>
</div>
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
<?php echo $this->Html->image('../img/core/img/logo-connect-login@3x.png', ['alt' => 'Logo']); ?> <?php echo $this->Html->image('../img/core/img/logo-connect-login@3x.png', ['alt' => 'Logo']); ?>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<?php echo $this->Form->create(null, ['url' => ['controller' => 'Users', 'action' => 'verify'], <?php
echo $this->Form->create(null, ['url' => ['controller' => 'Users', 'action' => 'verify'],
'id' => '', 'name' => 'Users', 'role' => 'form', 'onsubmit' => 'return validateForm()']); 'id' => '', 'name' => 'Users', 'role' => 'form', 'onsubmit' => 'return validateForm()']);
?> ?>
<?php echo $this->Flash->render() ?> <?php echo $this->Flash->render() ?>
...@@ -53,12 +54,11 @@ ...@@ -53,12 +54,11 @@
</label> </label>
</div> </div>
</div> </div>
<?php echo $this->Form->end(); ?> <?php echo $this->Form->end(); ?>
</div> </div>
</div> </div>
<!----------------------------------------------------------------------> <script type="text/javascript">
<script>
function validateForm() { function validateForm() {
var x = document.forms["Users"]["data[username]"].value; var x = document.forms["Users"]["data[username]"].value;
if (x == null || x == "") { if (x == null || x == "") {
...@@ -72,7 +72,10 @@ ...@@ -72,7 +72,10 @@
} }
} }
</script> </script>
<style>
<style type="text/css">
#alertBox { #alertBox {
position:relative; position:relative;
width:300px; width:300px;
...@@ -179,7 +182,7 @@ ...@@ -179,7 +182,7 @@
} }
</style> </style>
<script> <script type="text/javascript">
var ALERT_TITLE = ""; var ALERT_TITLE = "";
var ALERT_BUTTON_TEXT = "Ok"; var ALERT_BUTTON_TEXT = "Ok";
......
<script type='text/javascript'>
setTimeout(function(){
if (typeof Login == 'undefined') {
location = '<?php echo $redirectApplicationURL; ?>';
} else {
Login.onLogin('<?php echo $statusCode; ?>','<?php echo $redirectApplicationURL; ?>','<?php echo $topic; ?>');
}
}, 1000);
</script>;
\ No newline at end of file
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