X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Finquiry%2Fsuppliers_list.php;h=75c1395921d6839e003a5a9ceff9e9828e05522b;hb=7226477a2624571ba8460f773092f6e38bbc46f3;hp=764ab7c9608964eeca0d81fbe2d8f39c4391185c;hpb=ec7f3118c6d2c6dfb0848ce952023bdbc4bcd14f;p=fa-stable.git diff --git a/purchasing/inquiry/suppliers_list.php b/purchasing/inquiry/suppliers_list.php index 764ab7c9..75c13959 100644 --- a/purchasing/inquiry/suppliers_list.php +++ b/purchasing/inquiry/suppliers_list.php @@ -18,6 +18,7 @@ $page_security = "SA_PURCHASEORDER"; $path_to_root = "../.."; include_once($path_to_root . "/includes/session.inc"); include_once($path_to_root . "/includes/ui.inc"); +include_once($path_to_root . "/purchasing/includes/db/suppliers_db.inc"); $mode = get_company_pref('no_supplier_list'); if ($mode != 0) @@ -27,18 +28,10 @@ else page(_($help_context = "Suppliers"), true, false, "", $js); -if (isset($SysPrefs->max_rows_in_search)) - $limit = $SysPrefs->max_rows_in_search; -else - $limit = 10; - -// Activate Ajax on form submit if(get_post("search")) { $Ajax->activate("supplier_tbl"); } -// BEGIN: Filter form. Use query string so the client_id will not disappear -// after ajax form post. start_form(false, false, $_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING']); start_table(TABLESTYLE_NOBORDER); @@ -53,13 +46,6 @@ end_row(); end_table(); end_form(); -// END: Filter form - -// BEGIN: Link to add new supplier -// hyperlink_params($path_to_root . "/purchasing/manage/suppliers.php", _("Add new"), "popup=1"); -// END: Link to add new supplier - -// BEGIN: Supplier list div_start("supplier_tbl"); start_table(TABLESTYLE); @@ -68,17 +54,9 @@ $th = array("", _("Supplier"), _("Short Name"), _("Address"), _("Tax ID")); table_header($th); -// Query based on function supplier_list in includes/ui/ui_lists.inc. -$sql = "SELECT supplier_id, supp_name, supp_ref, address, gst_no FROM ".TB_PREF."suppliers - WHERE (supp_name LIKE " . db_escape("%" . get_post("supplier"). "%") . " OR - supp_ref LIKE " . db_escape("%" . get_post("supplier"). "%") . " OR - address LIKE " . db_escape("%" . get_post("supplier"). "%") . " OR - gst_no LIKE " . db_escape("%" . get_post("supplier"). "%") . ") - ORDER BY supp_name LIMIT 0, $limit"; // We only display 10 items. -$result = db_query($sql, "Failed in retreiving supplier list."); - -$k = 0; //row colour counter +$k = 0; $name = $_GET["client_id"]; +$result = get_suppliers_search(get_post("supplier")); while ($myrow = db_fetch_assoc($result)) { alt_table_row_color($k); $value = $myrow['supplier_id']; @@ -97,8 +75,5 @@ while ($myrow = db_fetch_assoc($result)) { } end_table(1); - div_end(); -// END: Supplier list - end_page(true);