Example #1
0
         <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>
         </table>
         <input type="submit" value="' . __('Change') . '">
     </form><br><br>';
     show_window(__('Edit signup price for user') . ' "' . $login . '"', $form);
     show_window('', wf_Link("?module=useredit&username="******"SELECT `name` FROM `tariffs`";
     $tariffs = simple_queryall($query);
     $prices = zb_TariffGetAllSignupPrices();
     $form = '<table width="100%" class="sortable" border="0">';
     $form .= '<tr class="row1"><td>' . __('Tariff') . '</td><td>' . __('Signup price') . '</td><td>' . __('Actions') . '</td></tr>';
     if (!empty($tariffs)) {
         foreach ($tariffs as $tariff) {
             $form .= '
                 <tr class="row3">
                     <td>' . $tariff['name'] . '</td>
                     <td>' . (isset($prices[$tariff['name']]) ? $prices[$tariff['name']] : '0') . '</td>
                     <td>
                         <a href="?module=signupprices&tariff=' . $tariff['name'] . '">' . wf_img('skins/icons/register.png', __('Edit signup price')) . '</a>
                     </td>
                 </tr>
             ';
         }
     }
Example #2
0
         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]);
                 $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 . ')';