Commit 9e6c0a7a by Zen-PC\Zen

Zen : update provainec box and add link for fa-arrow

parent fc44746c
...@@ -20,6 +20,11 @@ class ProfilesController extends AppController ...@@ -20,6 +20,11 @@ class ProfilesController extends AppController
]); ]);
$username = $responseUserProfile['username']; $username = $responseUserProfile['username'];
$this->loadModel('UserPersonals');
$responseUserPersonal = $this->UserPersonals->get($id, [
'contain' => []
]);
//********DropdownCountry******** //********DropdownCountry********
$this->loadModel('MasterCountries'); $this->loadModel('MasterCountries');
$Country = $this->MasterCountries->find('list', [ $Country = $this->MasterCountries->find('list', [
...@@ -28,6 +33,7 @@ class ProfilesController extends AppController ...@@ -28,6 +33,7 @@ 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********
...@@ -37,14 +43,11 @@ class ProfilesController extends AppController ...@@ -37,14 +43,11 @@ 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']]);
// pr($Province);die;
if(!empty($Province)) $Province = $Province->toArray(); if(!empty($Province)) $Province = $Province->toArray();
$this->loadModel('UserPersonals'); $res = $responseUserPersonal['birthdate'];
$responseUserProfile = $this->UserPersonals->get($id, [
'contain' => []
]);
$res = $responseUserProfile['birthdate'];
$dateNow = $res->i18nFormat('dd/MM/yyyy'); $dateNow = $res->i18nFormat('dd/MM/yyyy');
if ($this->request->is(['patch', 'post', 'put'])) { if ($this->request->is(['patch', 'post', 'put'])) {
...@@ -104,7 +107,7 @@ class ProfilesController extends AppController ...@@ -104,7 +107,7 @@ class ProfilesController extends AppController
} }
$this->Flash->error(__('Not update. Please, try again.')); $this->Flash->error(__('Not update. Please, try again.'));
} }
$this->set(compact('userPersonals', 'responseUserProfile', 'dateNow', 'username', 'Country', 'Province')); $this->set(compact('userPersonals', 'responseUserProfile', 'dateNow', 'username', 'Country', 'Province', 'responseUserPersonal'));
$this->set('_serialize', ['userPersonals', 'responseUserProfile', 'dateNow', 'username', 'Country', 'Province']); $this->set('_serialize', ['userPersonals', 'responseUserProfile', 'dateNow', 'username', 'Country', 'Province']);
} }
......
...@@ -30,6 +30,7 @@ public function generate(){ ...@@ -30,6 +30,7 @@ public function generate(){
<div class="row"> <div class="row">
<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>
<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/card-bg-front@3x-V2.png" class="img-responsive" id="img-upload" alt="Profile picture">
...@@ -37,7 +38,12 @@ public function generate(){ ...@@ -37,7 +38,12 @@ public function generate(){
</div> </div>
<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-right"></i> <a>
<?php echo $this->Html->link(
'<i class = "fa fa-angle-right"></i>',
['controller' => 'UserCards', 'action' => 'viewCard', '_full' => true],['escape' => false]
); ?>
</a>
</div> </div>
<div style="clear: both"></div> <div style="clear: both"></div>
</div><!--/row--> </div><!--/row-->
...@@ -133,9 +139,9 @@ public function generate(){ ...@@ -133,9 +139,9 @@ public function generate(){
'label' => false, 'label' => false,
'type' => 'select', 'type' => 'select',
'options' => $Country, 'options' => $Country,
'value' => $responseUserProfile['master_country_id'], 'value' => $responseUserPersonal['master_country_id'],
'empty' => '---Select---', 'empty' => '---Select---',
'default' => !empty($responseUserProfile['master_country_id'])? $responseUserProfile['master_country_id']:'', 'default' => !empty($responseUserPersonal['master_country_id'])? $responseUserPersonal['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%'
)); ));
...@@ -151,9 +157,9 @@ public function generate(){ ...@@ -151,9 +157,9 @@ public function generate(){
'label' => false, 'label' => false,
'type' => 'select', 'type' => 'select',
'options' => $Province, 'options' => $Province,
'value' => $responseUserProfile['master_province_id'], 'value' => $responseUserPersonal['master_province_id'],
'empty' => '---Select---', 'empty' => '---Select---',
'default' => !empty($responseUserProfile['master_province_id'])? $responseUserProfile['master_province_id']:'', 'default' => !empty($responseUserPersonal['master_province_id'])? $responseUserPersonal['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%'
)); ));
...@@ -199,7 +205,7 @@ public function generate(){ ...@@ -199,7 +205,7 @@ public function generate(){
</div> </div>
</div> </div>
</div> </div>
<?php $this->append('scriptBottom'); ?>
<script type="text/javascript"> <script type="text/javascript">
$(function () { $(function () {
$('#moblieNo').inputmask('999-999-9999'); $('#moblieNo').inputmask('999-999-9999');
...@@ -233,6 +239,7 @@ public function generate(){ ...@@ -233,6 +239,7 @@ public function generate(){
}); });
</script> </script>
<?php $this->end();?>
<style> <style>
.box-arrow{ .box-arrow{
font-size:36px; font-size:36px;
......
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