Esempio n. 1
0
            echo '<div class="a-alert">' . $LANG['no_pmtsplans_yet'] . '</div>';
        }
        break;
        /** VIEW INVOICE */
    /** VIEW INVOICE */
    case 'invoice_view':
        if (!ab_to(array('payments' => 'view'))) {
            die;
        }
        $csrf = \site\utils::str_random(10);
        echo '<div class="title">

<h2>' . $LANG['pmts_viewinv_title'] . '</h2>

<div style="float:right; margin: 0 2px 0 0;">';
        if (isset($_GET['id']) && ($invoice_exists = \query\payments::invoice_exists($_GET['id']))) {
            $info = \query\payments::invoice_infos($_GET['id']);
            if (ab_to(array('payments' => 'edit'))) {
                echo '<div class="options">
<a href="#" class="btn">' . $LANG['options'] . '</a>
<ul>';
                if ($GLOBALS['me']->is_admin) {
                    echo '<li><a href="?route=suggestions.php&amp;action=delete&amp;id=' . $_GET['id'] . '&amp;token=' . $csrf . '" data-delete-msg="' . $LANG['delete_msg'] . '">' . $LANG['delete'] . '</a></li>';
                }
                if ($info->paid) {
                    echo '<li><a href="?route=payments.php&amp;action=list&amp;type=unpaid&amp;id=' . $_GET['id'] . '&amp;token=' . $csrf . '">' . $LANG['set_as_unpaid'] . '</a></li>';
                } else {
                    echo '<li><a href="?route=payments.php&amp;action=list&amp;type=paid&amp;id=' . $_GET['id'] . '&amp;token=' . $csrf . '">' . $LANG['set_as_paid'] . '</a></li>';
                }
                if ($info->delivered) {
                    echo '<li><a href="?route=payments.php&amp;action=list&amp;type=undelivered&amp;id=' . $_GET['id'] . '&amp;token=' . $csrf . '">' . $LANG['set_as_undelivered'] . '</a></li>';