예제 #1
0
    ob_end_flush();
    cc_core_rebill($vars['paysys_id'], $vars['date'], $from_cron = false);
    /// next
    $vars['date'] = date('Y-m-d', strtotime($vars['date']) + 3600 * 24);
    if ($vars['date'] > $vars['date2']) {
        print "<font size=3>Rebilling Finished! <a href='rebill.php'>Back to the form</a></font>";
        $t->display('admin/footer.inc.html');
        return;
    }
    $d = strftime($config['date_format'], strtotime($vars['date']));
    print <<<CUT
\t<form method=post>
\t<input type=submit name=confirm value="Process next date[{$d}]" />
\t<input type=hidden name=date value='{$vars['date']}' />
\t<input type=hidden name=date1 value='{$vars['date1']}' />
\t<input type=hidden name=date2 value='{$vars['date2']}' />
\t<input type=hidden name=paysys_id value='{$vars['paysys_id']}' />
\t</form>
CUT;
    $t->display('admin/footer.inc.html');
}
$vars = get_input_vars();
if ($vars['date1'] && $vars['date2'] && $vars['paysys_id']) {
    if ($vars['confirm']) {
        do_rebill($vars);
    } else {
        display_confirmation($vars);
    }
} else {
    display_form();
}
예제 #2
0
            $options .= "<option value='{$p}'>{$p}</option>\n";
        }
        $dat = htmlentities($vars['dat']);
        print "<form method='post' action='rebill_log.php'>\n\t<select name='paysys_id'>\n\t<option value=''>*** Select a Payment System to continue ***</option>\n\t{$options}</select> <br />\n\t<label><input type='checkbox' name='repeat_declined' value='1' />\n\tRe-process payments that were marked as declined\n\t</label><br />\n\t<input type='submit' value='Continue'>\n\t<input type='hidden' name='dat' value='{$dat}'>\n\t<input type='hidden' name='do' value='rebill'>\n\t</form>\n\t";
    } else {
        // do rebill
        print "\n\t\t<h2>Manual CC Rebill {$hdat} - {$vars['paysys_id']}</h2>";
        print "<p><b>Please do not stop/exit your browser, do not run other payment processes until this process is finished!</b></p>";
        for ($i = 0; $i < 100; $i++) {
            print "          \n";
        }
        // to flush browser/apache buffer for sure
        print " Rebilling Process started at " . strftime($config['time_format']) . "....<br />\n";
        ob_end_flush();
        $dat = date('Y-m-d', strtotime($vars['dat']));
        $was = $db->query_one("SELECT COUNT(*) FROM {$db->config[prefix]}rebill_log");
        cc_core_rebill($vars['paysys_id'], $dat, $from_cron = false, intval($vars['repeat_declined']));
        $now = $db->query_one("SELECT COUNT(*) FROM {$db->config[prefix]}rebill_log");
        $added = $now - $was;
        print " Rebilling Process finished at " . strftime($config['time_format']) . ".<br />\n\t\t <b>{$added}</b> transactions processed. <br />\n";
        print "<br /><a href='rebill_log.php?do=rebill_stats'>Go back to Rebilling Stats</a>";
    }
    $t->display('admin/footer.inc.html');
}
if ($_REQUEST['do'] == 'rebill_stats') {
    do_stats();
} elseif ($_REQUEST['do'] == 'rebill') {
    do_rebill();
} else {
    do_logs();
}