Exemple #1
0
                 </td>
             </tr>
         </table>
         <input type="submit" value="' . __('Change') . '">
     </form><br><br>';
     show_window(__('Edit signup price for tariff') . ' "' . $tariff . '"', $form);
     show_window('', wf_Link("?module=signupprices", 'Back', true, 'ubButton'));
 } elseif (isset($_GET['username'])) {
     $login = mysql_real_escape_string($_GET['username']);
     $has_paid = zb_UserGetSignupPricePaid($login);
     $old_price = zb_UserGetSignupPrice($login);
     $new_price = isset($_POST['new_price']) ? mysql_real_escape_string($_POST['new_price']) : null;
     if (!is_null($new_price)) {
         if ($new_price >= $has_paid) {
             $cash = $old_price - $new_price;
             zb_UserChangeSignupPrice($login, $new_price);
             $billing->addcash($login, $cash);
             log_register("CHARGE SignupPriceFee(" . $login . ") " . $cash);
             rcms_redirect("?module=useredit&username="******"" method="POST">
         <table width="100%" border="0">
             <tr>
                 <td class="row2">' . __('Signup price') . '</td>
                 <td class="row3">
                     <input type="text" name="new_price" value="' . $old_price . '">
                 </td>
             </tr>
Exemple #2
0
         $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]);
                 $billing->addcash($login, $cash);
                 log_register("CHARGE SignupPriceFee(" . $login . ") " . $cash . " ACCORDING TO " . $tariff);
             } else {
                 show_window('', wf_modalOpened(__('Error'), __('You may not setup connection payment less then user has already paid!'), '400', '150'));
             }
         }
     }
 }
 $current_tariff = zb_UserGetStargazerData($login);
 $current_tariff = $current_tariff['Tariff'];
 $useraddress = zb_UserGetFullAddress($login) . ' (' . $login . ')';
 //check is user corporate?
 $alter_conf = rcms_parse_ini_file(CONFIG_PATH . "alter.ini");
 if ($alter_conf['USER_LINKING_ENABLED']) {
     if ($alter_conf['USER_LINKING_TARIFF']) {