Ejemplo n.º 1
0
if ($_REQUEST["account"] || $_REQUEST["ref"]) {
    if ($vline) {
        $viewline = $vline;
    } else {
        $viewline = 20;
    }
    $acct = new Account($db);
    if ($_GET["account"]) {
        $result = $acct->fetch($_GET["account"]);
    }
    if ($_GET["ref"]) {
        $result = $acct->fetch(0, $_GET["ref"]);
        $_GET["account"] = $acct->id;
    }
    // Onglets
    $head = bank_prepare_head($acct);
    dol_fiche_head($head, 'cash', $langs->trans("FinancialAccount"), 0, 'account');
    print '<table class="border" width="100%">';
    $linkback = '<a href="' . DOL_URL_ROOT . '/compta/bank/index.php">' . $langs->trans("BackToList") . '</a>';
    // Ref
    print '<tr><td width="25%">' . $langs->trans("Ref") . '</td>';
    print '<td colspan="3">';
    print $form->showrefnav($acct, 'ref', $linkback, 1, 'ref');
    print '</td></tr>';
    // Label
    print '<tr><td>' . $langs->trans("Label") . '</td>';
    print '<td colspan="3">' . $acct->label . '</td></tr>';
    print '</table>';
    dol_fiche_end();
    $solde = $acct->solde(0);
    /*
Ejemplo n.º 2
0
            }
            Header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
            exit;
        }
    }
}
/*
 * View
 */
llxHeader();
$form = new Form($db);
if ($id > 0 || !empty($ref)) {
    if ($object->fetch($id, $ref)) {
        $upload_dir = $conf->bank->dir_output . '/' . $object->ref;
        // Onglets
        $head = bank_prepare_head($object);
        dol_fiche_head($head, 'document', $langs->trans("FinancialAccount"), 0, 'account');
        // Construit liste des fichiers
        $filearray = dol_dir_list($upload_dir, "files", 0, '', '\\.meta$', $sortfield, strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC, 1);
        $totalsize = 0;
        foreach ($filearray as $key => $file) {
            $totalsize += $file['size'];
        }
        print '<table class="border"width="100%">';
        // Ref
        // Ref
        print '<tr><td valign="top" width="25%">' . $langs->trans("Ref") . '</td>';
        print '<td colspan="3">';
        print $form->showrefnav($object, 'ref', '', 1, 'ref');
        print '</td></tr>';
        // Label
Ejemplo n.º 3
0
    print '</form>';
} else {
    if (($_GET["id"] || $_GET["ref"]) && $action != 'edit') {
        $account = new Account($db);
        if ($_GET["id"]) {
            $account->fetch($_GET["id"]);
        }
        if ($_GET["ref"]) {
            $account->fetch(0, $_GET["ref"]);
            $_GET["id"] = $account->id;
        }
        /*
         * Affichage onglets
         */
        // Onglets
        $head = bank_prepare_head($account);
        dol_fiche_head($head, 'bankname', $langs->trans("FinancialAccount"), 0, 'account');
        /*
         * Confirmation to delete
         */
        if ($action == 'delete') {
            print $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $account->id, $langs->trans("DeleteAccount"), $langs->trans("ConfirmDeleteAccount"), "confirm_delete");
        }
        print '<table class="border" width="100%">';
        $linkback = '<a href="' . DOL_URL_ROOT . '/compta/bank/index.php">' . $langs->trans("BackToList") . '</a>';
        // Ref
        print '<tr><td width="25%">' . $langs->trans("Ref") . '</td>';
        print '<td colspan="3">';
        print $form->showrefnav($account, 'ref', $linkback, 1, 'ref');
        print '</td></tr>';
        // Label