Example #1
0
    }
    return true;
}
//--------------------------------------------------------------------------------------
if (isset($_POST['delete'])) {
    if (can_delete($selected_account)) {
        delete_gl_account($selected_account);
        meta_forward($_SERVER['PHP_SELF']);
    }
}
//-------------------------------------------------------------------------------------
start_form();
if (db_has_gl_accounts()) {
    echo "<center>";
    echo tr("Select an Account:") . "&nbsp;";
    gl_all_accounts_list('AccountList', null);
    echo "&nbsp;";
    submit('Select', tr("Edit Account"));
    echo "</center>";
}
hyperlink_no_params($_SERVER['PHP_SELF'], tr("New Account"));
br(1);
start_table($table_style2);
if ($selected_account != "") {
    //editing an existing account
    $myrow = get_gl_account($selected_account);
    $_POST['account_code'] = $myrow["account_code"];
    $_POST['account_code2'] = $myrow["account_code2"];
    $_POST['account_name'] = $myrow["account_name"];
    $_POST['account_type'] = $myrow["account_type"];
    $_POST['tax_code'] = $myrow["tax_code"];
 function gl_all_accounts_list_cells($label, $name, $selected_id = null, $skip_bank_accounts = false, $cells = false, $all_option = false, $submit_on_change = false, $all = false)
 {
     $controls = gl_all_accounts_list($name, $selected_id, $skip_bank_accounts, $cells, $all_option, $submit_on_change, $all);
     View::get()->addComboControls($label, $controls);
 }