Commit aa0913b0 by Wittaya-PIM

Merge branch 'integration' into wittaya

parents ad352506 c1dff3e9
<?php
namespace App\Controller;
use App\Controller\AppController;
class ProvincesController extends AppController
{
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;
}
}
}
......@@ -414,29 +414,4 @@ class UsersController extends AppController
$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;
}
}
}
......@@ -33,7 +33,7 @@ public function generate(){
<div class="col-xs-10 col-sm-10 col-md-10">
<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>
......@@ -179,28 +179,27 @@ public function generate(){
<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 box-ads">
<a class="close-modal" data-dismiss="modal">X </a>
<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>
<a class="close-modal" data-dismiss="modal">X </a>
<div class="container login-container">
<div class="owl-carousel owl-theme" data-plugin-options="{'items': 1}">
<div>
<img src="/img/core/img/connect-card-v2.png" class="img-responsive" id="img-upload" alt="Profile picture">
</div>
<div>
<div class="qrcode-profile"><br>
<?php echo __('แสดง QR Code เพื่อรับสิทธิ์');?>
</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>
......@@ -227,7 +226,7 @@ public function generate(){
var dataString = 'id=' + id;
$.ajax({
type: "POST",
url: '/users/getProvince',
url: '/provinces/getProvince',
data: dataString,
cache: false,
success: function (html) {
......
......@@ -440,7 +440,7 @@
$("#master_province_id").html('');
$.ajax({
type: "POST",
url: '/users/getProvince',
url: '/provinces/getProvince',
data: dataString,
cache: false,
success: function (html) {
......
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