PHP 7.X produces A non-numeric value encountered in \includes\date_functions.inc...
[fa-stable.git] / purchasing / inquiry / suppliers_list.php
1 <?php
2 /**********************************************************************
3     Copyright (C) FrontAccounting, LLC.
4         Released under the terms of the GNU General Public License, GPL, 
5         as published by the Free Software Foundation, either version 3 
6         of the License, or (at your option) any later version.
7     This program is distributed in the hope that it will be useful,
8     but WITHOUT ANY WARRANTY; without even the implied warranty of
9     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
10     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
11 ***********************************************************************/
12 /**********************************************************************
13   Page for searching supplier list and select it to supplier selection
14   in pages that have the supplier dropdown lists.
15   Author: bogeyman2007 from Discussion Forum. Modified by Joe Hunt
16 ***********************************************************************/
17 $page_security = "SA_PURCHASEORDER";
18 $path_to_root = "../..";
19 include_once($path_to_root . "/includes/session.inc");
20 include_once($path_to_root . "/includes/ui.inc");
21 include_once($path_to_root . "/purchasing/includes/db/suppliers_db.inc");
22
23 $mode = get_company_pref('no_supplier_list');
24 if ($mode != 0)
25         $js = get_js_set_combo_item();
26 else
27         $js = get_js_select_combo_item();
28
29 page(_($help_context = "Suppliers"), true, false, "", $js);
30
31 if(get_post("search")) {
32   $Ajax->activate("supplier_tbl");
33 }
34
35 start_form(false, false, $_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING']);
36
37 start_table(TABLESTYLE_NOBORDER);
38
39 start_row();
40
41 text_cells(_("Supplier"), "supplier");
42 submit_cells("search", _("Search"), "", _("Search suppliers"), "default");
43
44 end_row();
45
46 end_table();
47
48 end_form();
49 div_start("supplier_tbl");
50
51 start_table(TABLESTYLE);
52
53 $th = array("", _("Supplier"), _("Short Name"), _("Address"), _("Tax ID"));
54
55 table_header($th);
56
57 $k = 0;
58 $name = $_GET["client_id"];
59 $result = get_suppliers_search(get_post("supplier"));
60 while ($myrow = db_fetch_assoc($result)) {
61         alt_table_row_color($k);
62         $value = $myrow['supplier_id'];
63         if ($mode != 0) {
64                 $text = $myrow['supp_name'];
65                 ahref_cell(_("Select"), 'javascript:void(0)', '', 'setComboItem(window.opener.document, "'.$name.'",  "'.$value.'", "'.$text.'")');
66         }
67         else {
68                 ahref_cell(_("Select"), 'javascript:void(0)', '', 'selectComboItem(window.opener.document, "'.$name.'", "'.$value.'")');
69         }
70         label_cell($myrow["supp_name"]);
71         label_cell($myrow["supp_ref"]);
72         label_cell($myrow["address"]);
73         label_cell($myrow["gst_no"]);
74         end_row();
75 }
76
77 end_table(1);
78 div_end();
79 end_page(true);