Commit 4fd9f4d290e83be622618f6edf25c5b807e23ba8

Authored by Alex Savenko
1 parent 03d01355

customers search session add

src/app/backend/controllers/CustomersController.php
@@ -18,6 +18,8 @@ class CustomersController extends \Phalcon\Mvc\Controller @@ -18,6 +18,8 @@ class CustomersController extends \Phalcon\Mvc\Controller
18 18
19 $search_name = $this->request->getPost('search_name', 'string', NULL); 19 $search_name = $this->request->getPost('search_name', 'string', NULL);
20 $search_phone = $this->request->getPost('search_phone', 'int', NULL); 20 $search_phone = $this->request->getPost('search_phone', 'int', NULL);
  21 + $this->session->set('search_name', $search_name);
  22 + $this->session->set('search_phone', $search_phone);
21 if (!empty($search_name)) { 23 if (!empty($search_name)) {
22 $data = $this->models->getCustomers()->getDataByName($search_name); 24 $data = $this->models->getCustomers()->getDataByName($search_name);
23 $total = 1; 25 $total = 1;
src/app/backend/views/customers/index.php
@@ -13,8 +13,8 @@ @@ -13,8 +13,8 @@
13 <div class="table_name header_gradient">Пользователи</div> 13 <div class="table_name header_gradient">Пользователи</div>
14 <div class="table_add_page"><a href="<?= $this->url->get([ 'for' => 'customers_add' ]) ?>" title="Добавить">Добавить</a></div> 14 <div class="table_add_page"><a href="<?= $this->url->get([ 'for' => 'customers_add' ]) ?>" title="Добавить">Добавить</a></div>
15 <form method="post" action="" style="margin:10px;"> 15 <form method="post" action="" style="margin:10px;">
16 - <input type="text" name="search_name" placeholder="поиск по имени" />  
17 - <input type="text" name="search_phone" placeholder="поиск по телефону" /> 16 + <input type="text" name="search_name" placeholder="поиск по имени" value="<?= $this->session->get('search_name'); ?>" />
  17 + <input type="text" name="search_phone" placeholder="поиск по телефону" value="<?= $this->session->get('search_phone'); ?>" />
18 <input type="submit" value="Поиск" /> 18 <input type="submit" value="Поиск" />
19 </form> 19 </form>
20 <div class="table_pages_wrapper"> 20 <div class="table_pages_wrapper">