Example #1
0
function gl_inquiry_controls()
{
    $dim = get_company_pref('use_dimension');
    start_form();
    start_table(TABLESTYLE_NOBORDER);
    $date = today();
    if (!isset($_POST['TransFromDate'])) {
        $_POST['TransFromDate'] = begin_month($date);
    }
    if (!isset($_POST['TransToDate'])) {
        $_POST['TransToDate'] = end_month($date);
    }
    date_cells(_("From:"), 'TransFromDate');
    date_cells(_("To:"), 'TransToDate');
    if ($dim >= 1) {
        dimensions_list_cells(_("Dimension") . " 1:", 'Dimension', null, true, " ", false, 1);
    }
    if ($dim > 1) {
        dimensions_list_cells(_("Dimension") . " 2:", 'Dimension2', null, true, " ", false, 2);
    }
    check_cells(_("No zero values"), 'NoZero', null);
    check_cells(_("Only balances"), 'Balance', null);
    submit_cells('Show', _("Show"), '', '', 'default');
    end_table();
    end_form();
}
Example #2
0
function gl_payment_controls()
{
    global $table_style2;
    $home_currency = get_company_currency();
    start_form(false, true);
    start_table($table_style2, 5, 7);
    echo "<tr><td valign=top>";
    // outer table
    echo "<table>";
    bank_accounts_list_row(tr("From Account:"), 'FromBankAccount', null, true);
    bank_accounts_list_row(tr("To Account:"), 'ToBankAccount', null, true);
    date_row(tr("Transfer Date:"), 'DatePaid');
    $from_currency = get_bank_account_currency($_POST['FromBankAccount']);
    $to_currency = get_bank_account_currency($_POST['ToBankAccount']);
    if ($from_currency != "" && $to_currency != "" && $from_currency != $to_currency) {
        amount_row(tr("Amount:"), 'amount', null, null, $from_currency);
        exchange_rate_display($from_currency, $to_currency, $_POST['DatePaid']);
    } else {
        amount_row(tr("Amount:"), 'amount');
    }
    echo "</table>";
    echo "</td><td valign=top class='tableseparator'>";
    // outer table
    echo "<table>";
    bank_trans_types_list_row(tr("Transfer Type:"), 'TransferType', null);
    ref_row(tr("Reference:"), 'ref', references::get_next(systypes::bank_transfer()));
    textarea_row(tr("Memo:"), 'memo_', null, 40, 4);
    end_table(1);
    echo "</td></tr>";
    end_table(1);
    // outer table
    submit_center('AddPayment', tr("Enter Transfer"));
    end_form();
}
Example #3
0
function edit_allocations_for_transaction($type, $trans_no)
{
    global $systypes_array;
    $cart = $_SESSION['alloc'];
    display_heading(sprintf(_("Allocation of %s # %d"), $systypes_array[$cart->type], $cart->trans_no));
    display_heading($cart->person_name);
    display_heading2(_("Date:") . " <b>" . $cart->date_ . "</b>");
    display_heading2(_("Total:") . " <b>" . price_format($cart->bank_amount) . ' ' . $cart->currency . "</b>");
    if ($cart->currency != $cart->person_curr) {
        $total = _("Total in clearing currency:") . " <b>" . price_format($cart->amount) . "</b>" . sprintf(" %s (%s %s/%s)", $cart->person_curr, exrate_format($cart->bank_amount / $cart->amount), $cart->currency, $cart->person_curr);
        display_heading2($total);
    }
    echo "<br>";
    start_form();
    div_start('alloc_tbl');
    if (count($cart->allocs) > 0) {
        show_allocatable(true);
        submit_center_first('UpdateDisplay', _("Refresh"), _('Start again allocation of selected amount'), true);
        submit('Process', _("Process"), true, _('Process allocations'), 'default');
        submit_center_last('Cancel', _("Back to Allocations"), _('Abandon allocations and return to selection of allocatable amounts'), 'cancel');
    } else {
        display_note(_("There are no unsettled transactions to allocate."), 0, 1);
        submit_center('Cancel', _("Back to Allocations"), true, _('Abandon allocations and return to selection of allocatable amounts'), 'cancel');
    }
    div_end();
    end_form();
}
Example #4
0
function safe_exit()
{
    global $path_to_root;
    hyperlink_no_params("", tr("Enter a new work order"));
    hyperlink_no_params("search_work_orders.php", tr("Select an existing work order"));
    echo "<br>";
    end_form();
    end_page();
    exit;
}
Example #5
0
function gl_inquiry_controls()
{
    start_form();
    start_table("class='tablestyle_noborder'");
    date_cells(tr("From:"), 'TransFromDate', null, -30);
    date_cells(tr("To:"), 'TransToDate');
    check_cells(tr("No zero values"), 'NoZero', null);
    submit_cells('Show', tr("Show"));
    end_table();
    end_form();
}
Example #6
0
function tax_inquiry_controls()
{
    start_form();
    start_table(TABLESTYLE_NOBORDER);
    start_row();
    date_cells(_("from:"), 'TransFromDate', '', null, -30);
    date_cells(_("to:"), 'TransToDate');
    submit_cells('Show', _("Show"), '', '', 'default');
    end_row();
    end_table();
    end_form();
}
Example #7
0
function show_navigation($start_with)
{
    start_form("", "get");
    if ($start_with > 0) {
        echo get_href("<p>Previous", set_var(get_current_url(), "start", max(0, $start_with - SHOW_ITEMS)));
    } else {
        echo "Previous";
    }
    echo " ";
    echo get_href("Next", set_var(get_current_url(), "start", $start_with + SHOW_ITEMS));
    end_form();
}
function display_reval()
{
    global $Refs;
    start_form();
    start_table(TABLESTYLE2);
    if (!isset($_POST['date'])) {
        $_POST['date'] = Today();
    }
    date_row(_("Date for Revaluation:"), 'date', '', null, 0, 0, 0, null, true);
    ref_row(_("Reference:"), 'ref', '', $Refs->get_next(ST_JOURNAL));
    textarea_row(_("Memo:"), 'memo_', null, 40, 4);
    end_table(1);
    submit_center('submit', _("Revaluate Currencies"), true, false);
    end_form();
}
Example #9
0
function display_controls()
{
    global $table_style2;
    start_form(false, true);
    if (!isset($_POST['supplier_id'])) {
        $_POST['supplier_id'] = get_global_supplier(false);
    }
    if (!isset($_POST['DatePaid'])) {
        $_POST['DatePaid'] = Today();
        if (!is_date_in_fiscalyear($_POST['DatePaid'])) {
            $_POST['DatePaid'] = end_fiscalyear();
        }
    }
    start_table($table_style2, 5, 7);
    echo "<tr><td valign=top>";
    // outer table
    echo "<table>";
    bank_accounts_list_row(tr("From Bank Account:"), 'bank_account', null, true);
    amount_row(tr("Amount of Payment:"), 'amount');
    amount_row(tr("Amount of Discount:"), 'discount');
    date_row(tr("Date Paid") . ":", 'DatePaid');
    echo "</table>";
    echo "</td><td valign=top class='tableseparator'>";
    // outer table
    echo "<table>";
    supplier_list_row(tr("Payment To:"), 'supplier_id', null, false, true);
    set_global_supplier($_POST['supplier_id']);
    $supplier_currency = get_supplier_currency($_POST['supplier_id']);
    $bank_currency = get_bank_account_currency($_POST['bank_account']);
    if ($bank_currency != $supplier_currency) {
        exchange_rate_display($bank_currency, $supplier_currency, $_POST['DatePaid']);
    }
    bank_trans_types_list_row(tr("Payment Type:"), 'PaymentType', null);
    ref_row(tr("Reference:"), 'ref', references::get_next(22));
    text_row(tr("Memo:"), 'memo_', null, 52, 50);
    echo "</table>";
    echo "</td></tr>";
    end_table(1);
    // outer table
    submit_center('ProcessSuppPayment', tr("Enter Payment"));
    if ($bank_currency != $supplier_currency) {
        display_note(tr("The amount and discount are in the bank account's currency."), 2, 0);
    }
    end_form();
}
Example #10
0
function voiding_controls()
{
    global $table_style2;
    start_form(false, true);
    start_table($table_style2);
    systypes_list_row(tr("Transaction Type:"), "filterType", null, true);
    text_row(tr("Transaction #:"), 'trans_no', null, 12, 12);
    date_row(tr("Voiding Date:"), 'date_');
    textarea_row(tr("Memo:"), 'memo_', null, 30, 4);
    end_table(1);
    if (!isset($_POST['ProcessVoiding'])) {
        submit_center('ProcessVoiding', tr("Void Transaction"));
    } else {
        display_note(tr("Are you sure you want to void this transaction ? This action cannot be undone."), 0, 1);
        submit_center_first('ConfirmVoiding', tr("Proceed"));
        submit_center_last('CancelVoiding', tr("Cancel"));
    }
    end_form();
}
function viewing_controls()
{
    display_note(tr("Only documents can be printed."));
    start_form(false, true);
    start_table("class='tablestyle_noborder'");
    start_row();
    systypes_list_cells(tr("Type:"), 'filterType', null, true);
    if (!isset($_POST['FromTransNo'])) {
        $_POST['FromTransNo'] = "1";
    }
    if (!isset($_POST['ToTransNo'])) {
        $_POST['ToTransNo'] = "999999";
    }
    ref_cells(tr("from #:"), 'FromTransNo');
    ref_cells(tr("to #:"), 'ToTransNo');
    submit_cells('ProcessSearch', tr("Search"));
    end_row();
    end_table(1);
    end_form();
}
Example #12
0
function edit_allocations_for_transaction($type, $trans_no)
{
    global $systypes_array;
    start_form();
    display_heading(_("Allocation of") . " " . $systypes_array[$_SESSION['alloc']->type] . " # " . $_SESSION['alloc']->trans_no);
    display_heading($_SESSION['alloc']->person_name);
    display_heading2(_("Date:") . " <b>" . $_SESSION['alloc']->date_ . "</b>");
    display_heading2(_("Total:") . " <b>" . price_format(-$_SESSION['alloc']->amount) . "</b>");
    echo "<br>";
    div_start('alloc_tbl');
    if (count($_SESSION['alloc']->allocs) > 0) {
        show_allocatable(true);
        submit_center_first('UpdateDisplay', _("Refresh"), _('Start again allocation of selected amount'), true);
        submit('Process', _("Process"), true, _('Process allocations'), 'default');
        submit_center_last('Cancel', _("Back to Allocations"), _('Abandon allocations and return to selection of allocatable amounts'), 'cancel');
    } else {
        display_note(_("There are no unsettled transactions to allocate."), 0, 1);
        submit_center('Cancel', _("Back to Allocations"), true, _('Abandon allocations and return to selection of allocatable amounts'), 'cancel');
    }
    div_end();
    end_form();
}
Example #13
0
function gl_inquiry_controls()
{
    global $table_style2;
    $dim = get_company_pref('use_dimension');
    start_form();
    //start_table($table_style2);
    start_table("class='tablestyle_noborder'");
    start_row();
    gl_all_accounts_list_cells(tr("Account:"), 'account', null);
    date_cells(tr("from:"), 'TransFromDate', null, -30);
    date_cells(tr("to:"), 'TransToDate');
    submit_cells('Show', tr("Show"));
    end_row();
    if ($dim >= 1) {
        dimensions_list_row(tr("Dimension") . " 1", 'Dimension', null, true, " ", false, 1);
    }
    if ($dim > 1) {
        dimensions_list_row(tr("Dimension") . " 2", 'Dimension2', null, true, " ", false, 2);
    }
    end_table();
    end_form();
}
Example #14
0
function gl_payment_controls()
{
    global $Refs;
    $home_currency = get_company_currency();
    start_form();
    start_outer_table(TABLESTYLE2);
    table_section(1);
    bank_accounts_list_row(_("From Account:"), 'FromBankAccount', null, true);
    bank_balance_row($_POST['FromBankAccount']);
    bank_accounts_list_row(_("To Account:"), 'ToBankAccount', null, true);
    if (!isset($_POST['DatePaid'])) {
        // init page
        $_POST['DatePaid'] = new_doc_date();
        if (!is_date_in_fiscalyear($_POST['DatePaid'])) {
            $_POST['DatePaid'] = end_fiscalyear();
        }
    }
    date_row(_("Transfer Date:"), 'DatePaid', '', true, 0, 0, 0, null, true);
    ref_row(_("Reference:"), 'ref', '', $Refs->get_next(ST_BANKTRANSFER));
    table_section(2);
    $from_currency = get_bank_account_currency($_POST['FromBankAccount']);
    $to_currency = get_bank_account_currency($_POST['ToBankAccount']);
    if ($from_currency != "" && $to_currency != "" && $from_currency != $to_currency) {
        amount_row(_("Amount:"), 'amount', null, null, $from_currency);
        amount_row(_("Bank Charge:"), 'charge', null, null, $from_currency);
        amount_row(_("Incoming Amount:"), 'target_amount', null, '', $to_currency, 2);
    } else {
        amount_row(_("Amount:"), 'amount');
        amount_row(_("Bank Charge:"), 'charge');
    }
    textarea_row(_("Memo:"), 'memo_', null, 40, 4);
    end_outer_table(1);
    // outer table
    submit_center('AddPayment', _("Enter Transfer"), true, '', 'default');
    end_form();
}
Example #15
0
function track_result_row($row)
{
    $a = start_form();
    $a .= "<tr>\n";
    $a .= "<td class=\"cell_value\">" . track_input_text('Ttrack_number', 'Ttrack_number', $row['track_number']) . "</td>\n";
    $a .= "<td class=\"cell_value\">" . track_input_text('Ttitle', 'Ttitle', $row['title']) . "</td>\n";
    $a .= "<td class=\"cell_value\">" . track_input_text('Tduration', 'Tduration', $row['disp_duration']) . "</td>\n";
    $a .= "<td class=\"cell_value\">" . action_button('track_update', ' Update ') . action_button('track_delete', ' Delete ') . "</td>\n";
    $a .= hidden_element('a', 'track_update') . hidden_element('album_id', $row['album_id']) . hidden_element('id', $row['id']) . "\n";
    $a .= "</tr>\n";
    $a .= end_form();
    return $a;
}
Example #16
0
function edit_allocations_for_transaction($type, $trans_no)
{
    global $table_style;
    start_form(false, true);
    display_heading(sprintf(tr("Allocation of %s # %d"), systypes::name($_SESSION['alloc']->type), $_SESSION['alloc']->trans_no));
    display_heading($_SESSION['alloc']->person_name);
    display_heading2(tr("Date:") . " <b>" . $_SESSION['alloc']->date_ . "</b>");
    display_heading2(tr("Total:") . " <b>" . price_format($_SESSION['alloc']->amount) . "</b>");
    echo "<br>";
    if (count($_SESSION['alloc']->allocs) > 0) {
        start_table($table_style);
        $th = array(tr("Transaction Type"), tr("#"), tr("Date"), tr("Due Date"), tr("Amount"), tr("Other Allocations"), tr("This Allocation"), tr("Left to Allocate"), "", "");
        table_header($th);
        $k = $counter = $total_allocated = 0;
        foreach ($_SESSION['alloc']->allocs as $allocn_item) {
            alt_table_row_color($k);
            label_cell(systypes::name($allocn_item->type));
            label_cell(get_trans_view_str($allocn_item->type, $allocn_item->type_no));
            label_cell($allocn_item->date_, "align=right");
            label_cell($allocn_item->due_date, "align=right");
            amount_cell($allocn_item->amount);
            amount_cell($allocn_item->amount_allocated);
            if (!check_num('amount' . $counter)) {
                $_POST['amount' . $counter] = price_format($allocn_item->current_allocated);
            }
            amount_cells(null, 'amount' . $counter, $_POST['amount' . $counter]);
            $un_allocated = round($allocn_item->amount - $allocn_item->amount_allocated, 6);
            hidden("un_allocated" . $counter, $un_allocated);
            amount_cell($un_allocated);
            label_cell("<a href='#' name=Alloc{$counter} onclick='allocate_all(this.name.substr(5));return true;'>" . tr("All") . "</a>");
            label_cell("<a href='#' name=DeAll{$counter} onclick='allocate_none(this.name.substr(5));return true;'>" . tr("None") . "</a>");
            end_row();
            $total_allocated += input_num('amount' . $counter);
            $counter++;
        }
        label_row(tr("Total Allocated"), price_format($total_allocated), "colspan=6 align=right", "nowrap align=right id='total_allocated'");
        if ($_SESSION['alloc']->amount - $total_allocated < 0) {
            $font1 = "<font color=red>";
            $font2 = "</font>";
        } else {
            $font1 = $font2 = "";
        }
        $left_to_allocate = $_SESSION['alloc']->amount - $total_allocated;
        $left_to_allocate = price_format($left_to_allocate);
        label_row(tr("Left to Allocate"), $font1 . $left_to_allocate . $font2, "colspan=6 align=right ", "nowrap align=right id='left_to_allocate'");
        end_table(1);
        hidden('TotalNumberOfAllocs', $counter);
        //		hidden('left_to_allocate', $left_to_allocate);
        submit_center_first('UpdateDisplay', tr("Update"));
        submit('Process', tr("Process"));
    } else {
        display_note(tr("There are no unsettled transactions to allocate."), 0, 1);
    }
    submit_center_last('Cancel', tr("Back to Allocations"));
    end_form();
}
function display_company_edit($selected_id)
{
    global $def_coy, $db_connections, $tb_pref_counter;
    start_form();
    start_table(TABLESTYLE2);
    if ($selected_id != -1) {
        $conn = $db_connections[$selected_id];
        $_POST['name'] = $conn['name'];
        $_POST['host'] = $conn['host'];
        $_POST['dbuser'] = $conn['dbuser'];
        $_POST['dbpassword'] = $conn['dbpassword'];
        $_POST['dbname'] = $conn['dbname'];
        $_POST['tbpref'] = $conn['tbpref'];
        if ($selected_id == $def_coy) {
            $_POST['def'] = true;
        } else {
            $_POST['def'] = false;
        }
        $_POST['dbcreate'] = false;
        hidden('selected_id', $selected_id);
        hidden('tbpref', $_POST['tbpref']);
        hidden('dbpassword', $_POST['dbpassword']);
    } else {
        $_POST['tbpref'] = $tb_pref_counter . "_";
        // Insert the current settings as default
        $conn = $db_connections[user_company()];
        $_POST['name'] = '';
        $_POST['host'] = $conn['host'];
        $_POST['dbuser'] = $conn['dbuser'];
        $_POST['dbpassword'] = $conn['dbpassword'];
        $_POST['dbname'] = $conn['dbname'];
    }
    text_row_ex(_("Company"), 'name', 50);
    if ($selected_id == -1) {
        text_row_ex(_("Host"), 'host', 30, 60);
        text_row_ex(_("Database User"), 'dbuser', 30);
        text_row_ex(_("Database Password"), 'dbpassword', 30);
        text_row_ex(_("Database Name"), 'dbname', 30);
        yesno_list_row(_("Table Pref"), 'tbpref', 1, $_POST['tbpref'], _("None"), false);
    } else {
        label_row(_("Host"), $_POST['host']);
        label_row(_("Database User"), $_POST['dbuser']);
        label_row(_("Database Name"), $_POST['dbname']);
        label_row(_("Table Pref"), $_POST['tbpref']);
    }
    yesno_list_row(_("Default"), 'def', null, "", "", false);
    if ($selected_id == -1) {
        coa_list_row(_("Database Script"), 'coa');
        text_row_ex(_("New script Admin Password"), 'admpassword', 20);
    }
    end_table(1);
    submit_center('save', _("Save"));
    end_form();
}
Example #18
0
            set_focus('name');
        }
        if (!isset($installed_extensions)) {
            $installed_extensions = array();
            update_extensions($installed_extensions);
        }
        subpage_title(_('Company Settings'));
        start_table(TABLESTYLE);
        text_row_ex(_("Company Name:"), 'name', 30);
        text_row_ex(_("Admin Login:"******"Admin Password:"******"Reenter Password:"******"Select Chart of Accounts:"), 'coa');
        languages_list_row(_("Select Default Language:"), 'lang');
        end_table(1);
        submit_center_first('back', _('<< Back'));
        submit_center_last('set_admin', _('Continue >>'));
        break;
    case '6':
        // final screen
        subpage_title(_('SerbizHub Suite ERP has been installed successsfully.'));
        display_note(_('Please do not forget to remove install wizard folder.'));
        session_unset();
        session_destroy();
        hyperlink_no_params($path_to_root . '/index.php', _('Click here to start.'));
        break;
}
hidden('Tests');
hidden('Page');
end_form(1);
end_page(false, false, true);
Example #19
0
//----------------
table_section(2);
table_section_title(_("Dimension Defaults"));
text_row(_("Dimension Required By After:"), 'default_dim_required', $_POST['default_dim_required'], 6, 6, '', "", _("days"));
//---------------
table_section_title(_("Suppliers and Purchasing"));
percent_row(_("Delivery Over-Receive Allowance:"), 'po_over_receive');
percent_row(_("Invoice Over-Charge Allowance:"), 'po_over_charge');
table_section_title(_("Suppliers and Purchasing Defaults"));
gl_all_accounts_list_row(_("Payable Account:"), 'creditors_act', $_POST['creditors_act']);
gl_all_accounts_list_row(_("Purchase Discount Account:"), 'pyt_discount_act', $_POST['pyt_discount_act']);
gl_all_accounts_list_row(_("GRN Clearing Account:"), 'grn_clearing_act', get_post('grn_clearing_act'), true, false, _("No postings on GRN"));
table_section_title(_("Inventory"));
check_row(_("Allow Negative Inventory:"), 'allow_negative_stock', null);
label_row(null, _("Warning:  This may cause a delay in GL postings"), "", "class='stockmankofg' colspan=2");
table_section_title(_("Items Defaults"));
gl_all_accounts_list_row(_("Sales Account:"), 'default_inv_sales_act', $_POST['default_inv_sales_act']);
gl_all_accounts_list_row(_("Inventory Account:"), 'default_inventory_act', $_POST['default_inventory_act']);
// this one is default for items and suppliers (purchase account)
gl_all_accounts_list_row(_("C.O.G.S. Account:"), 'default_cogs_act', $_POST['default_cogs_act']);
gl_all_accounts_list_row(_("Inventory Adjustments Account:"), 'default_adj_act', $_POST['default_adj_act']);
gl_all_accounts_list_row(_("Item Assembly Costs Account:"), 'default_assembly_act', $_POST['default_assembly_act']);
//----------------
table_section_title(_("Manufacturing Defaults"));
text_row(_("Work Order Required By After:"), 'default_workorder_required', $_POST['default_workorder_required'], 6, 6, '', "", _("days"));
//----------------
end_outer_table(1);
submit_center('submit', _("Update"), true, '', 'default');
end_form(2);
//-------------------------------------------------------------------------------------------------
end_page();
Example #20
0
function display_company_edit($selected_id)
{
    global $def_coy, $db_connections, $tb_pref_counter, $table_style2;
    if ($selected_id != -1) {
        $n = $selected_id;
    } else {
        $n = count($db_connections);
    }
    start_form(true, true);
    echo "\n\t\t<script language='javascript'>\n\t\tfunction updateCompany() {\n\t\t\tif (document.forms[0].uploadfile.value!='' && document.forms[0].dbname.value!='') {\n\t\t\t\tdocument.forms[0].action='create_coy.php?c=u&ul=1&id=" . $n . "&fn=' + document.forms[0].uploadfile.value\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdocument.forms[0].action='create_coy.php?c=u&id=" . $n . "&fn=' + document.forms[0].uploadfile.value\n\t\t\t}\n\t\t\tdocument.forms[0].submit()\n\t\t}\n\t\t</script>";
    start_table($table_style2);
    if ($selected_id != -1) {
        $conn = $db_connections[$selected_id];
        $_POST['name'] = $conn['name'];
        $_POST['host'] = $conn['host'];
        $_POST['dbuser'] = $conn['dbuser'];
        $_POST['dbpassword'] = $conn['dbpassword'];
        $_POST['dbname'] = $conn['dbname'];
        if ($selected_id == $def_coy) {
            $_POST['def'] = true;
        } else {
            $_POST['def'] = false;
        }
        $_POST['dbcreate'] = false;
        hidden('selected_id', $selected_id);
        hidden('dbpassword', $_POST['dbpassword']);
    } else {
        text_row_ex(tr("Company"), 'name', 30);
    }
    text_row_ex(tr("Host"), 'host', 30);
    text_row_ex(tr("Database User"), 'dbuser', 30);
    if ($selected_id == -1) {
        text_row_ex(tr("Database Password"), 'dbpassword', 30);
    }
    text_row_ex(tr("Database Name"), 'dbname', 30);
    yesno_list_row(tr("Default"), 'def', null, "", "", false);
    start_row();
    label_cell(tr("Database Script"));
    label_cell("<input name='uploadfile' type='file'>");
    end_row();
    text_row_ex(tr("New script Admin Password"), 'admpassword', 20);
    end_table();
    display_note(tr("Choose from Database scripts in SQL folder. No Datase is created without a script."), 0, 1);
    echo "<center><input onclick='javascript:updateCompany()' type='button' style='width:150' value='" . tr("Save") . "'>";
    end_form();
}
function voiding_controls()
{
    global $selected_id;
    $not_implemented = array(ST_PURCHORDER, ST_SALESORDER, ST_SALESQUOTE, ST_COSTUPDATE);
    start_form();
    start_table(TABLESTYLE_NOBORDER);
    start_row();
    systypes_list_cells(_("Type:"), 'filterType', null, true, $not_implemented);
    if (list_updated('filterType')) {
        $selected_id = -1;
    }
    if (!isset($_POST['FromTransNo'])) {
        $_POST['FromTransNo'] = "1";
    }
    if (!isset($_POST['ToTransNo'])) {
        $_POST['ToTransNo'] = "999999";
    }
    ref_cells(_("from #:"), 'FromTransNo');
    ref_cells(_("to #:"), 'ToTransNo');
    submit_cells('ProcessSearch', _("Search"), '', '', 'default');
    end_row();
    end_table(1);
    $trans_ref = false;
    $sql = get_sql_for_view_transactions($_POST['filterType'], $_POST['FromTransNo'], $_POST['ToTransNo'], $trans_ref);
    if ($sql == "") {
        return;
    }
    $cols = array(_("#") => array('insert' => true, 'fun' => 'view_link'), _("Reference") => array('fun' => 'ref_view'), _("Date") => array('type' => 'date', 'fun' => 'date_view'), _("GL") => array('insert' => true, 'fun' => 'gl_view'), _("Select") => array('insert' => true, 'fun' => 'select_link'));
    $table =& new_db_pager('transactions', $sql, $cols);
    $table->width = "40%";
    display_db_pager($table);
    start_table(TABLESTYLE2);
    if ($selected_id != -1) {
        hidden('trans_no', $selected_id);
        hidden('selected_id', $selected_id);
    } else {
        hidden('trans_no', '');
        $_POST['memo_'] = '';
    }
    label_row(_("Transaction #:"), $selected_id == -1 ? '' : $selected_id);
    date_row(_("Voiding Date:"), 'date_');
    textarea_row(_("Memo:"), 'memo_', null, 30, 4);
    end_table(1);
    if (!isset($_POST['ProcessVoiding'])) {
        submit_center('ProcessVoiding', _("Void Transaction"), true, '', 'default');
    } else {
        if (!exist_transaction($_POST['filterType'], $_POST['trans_no'])) {
            display_error(_("The entered transaction does not exist or cannot be voided."));
            unset($_POST['trans_no']);
            unset($_POST['memo_']);
            unset($_POST['date_']);
            submit_center('ProcessVoiding', _("Void Transaction"), true, '', 'default');
        } else {
            display_warning(_("Are you sure you want to void this transaction ? This action cannot be undone."), 0, 1);
            br();
            submit_center_first('ConfirmVoiding', _("Proceed"), '', true);
            submit_center_last('CancelVoiding', _("Cancel"), '', 'cancel');
        }
    }
    end_form();
}
function display_fiscalyear_edit($selected_id)
{
    global $Mode;
    start_form();
    start_table(TABLESTYLE2);
    $company_year = get_company_pref('f_year');
    $result = get_all_fiscalyears();
    $row_cnt = db_num_rows($result);
    if ($selected_id != -1) {
        if ($Mode == 'Edit') {
            $myrow = get_fiscalyear($selected_id);
            $_POST['from_date'] = sql2date($myrow["begin"]);
            $_POST['to_date'] = sql2date($myrow["end"]);
            $_POST['closed'] = $myrow["closed"];
        }
        if ($row_cnt == 1) {
            date_row(_("Fiscal Year Begin:"), 'from_date', '', null, 0, 0, 1001);
        } else {
            hidden('from_date');
            label_row(_("Fiscal Year Begin:"), $_POST['from_date']);
        }
        hidden('to_date');
        label_row(_("Fiscal Year End:"), $_POST['to_date']);
        if ($myrow["id"] != $company_year) {
            yesno_list_row(_("Is Closed:"), 'closed', null, "", "", false);
        } else {
            hidden('closed');
            label_row(_("Is Closed:"), yesno_value($_POST['closed']));
        }
    } else {
        $begin = next_begin_date();
        if ($begin && $Mode != 'ADD_ITEM') {
            $_POST['from_date'] = $begin;
            $_POST['to_date'] = end_month(add_months($begin, 11));
            $_POST['closed'] = 0;
        }
        hidden('from_date');
        hidden('to_date');
        hidden('closed');
    }
    hidden('selected_id', $selected_id);
    end_table(1);
    submit_add_or_update_center($selected_id == -1, '', 'both');
    end_form();
}
Example #23
0
function display_module_edit($selected_id)
{
    global $installed_modules, $table_style2;
    if ($selected_id != -1) {
        $n = $selected_id;
    } else {
        $n = count($installed_modules);
    }
    start_form(true, true);
    echo "\n\t\t<script language='javascript'>\n\t\tfunction updateModule() {\n\t\t\tdocument.forms[0].action='inst_module.php?c=u&id=" . $n . "'\n\t\t\tdocument.forms[0].submit()\n\t\t}\n\t\t</script>";
    start_table($table_style2);
    if ($selected_id != -1) {
        $mod = $installed_modules[$selected_id];
        $_POST['tab'] = $mod['tab'];
        $_POST['name'] = $mod['name'];
        $_POST['path'] = $mod['path'];
        $_POST['filename'] = $mod['filename'];
        hidden('selected_id', $selected_id);
        hidden('filename', $_POST['filename']);
    }
    tab_list_row(tr("Menu Tab"), 'tab', null);
    text_row_ex(tr("Name"), 'name', 30);
    text_row_ex(tr("Folder"), 'path', 20);
    label_row(tr("Module File"), "<input name='uploadfile' type='file'>");
    label_row(tr("SQL File"), "<input name='uploadfile2' type='file'>");
    end_table(0);
    display_note(tr("Select your module PHP file from your local harddisk."), 0, 1);
    echo "<center><input onclick='javascript:updateModule()' type='button' style='width:150' value='" . tr("Save") . "'>";
    end_form();
}
function display_allocatable_transactions()
{
    global $table_style, $path_to_root;
    start_form();
    /* show all outstanding receipts and credits to be allocated */
    /*Clear any previous allocation records */
    if (isset($_SESSION['alloc'])) {
        unset($_SESSION['alloc']->allocs);
        unset($_SESSION['alloc']);
    }
    if (!isset($_POST['supplier_id'])) {
        $_POST['supplier_id'] = get_global_supplier();
    }
    echo "<center>" . tr("Select a Supplier: ") . "&nbsp;&nbsp;";
    supplier_list('supplier_id', $_POST['supplier_id'], true, true);
    echo "<br>";
    check(tr("Show Settled Items:"), 'ShowSettled', null, true);
    echo "</center><br><br>";
    set_global_supplier($_POST['supplier_id']);
    if (isset($_POST['supplier_id']) && $_POST['supplier_id'] == reserved_words::get_all()) {
        unset($_POST['supplier_id']);
    }
    $settled = false;
    if (check_value('ShowSettled')) {
        $settled = true;
    }
    $supplier_id = null;
    if (isset($_POST['supplier_id'])) {
        $supplier_id = $_POST['supplier_id'];
    }
    $trans_items = get_allocatable_from_supp_transactions($supplier_id, $settled);
    start_table($table_style);
    if (!isset($_POST['supplier_id'])) {
        $th = array(tr("Transaction Type"), tr("#"), tr("Reference"), tr("Date"), tr("Supplier"), tr("Currency"), tr("Total"), tr("Left To Allocate"));
    } else {
        $th = array(tr("Transaction Type"), tr("#"), tr("Reference"), tr("Date"), tr("Total"), tr("Left To Allocate"));
    }
    table_header($th);
    $k = 0;
    //row colour counter
    $has_settled_items = false;
    while ($myrow = db_fetch($trans_items)) {
        if ($myrow["settled"] == 1) {
            start_row("class='settledbg'");
            $has_settled_items = true;
        } else {
            alt_table_row_color($k);
        }
        label_cell(systypes::name($myrow["type"]));
        label_cell(get_trans_view_str($myrow["type"], $myrow["trans_no"]));
        label_cell($myrow["reference"]);
        label_cell(sql2date($myrow["tran_date"]));
        if (!isset($_POST['supplier_id'])) {
            label_cell($myrow["supp_name"]);
            label_cell($myrow["curr_code"]);
        }
        amount_cell(-$myrow["Total"]);
        amount_cell(-$myrow["Total"] - $myrow["alloc"]);
        label_cell("<a href='{$path_to_root}/purchasing/allocations/supplier_allocate.php?trans_no=" . $myrow["trans_no"] . "&trans_type=" . $myrow["type"] . "'>" . tr("Allocate") . "</a>");
        end_row();
    }
    end_table();
    if ($has_settled_items) {
        display_note(tr("Marked items are settled."), 0, 1, "class='settledfg'");
    }
    if (db_num_rows($trans_items) == 0) {
        display_note(tr("There are no allocations to be done."), 1, 2);
    }
    end_form();
}
Example #25
0
function main_screen($mode = 'reg')
{
    global $month_names;
    $page_title = "Statistic Center";
    $page_detail = "Please define the date ranges and other options below.<br>Note: The statistics generated are based on the information currently held in the database, they do not take into account pruned forums or delete posts, etc.";
    if ($mode == 'reg') {
        $form_code = 'show_reg';
        $table = 'Registration Statistics<br />';
    } else {
        if ($mode == 'rate') {
            $form_code = 'show_rate';
            $table = 'Rating Statistics';
        } else {
            if ($mode == 'post') {
                $form_code = 'show_post';
                $table = 'Post Statistics';
            } else {
                if ($mode == 'msg') {
                    $form_code = 'show_msg';
                    $table = 'PM Statistics';
                } else {
                    if ($mode == 'torr') {
                        $form_code = 'show_torr';
                        $table = 'Torrent Statistics';
                    } else {
                        if ($mode == 'bans') {
                            $form_code = 'show_bans';
                            $table = 'Ban Statistics';
                        } else {
                            if ($mode == 'comm') {
                                $form_code = 'show_comm';
                                $table = 'Comment Statistics';
                            } else {
                                if ($mode == 'new') {
                                    $form_code = 'show_new';
                                    $table = 'News Statistics';
                                } else {
                                    if ($mode == 'poll') {
                                        $form_code = 'show_poll';
                                        $table = 'Polls Statistics';
                                    } else {
                                        if ($mode == 'rqst') {
                                            $form_code = 'show_rqst';
                                            $table = 'Request Statistics';
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    $old_date = getdate(time() - 3600 * 24 * 90);
    $new_date = getdate(time() + 3600 * 24);
    // -----------------------------------------
    $html = "<table id=torrenttable border=1><tr><td>{$table}</td></tr>";
    $html .= "<tr><td>{$page_title}<br />{$page_detail}</td></tr>";
    $html .= start_form(array(1 => array('code', $form_code), 2 => array('act', 'stats')));
    // -----------------------------------------
    // Naaaaaaaaaaaah!!
    // $td_header = array();
    // $td_header[] = array( "&nbsp;"  , "40%" );
    // $td_header[] = array( "&nbsp;"  , "60%" );
    // -----------------------------------------
    $html .= "<tr><td><br /><b>Date From</b>" . form_dropdown("from_month", make_month(), $old_date['mon']) . '&nbsp;&nbsp;' . form_dropdown("from_day", make_day(), $old_date['mday']) . '&nbsp;&nbsp;' . form_dropdown("from_year", make_year(), $old_date['year']) . "<br /></td></tr>";
    $html .= "<tr><td><br /><b>Date To</b>" . form_dropdown("to_month", make_month(), $new_date['mon']) . '&nbsp;&nbsp;' . form_dropdown("to_day", make_day(), $new_date['mday']) . '&nbsp;&nbsp;' . form_dropdown("to_year", make_year(), $new_date['year']) . "<br /></td></tr>";
    if ($mode != 'views') {
        $html .= "<tr><td><br /><b>Time scale</b>" . form_dropdown("timescale", array(0 => array('daily', 'Daily'), 1 => array('weekly', 'Weekly'), 2 => array('monthly', 'Monthly'))) . "<br /></td></tr>";
    }
    $html .= "<tr><td><br /><b>Result Sorting</b>" . form_dropdown("sortby", array(0 => array('asc', 'Ascending - Oldest dates first'), 1 => array('desc', 'Descending - Newest dates first')), 'desc') . "<br /></td></tr>";
    $html .= end_form("Show") . "</table>";
    print $html;
}
Example #26
0
function display_fiscalyear_edit($selected_id)
{
    global $Mode;
    start_form();
    start_table(TABLESTYLE2);
    if ($selected_id != -1) {
        if ($Mode == 'Edit') {
            $myrow = get_fiscalyear($selected_id);
            $_POST['from_date'] = sql2date($myrow["begin"]);
            $_POST['to_date'] = sql2date($myrow["end"]);
            $_POST['closed'] = $myrow["closed"];
        }
        hidden('from_date');
        hidden('to_date');
        label_row(_("Fiscal Year Begin:"), $_POST['from_date']);
        label_row(_("Fiscal Year End:"), $_POST['to_date']);
    } else {
        $begin = next_begin_date();
        if ($begin && $Mode != 'ADD_ITEM') {
            $_POST['from_date'] = $begin;
            $_POST['to_date'] = end_month(add_months($begin, 11));
        }
        date_row(_("Fiscal Year Begin:"), 'from_date', '', null, 0, 0, 1001);
        date_row(_("Fiscal Year End:"), 'to_date', '', null, 0, 0, 1001);
    }
    hidden('selected_id', $selected_id);
    yesno_list_row(_("Is Closed:"), 'closed', null, "", "", false);
    end_table(1);
    submit_add_or_update_center($selected_id == -1, '', 'both');
    end_form();
}
Example #27
0
function main()
{
    if (strcmp('4.1.0', phpversion()) > 0) {
        die("Error: PHP version 4.1.0 or above required!");
    }
    if (!($file = fopen("search.idx", "rb"))) {
        die("Error: Search index file could NOT be opened!");
    }
    if (readHeader($file) != "DOXS") {
        die("Error: Header of index file is invalid!");
    }
    $query = "";
    if (array_key_exists("query", $_GET)) {
        $query = $_GET["query"];
    }
    end_form($query);
    echo "&nbsp;\n<div class=\"searchresults\">\n";
    $results = array();
    $requiredWords = array();
    $forbiddenWords = array();
    $foundWords = array();
    $word = strtok($query, " ");
    while ($word) {
        if ($word[0] == '+') {
            $word = substr($word, 1);
            $requiredWords[] = $word;
        }
        if ($word[0] == '-') {
            $word = substr($word, 1);
            $forbiddenWords[] = $word;
        }
        if (!in_array($word, $foundWords)) {
            $foundWords[] = $word;
            search($file, strtolower($word), $results);
        }
        $word = strtok(" ");
    }
    $docs = array();
    combine_results($results, $docs);
    // filter out documents with forbidden word or that do not contain
    // required words
    $filteredDocs = filter_results($docs, $requiredWords, $forbiddenWords);
    // sort the results based on rank
    $sorted = array();
    sort_results($filteredDocs, $sorted);
    // report results to the user
    report_results($sorted);
    echo "</div>\n";
    fclose($file);
}
Example #28
0
function gl_inquiry_controls()
{
    $dim = get_company_pref('use_dimension');
    start_form();
    start_table(TABLESTYLE_NOBORDER);
    start_row();
    gl_all_accounts_list_cells(_("Account:"), 'account', null, false, false, _("All Accounts"));
    date_cells(_("from:"), 'TransFromDate', '', null, -30);
    date_cells(_("to:"), 'TransToDate');
    end_row();
    end_table();
    start_table(TABLESTYLE_NOBORDER);
    start_row();
    if ($dim >= 1) {
        dimensions_list_cells(_("Dimension") . " 1:", 'Dimension', null, true, " ", false, 1);
    }
    if ($dim > 1) {
        dimensions_list_cells(_("Dimension") . " 2:", 'Dimension2', null, true, " ", false, 2);
    }
    small_amount_cells(_("Amount min:"), 'amount_min', null, " ");
    small_amount_cells(_("Amount max:"), 'amount_max', null, " ");
    submit_cells('Show', _("Show"), '', '', 'default');
    end_row();
    end_table();
    echo '<hr>';
    end_form();
}
Example #29
0
            $_POST['loc_code'] = $myrow["loc_code"];
            $_POST['component'] = $myrow["component"];
            // by Tom Moulton
            $_POST['workcentre_added'] = $myrow["workcentre_added"];
            $_POST['quantity'] = number_format2($myrow["quantity"], get_qty_dec($myrow["component"]));
            label_row(_("Component:"), $myrow["component"] . " - " . $myrow["description"]);
        }
        hidden('selected_id', $selected_id);
    } else {
        start_row();
        label_cell(_("Component:"), "class='label'");
        echo "<td>";
        echo stock_component_items_list('component', $selected_parent, null, false, true);
        if (get_post('_component_update')) {
            $Ajax->activate('quantity');
        }
        echo "</td>";
        end_row();
    }
    hidden('stock_id', $selected_parent);
    locations_list_row(_("Location to Draw From:"), 'loc_code', null);
    workcenter_list_row(_("Work Centre Added:"), 'workcentre_added', null);
    $dec = get_qty_dec(get_post('component'));
    $_POST['quantity'] = number_format2(input_num('quantity', 1), $dec);
    qty_row(_("Quantity:"), 'quantity', null, null, null, $dec);
    end_table(1);
    submit_add_or_update_center($selected_id == -1, '', 'both');
    end_form();
}
// ----------------------------------------------------------------------------------
end_page();
Example #30
0
function display_language_edit($selected_id)
{
    global $installed_languages, $dflt_lang;
    if ($selected_id == -1) {
        $n = count($installed_languages);
    } else {
        $n = $selected_id;
    }
    start_form(true);
    start_table(TABLESTYLE2);
    if ($selected_id != -1) {
        $lang = $installed_languages[$n];
        $_POST['code'] = $lang['code'];
        $_POST['name'] = $lang['name'];
        $_POST['encoding'] = $lang['encoding'];
        if (isset($lang['rtl']) && $lang['rtl'] === true) {
            $_POST['rtl'] = $lang['rtl'];
        } else {
            $_POST['rtl'] = false;
        }
        $_POST['dflt'] = $dflt_lang == $lang['code'];
        hidden('selected_id', $selected_id);
    }
    text_row_ex(_("Language Code"), 'code', 20);
    text_row_ex(_("Language Name"), 'name', 20);
    text_row_ex(_("Encoding"), 'encoding', 20);
    yesno_list_row(_("Right To Left"), 'rtl', null, "", "", false);
    yesno_list_row(_("Default Language"), 'dflt', null, "", "", false);
    file_row(_("Language File") . " (PO)", 'uploadfile');
    file_row(_("Language File") . " (MO)", 'uploadfile2');
    end_table(0);
    display_note(_("Select your language files from your local harddisk."), 0, 1);
    submit_add_or_update_center(false, '', 'both');
    end_form();
}