X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=gl%2Finquiry%2Faccounts_list.php;h=a9174c58fd3c8cc2ae70bb64488028a374e3131a;hb=4e6c60dfc8ab630d72010941b00f65b9659fe0b3;hp=eb8b0e2b6d507400534c28cdfbc245508490b5e9;hpb=acec14f639533b3e6b9b33c395ae5aeff29684f3;p=fa-stable.git diff --git a/gl/inquiry/accounts_list.php b/gl/inquiry/accounts_list.php index eb8b0e2b..a9174c58 100644 --- a/gl/inquiry/accounts_list.php +++ b/gl/inquiry/accounts_list.php @@ -1,28 +1,34 @@ . +***********************************************************************/ /********************************************************************** Page for searching GL account list and select it to GL account - selection in page that has GL account dropdown list. + selection in pages that have GL account dropdown lists. + Author: bogeyman2007 from Discussion Forum. Modified by Joe Hunt ***********************************************************************/ $page_security = "SA_GLACCOUNT"; $path_to_root = "../.."; include_once($path_to_root . "/includes/session.inc"); include_once($path_to_root . "/includes/ui.inc"); +include_once($path_to_root . "/gl/includes/db/gl_db_accounts.inc"); $js = get_js_select_combo_item(); page(_($help_context = "GL Accounts"), 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("account_tbl"); } -// BEGIN: Filter form. Use query string so the client_id will not disappear +// 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']); @@ -38,9 +44,7 @@ end_row(); end_table(); end_form(); -// END: Filter form -// BEGIN: Account list div_start("account_tbl"); start_table(TABLESTYLE); @@ -49,19 +53,11 @@ $th = array("", _("Account Code"), _("Description"), _("Category")); table_header($th); -// Query based on function gl_all_accounts_list in includes/ui/ui_lists.inc. -$sql = "SELECT chart.account_code, chart.account_name, type.name - FROM ".TB_PREF."chart_master chart,".TB_PREF."chart_types type - WHERE chart.account_type=type.id - AND ( - chart.account_name LIKE " . db_escape("%" . get_post("description"). "%") . " OR - chart.account_code LIKE " . db_escape("%" . get_post("description"). "%") . " - ) - ORDER BY chart.account_code LIMIT 0, $limit"; // We only display 10 items. -$result = db_query($sql, "Failed in retreiving GL account list."); - -$k = 0; //row colour counter +$k = 0; $name = $_GET["client_id"]; +$skip = $_GET["skip"]; + +$result = get_chart_accounts_search(get_post("description"), $skip); while ($myrow = db_fetch_assoc($result)) { alt_table_row_color($k); $value = $myrow['account_code']; @@ -75,6 +71,4 @@ while ($myrow = db_fetch_assoc($result)) { end_table(1); div_end(); -// END: Account list - -end_page(true); \ No newline at end of file +end_page(true);