예제 #1
0
function catvbs_ProcessHash($hash)
{
    global $billing;
    $alterconf = rcms_parse_ini_file(CONFIG_PATH . "catv.ini");
    $query = "SELECT `id`,`summ`,`login`,`address` from `catv_bankstaparsed` WHERE `hash`='" . $hash . "' AND `state`='0' AND `login` !=''";
    $allinprocessed = simple_queryall($query);
    if (!empty($allinprocessed)) {
        log_register("CATV_BANKSTA PROCESSING " . $hash . " START");
        foreach ($allinprocessed as $io => $eachrow) {
            //setting payment variables
            $cash = $eachrow['summ'];
            $note = mysql_real_escape_string("CATV_BANKSTA:" . $eachrow['id']);
            $month_detect = catvbs_MonthDetect($eachrow['address']);
            if ($month_detect) {
                $target_month = $month_detect;
            } else {
                $target_month = date("m");
            }
            $target_year = date("Y");
            $curdate = curdatetime();
            // standalone user cash push
            //zb_CashAdd($eachrow['login'], $cash, $operation, $cashtype, $note);
            //deb('DEBUG CATV adding cash'.$eachrow['login']);
            catv_CashAdd($eachrow['login'], $curdate, $cash, $target_month, $target_year, $target_month, $target_year, $note);
            simple_update_field('catv_bankstaparsed', 'state', '1', "WHERE `id`='" . $eachrow['id'] . "'");
            // end of processing without linking
        }
        log_register("CATV_BANKSTA PROCESSING " . $hash . " END");
    } else {
        log_register("CATV_BANKSTA PROCESSING " . $hash . " EMPTY");
    }
}
예제 #2
0
<?php

// check for right of current admin on this module
if (cfr('CATVCASH')) {
    catv_GlobalControlsShow();
    if (wf_CheckGet(array('userid'))) {
        $userid = $_GET['userid'];
        // if payment post received
        if (wf_CheckPost(array('createpayment', 'newpayment', 'optype'))) {
            //just adding cash
            if ($_POST['optype'] == 'add') {
                catv_CashAdd($userid, $_POST['date'], $_POST['newpayment'], $_POST['from_month'], $_POST['from_year'], $_POST['to_month'], $_POST['to_year'], $_POST['notes']);
            }
            //correcting saldo
            if ($_POST['optype'] == 'corr') {
                catv_CashCorrect($userid, $_POST['date'], $_POST['newpayment'], $_POST['from_month'], $_POST['from_year'], $_POST['to_month'], $_POST['to_year'], $_POST['notes']);
            }
            //mock payment
            if ($_POST['optype'] == 'mock') {
                catv_CashMock($userid, $_POST['date'], $_POST['newpayment'], $_POST['from_month'], $_POST['from_year'], $_POST['to_month'], $_POST['to_year'], $_POST['notes']);
            }
            rcms_redirect("?module=catv_addcash&userid=" . $userid);
        }
        if (wf_CheckPost(array('createpayment', 'optype'))) {
            //set payment may be zero
            if ($_POST['optype'] == 'set') {
                if (isset($_POST['newpayment'])) {
                    catv_CashSet($userid, $_POST['date'], $_POST['newpayment'], $_POST['from_month'], $_POST['from_year'], $_POST['to_month'], $_POST['to_year'], $_POST['notes']);
                }
            }
            rcms_redirect("?module=catv_addcash&userid=" . $userid);