function build_main_html() { global $db, $messageStack; // Build heading bar $output = '<table border="0" width="100%" cellspacing="0" cellpadding="1">' . chr(10); $output .= ' <tr class="dataTableHeadingRow" valign="top">' . chr(10); $heading_array = array('countries_name' => SETUP_INFO_COUNTRY_NAME, 'countries_iso_code_2' => SETUP_INFO_COUNTRY_CODE_2, 'countries_iso_code_3' => SETUP_INFO_COUNTRY_CODE_3); $result = html_heading_bar($heading_array, $_GET['list_order']); $output .= $result['html_code']; $disp_order = $result['disp_order']; $output .= ' </tr>' . chr(10); // Build field data $query_raw = "select countries_id, countries_name, countries_iso_code_2, countries_iso_code_3 \r\n from " . $this->db_table . " order by {$disp_order}"; $page_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $query_raw, $query_numrows); $result = $db->Execute($query_raw); while (!$result->EOF) { $output .= ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . chr(10); $output .= ' <td class="dataTableContent" onclick="loadPopUp(\'edit\', ' . $result->fields['countries_id'] . ')">' . htmlspecialchars($result->fields['countries_name']) . '</td>' . chr(10); $output .= ' <td class="dataTableContent" onclick="loadPopUp(\'edit\', ' . $result->fields['countries_id'] . ')">' . $result->fields['countries_iso_code_2'] . '</td>' . chr(10); $output .= ' <td class="dataTableContent" onclick="loadPopUp(\'edit\', ' . $result->fields['countries_id'] . ')">' . $result->fields['countries_iso_code_3'] . '</td>' . chr(10); $output .= ' <td class="dataTableContent" align="right">' . chr(10); if ($this->security_id > 1) { $output .= html_icon('actions/edit-find-replace.png', TEXT_EDIT, 'small', 'onclick="loadPopUp(\'edit\', ' . $result->fields['countries_id'] . ')"') . chr(10); } if ($this->security_id > 3) { $output .= html_icon('emblems/emblem-unreadable.png', TEXT_DELETE, 'small', 'onclick="if (confirm(\'' . SETUP_COUNTRY_DELETE_INTRO . '\')) submitSeq(' . $result->fields['countries_id'] . ', \'delete\')"') . chr(10); } $output .= ' </td>' . chr(10); $output .= ' </tr>' . chr(10); $result->MoveNext(); } $output .= '</table>' . chr(10); $output .= '<div class="page_count_right">' . $page_split->display_links($query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']) . '</div>' . chr(10); $output .= '<div class="page_count">' . $page_split->display_count($query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_COUNTRIES) . '</div>' . chr(10); return $output; }
function build_main_html() { global $db, $messageStack; // Build heading bar $output = '<table border="0" width="100%" cellspacing="0" cellpadding="1">' . chr(10); $output .= ' <tr class="dataTableHeadingRow" valign="top">' . chr(10); $heading_array = array('description_short' => HR_ACCOUNT_ID, 'description' => TEXT_DESCRIPTION, 'subdepartment' => HR_HEADING_SUBACCOUNT, 'department_inactive' => TEXT_INACTIVE); $result = html_heading_bar($heading_array, $_GET['list_order']); $output .= $result['html_code']; $disp_order = $result['disp_order']; $output .= ' </tr>' . chr(10); // Build field data $query_raw = "select id, description_short, description, subdepartment, primary_dept_id, department_inactive from " . $this->db_table . " order by {$disp_order}"; $page_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $query_raw, $query_numrows); $result = $db->Execute($query_raw); while (!$result->EOF) { $output .= ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . chr(10); $output .= ' <td class="dataTableContent" onclick="loadPopUp(\'edit\', \'' . $result->fields['id'] . '\')">' . htmlspecialchars($result->fields['description_short']) . '</td>' . chr(10); $output .= ' <td class="dataTableContent" onclick="loadPopUp(\'edit\', \'' . $result->fields['id'] . '\')">' . htmlspecialchars($result->fields['description']) . '</td>' . chr(10); $output .= ' <td class="dataTableContent" onclick="loadPopUp(\'edit\', \'' . $result->fields['id'] . '\')">' . ($result->fields['subdepartment'] ? TEXT_YES : TEXT_NO) . '</td>' . chr(10); $output .= ' <td class="dataTableContent" onclick="loadPopUp(\'edit\', \'' . $result->fields['id'] . '\')">' . ($result->fields['department_inactive'] ? TEXT_YES : TEXT_NO) . '</td>' . chr(10); $output .= ' <td class="dataTableContent" align="right">' . chr(10); if ($this->security_id > 1) { $output .= html_icon('actions/edit-find-replace.png', TEXT_EDIT, 'small', 'onclick="loadPopUp(\'edit\', \'' . $result->fields['id'] . '\')"') . chr(10); } if ($this->security_id > 3) { $output .= html_icon('emblems/emblem-unreadable.png', TEXT_DELETE, 'small', 'onclick="if (confirm(\'' . HR_INFO_DELETE_INTRO . '\')) submitSeq(\'' . $result->fields['id'] . '\', \'delete\')"') . chr(10); } $output .= ' </td>' . chr(10); $output .= ' </tr>' . chr(10); $result->MoveNext(); } $output .= '</table>' . chr(10); $output .= '<div class="page_count_right">' . $page_split->display_links($query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']) . '</div>' . chr(10); $output .= '<div class="page_count">' . $page_split->display_count($query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], HR_DISPLAY_NUMBER_OF_DEPTS) . '</div>' . chr(10); return $output; }
// | | // | This program is distributed in the hope that it will be useful, | // | but WITHOUT ANY WARRANTY; without even the implied warranty of | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | // | GNU General Public License for more details. | // +-----------------------------------------------------------------+ // Path: /modules/contacts/pages/main/template_contacts.php // ?> <div id="tab_contacts"> <?php if (is_array($cInfo->contacts)) { $heading_array = array(); // don't sort $non_sort_array = array(GEN_LAST_NAME, GEN_FIRST_NAME, TEXT_TITLE, GEN_TELEPHONE1, GEN_TELEPHONE4, GEN_EMAIL, TEXT_ACTION); $crm_headings = html_heading_bar($heading_array, $non_sort_array); ?> <fieldset> <legend><?php echo TEXT_CONTACTS; ?> </legend> <table class="ui-widget" style="border-collapse:collapse;width:100%;"> <thead class="ui-widget-header"><?php echo $crm_headings['html_code']; ?> </thead> <tbody class="ui-widget-content"> <?php $odd = true; foreach ($cInfo->contacts as $entry) {
default: } /***************** prepare to display templates *************************/ $include_header = true; $include_footer = true; $include_tabs = true; $include_calendar = true; switch ($action) { case 'new': case 'edit': $include_template = 'template_detail.php'; define('PAGE_TITLE', $action == 'new' ? PRICE_SHEET_NEW_TITLE : PRICE_SHEET_EDIT_TITLE); break; default: $heading_array = array('sheet_name' => TEXT_SHEET_NAME, 'inactive' => TEXT_INACTIVE, 'revision' => TEXT_REVISION, 'default_sheet' => TEXT_DEFAULT, 'effective_date' => TEXT_EFFECTIVE_DATE, 'expiration_date' => TEXT_EXPIRATION_DATE); $result = html_heading_bar($heading_array, $_GET['list_order'], array(TEXT_SPECIAL_PRICING, TEXT_ACTION)); $list_header = $result['html_code']; $disp_order = $result['disp_order']; // find the highest rev level by sheet name $result = $db->Execute("select distinct sheet_name, max(revision) as rev from " . TABLE_PRICE_SHEETS . " group by sheet_name"); $rev_levels = array(); while (!$result->EOF) { $rev_levels[$result->fields['sheet_name']] = $result->fields['rev']; $result->MoveNext(); } // build the list for the page selected if (isset($search_text) && gen_not_null($search_text)) { $search_fields = array('sheet_name', 'revision'); // hook for inserting new search fields to the query criteria. if (is_array($extra_search_fields)) { $search_fields = array_merge($search_fields, $extra_search_fields);
function build_main_html() { global $db, $messageStack; // Build heading bar $output = '<table border="0" width="100%" cellspacing="0" cellpadding="1">' . chr(10); $output .= ' <tr class="dataTableHeadingRow" valign="top">' . chr(10); $heading_array = array('title' => SETUP_CURRENCY_NAME, 'code' => SETUP_CURRENCY_CODES, 'value' => TEXT_VALUE); $result = html_heading_bar($heading_array, $_GET['list_order']); $output .= $result['html_code']; $disp_order = $result['disp_order']; $output .= ' </tr>' . chr(10); // Build field data $query_raw = "select currencies_id, title, code, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, last_updated, value \r\n\t from " . TABLE_CURRENCIES . " order by {$disp_order}"; $page_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $query_raw, $query_numrows); $currency = $db->Execute($query_raw); while (!$currency->EOF) { $output .= ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . chr(10); if (DEFAULT_CURRENCY == $currency->fields['code']) { $output .= ' <td class="dataTableContent" onclick="loadPopUp(\'edit\', ' . $currency->fields['currencies_id'] . ')"><b>' . htmlspecialchars($currency->fields['title']) . ' (' . TEXT_DEFAULT . ')</b></td>' . chr(10); } else { $output .= ' <td class="dataTableContent" onclick="loadPopUp(\'edit\', ' . $currency->fields['currencies_id'] . ')">' . htmlspecialchars($currency->fields['title']) . '</td>' . chr(10); } $output .= ' <td class="dataTableContent" onclick="loadPopUp(\'edit\', ' . $currency->fields['currencies_id'] . ')">' . $currency->fields['code'] . '</td>' . chr(10); $output .= ' <td class="dataTableContent" align="right" onclick="loadPopUp(\'edit\', ' . $currency->fields['currencies_id'] . ')">' . number_format($currency->fields['value'], 8) . '</td>' . chr(10); $output .= ' <td class="dataTableContent" align="right">' . chr(10); if ($this->security_id > 1) { $output .= html_icon('actions/edit-find-replace.png', TEXT_EDIT, 'small', 'onclick="loadPopUp(\'edit\', ' . $currency->fields['currencies_id'] . ')"') . chr(10); } if ($this->security_id > 3) { $output .= html_icon('emblems/emblem-unreadable.png', TEXT_DELETE, 'small', 'onclick="if (confirm(\'' . SETUP_CURR_DELETE_INTRO . '\')) submitSeq(' . $currency->fields['currencies_id'] . ', \'delete\')"') . chr(10); } $output .= ' </td>' . chr(10); $output .= ' </tr>' . chr(10); $currency->MoveNext(); } $output .= '</table>' . chr(10); $output .= '<div class="page_count_right">' . $page_split->display_links($query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']) . '</div>' . chr(10); $output .= '<div class="page_count">' . $page_split->display_count($query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_CURRENCIES) . '</div>' . chr(10); return $output; }
$_GET['page']++; break; case 'go_last': $_GET['page'] = 99999; break; case 'search': case 'search_reset': case 'go_page': default: } /***************** prepare to display templates *************************/ // generate chart of account types $coa_types = load_coa_types(); // build the list header $heading_array = array('post_date' => TEXT_DATE, 'purchase_invoice_id' => TEXT_REFERENCE, 'total_amount' => TEXT_AMOUNT); $result = html_heading_bar($heading_array, $_GET['list_order'], array(TEXT_DESCRIPTION)); $list_header = $result['html_code']; $disp_order = $result['disp_order']; // build the list for the page selected $acct_period = $_GET['search_period'] ? $_GET['search_period'] : $_POST['search_period']; if (!$acct_period) { $acct_period = CURRENT_ACCOUNTING_PERIOD; } $period_filter = $acct_period == 'all' ? '' : ' and period = ' . $acct_period; $search_text = $_GET['search_text'] == TEXT_SEARCH ? '' : db_input(db_prepare_input($_GET['search_text'])); if (isset($search_text) && gen_not_null($search_text)) { $search_fields = array('purchase_invoice_id', 'total_amount'); // hook for inserting new search fields to the query criteria. if (is_array($extra_search_fields)) { $search_fields = array_merge($search_fields, $extra_search_fields); }
case 'search': case 'search_reset': case 'go_page': default: } /***************** prepare to display templates *************************/ // build the list header if (!isset($_REQUEST['sf'])) { $_REQUEST['sf'] = 'post_date'; } if (!isset($_REQUEST['so'])) { $_REQUEST['so'] = 'desc'; } // default to descending by postdate $heading_array = array('id' => GEN_LINK_POINT_ID, 'short_name' => GEN_CUSTOMER, 'contact_last' => GEN_LAST_NAME, 'contact_first' => GEN_FIRST_NAME, 'empty_1' => '', 'empty_2' => '', 'empty_3' => '', 'empty_4' => '', 'first_date' => GEN_ACCOUNT_CREATED, 'empty_5' => ''); $result = html_heading_bar($heading_array, $extra_headings = array()); $list_header = $result['html_code']; $disp_order = $result['disp_order']; // build the list for the page selected if ($acct_period == 'all') { $period_filter = ''; } else { $periods = $db->Execute("select * from " . TABLE_ACCOUNTING_PERIODS . " where period = {$acct_period}"); $start_date = $periods->fields['start_date']; $end_date = $periods->fields['end_date']; $period_filter = " and DATE_FORMAT(lp.date_added,'%Y-%m-%d' ) BETWEEN '{$start_date}' AND '{$end_date}' "; } if (isset($_REQUEST['search_text']) && $_REQUEST['search_text'] != '') { $search_fields = array('short_name'); // hook for inserting new search fields to the query criteria. $search = ' and (' . implode(' like \'%' . $_REQUEST['search_text'] . '%\' or ', $search_fields) . ' like \'%' . $_REQUEST['search_text'] . '%\')';
$toc_array[$result->fields['parent_id']][] = array('id' => $result->fields['id'], 'doc_type' => $result->fields['doc_type'], 'doc_title' => $result->fields['doc_title'], 'show' => $result->fields['doc_group'] == $tab ? true : false); } $result->MoveNext(); } $toggle_list = false; if ($group) { $result = $db->Execute("select id from " . TABLE_PHREEFORM . " where doc_group = '" . $group . "'"); if ($result->RecordCount() > 0) { $toggle_list = buildToggleList($result->fields['id']); } } switch ($_REQUEST['action']) { // figure which detail page to load case 'search': case 'view': $result = html_heading_bar(array(), array(' ', TEXT_DOCUMENT_TITLE, TEXT_ACTION)); $list_header = $result['html_code']; // build the list for the page selected if (isset($_REQUEST['search_text']) && $_REQUEST['search_text'] != '') { $search_fields = array('doc_title'); $search = ' where ' . implode(' like \'%' . $_REQUEST['search_text'] . '%\' or ', $search_fields) . ' like \'%' . $_REQUEST['search_text'] . '%\''; } else { $search = ''; } $field_list = array('id', 'doc_title', 'doc_ext'); $query_raw = "select SQL_CALC_FOUND_ROWS " . implode(', ', $field_list) . " from " . TABLE_PHREEFORM . $search; $query_result = $db->Execute($query_raw, MAX_DISPLAY_SEARCH_RESULTS * ($_REQUEST['list'] - 1) . ", " . MAX_DISPLAY_SEARCH_RESULTS); // the splitPageResults should be run directly after the query that contains SQL_CALC_FOUND_ROWS $query_split = new splitPageResults($_REQUEST['list'], ''); if ($query_split->current_page_number != $_REQUEST['list']) { // if here, go last was selected, now we know # pages, requery to get results
<?php echo TEXT_INFO_SEARCH_PERIOD_FILTER . ' ' . html_pull_down_menu('search_period', gen_get_period_pull_down(false), $period, 'onchange="submit();"'); ?> </div> <?php if (ENABLE_MULTI_CURRENCY) { echo '<p>' . sprintf(GEN_PRICE_SHEET_CURRENCY_NOTE, $currencies->currencies[DEFAULT_CURRENCY]['title']) . '</p>' . chr(10); } ?> <table class="ui-widget" style="border-collapse:collapse;width:900px;margin-left:auto;margin-right:auto;"> <thead class="ui-widget-header"> <tr> <?php $heading_array = array('reference' => TEXT_REFERENCE, 'post_date' => TEXT_DATE, 'dep_amount' => BNK_DEPOSIT_CREDIT, 'pmt_amount' => BNK_CHECK_PAYMENT); $result = html_heading_bar($heading_array, array(TEXT_SOURCE, TEXT_CLEAR, ' ')); echo $result['html_code']; ?> </tr> </thead> <tbody class="ui-widget-content"> <?php $i = 0; if (sizeof($combined_list) > 0) { $odd = true; foreach ($combined_list as $values) { $bkgnd = $values['partial'] ? ' style="background-color:yellow"' : ''; $disabled = $values['cleared'] != $period && $values['cleared'] > 0 ? 'disabled="disabled" ' : ''; $cleared = $values['cleared'] != $period && $values['cleared'] > 0 ? $values['cleared'] . ' ' : ''; ?> <tr class="<?php
$_GET['page']++; break; case 'go_last': $_GET['page'] = 99999; break; case 'search': case 'search_reset': case 'go_page': default: } /***************** prepare to display templates *************************/ // generate chart of account types $coa_types = load_coa_types(); // build the list header $heading_array = array('id' => GEN_ACCOUNT_ID, 'description' => TEXT_DESCRIPTION); $result = html_heading_bar($heading_array, $_GET['list_order'], array(TEXT_ACCOUNT_TYPE)); $list_header = $result['html_code']; $disp_order = $result['disp_order']; // build the list for the page selected $search_text = $_GET['search_text'] == TEXT_SEARCH ? '' : db_input(db_prepare_input($_GET['search_text'])); if (isset($search_text) && gen_not_null($search_text)) { $search_fields = array('id', 'description'); // hook for inserting new search fields to the query criteria. if (is_array($extra_search_fields)) { $search_fields = array_merge($search_fields, $extra_search_fields); } $search = ' where ' . implode(' like \'%' . $search_text . '%\' or ', $search_fields) . ' like \'%' . $search_text . '%\''; } else { $search = ''; } $field_list = array('id', 'description', 'account_type');
?> </ol> </fieldset> <?php } else { echo html_hidden_field('till_id', $tills->till_id) . chr(10); echo html_hidden_field('post_date', gen_locale_date($post_date)) . chr(10); ?> <table class="ui-widget" style="border-collapse:collapse;width:900px;margin-left:auto;margin-right:auto;"> <thead class="ui-widget-header"> <tr> <?php $heading_array = array(); $result = html_heading_bar($heading_array, array(TEXT_REFERENCE, TEXT_DATE, TEXT_SOURCE, TEXT_AMOUNT, TEXT_CLEAR, ' ')); echo $result['html_code']; ?> </tr> </thead> <tbody class="ui-widget-content"> <?php $i = 0; if (sizeof($combined_list) > 0) { $odd = true; foreach ($combined_list as $values) { $bkgnd = $values['partial'] ? ' style="background-color:yellow"' : ''; ?> <tr class="<?php echo $odd ? 'odd' : 'even'; ?>
case 'go_last': $_GET['page'] = 99999; break; case 'search': case 'search_reset': case 'go_page': default: } /***************** prepare to display templates *************************/ // build the list header if (!isset($_GET['list_order'])) { $_GET['list_order'] = 'post_date-desc'; } // default to descending by invoice number $heading_array = array('post_date' => TEXT_DATE, 'purchase_invoice_id' => TEXT_INVOICE, 'closed' => ORD_PAID, 'bill_primary_name' => GEN_PRIMARY_NAME, 'shipper_code' => TEXT_CARRIER); $result = html_heading_bar($heading_array, $_GET['list_order'], array(ORD_SHIPPED, TEXT_ACTION)); $list_header = $result['html_code']; $disp_order = $result['disp_order']; // build the list for the page selected $period_filter = $acct_period == 'all' ? '' : ' and period = ' . $acct_period; if (isset($search_text) && gen_not_null($search_text)) { $search_fields = array('bill_primary_name', 'purchase_invoice_id', 'purch_order_id'); // hook for inserting new search fields to the query criteria. if (is_array($extra_search_fields)) { $search_fields = array_merge($search_fields, $extra_search_fields); } $search = ' and (' . implode(' like \'%' . $search_text . '%\' or ', $search_fields) . ' like \'%' . $search_text . '%\')'; } else { $search = ''; } $field_list = array('id', 'post_date', 'shipper_code', 'purchase_invoice_id', 'closed', 'bill_primary_name', 'journal_id');
case 'import': $include_template = 'template_import.php'; define('PAGE_TITLE', TEXT_IMPORT_TRANSLATION); break; case 'export_all': $include_template = 'template_export.php'; define('PAGE_TITLE', TEXT_EXPORT_TRANSLATION); break; case 'upload': $include_template = 'template_upload.php'; define('PAGE_TITLE', TEXT_UPLOAD_TRANSLATION); break; case 'filter_main': default: $heading_array = array('module' => TEXT_MODULE, 'language' => TEXT_LANGUAGE_CODE, 'version' => TEXT_VERSION); $result = html_heading_bar($heading_array, array(TEXT_STATISTICS, TEXT_ACTION)); $list_header = $result['html_code']; $disp_order = $result['disp_order']; if (!isset($_GET['list_order'])) { $disp_order = 'language'; } if ($mod && $mod != 'all') { $criteria[] = "module = '" . $mod . "'"; } if ($lang) { $criteria[] = "language = '" . $lang . "'"; } if ($ver && $ver != 'L') { $criteria[] = "version = '" . $ver . "'"; } // build the list for the page selected
case 'search': case 'search_reset': case 'go_page': default: } /***************** prepare to display templates *************************/ // build the list header $heading_array = array('m.post_date' => TEXT_DATE, 'purchase_invoice_id' => TEXT_REFERENCE, 'qty' => TEXT_QUANTITY, 'sku' => TEXT_SKU, 'description' => TEXT_DESCRIPTION); if (ENABLE_MULTI_BRANCH && $adj_type == 'xfr') { $extras = array(TEXT_FROM_BRANCH, TEXT_DEST_BRANCH); } elseif (ENABLE_MULTI_BRANCH) { $extras = array(TEXT_BRANCH); } else { $extras = array(); } $result = html_heading_bar($heading_array, $extras); $list_header = $result['html_code']; $disp_order = $result['disp_order']; // build the list for the page selected if (isset($_REQUEST['search_text']) && $_REQUEST['search_text'] != '') { $search_fields = array('i.sku', 'm.purchase_invoice_id', 'i.debit_amount', 'i.credit_amount', 'i.description', 'i.gl_account'); // hook for inserting new search fields to the query criteria. if (is_array($extra_search_fields)) { $search_fields = array_merge($search_fields, $extra_search_fields); } $filters[] = '(' . implode(' like \'%' . $_REQUEST['search_text'] . '%\' or ', $search_fields) . ' like \'%' . $_REQUEST['search_text'] . '%\')'; } $field_list = array('m.id', 'm.purchase_invoice_id', 'm.post_date', 'm.store_id', 'm.bill_acct_id', 'sum(i.qty) as qty', 'i.sku', 'count(i.sku) as sku_cnt', 'i.description'); // hook to add new fields to the query return results if (is_array($extra_query_list_fields) > 0) { $field_list = array_merge($field_list, $extra_query_list_fields);
require_once DIR_FS_MODULES . 'phreeform/defaults.php'; require_once DIR_FS_MODULES . 'phreeform/functions/phreeform.php'; /************** page specific initialization *************************/ if (!isset($_REQUEST['list'])) { $_REQUEST['list'] = 1; } $fieldset_content = 'NULL'; $id = (int) $_GET['id']; if (!isset($_GET['id'])) { die; } $doc_details = $db->Execute("select * from " . TABLE_PHREEFORM . " where id = '" . $id . "'"); if ($id == 0 || $doc_details->fields['doc_type'] == '0') { // folder $dir_path = TEXT_PATH . ': /' . build_dir_path($id); $result = html_heading_bar(array(), array(' ', $dir_path, TEXT_ACTION)); $list_header = $result['html_code']; $field_list = array('id', 'doc_type', 'doc_title', 'security'); $query_raw = "select SQL_CALC_FOUND_ROWS " . implode(', ', $field_list) . " from " . TABLE_PHREEFORM . " where parent_id = '" . $id . "'"; $query_result = $db->Execute($query_raw, MAX_DISPLAY_SEARCH_RESULTS * ($_REQUEST['list'] - 1) . ", " . MAX_DISPLAY_SEARCH_RESULTS); // the splitPageResults should be run directly after the query that contains SQL_CALC_FOUND_ROWS $query_split = new splitPageResults($_REQUEST['list'], ''); include DIR_FS_MODULES . 'phreeform/pages/main/tab_folder.php'; } else { // load document details include DIR_FS_MODULES . 'phreeform/pages/main/tab_report.php'; } $html = "<div>"; $html .= $fieldset_content; $html .= "</div>"; $xml .= "\t" . xmlEntry("htmlContents", $html);
case 'new': default: } /***************** prepare to display templates *************************/ $cal_ps = array('name' => 'datePost', 'form' => 'pricesheet', 'fieldname' => 'effective_date', 'imagename' => 'btn_date_1', 'default' => $effective_date); $include_header = true; $include_footer = true; switch ($_REQUEST['action']) { case 'new': case 'edit': $include_template = 'template_detail.php'; define('PAGE_TITLE', $_REQUEST['action'] == 'new' ? PRICE_SHEET_NEW_TITLE : PRICE_SHEET_EDIT_TITLE); break; default: $heading_array = array('sheet_name' => TEXT_SHEET_NAME, 'inactive' => TEXT_INACTIVE, 'revision' => TEXT_REVISION, 'default_sheet' => TEXT_DEFAULT, 'effective_date' => TEXT_EFFECTIVE_DATE, 'expiration_date' => TEXT_EXPIRATION_DATE); $result = html_heading_bar($heading_array, array(TEXT_SPECIAL_PRICING, TEXT_ACTION)); $list_header = $result['html_code']; $disp_order = $result['disp_order']; // find the highest rev level by sheet name $result = $db->Execute("select distinct sheet_name, max(revision) as rev from " . TABLE_PRICE_SHEETS . " \n\t where type = '{$type}' group by sheet_name"); $rev_levels = array(); while (!$result->EOF) { $rev_levels[$result->fields['sheet_name']] = $result->fields['rev']; $result->MoveNext(); } // build the list for the page selected $search = ''; if (isset($_REQUEST['search_text']) && $_REQUEST['search_text'] != '') { $search_fields = array('sheet_name', 'revision'); // hook for inserting new search fields to the query criteria. if (is_array($extra_search_fields)) {
if (DEBUG) { $messageStack->write_debug(); } // send to printer (range of check numbers) break; case 'search': default: } /***************** prepare to display templates *************************/ // load the gl account beginning balance $acct_balance = load_cash_acct_balance($post_date, $gl_acct_id, $period); // load gl accounts $gl_array_list = gen_coa_pull_down(); // build the list header $heading_array = array('post_date' => BNK_INVOICE_DATE, 'bill_primary_name' => BNK_VENDOR_NAME, 'purchase_invoice_id' => BNK_INVOICE_NUM, 'total_amount' => BNK_AMOUNT_DUE); $result = html_heading_bar($heading_array, array(TEXT_NOTES, BNK_DUE_DATE, TEXT_DISCOUNT, BNK_20_AMOUNT_PAID, TEXT_PAY)); $list_header = $result['html_code']; $disp_order = $result['disp_order']; if (!$disp_order) { $disp_order = 'post_date'; } // build the list for the page selected $field_list = array('m.id', 'm.journal_id', 'm.post_date', 'm.total_amount', 'm.terms', 'm.gl_acct_id', 'm.purchase_invoice_id', 'm.purch_order_id', 'm.bill_acct_id', 'm.bill_primary_name', 'm.waiting'); // hook to add new fields to the query return results if (is_array($extra_query_list_fields) > 0) { $field_list = array_merge($field_list, $extra_query_list_fields); } $query_raw = "select " . implode(', ', $field_list) . " \n\tfrom " . TABLE_JOURNAL_MAIN . " m inner join " . TABLE_CONTACTS . " a on m.bill_acct_id = a.id \n\twhere a.type = 'v' and m.journal_id in (6, 7) and m.closed = '0' \n\torder by {$disp_order}, post_date"; $query_result = $db->Execute($query_raw); $cal_bills0 = array('name' => 'datePosted', 'form' => 'bulk_bills', 'fieldname' => 'post_date', 'imagename' => 'btn_date_1', 'default' => gen_locale_date($post_date), 'params' => array('align' => 'left', 'onchange' => 'loadNewBalance();')); $cal_bills1 = array('name' => 'dateInvoice', 'form' => 'bulk_bills', 'fieldname' => 'invoice_date', 'imagename' => 'btn_date_2', 'default' => gen_locale_date($invoice_date), 'params' => array('align' => 'left'));
function build_main_html() { global $db, $messageStack, $project_cost_types; // Build heading bar $output = '<table border="0" width="100%" cellspacing="0" cellpadding="1">' . chr(10); $output .= ' <tr class="dataTableHeadingRow" valign="top">' . chr(10); $heading_array = array('description_short' => TEXT_SHORT_NAME, 'cost_type' => TEXT_COST_TYPE, 'cost_breakdown' => TEXT_COST_BREAKDOWN, 'inactive' => TEXT_INACTIVE); $result = html_heading_bar($heading_array, $_GET['list_order']); $output .= $result['html_code']; $disp_order = $result['disp_order']; $output .= ' </tr>' . chr(10); // Build field data $query_raw = "select phase_id, description_short, cost_type, cost_breakdown, inactive \r\n\tfrom " . $this->db_table . " order by {$disp_order}"; $page_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $query_raw, $query_numrows); $result = $db->Execute($query_raw); while (!$result->EOF) { $output .= ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . chr(10); $output .= ' <td class="dataTableContent" onclick="loadPopUp(\'edit\', ' . $result->fields['phase_id'] . ')">' . htmlspecialchars($result->fields['description_short']) . '</td>' . chr(10); $output .= ' <td class="dataTableContent" onclick="loadPopUp(\'edit\', ' . $result->fields['phase_id'] . ')">' . $project_cost_types[$result->fields['cost_type']] . '</td>' . chr(10); $output .= ' <td class="dataTableContent" onclick="loadPopUp(\'edit\', ' . $result->fields['phase_id'] . ')">' . ($result->fields['cost_breakdown'] ? TEXT_YES : '') . '</td>' . chr(10); $output .= ' <td class="dataTableContent" onclick="loadPopUp(\'edit\', ' . $result->fields['phase_id'] . ')">' . ($result->fields['inactive'] ? TEXT_YES : '') . '</td>' . chr(10); $output .= ' <td class="dataTableContent" align="right">' . chr(10); if ($this->security_id > 1) { $output .= html_icon('actions/edit-find-replace.png', TEXT_EDIT, 'small', 'onclick="loadPopUp(\'edit\', ' . $result->fields['phase_id'] . ')"') . chr(10); } if ($this->security_id > 3) { $output .= html_icon('emblems/emblem-unreadable.png', TEXT_DELETE, 'small', 'onclick="if (confirm(\'' . SETUP_PROJECT_PHASES_DELETE_INTRO . '\')) submitSeq(' . $result->fields['phase_id'] . ', \'delete\')"') . chr(10); } $output .= ' </td>' . chr(10); $output .= ' </tr>' . chr(10); $result->MoveNext(); } $output .= '</table>' . chr(10); $output .= '<div class="page_count_right">' . $page_split->display_links($query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']) . '</div>' . chr(10); $output .= '<div class="page_count">' . $page_split->display_count($query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], SETUP_DISPLAY_NUMBER_OF_PROJECT_PHASES) . '</div>' . chr(10); return $output; }
function build_main_html() { global $db, $messageStack; // Build heading bar $output = '<table border="0" width="100%" cellspacing="0" cellpadding="1">' . chr(10); $output .= ' <tr class="dataTableHeadingRow" valign="top">' . chr(10); $heading_array = array('id' => GL_HEADING_ACCOUNT_NAME, 'description' => TEXT_ACCT_DESCRIPTION, 'account_type' => GL_INFO_ACCOUNT_TYPE, 'subaccount' => GL_HEADING_SUBACCOUNT); $result = html_heading_bar($heading_array, $_GET['list_order']); $output .= $result['html_code']; $disp_order = $result['disp_order']; $output .= ' </tr>' . chr(10); // Build field data $query_raw = "select id, description, heading_only, primary_acct_id, account_type, account_inactive \r\n\t\tfrom " . $this->db_table . " order by {$disp_order}"; $page_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $query_raw, $query_numrows); $result = $db->Execute($query_raw); while (!$result->EOF) { $bkgnd = $result->fields['account_inactive'] ? 'style="background-color:pink"' : ''; $account_type_desc = gen_get_type_description(TABLE_CHART_OF_ACCOUNTS_TYPES, $result->fields['account_type'], false); if ($result->fields['heading_only']) { $account_type_desc = TEXT_HEADING; $bkgnd = 'style="background-color:#cccccc"'; } $output .= ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . chr(10); $output .= ' <td class="dataTableContent" ' . $bkgnd . ' onclick="loadPopUp(\'edit\', \'' . $result->fields['id'] . '\')">' . $result->fields['id'] . '</td>' . chr(10); $output .= ' <td class="dataTableContent" ' . $bkgnd . ' onclick="loadPopUp(\'edit\', \'' . $result->fields['id'] . '\')">' . htmlspecialchars($result->fields['description']) . '</td>' . chr(10); $output .= ' <td class="dataTableContent" ' . $bkgnd . ' onclick="loadPopUp(\'edit\', \'' . $result->fields['id'] . '\')">' . $account_type_desc . '</td>' . chr(10); $output .= ' <td class="dataTableContent" ' . $bkgnd . ' onclick="loadPopUp(\'edit\', \'' . $result->fields['id'] . '\')">' . htmlspecialchars($result->fields['primary_acct_id'] ? TEXT_YES . ' - ' . $result->fields['primary_acct_id'] : TEXT_NO) . '</td>' . chr(10); $output .= ' <td class="dataTableContent" align="right">' . chr(10); if ($this->security_id > 1) { $output .= html_icon('actions/edit-find-replace.png', TEXT_EDIT, 'small', 'onclick="loadPopUp(\'edit\', \'' . $result->fields['id'] . '\')"') . chr(10); } if ($this->security_id > 3) { $output .= html_icon('emblems/emblem-unreadable.png', TEXT_DELETE, 'small', 'onclick="if (confirm(\'' . GL_INFO_DELETE_INTRO . '\')) submitSeq(\'' . $result->fields['id'] . '\', \'delete\')"') . chr(10); } $output .= ' </td>' . chr(10); $output .= ' </tr>' . chr(10); $result->MoveNext(); } $output .= '</table>' . chr(10); $output .= '<div class="page_count_right">' . $page_split->display_links($query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']) . '</div>' . chr(10); $output .= '<div class="page_count">' . $page_split->display_count($query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], GL_DISPLAY_NUMBER_OF_COA) . '</div>' . chr(10); return $output; }
$static_array = array('post_date' => TEXT_DATE, 'purchase_invoice_id' => 'Amazon Order ID', 'ship_primary_name' => 'Customer Name', 'ship_telephone1' => 'Telephone', 'ship_email' => 'Email', 'shipper_code' => TEXT_CARRIER, 'filler' => TEXT_ACTION); $cal_pps = array('name' => 'shipDate', 'form' => 'amazon', 'fieldname' => 'ship_date', 'imagename' => 'btn_date_1', 'default' => gen_locale_date($ship_date), 'params' => array('align' => 'left')); $result = html_heading_bar(array(), 'Date', 'desc', $static_array); $so_list_header = $result['html_code']; // build the list for the page selected $field_list = array('id', 'post_date', 'shipper_code', 'purchase_invoice_id', 'ship_primary_name', 'ship_telephone1', 'ship_email'); $query_raw = "SELECT " . implode(', ', $field_list) . " FROM " . TABLE_JOURNAL_MAIN . " \n\t\tWHERE journal_id=10 AND closed='0' AND bill_primary_name LIKE '%amazon%' ORDER BY post_date DESC"; $so_query_split = new splitPageResults($list = 1, $max_list, $query_raw, $query_numrows); $so_query_result = $db->Execute($query_raw); // build the list header - Invoices if (!isset($_GET['list_order'])) { $_GET['list_order'] = 'post_date-desc'; } // default to descending by invoice number $heading_array = array('post_date' => TEXT_DATE, 'purchase_invoice_id' => TEXT_INVOICE, 'purch_order_id' => 'Amazon Order ID', 'ship_primary_name' => 'Customer Name', 'shipper_code' => TEXT_CARRIER); $result = html_heading_bar($heading_array, $_GET['sf'], $_GET['so'], array('Method', TEXT_SHIPPED, 'Confirmed', TEXT_ACTION)); $list_header = $result['html_code']; $disp_order = $result['disp_order']; // build the list for the page selected $period_filter = $acct_period == 'all' ? '' : ' and period = ' . $acct_period; if (isset($search_text) && $search_text != '') { $search_fields = array('bill_primary_name', 'ship_primary_name', 'purchase_invoice_id', 'purch_order_id'); // hook for inserting new search fields to the query criteria. if (is_array($extra_search_fields)) { $search_fields = array_merge($search_fields, $extra_search_fields); } $search = ' and (' . implode(' like \'%' . $search_text . '%\' or ', $search_fields) . ' like \'%' . $search_text . '%\')'; } else { $search = ''; } $field_list = array('id', 'post_date', 'shipper_code', 'purchase_invoice_id', 'purch_order_id', 'ship_primary_name');
case 'search': case 'search_reset': case 'go_page': default: } /***************** prepare to display templates *************************/ // generate chart of account types $coa_types = load_coa_types(); // build the list header $heading_array = array('post_date' => TEXT_DATE); if (ENABLE_MULTI_BRANCH) { $heading_array['store_id'] = GEN_STORE_ID; } $heading_array['purchase_invoice_id'] = TEXT_REFERENCE; $heading_array['total_amount'] = TEXT_AMOUNT; $result = html_heading_bar($heading_array, array(TEXT_DESCRIPTION)); $list_header = $result['html_code']; $disp_order = $result['disp_order']; // build the list for the page selected $acct_period = $_GET['search_period'] ? $_GET['search_period'] : $_POST['search_period']; if (!$acct_period) { $acct_period = CURRENT_ACCOUNTING_PERIOD; } $period_filter = $acct_period == 'all' ? '' : ' and period = ' . $acct_period; if (isset($_REQUEST['search_text']) && $_REQUEST['search_text'] != '') { $search_fields = array('purchase_invoice_id', 'total_amount'); // hook for inserting new search fields to the query criteria. if (is_array($extra_search_fields)) { $search_fields = array_merge($search_fields, $extra_search_fields); } $search = ' and (' . implode(' like \'%' . $_REQUEST['search_text'] . '%\' or ', $search_fields) . ' like \'%' . $_REQUEST['search_text'] . '%\')';
$_GET['page']--; break; case 'go_next': $_GET['page']++; break; case 'go_last': $_GET['page'] = 99999; break; case 'search': case 'search_reset': case 'go_page': default: } /***************** prepare to display templates *************************/ $heading_array = array('h.sku' => TEXT_SKU, 'i.inactive' => TEXT_INACTIVE, 'i.description_short' => TEXT_DESCRIPTION, 'h.remaining' => INV_TEXT_REMAINING, 'h.unit_cost' => INV_TEXT_UNIT_COST); $result = html_heading_bar($heading_array, $_GET['list_order'], array(INV_TEXT_CURRENT_VALUE, INV_TEXT_NEW_VALUE)); $list_header = $result['html_code']; $disp_order = $result['disp_order']; // build the list for the page selected $search_text = $_GET['search_text'] == TEXT_SEARCH ? '' : db_input(db_prepare_input($_GET['search_text'])); if (isset($search_text) && gen_not_null($search_text)) { $search_fields = array('i.description_short', 'h.sku'); // hook for inserting new search fields to the query criteria. if (is_array($extra_search_fields)) { $search_fields = array_merge($search_fields, $extra_search_fields); } $search = ' and (' . implode(' like \'%' . $search_text . '%\' or ', $search_fields) . ' like \'%' . $search_text . '%\')'; } else { $search = ''; } $field_list = array('h.id', 'h.sku', 'h.remaining', 'h.unit_cost', 'i.inactive', 'i.description_short');
?> </div> <div align="center"><?php echo TEXT_CASH_ACCOUNT . ' ' . html_pull_down_menu('gl_account', $account_array, $gl_account, 'onchange="submit();"'); ?> </div> <table id="item_table" align="center" width="900" border="0" cellspacing="0" cellpadding="1"> <?php if (ENABLE_MULTI_CURRENCY) { echo '<tr><td colspan="6" class="fieldRequired"> ' . sprintf(GEN_PRICE_SHEET_CURRENCY_NOTE, $currencies->currencies[DEFAULT_CURRENCY]['title']) . '</td></tr>'; } ?> <tr class="dataTableHeadingRow" valign="top"> <?php $heading_array = array('reference' => TEXT_REFERENCE, 'post_date' => TEXT_DATE, 'dep_amount' => BNK_DEPOSIT_CREDIT, 'pmt_amount' => BNK_CHECK_PAYMENT); $result = html_heading_bar($heading_array, $_GET['list_order'], array(TEXT_SOURCE, TEXT_CLEAR, ' ')); echo $result['html_code']; ?> </tr> <?php $i = 0; if (is_array($combined_list)) { foreach ($combined_list as $values) { $bkgnd = $values['partial'] ? ' style="background-color:yellow"' : ''; ?> <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)"> <td width="16%" class="dataTableContent"><?php echo $values['reference']; ?> </td> <td width="10%" class="dataTableContent"><?php
case 'go_next': $_GET['page']++; break; case 'go_last': $_GET['page'] = 99999; break; case 'search': case 'search_reset': case 'go_page': default: } /***************** prepare to display templates *************************/ // build the list header $heading_array = array('m.post_date' => TEXT_DATE, 'purchase_invoice_id' => TEXT_REFERENCE, 'total_amount' => TEXT_AMOUNT, 'description' => TEXT_DESCRIPTION); $extras = ENABLE_MULTI_BRANCH ? array(TEXT_BRANCH) : array(); $result = html_heading_bar($heading_array, $_GET['list_order'], $extras); $list_header = $result['html_code']; $disp_order = $result['disp_order']; // build the list for the page selected if (isset($search_text) && gen_not_null($search_text)) { $search_fields = array('i.sku', 'm.purchase_invoice_id', 'i.debit_amount', 'i.credit_amount', 'i.description'); // hook for inserting new search fields to the query criteria. if (is_array($extra_search_fields)) { $search_fields = array_merge($search_fields, $extra_search_fields); } $search = ' and (' . implode(' like \'%' . $search_text . '%\' or ', $search_fields) . ' like \'%' . $search_text . '%\')'; } else { $search = ''; } $field_list = array('m.id', 'm.purchase_invoice_id', 'm.post_date', 'm.store_id', 'i.description', 'i.qty'); // hook to add new fields to the query return results
function build_main_html() { global $db, $messageStack; // Build heading bar $output = '<table border="0" width="100%" cellspacing="0" cellpadding="1">' . chr(10); $output .= ' <tr class="dataTableHeadingRow" valign="top">' . chr(10); $heading_array = array('description_short' => SETUP_TAX_DESC_SHORT, 'account_id' => SETUP_TAX_GL_ACCT, 'tax_rate' => SETUP_TAX_RATE); $result = html_heading_bar($heading_array, $_GET['list_order']); $output .= $result['html_code']; $disp_order = $result['disp_order']; $output .= ' </tr>' . chr(10); // Build field data $query_raw = "select tax_auth_id, description_short, account_id, tax_rate \r\n\tfrom " . $this->db_table . " where type = '" . $this->type . "' order by {$disp_order}"; $page_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $query_raw, $query_numrows); $result = $db->Execute($query_raw); while (!$result->EOF) { $output .= ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . chr(10); $output .= ' <td class="dataTableContent" onclick="loadPopUp(\'edit\', ' . $result->fields['tax_auth_id'] . ')">' . htmlspecialchars($result->fields['description_short']) . '</td>' . chr(10); $output .= ' <td class="dataTableContent" onclick="loadPopUp(\'edit\', ' . $result->fields['tax_auth_id'] . ')">' . gen_get_type_description(TABLE_CHART_OF_ACCOUNTS, $result->fields['account_id']) . '</td>' . chr(10); $output .= ' <td class="dataTableContent" onclick="loadPopUp(\'edit\', ' . $result->fields['tax_auth_id'] . ')">' . $result->fields['tax_rate'] . '</td>' . chr(10); $output .= ' <td class="dataTableContent" align="right">' . chr(10); if ($this->security_id > 1) { $output .= html_icon('actions/edit-find-replace.png', TEXT_EDIT, 'small', 'onclick="loadPopUp(\'edit\', ' . $result->fields['tax_auth_id'] . ')"') . chr(10); } if ($this->security_id > 3) { $output .= html_icon('emblems/emblem-unreadable.png', TEXT_DELETE, 'small', 'onclick="if (confirm(\'' . SETUP_TAX_AUTH_DELETE_INTRO . '\')) submitSeq(' . $result->fields['tax_auth_id'] . ', \'delete\')"') . chr(10); } $output .= ' </td>' . chr(10); $output .= ' </tr>' . chr(10); $result->MoveNext(); } $output .= '</table>' . chr(10); $output .= '<div class="page_count_right">' . $page_split->display_links($query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']) . '</div>' . chr(10); $output .= '<div class="page_count">' . $page_split->display_count($query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], SETUP_DISPLAY_NUMBER_OF_TAX_AUTH) . '</div>' . chr(10); return $output; }
$include_template = 'template_detail.php'; define('PAGE_TITLE', $_REQUEST['action'] == 'new' ? $cInfo->page_title_new : constant('ACT_' . strtoupper($type) . '_PAGE_TITLE_EDIT') . ' - (' . $cInfo->short_name . ') ' . $cInfo->address[m][0]->primary_name); break; default: $heading_array = array('c.short_name' => constant('ACT_' . strtoupper($type) . '_SHORT_NAME')); if ($type == 'e') { $heading_array['c.contact_last,c.contact_first'] = GEN_EMPLOYEE_NAME; } else { $heading_array['a.primary_name'] = GEN_PRIMARY_NAME; } $heading_array['address1'] = GEN_ADDRESS1; $heading_array['city_town'] = GEN_CITY_TOWN; $heading_array['state_province'] = GEN_STATE_PROVINCE; $heading_array['postal_code'] = GEN_POSTAL_CODE; $heading_array['telephone1'] = GEN_TELEPHONE1; $result = html_heading_bar($heading_array); $list_header = $result['html_code']; $disp_order = $result['disp_order']; // build the list for the page selected $criteria[] = "a.type = '" . $type . "m'"; if (isset($_REQUEST['search_text']) && $_REQUEST['search_text'] != '') { $search_fields = array('a.primary_name', 'a.contact', 'a.telephone1', 'a.telephone2', 'a.address1', 'a.address2', 'a.city_town', 'a.postal_code', 'c.short_name'); // hook for inserting new search fields to the query criteria. if (is_array($extra_search_fields)) { $search_fields = array_merge($search_fields, $extra_search_fields); } $criteria[] = '(' . implode(' like \'%' . $_REQUEST['search_text'] . '%\' or ', $search_fields) . ' like \'%' . $_REQUEST['search_text'] . '%\')'; } if (!$_SESSION['f0']) { $criteria[] = "(c.inactive = '0' or c.inactive = '')"; }
break; case 12: case 13: $heading_array['so_po_ref_id'] = ORD_HEADING_NUMBER_10; $heading_array['closed'] = TEXT_PAID; break; case 19: $heading_array['so_po_ref_id'] = ORD_HEADING_NUMBER_10; $heading_array['closed'] = TEXT_CLOSED; break; default: $heading_array['closed'] = TEXT_CLOSED; } $heading_array['bill_primary_name'] = in_array(JOURNAL_ID, array(12, 13)) ? ORD_CUSTOMER_NAME : ORD_VENDOR_NAME; $heading_array['total_amount'] = TEXT_AMOUNT; $result = html_heading_bar($heading_array, array()); $list_header = $result['html_code']; $disp_order = $result['disp_order']; if ($disp_order == 'post_date') { $disp_order .= ', purchase_invoice_id'; } if (!$date == false) { $period_filter = " and post_date = '{$date}'"; $acct_period = ''; } else { if ($acct_period == false) { $acct_period = CURRENT_ACCOUNTING_PERIOD; } $period_filter = $acct_period == 'all' ? '' : ' and period = ' . $acct_period; $date = ''; }
$_GET['page']++; break; case 'go_last': $_GET['page'] = 99999; break; case 'search': case 'search_reset': case 'go_page': default: } /***************** prepare to display templates *************************/ // generate address arrays for javascript $js_arrays = gen_build_acct_arrays(); // build the list header $heading_array = array('m.bill_primary_name' => GEN_PRIMARY_NAME, 'm.bill_city_town, m.bill_state_province' => GEN_CITY_TOWN, 'm.bill_state_province, m.bill_city_town' => GEN_STATE_PROVINCE, 'm.postal_code' => GEN_POSTAL_CODE, 'total_amount' => TEXT_BALANCE . (ENABLE_MULTI_CURRENCY ? ' (' . DEFAULT_CURRENCY . ')' : '')); $result = html_heading_bar($heading_array, $_GET['list_order'], array()); $list_header = $result['html_code']; $disp_order = $result['disp_order']; // build the list for the page selected if (isset($search_text) && gen_not_null($search_text)) { $search_fields = array('c.short_name', 'm.bill_primary_name', 'm.bill_contact', 'm.bill_address1', 'm.bill_address2', 'm.bill_city_town', 'm.bill_postal_code', 'm.purchase_invoice_id'); // hook for inserting new search fields to the query criteria. if (is_array($extra_search_fields)) { $search_fields = array_merge($search_fields, $extra_search_fields); } $search = ' and (' . implode(' like \'%' . $search_text . '%\' or ', $search_fields) . ' like \'%' . $search_text . '%\')'; } else { $search = ''; } $field_list = array('m.bill_acct_id', 'm.bill_primary_name', 'm.bill_city_town', 'm.bill_state_province', 'm.bill_postal_code', 'sum(m.total_amount) as ztotal_amount'); // hook to add new fields to the query return results
function load_crm_headings() { $heading_array = array(); // don't sort $non_sort_array = array(GEN_LAST_NAME, GEN_FIRST_NAME, TEXT_TITLE, GEN_TELEPHONE1, GEN_TELEPHONE4, GEN_EMAIL, TEXT_ACTION); $result = html_heading_bar($heading_array, '', $non_sort_array); return $result['html_code']; }