Commit 3e1fe137 by Teeradone-PIM

Merge branch 'integration' into teeradone

parents 3fad2af2 5681bf63
...@@ -3,3 +3,4 @@ www/logs/ ...@@ -3,3 +3,4 @@ www/logs/
www/tmp/ www/tmp/
www/webroot/img/img/demos/shop/products/shop8/product2.jpg www/webroot/img/img/demos/shop/products/shop8/product2.jpg
www/webroot/img/img/demos/ www/webroot/img/img/demos/
www/src/Controller/UsersController.php.bg20180515
...@@ -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;
// }
} }
...@@ -231,6 +231,7 @@ class UserCardsController extends AppController ...@@ -231,6 +231,7 @@ class UserCardsController extends AppController
} }
public function viewCard($user_id = null){ public function viewCard($user_id = null){
$this->viewBuilder()->layout('blank'); $this->viewBuilder()->layout('blank');
// $user = $this->Auth();
$this->loadModel('UserCards'); $this->loadModel('UserCards');
$UserCards = $this->UserCards->find('all') $UserCards = $this->UserCards->find('all')
->select($this->UserCards) ->select($this->UserCards)
......
...@@ -99,6 +99,6 @@ ...@@ -99,6 +99,6 @@
<?php echo $this->Html->script('custom'); ?> <?php echo $this->Html->script('custom'); ?>
<!-- Theme Initialization Files --> <!-- Theme Initialization Files -->
<?php echo $this->Html->script('theme.init'); ?> <?php echo $this->Html->script('theme.init'); ?>
<?php echo $this->fetch('scriptBottom'); ?>
</body> </body>
</html> </html>
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
var date = document.getElementById("date"); var date = document.getElementById("date");
$(document).ready(function() { $(document).ready(function() {
$("#organize_code").on('change',function(){ $("#organize_code").on('change',function(){
var organize_code = document.getElementById("organize_code").value var organize_code = document.getElementById("organize_code").value;
alert(organize_code); alert(organize_code);
$.post("/UserCards/checkOrg", {organize_code: organize_code}, function(data) { $.post("/UserCards/checkOrg", {organize_code: organize_code}, function(data) {
if(data!='false'){ if(data!='false'){
...@@ -94,8 +94,7 @@ ...@@ -94,8 +94,7 @@
date.focus(); date.focus();
} }
} }
</script>
<script>
$(document).ready(function(){ $(document).ready(function(){
var date_input=$('input[id="date"]'); //our date input has the name "date" var date_input=$('input[id="date"]'); //our date input has the name "date"
var container=$('.bootstrap-iso form').length>0 ? $('.bootstrap-iso form').parent() : "body"; var container=$('.bootstrap-iso form').length>0 ? $('.bootstrap-iso form').parent() : "body";
......
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