Commit 4fd9f4d290e83be622618f6edf25c5b807e23ba8
1 parent
03d01355
customers search session add
Showing
2 changed files
with
4 additions
and
2 deletions
Show diff stats
src/app/backend/controllers/CustomersController.php
... | ... | @@ -18,6 +18,8 @@ class CustomersController extends \Phalcon\Mvc\Controller |
18 | 18 | |
19 | 19 | $search_name = $this->request->getPost('search_name', 'string', NULL); |
20 | 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 | 23 | if (!empty($search_name)) { |
22 | 24 | $data = $this->models->getCustomers()->getDataByName($search_name); |
23 | 25 | $total = 1; | ... | ... |
src/app/backend/views/customers/index.php
... | ... | @@ -13,8 +13,8 @@ |
13 | 13 | <div class="table_name header_gradient">Пользователи</div> |
14 | 14 | <div class="table_add_page"><a href="<?= $this->url->get([ 'for' => 'customers_add' ]) ?>" title="Добавить">Добавить</a></div> |
15 | 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 | 18 | <input type="submit" value="Поиск" /> |
19 | 19 | </form> |
20 | 20 | <div class="table_pages_wrapper"> | ... | ... |