Пример #1
0
            meta_forward($_SERVER['PHP_SELF']);
        }
        if ($allow_demo_mode) {
            display_warning(_("Display settings have been updated. Keep in mind that changed settings are restored on every login in demo mode."));
        } else {
            display_notification_centered(_("Display settings have been updated."));
        }
    }
}
start_form();
start_outer_table(TABLESTYLE2);
table_section(1);
table_section_title(_("Decimal Places"));
number_list_row(_("Prices/Amounts:"), 'prices_dec', user_price_dec(), 0, 10);
number_list_row(_("Quantities:"), 'qty_dec', user_qty_dec(), 0, 10);
number_list_row(_("Exchange Rates:"), 'rates_dec', user_exrate_dec(), 0, 10);
number_list_row(_("Percentages:"), 'percent_dec', user_percent_dec(), 0, 10);
table_section_title(_("Dateformat and Separators"));
dateformats_list_row(_("Dateformat:"), "date_format", user_date_format());
dateseps_list_row(_("Date Separator:"), "date_sep", user_date_sep());
/* The array $dateseps is set up in config.php for modifications
possible separators can be added by modifying the array definition by editing that file */
thoseps_list_row(_("Thousand Separator:"), "tho_sep", user_tho_sep());
/* The array $thoseps is set up in config.php for modifications
possible separators can be added by modifying the array definition by editing that file */
decseps_list_row(_("Decimal Separator:"), "dec_sep", user_dec_sep());
/* The array $decseps is set up in config.php for modifications
possible separators can be added by modifying the array definition by editing that file */
if (!isset($_POST['language'])) {
    $_POST['language'] = $_SESSION['language']->code;
}
 function pager(&$pager)
 {
     global $use_popup_windows, $use_date_picker, $path_to_root;
     $pager->select_records();
     div_start("_{$pager->name}_span");
     $headers = array();
     foreach ($pager->columns as $num_col => $col) {
         // record status control column is displayed only when control checkbox is on
         if (isset($col['head']) && ($col['type'] != 'inactive' || get_post('show_inactive'))) {
             if (!isset($col['ord'])) {
                 $headers[] = $col['head'];
             } else {
                 $icon = $col['ord'] == 'desc' ? 'sort_desc.gif' : ($col['ord'] == 'asc' ? 'sort_asc.gif' : 'sort_none.gif');
                 $headers[] = navi_button($pager->name . '_sort_' . $num_col, $col['head'], true, $icon);
             }
         }
     }
     /* show a table of records returned by the sql */
     start_table(TABLESTYLE, "width={$pager->width}");
     table_header($headers);
     if ($pager->header_fun) {
         // if set header handler
         start_row("class='{$pager->header_class}'");
         $fun = $pager->header_fun;
         if (method_exists($pager, $fun)) {
             $h = $pager->{$fun}($pager);
         } elseif (function_exists($fun)) {
             $h = $fun($pager);
         }
         foreach ($h as $c) {
             // draw header columns
             $pars = isset($c[1]) ? $c[1] : '';
             label_cell($c[0], $pars);
         }
         end_row();
     }
     $cc = 0;
     // row colour counter
     foreach ($pager->data as $line_no => $row) {
         $marker = $pager->marker;
         if ($marker && $marker($row)) {
             start_row("class='{$pager->marker_class}'");
         } else {
             alt_table_row_color($cc);
         }
         foreach ($pager->columns as $k => $col) {
             $coltype = $col['type'];
             $cell = isset($col['name']) ? $row[$col['name']] : '';
             if (isset($col['fun'])) {
                 // use data input function if defined
                 $fun = $col['fun'];
                 if (method_exists($pager, $fun)) {
                     $cell = $pager->{$fun}($row, $cell);
                 } elseif (function_exists($fun)) {
                     $cell = $fun($row, $cell);
                 } else {
                     $cell = '';
                 }
             }
             switch ($coltype) {
                 // format column
                 case 'time':
                     label_cell($cell, "width=40");
                     break;
                 case 'date':
                     label_cell(sql2date($cell), "align='center' nowrap");
                     break;
                 case 'dstamp':
                     // time stamp displayed as date
                     label_cell(sql2date(substr($cell, 0, 10)), "align='center' nowrap");
                     break;
                 case 'tstamp':
                     // time stamp - FIX user format
                     label_cell(sql2date(substr($cell, 0, 10)) . ' ' . substr($cell, 10), "align='center'");
                     break;
                 case 'percent':
                     percent_cell($cell);
                     break;
                 case 'amount':
                     if ($cell == '') {
                         label_cell('');
                     } else {
                         amount_cell($cell, false);
                     }
                     break;
                 case 'qty':
                     if ($cell == '') {
                         label_cell('');
                     } else {
                         qty_cell($cell, false, isset($col['dec']) ? $col['dec'] : null);
                     }
                     break;
                 case 'email':
                     email_cell($cell, isset($col['align']) ? "align='" . $col['align'] . "'" : null);
                     break;
                 case 'rate':
                     label_cell(number_format2($cell, user_exrate_dec()), "align=center");
                     break;
                 case 'inactive':
                     if (get_post('show_inactive')) {
                         $pager->inactive_control_cell($row);
                     }
                     break;
                 default:
                     // case 'text':
                     if (isset($col['align'])) {
                         label_cell($cell, "align='" . $col['align'] . "'");
                     } else {
                         label_cell($cell);
                     }
                 case 'skip':
                     // column not displayed
             }
         }
         end_row();
     }
     // end of while loop
     if ($pager->footer_fun) {
         // if set footer handler
         start_row("class='{$pager->footer_class}'");
         $fun = $pager->footer_fun;
         if (method_exists($pager, $fun)) {
             $h = $pager->{$fun}($pager);
         } elseif (function_exists($fun)) {
             $h = $fun($pager);
         }
         foreach ($h as $c) {
             // draw footer columns
             $pars = isset($c[1]) ? $c[1] : '';
             label_cell($c[0], $pars);
         }
         end_row();
     }
     start_row("class='navibar'");
     $colspan = count($pager->columns);
     $inact = @$pager->inactive_ctrl == true ? ' ' . checkbox(null, 'show_inactive', null, true) . _("Show also Inactive") : '';
     end_row();
     end_table();
     $but_pref = $pager->name . '_page_';
     // 			if (@$pager->inactive_ctrl)
     // 				submit('Update', _('Update'), true, '', null); // inactive update
     $context = array('first' => $this->pager_button($but_pref . 'first', _('«'), $pager->first_page), 'previous' => $this->pager_button($but_pref . 'prev', _('‹'), $pager->prev_page), 'next' => $this->pager_button($but_pref . 'next', _('›'), $pager->next_page), 'last' => $this->pager_button($but_pref . 'last', _('»'), $pager->last_page));
     $from = ($pager->curr_page - 1) * $pager->page_len + 1;
     $to = $from + $pager->page_len - 1;
     if ($to > $pager->rec_count) {
         $to = $pager->rec_count;
     }
     $all = $pager->rec_count;
     // 			echo sprintf(_('Records %d-%d of %d'), $from, $to, $all);
     // 			echo $inact;
     // 			echo "</td>";
     echo ThemeBootstrap::get()->renderBlock('controls.twig.html', 'pager', $context);
     /*
     		if ($pager->rec_count) {
     			echo "<td colspan=$colspan class='navibar' style='border:none;padding:3px;'>";
     			echo "<div style='float:right;'>";
     			$but_pref = $pager->name . '_page_';
     			start_table();
     			start_row();
     			if (@$pager->inactive_ctrl)
     				submit('Update', _('Update'), true, '', null); // inactive update
     			echo navi_button_cell($but_pref . 'first', _('First'), $pager->first_page, 'right');
     			echo navi_button_cell($but_pref . 'prev', _('Prev'), $pager->prev_page, 'right');
     			echo navi_button_cell($but_pref . 'next', _('Next'), $pager->next_page, 'right');
     			echo navi_button_cell($but_pref . 'last', _('Last'), $pager->last_page, 'right');
     			end_row();
     			end_table();
     			echo "</div>";
     			$from = ($pager->curr_page - 1) * $pager->page_len + 1;
     			$to = $from + $pager->page_len - 1;
     			if ($to > $pager->rec_count)
     				$to = $pager->rec_count;
     			$all = $pager->rec_count;
     			echo sprintf(_('Records %d-%d of %d'), $from, $to, $all);
     			echo $inact;
     			echo "</td>";
     		} else {
     			label_cell(_('No records') . $inact, "colspan=$colspan class='navibar'");
     		}
     */
     if (isset($pager->marker_txt)) {
         display_note($pager->marker_txt, 0, 1, "class='{$pager->notice_class}'");
     }
     div_end();
     return true;
 }
Пример #3
0
            meta_forward($_SERVER['PHP_SELF']);
        }
        if ($allow_demo_mode) {
            display_warning(_("Display settings have been updated. Keep in mind that changed settings are restored on every login in demo mode."));
        } else {
            display_notification_centered(_("Display settings have been updated."));
        }
    }
}
start_form();
start_outer_table(TABLESTYLE2);
table_section(1);
table_section_title(_("Decimal Places"));
text_row_ex(_("Prices/Amounts:"), 'prices_dec', 5, 5, '', user_price_dec());
text_row_ex(_("Quantities:"), 'qty_dec', 5, 5, '', user_qty_dec());
text_row_ex(_("Exchange Rates:"), 'rates_dec', 5, 5, '', user_exrate_dec());
text_row_ex(_("Percentages:"), 'percent_dec', 5, 5, '', user_percent_dec());
table_section_title(_("Dateformat and Separators"));
dateformats_list_row(_("Dateformat:"), "date_format", user_date_format());
dateseps_list_row(_("Date Separator:"), "date_sep", user_date_sep());
/* The array $dateseps is set up in config.php for modifications
possible separators can be added by modifying the array definition by editing that file */
thoseps_list_row(_("Thousand Separator:"), "tho_sep", user_tho_sep());
/* The array $thoseps is set up in config.php for modifications
possible separators can be added by modifying the array definition by editing that file */
decseps_list_row(_("Decimal Separator:"), "dec_sep", user_dec_sep());
/* The array $decseps is set up in config.php for modifications
possible separators can be added by modifying the array definition by editing that file */
if (!isset($_POST['language'])) {
    $_POST['language'] = $_SESSION['language']->code;
}
Пример #4
0
         $_POST['dimension2_id'] = $myrow["dimension2_id"];
     }
 }
 quick_actions_list_row(_("Posted") . ":", 'actn', null, true);
 if (list_updated('actn')) {
     $Ajax->activate('edit_line');
 }
 $actn = strtolower(substr($_POST['actn'], 0, 1));
 if ($actn == 't') {
     //item_tax_types_list_row(_("Item Tax Type").":",'dest_id', null);
     tax_types_list_row(_("Tax Type") . ":", 'dest_id', null);
 } else {
     gl_all_accounts_list_row(_("Account") . ":", 'dest_id', null, $_POST['type'] == QE_DEPOSIT || $_POST['type'] == QE_PAYMENT);
     if ($actn != '=') {
         if ($actn == '%') {
             small_amount_row(_("Part") . ":", 'amount', price_format(0), null, "%", user_exrate_dec());
         } else {
             amount_row(_("Amount") . ":", 'amount', price_format(0));
         }
     }
 }
 if ($dim >= 1) {
     dimensions_list_row(_("Dimension") . ":", 'dimension_id', null, true, " ", false, 1);
 }
 if ($dim > 1) {
     dimensions_list_row(_("Dimension") . " 2:", 'dimension2_id', null, true, " ", false, 2);
 }
 end_table(1);
 if ($dim < 2) {
     hidden('dimension2_id', 0);
 }
Пример #5
0
function display_rate_edit()
{
    global $selected_id, $table_style2;
    start_table($table_style2);
    if (isset($_POST['get_rate'])) {
        $_POST['BuyRate'] = exrate_format(get_ecb_rate($_POST['curr_abrev']));
    }
    if ($selected_id != "") {
        //editing an existing exchange rate
        $myrow = get_exchange_rate($selected_id);
        $_POST['date_'] = sql2date($myrow["date_"]);
        $_POST['BuyRate'] = exrate_format($myrow["rate_buy"]);
        hidden('selected_id', $selected_id);
        hidden('date_', $_POST['date_']);
        hidden('curr_abrev', $_POST['curr_abrev']);
        label_row(tr("Date to Use From:"), $_POST['date_']);
    } else {
        date_row(tr("Date to Use From:"), 'date_');
    }
    small_amount_row(tr("Exchange Rate:"), 'BuyRate', null, '', submit('get_rate', tr("Get")), user_exrate_dec());
    end_table(1);
    submit_add_or_update_center($selected_id == "");
    display_note(tr("Exchange rates are entered against the company currency."), 1);
}
Пример #6
0
if (isset($_POST['setprefs'])) {
    $theme = user_theme();
    set_user_prefs($_POST['prices'], $_POST['Quantities'], $_POST['Rates'], $_POST['Percent'], check_value('show_gl'), check_value('show_codes'), $_POST['date_format'], $_POST['date_sep'], $_POST['tho_sep'], $_POST['dec_sep'], $_POST['theme'], $_POST['page_size']);
    language::set_language($_POST['language']);
    flush_dir($comp_path . '/' . user_company() . '/js_cache');
    if (user_theme() != $theme) {
        reload_page("");
    }
    display_notification_centered(tr("Display settings have been updated."));
}
start_form();
start_table($table_style2);
table_section_title(tr("Decimal Places"));
text_row_ex(tr("Prices/Amounts:"), 'prices', 5, 5, user_price_dec());
text_row_ex(tr("Quantities:"), 'Quantities', 5, 5, user_qty_dec());
text_row_ex(tr("Exchange Rates:"), 'Rates', 5, 5, user_exrate_dec());
text_row_ex(tr("Percentages:"), 'Percent', 5, 5, user_percent_dec());
table_section_title(tr("Dateformat and Separators"));
dateformats_list_row(tr("Dateformat:"), "date_format", user_date_format());
dateseps_list_row(tr("Date Separator:"), "date_sep", user_date_sep());
/* The array $dateseps is set up in config.php for modifications
possible separators can be added by modifying the array definition by editing that file */
thoseps_list_row(tr("Thousand Separator:"), "tho_sep", user_tho_sep());
/* The array $thoseps is set up in config.php for modifications
possible separators can be added by modifying the array definition by editing that file */
decseps_list_row(tr("Decimal Separator:"), "dec_sep", user_dec_sep());
/* The array $decseps is set up in config.php for modifications
possible separators can be added by modifying the array definition by editing that file */
table_section_title(tr("Miscellaneous"));
check_row(tr("Show GL Information:"), 'show_gl', user_show_gl_info());
check_row(tr("Show Item Codes:"), 'show_codes', user_show_codes());
Пример #7
0
    $myrow = db_fetch($result);
    $supp_name = $myrow["supp_name"];
    $_POST['price'] = price_format($myrow["price"]);
    $_POST['suppliers_uom'] = $myrow["suppliers_uom"];
    $_POST['supplier_description'] = $myrow["supplier_description"];
    $_POST['conversion_factor'] = exrate_format($myrow["conversion_factor"]);
}
echo "<br>";
start_table($table_style2);
if (isset($_GET['Edit'])) {
    hidden('supplier_id', $supplier_id);
    label_row(tr("Supplier:"), $supp_name);
} else {
    supplier_list_row(tr("Supplier:"), 'supplier_id', null, false, true);
    $supplier_id = $_POST['supplier_id'];
}
amount_row(tr("Price:"), 'price', null, '', get_supplier_currency($supplier_id));
text_row(tr("Suppliers Unit of Measure:"), 'suppliers_uom', null, 50, 51);
if (!isset($_POST['conversion_factor']) || $_POST['conversion_factor'] == "") {
    $_POST['conversion_factor'] = exrate_format(1);
}
amount_row(tr("Conversion Factor (to our UOM):"), 'conversion_factor', exrate_format($_POST['conversion_factor']), null, null, user_exrate_dec());
text_row(tr("Supplier's Code or Description:"), 'supplier_description', null, 50, 51);
end_table(1);
if (isset($_GET['Edit'])) {
    submit_center('UpdateRecord', tr("Update Purchasing Data"));
} else {
    submit_center('AddRecord', tr("Add Purchasing Data"));
}
end_form();
end_page();