$tariff = $_POST['newtariff']; if (!isset($_POST['nextmonth'])) { $billing->settariff($login, $tariff); log_register('CHANGE Tariff (' . $login . ') ON `' . $tariff . '`'); //optional user reset if ($alter_conf['TARIFFCHGRESET']) { $billing->resetuser($login); log_register('RESET User (' . $login . ')'); } } else { $billing->settariffnm($login, $tariff); log_register('CHANGE TariffNM (' . $login . ') ON `' . $tariff . '`'); } //auto credit option handling if ($alter_conf['TARIFFCHGAUTOCREDIT']) { $newtariffprice = zb_TariffGetPrice($tariff); $billing->setcredit($login, $newtariffprice); log_register("CHANGE AutoCredit (" . $login . ") ON `" . $newtariffprice . '`'); } if (isset($alter_conf['SIGNUP_PAYMENTS']) && !empty($alter_conf['SIGNUP_PAYMENTS'])) { if (isset($_POST['charge_signup_price'])) { $has_paid = zb_UserGetSignupPricePaid($login); $old_price = zb_UserGetSignupPrice($login); $new_price = zb_TariffGetAllSignupPrices(); if (!isset($new_price[$tariff])) { zb_TariffCreateSignupPrice($tariff, 0); $new_price = zb_TariffGetAllSignupPrices(); } if ($new_price[$tariff] >= $has_paid) { $cash = $old_price - $new_price[$tariff]; zb_UserChangeSignupPrice($login, $new_price[$tariff]);
<?php $result = ''; if (cfr('USERPROFILE')) { if (wf_CheckGet(array('tariff'))) { $tariffName = mysql_real_escape_string($_GET['tariff']); $tariffNameRaw = $_GET['tariff']; $tariffInfo = ''; if ($tariffName == '*_NO_TARIFF_*') { $messages = new UbillingMessageHelper(); $tariffInfo = $messages->getStyledMessage(__('No tariff'), 'warning'); } else { $tariffPrice = zb_TariffGetPrice($tariffNameRaw); $tariffPeriods = zb_TariffGetPeriodsAll(); $tariffSpeeds = zb_TariffGetAllSpeeds(); $speedDown = isset($tariffSpeeds[$tariffName]) ? $tariffSpeeds[$tariffName]['speeddown'] : __('No'); $speedUp = isset($tariffSpeeds[$tariffName]) ? $tariffSpeeds[$tariffName]['speedup'] : __('No'); $period = isset($tariffPeriods[$tariffName]) ? __($tariffPeriods[$tariffName]) : __('No'); $cells = wf_TableCell(__('Fee'), '', 'row1'); $cells .= wf_TableCell($tariffPrice); $rows = wf_TableRow($cells, 'row2'); $cells = wf_TableCell(__('Download speed'), '', 'row1'); $cells .= wf_TableCell($speedDown); $rows .= wf_TableRow($cells, 'row2'); $cells = wf_TableCell(__('Upload speed'), '', 'row1'); $cells .= wf_TableCell($speedUp); $rows .= wf_TableRow($cells, 'row2'); $cells = wf_TableCell(__('Period'), '', 'row1'); $cells .= wf_TableCell($period); $rows .= wf_TableRow($cells, 'row2'); $tariffInfo = wf_TableBody($rows, '40%', 0, '');
log_register('BALANCEADDFAIL (' . $login . ') WRONG SUMM `' . $cash . '`'); } } else { show_window('', wf_modalOpened(__('Error'), __('You have not completed the required amount of money to deposit into account. We hope next time you will be more attentive.'), '400', '150')); log_register('BALANCEADDFAIL (' . $login . ') EMPTY SUMM `' . $cash . '`'); } } // Profile: $profile = new UserProfile($login); show_window(__('User profile'), $profile->render()); $user_data = $profile->extractUserData(); $current_balance = $user_data['Cash']; $useraddress = $profile->extractUserAddress() . ' (' . $login . ')'; // Edit money form construct: $user_tariff = $user_data['Tariff']; $tariff_price = zb_TariffGetPrice($user_tariff); $fieldnames = array('fieldname1' => __('Current Cash state'), 'fieldname2' => __('New cash')); $fieldkey = 'newcash'; $form = ''; $form .= web_EditorCashDataForm($fieldnames, $fieldkey, $useraddress, $current_balance, $tariff_price); // Check is user corporate? if ($alter['USER_LINKING_ENABLED']) { if ($alter['USER_LINKING_CASH']) { if (cu_IsChild($login)) { $allchildusers = cu_GetAllLinkedUsers(); $parent_link = $allchildusers[$login]; rcms_redirect("?module=corporate&userlink=" . $parent_link . "&control=cash"); } if (cu_IsParent($login)) { $allparentusers = cu_GetAllParentUsers(); $parent_link = $allparentusers[$login];