Commit 090d3476a6a733ecbb7c1cf17ca27fc964f0b274

Authored by Alex Savenko
1 parent e56e710d

submit button check

Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
src/app/backend/controllers/CustomersController.php
@@ -21,7 +21,7 @@ class CustomersController extends \Phalcon\Mvc\Controller @@ -21,7 +21,7 @@ class CustomersController extends \Phalcon\Mvc\Controller
21 $search_submit = $this->request->getPost('search_submit', 'string', NULL); 21 $search_submit = $this->request->getPost('search_submit', 'string', NULL);
22 $this->session->set('search_name', $search_name); 22 $this->session->set('search_name', $search_name);
23 $this->session->set('search_phone', $search_phone); 23 $this->session->set('search_phone', $search_phone);
24 - if (!empty($search_name) && isset($search_phone)) { 24 + if (!empty($search_name) && (!empty($search_phone) || $search_phone == '0')) {
25 $data = $this->models->getCustomers()->getDataByNameAndPhone($search_name, $search_phone); 25 $data = $this->models->getCustomers()->getDataByNameAndPhone($search_name, $search_phone);
26 $total = 1; 26 $total = 1;
27 } 27 }
@@ -29,7 +29,7 @@ class CustomersController extends \Phalcon\Mvc\Controller @@ -29,7 +29,7 @@ class CustomersController extends \Phalcon\Mvc\Controller
29 $data = $this->models->getCustomers()->getDataByName($search_name); 29 $data = $this->models->getCustomers()->getDataByName($search_name);
30 $total = 1; 30 $total = 1;
31 } 31 }
32 - elseif(isset($search_phone)) { 32 + elseif(!empty($search_phone) || $search_phone == '0') {
33 $data = $this->models->getCustomers()->getDataByPhone($search_phone); 33 $data = $this->models->getCustomers()->getDataByPhone($search_phone);
34 $total = 1; 34 $total = 1;
35 } 35 }