Commit 2d65c262 by Teeradone-PIM

teeradone: regster แก้ไข Province

parent 3e1fe137
...@@ -414,29 +414,4 @@ class UsersController extends AppController ...@@ -414,29 +414,4 @@ class UsersController extends AppController
$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;
}
}
} }
...@@ -440,7 +440,7 @@ ...@@ -440,7 +440,7 @@
$("#master_province_id").html(''); $("#master_province_id").html('');
$.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) {
......
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