Correct some experimental code.

This commit is contained in:
Steve Ireland
2023-03-12 12:41:46 -04:00
parent a9e4283b80
commit 7cb4c3eef1
2 changed files with 16 additions and 16 deletions

View File

@@ -93,11 +93,11 @@ class Customers extends Persons
*/
public function getSearch(): void
{
$search = $this->request->get('search', FILTER_SANITIZE_STRING);
$limit = $this->request->get('limit', FILTER_SANITIZE_NUMBER_INT);
$offset = $this->request->get('offset', FILTER_SANITIZE_NUMBER_INT);
$sort = $this->request->get('sort', FILTER_SANITIZE_STRING);
$order = $this->request->get('order', FILTER_SANITIZE_STRING);
$search = $this->request->getVar('search', FILTER_SANITIZE_STRING);
$limit = $this->request->getVar('limit', FILTER_SANITIZE_NUMBER_INT);
$offset = $this->request->getVar('offset', FILTER_SANITIZE_NUMBER_INT);
$sort = $this->request->getVar('sort', FILTER_SANITIZE_STRING);
$order = $this->request->getVar('order', FILTER_SANITIZE_STRING);
$customers = $this->customer->search($search, $limit, $offset, $sort, $order);
$total_rows = $this->customer->get_found_rows($search);
@@ -131,7 +131,7 @@ class Customers extends Persons
*/
public function suggest(): void
{
$suggestions = $this->customer->get_search_suggestions($this->request->get('term', FILTER_SANITIZE_STRING), 25,TRUE);
$suggestions = $this->customer->get_search_suggestions($this->request->getVar('term', FILTER_SANITIZE_STRING), 25,TRUE);
echo json_encode($suggestions);
}

View File

@@ -101,27 +101,27 @@ class Sales extends Secure_Controller
public function getSearch(): void
{
$search = $this->request->get('search', FILTER_SANITIZE_STRING);
$limit = $this->request->get('limit', FILTER_SANITIZE_NUMBER_INT);
$offset = $this->request->get('offset', FILTER_SANITIZE_NUMBER_INT);
$sort = $this->request->get('sort', FILTER_SANITIZE_STRING);
$order = $this->request->get('order', FILTER_SANITIZE_STRING);
$search = $this->request->getVar('search', FILTER_SANITIZE_STRING);
$limit = $this->request->getVar('limit', FILTER_SANITIZE_NUMBER_INT);
$offset = $this->request->getVar('offset', FILTER_SANITIZE_NUMBER_INT);
$sort = $this->request->getVar('sort', FILTER_SANITIZE_STRING);
$order = $this->request->getVar('order', FILTER_SANITIZE_STRING);
$filters = [
'sale_type' => 'all',
'location_id' => 'all',
'start_date' => $this->request->get('start_date', FILTER_SANITIZE_STRING),
'end_date' => $this->request->get('end_date', FILTER_SANITIZE_STRING),
'start_date' => $this->request->getVar('start_date', FILTER_SANITIZE_STRING),
'end_date' => $this->request->getVar('end_date', FILTER_SANITIZE_STRING),
'only_cash' => FALSE,
'only_due' => FALSE,
'only_check' => FALSE,
'only_creditcard' => FALSE,
'only_invoices' => $this->config['invoice_enable'] && $this->request->get('only_invoices', FILTER_SANITIZE_NUMBER_INT),
'only_invoices' => $this->config['invoice_enable'] && $this->request->getVar('only_invoices', FILTER_SANITIZE_NUMBER_INT),
'is_valid_receipt' => $this->sale->is_valid_receipt($search)
];
// check if any filter is set in the multiselect dropdown
$filledup = array_fill_keys($this->request->get('filters', FILTER_SANITIZE_STRING), TRUE); //TODO: Variable does not meet naming conventions
$filledup = array_fill_keys($this->request->getVar('filters', FILTER_SANITIZE_STRING), TRUE); //TODO: Variable does not meet naming conventions
$filters = array_merge($filters, $filledup);
$sales = $this->sale->search($search, $filters, $limit, $offset, $sort, $order);
@@ -150,7 +150,7 @@ class Sales extends Secure_Controller
public function item_search(): void
{
$suggestions = [];
$receipt = $search = $this->request->get('term') != '' ? $this->request->get('term', FILTER_SANITIZE_STRING) : NULL;
$receipt = $search = $this->request->getVar('term') != '' ? $this->request->get('term', FILTER_SANITIZE_STRING) : NULL;
if($this->sale_lib->get_mode() == 'return' && $this->sale->is_valid_receipt($receipt))
{