Exemplo n.º 1
0
             $newcredit = $change_prices[$_POST['newtariff']] + $user_credit;
             billing_setcredit($user_login, $newcredit);
             // check for current credit expirity - added in 0.5.7
             // without this check this conflicts with SC_ module
             if (!$user_credit_expire) {
                 //set credit expire date for month from this moment
                 $timestamp = time();
                 $monthOffset = $timestamp + 2678400;
                 // 31 days in seconds
                 $creditend = date("Y-m-d", $monthOffset);
                 billing_setcreditexpire($user_login, $creditend);
             }
         }
     }
     //TC change fee anyway
     zbs_PaymentLog($user_login, '-' . $change_prices[$_POST['newtariff']], $tc_cashtypeid, "TCHANGE:" . $_POST['newtariff']);
     billing_addcash($user_login, '-' . $change_prices[$_POST['newtariff']]);
     //nm set tariff routine
     $nextMonthTc = true;
     if (isset($us_config['TC_RIGHTNOW'])) {
         if ($us_config['TC_RIGHTNOW']) {
             $nextMonthTc = false;
         }
     }
     if ($nextMonthTc) {
         billing_settariffnm($user_login, mysql_real_escape_string($_POST['newtariff']));
     } else {
         billing_settariff($user_login, mysql_real_escape_string($_POST['newtariff']));
     }
     rcms_redirect("index.php");
 } else {
Exemplo n.º 2
0
             show_window('', zbs_ShowEnableReminderForm());
         } else {
             $license_text = __('Wrong mobile format');
             show_window(__("Reminder"), $license_text);
         }
     } else {
         $license_text = __("You can't enable payments sms reminder") . "." . " " . __("Your have empty mobile") . ".";
         show_window(__("Reminder"), $license_text);
     }
 }
 //catch POST's parametrs
 if (isset($_POST['setremind'])) {
     if (isset($_POST['agree'])) {
         stg_add_user_tag($user_login, $tagid);
         if ($forceFee) {
             zbs_PaymentLog($user_login, '-' . $rr_price, $rr_cashtypeid, "REMINDER");
             billing_addcash($user_login, '-' . $rr_price);
         }
         rcms_redirect("?module=reminder");
     } else {
         show_window(__('Sorry'), __('You must accept our policy'));
     }
 }
 if (isset($_POST['deleteremind'])) {
     if ($turnOffable) {
         if (isset($_POST['agree'])) {
             stg_del_user_tagid($user_login, $tagid);
             rcms_redirect("?module=reminder");
         } else {
             show_window(__('Sorry'), __('You must accept our policy'));
         }
Exemplo n.º 3
0
 $usercash = zbs_CashGetUserBalance($user_login);
 $user_tariff = $userdata['Tariff'];
 $passive_current = $userdata['Passive'];
 //check is tariff allowed?
 if (in_array($user_tariff, $allowed_tariffs)) {
     //is user really active now?
     if ($usercash >= 0) {
         //check for prevent dual freeze
         if ($passive_current != '1') {
             // freezing subroutine
             if (isset($_POST['dofreeze'])) {
                 if (isset($_POST['afagree'])) {
                     //all ok, lets freeze account
                     billing_freeze($user_login);
                     //push cash fee anyway
                     zbs_PaymentLog($user_login, '-' . $freezeprice, $af_cahtypeid, "AFFEE");
                     billing_addcash($user_login, '-' . $freezeprice);
                     rcms_redirect("index.php");
                 } else {
                     show_window(__('Error'), __('You must accept our policy'));
                 }
             } else {
                 //show some forms and notices
                 $af_message = __('Service "account freeze" will allow you to suspend the charge of the monthly fee during your long absence - such as holidays or vacations. The cost of this service is:') . ' ';
                 $af_message .= la_tag('b') . $freezeprice . ' ' . $af_currency . la_tag('b', true) . '. ';
                 $af_message .= __('Be aware that access to the network will be limited to immediately after you confirm your desire to freeze the account. To unfreeze the account you need to contact the nearest office.');
                 // terms of service
                 show_window(__('Account freezing'), $af_message);
                 //account freezing form
                 $inputs = la_CheckInput('afagree', __('I am sure that I am an adult and have read everything that is written above'), false, false);
                 $inputs .= la_HiddenInput('dofreeze', 'true');
Exemplo n.º 4
0
/**
 * Sets credit for user, logs it, sets expire date and redirects in main profile
 * 
 * @param string $user_login
 * @param float  $tariffprice
 * @param int    $sc_price
 * @param string $scend
 * @param int $sc_cashtypeid
 * 
 *  @return void
 */
function zbs_CreditDoTheCredit($user_login, $tariffprice, $sc_price, $scend, $sc_cashtypeid)
{
    zbs_CreditLogPush($user_login);
    billing_setcredit($user_login, $tariffprice + $sc_price);
    billing_setcreditexpire($user_login, $scend);
    zbs_PaymentLog($user_login, '-' . $sc_price, $sc_cashtypeid, "SCFEE");
    billing_addcash($user_login, '-' . $sc_price);
    show_window('', __('Now you have a credit'));
    rcms_redirect("index.php");
}
Exemplo n.º 5
0
/**
 * Marks payment card ad used in database and pushes its price to user account
 * 
 * @global string $user_ip
 * @global string $user_login
 * @param string $cardnumber
 */
function zbs_PaycardUse($cardnumber)
{
    global $user_ip;
    global $user_login;
    $cardnumber = vf($cardnumber);
    $us_config = zbs_LoadConfig();
    $carddata = zbs_PaycardGetParams($cardnumber);
    $cardcash = $carddata['cash'];
    $ctime = curdatetime();
    $carduse_q = "UPDATE `cardbank` SET\n        `usedlogin` = '" . $user_login . "',\n        `usedip` = '" . $user_ip . "',\n        `usedate`= '" . $ctime . "',\n        `used`='1'\n         WHERE `serial` ='" . $cardnumber . "';\n        ";
    nr_query($carduse_q);
    zbs_PaymentLog($user_login, $cardcash, $us_config['PC_CASHTYPEID'], "CARD:" . $cardnumber);
    billing_addcash($user_login, $cardcash);
    rcms_redirect("index.php");
}