Example #1
0
 /**
  * signup prices controller
  * 
  * @return string
  */
 protected function getSignupPricing()
 {
     $result = '';
     if (isset($this->alterCfg['SIGNUP_PAYMENTS']) && !empty($this->alterCfg['SIGNUP_PAYMENTS'])) {
         $result = $this->addRow(__('Signup paid'), zb_UserGetSignupPricePaid($this->login) . '/' . zb_UserGetSignupPrice($this->login));
     }
     return $result;
 }
Example #2
0
     $form = '<form action="" method="POST">
         <table width="100%" border="0">
             <tr>
                 <td class="row2">' . __('Signup price') . '</td>
                 <td class="row3">
                     <input type="text" name="new_price" value="' . $prices[$tariff] . '">
                 </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">
Example #3
0
/**
 * Returns tariff changing form without lousy tariffs
 * 
 * @global object $ubillingConfig
 * @param string  $fieldname
 * @param string $fieldkey
 * @param string $useraddress
 * @param string $olddata
 * @return string
 */
function web_EditorTariffFormWithoutLousy($fieldname, $fieldkey, $useraddress, $olddata = '')
{
    global $ubillingConfig;
    $alter = $ubillingConfig->getAlter();
    $login = isset($_GET['username']) ? vf($_GET['username']) : null;
    $nm_flag = $olddata == '*_NO_TARIFF_*' ? 'DISABLED' : null;
    if (isset($alter['SIGNUP_PAYMENTS']) && !empty($alter['SIGNUP_PAYMENTS'])) {
        $payment = zb_UserGetSignupPrice($login);
        $paid = zb_UserGetSignupPricePaid($login);
        $disabled = $payment == $paid && $payment > 0 ? 'disabled' : null;
        $charge_signup_price_checkbox = '
            <label for="charge_signup_price_checkbox"> ' . __('Charge signup price') . '
                <input type="checkbox"  name="charge_signup_price" id="charge_signup_price_checkbox" ' . $disabled . '> 
            </label>
        ';
    } else {
        $charge_signup_price_checkbox = null;
    }
    $nmControl = wf_tag('label', false, '', 'for="nm"');
    $nmControl .= __('Next month');
    $nmControl .= wf_tag('input', false, '', 'type="checkbox"  name="nextmonth" id="nm" ' . $nm_flag);
    $nmControl .= wf_tag('label', true);
    $cells = wf_TableCell(__('User'), '', 'row2');
    $cells .= wf_TableCell($useraddress, '', 'row3');
    $rows = wf_TableRow($cells);
    $cells = wf_TableCell($fieldname, '', 'row2');
    $cells .= wf_TableCell($olddata, '', 'row3');
    $rows .= wf_TableRow($cells);
    $cells = wf_TableCell($nmControl, '', 'row2', 'align="right"');
    $cells .= wf_TableCell(web_tariffselectorNoLousy($fieldkey) . $charge_signup_price_checkbox, '', 'row3');
    $rows .= wf_TableRow($cells);
    $table = wf_TableBody($rows, '100%', 0);
    $inputs = $table;
    $inputs .= wf_tag('br');
    $inputs .= wf_Submit(__('Change'));
    $inputs .= wf_delimiter();
    $form = wf_Form("", 'POST', $inputs, '');
    return $form;
}
Example #4
0
/**
 * Signup payments processing and addcash function inside
 * 
 * @global object $ubillingConfig   Ubilling config helper object
 * @param string  $login     Existing users login
 * @param float   $cash      Amount of money to put/set on user login
 * @param string  $operation Operation  type: add, correct,set,mock
 * @param int     $cashtype  Existing cashtype ID for payment registry
 * @param string  $note      Payment notes
 * 
 * @return void
 */
function zb_CashAddWithSignup($login, $cash, $operation, $cashtype, $note)
{
    switch ($operation) {
        case 'add':
            $signup_payment = zb_UserGetSignupPrice($login);
            $signup_paid = zb_UserGetSignupPricePaid($login);
            $signup_left = $signup_payment - $signup_paid;
            if ($signup_left > 0 && $cash > 0) {
                global $ubillingConfig;
                $alter = $ubillingConfig->getAlter();
                if ($cash > $signup_left) {
                    $signup_cash = $signup_left;
                    $balance_cash = $cash - $signup_cash;
                    zb_CashAdd($login, $signup_cash, $operation, $alter['SIGNUP_TYPEID'], __('Signup payment'));
                    zb_CashAdd($login, $balance_cash, $operation, $cashtype, $note);
                } else {
                    zb_CashAdd($login, $cash, $operation, $alter['SIGNUP_TYPEID'], __('Signup payment'));
                }
            } else {
                zb_CashAdd($login, $cash, $operation, $cashtype, $note);
            }
            break;
        default:
            zb_CashAdd($login, $cash, $operation, $cashtype, $note);
            break;
    }
}
Example #5
0
 function web_UserEditShowForm($login)
 {
     global $ubillingConfig;
     $alter_conf = $ubillingConfig->getAlter();
     $stgdata = zb_UserGetStargazerData($login);
     $address = zb_UserGetFullAddress($login);
     $realname = zb_UserGetRealName($login);
     $phone = zb_UserGetPhone($login);
     $contract = zb_UserGetContract($login);
     $mobile = zb_UserGetMobile($login);
     $mail = zb_UserGetEmail($login);
     $notes = zb_UserGetNotes($login);
     $ip = $stgdata['IP'];
     $mac = zb_MultinetGetMAC($stgdata['IP']);
     $speedoverride = zb_UserGetSpeedOverride($login);
     $tariff = $stgdata['Tariff'];
     $credit = $stgdata['Credit'];
     $cash = $stgdata['Cash'];
     $password = $stgdata['Password'];
     $aonline = $stgdata['AlwaysOnline'];
     $dstatdisable = $stgdata['DisabledDetailStat'];
     $passive = $stgdata['Passive'];
     $down = $stgdata['Down'];
     $creditexpire = $stgdata['CreditExpire'];
     if ($alter_conf['PASSWORDSHIDE']) {
         $password = __('Hidden');
     }
     if ($speedoverride == '0') {
         $speedoverride = __('No');
     }
     if ($creditexpire > 0) {
         $creditexpire = date("Y-m-d", $creditexpire);
     } else {
         $creditexpire = __('No');
     }
     $cells = wf_TableCell(__('Parameter'));
     $cells .= wf_TableCell(__('Current value'));
     $cells .= wf_TableCell(__('Actions'));
     $rows = wf_TableRow($cells, 'row2');
     //express card
     if ($alter_conf['CRM_MODE']) {
         $cells = wf_TableCell(__('Express card'));
         $cells .= wf_TableCell('');
         $cells .= wf_TableCell(wf_Link('?module=expresscard&username='******'skins/express.gif') . ' ' . __('Edit')));
         $rows .= wf_TableRow($cells, 'row3');
     }
     //default fields editing
     $cells = wf_TableCell(__('Full address'));
     $cells .= wf_TableCell($address);
     $cells .= wf_TableCell(wf_Link('?module=binder&username='******'skins/icon_build.gif') . ' ' . __('Occupancy')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Password'));
     $cells .= wf_TableCell($password);
     $cells .= wf_TableCell(wf_Link('?module=passwordedit&username='******'skins/icon_key.gif') . ' ' . __('Change') . ' ' . __('password')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Real Name'));
     $cells .= wf_TableCell($realname);
     $cells .= wf_TableCell(wf_Link('?module=realnameedit&username='******'skins/icon_user.gif') . ' ' . __('Change') . ' ' . __('Real Name')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Phone'));
     $cells .= wf_TableCell($phone);
     $cells .= wf_TableCell(wf_Link('?module=phoneedit&username='******'skins/icon_phone.gif') . ' ' . __('Change') . ' ' . __('phone')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Mobile'));
     $cells .= wf_TableCell($mobile);
     $cells .= wf_TableCell(wf_Link('?module=mobileedit&username='******'skins/icon_mobile.gif') . ' ' . __('Change') . ' ' . __('mobile')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Contract'));
     $cells .= wf_TableCell($contract);
     $cells .= wf_TableCell(wf_Link('?module=contractedit&username='******'skins/icon_link.gif') . ' ' . __('Change') . ' ' . __('contract')));
     $rows .= wf_TableRow($cells, 'row3');
     if ($alter_conf['CORPS_ENABLED']) {
         $greed = new Avarice();
         $corpsRuntime = $greed->runtime('CORPS');
         if (!empty($corpsRuntime)) {
             $corps = new Corps();
             $corpsCheck = $corps->userIsCorporate($login);
             $cells = wf_TableCell(__('User type'));
             if (cfr('CORPS')) {
                 $corpControls = wf_Link(Corps::URL_USER_MANAGE . $login, wf_img('skins/corporate_small.gif') . ' ' . __('Change') . ' ' . __('user type'));
             } else {
                 $corpControls = '';
             }
             if ($corpsCheck) {
                 $cells .= wf_TableCell(__('Corporate user'));
                 $cells .= wf_TableCell($corpControls);
             } else {
                 $cells .= wf_TableCell(__('Private user'));
                 $cells .= wf_TableCell($corpControls);
             }
             $rows .= wf_TableRow($cells, 'row3');
         }
     }
     $cells = wf_TableCell(__('Email'));
     $cells .= wf_TableCell($mail);
     $cells .= wf_TableCell(wf_Link('?module=mailedit&username='******'skins/icon_mail.gif') . ' ' . __('Change') . ' ' . __('email')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Tariff'));
     $cells .= wf_TableCell($tariff);
     $cells .= wf_TableCell(wf_Link('?module=tariffedit&username='******'skins/icon_tariff.gif') . ' ' . __('Change') . ' ' . __('tariff')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Speed override'));
     $cells .= wf_TableCell($speedoverride);
     $cells .= wf_TableCell(wf_Link('?module=speededit&username='******'skins/icon_speed.gif') . ' ' . __('Change') . ' ' . __('speed override')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Credit'));
     $cells .= wf_TableCell($credit);
     $cells .= wf_TableCell(wf_Link('?module=creditedit&username='******'skins/icon_credit.gif') . ' ' . __('Change') . ' ' . __('credit limit')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Credit expire'));
     $cells .= wf_TableCell($creditexpire);
     $cells .= wf_TableCell(wf_Link('?module=creditexpireedit&username='******'skins/icon_calendar.gif') . ' ' . __('Change') . ' ' . __('credit expire date')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Balance'));
     $cells .= wf_TableCell($cash);
     $cells .= wf_TableCell(wf_Link('?module=addcash&username='******'#profileending', wf_img('skins/icon_dollar.gif') . ' ' . __('Finance operations')));
     $rows .= wf_TableRow($cells, 'row3');
     if (isset($alter_conf['SIGNUP_PAYMENTS']) && !empty($alter_conf['SIGNUP_PAYMENTS'])) {
         $payment = zb_UserGetSignupPrice($login);
         $paid = zb_UserGetSignupPricePaid($login);
         if ($payment != $paid && $payment > 0) {
             $cells = wf_TableCell(__('Signup paid'));
             $cells .= wf_TableCell(zb_UserGetSignupPricePaid($login) . '/' . zb_UserGetSignupPrice($login));
             $cells .= wf_TableCell(wf_Link('?module=signupprices&username='******'skins/icons/register.png', __('Edit signup price')) . ' ' . __('Edit signup price')));
             $rows .= wf_TableRow($cells, 'row3');
         }
     }
     $cells = wf_TableCell(__('IP'));
     $cells .= wf_TableCell($ip);
     $cells .= wf_TableCell(wf_Link('?module=pl_ipchange&username='******'skins/icon_ip.gif') . ' ' . __('Change') . ' ' . __('IP')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('MAC'));
     $cells .= wf_TableCell($mac);
     $cells .= wf_TableCell(wf_Link('?module=macedit&username='******'skins/icon_ether.gif') . ' ' . __('Change') . ' ' . __('MAC')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('AlwaysOnline'));
     $cells .= wf_TableCell(web_trigger($aonline));
     $cells .= wf_TableCell(wf_Link('?module=aoedit&username='******'skins/icon_online.gif') . ' ' . __('AlwaysOnline')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Disable detailed stats'));
     $cells .= wf_TableCell(web_trigger($dstatdisable));
     $cells .= wf_TableCell(wf_Link('?module=dstatedit&username='******'skins/icon_stats.gif') . ' ' . __('Disable detailed stats')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('User passive'));
     $cells .= wf_TableCell(web_trigger($passive));
     $cells .= wf_TableCell(wf_Link('?module=passiveedit&username='******'skins/icon_passive.gif') . ' ' . __('User passive')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('User down'));
     $cells .= wf_TableCell(web_trigger($down));
     $cells .= wf_TableCell(wf_Link('?module=downedit&username='******'skins/icon_down.gif') . ' ' . __('User down')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Passport data'));
     $cells .= wf_TableCell('');
     $cells .= wf_TableCell(wf_Link('?module=pdataedit&username='******'skins/icon_passport.gif') . ' ' . __('Change') . ' ' . __('passport data')));
     $rows .= wf_TableRow($cells, 'row3');
     if ($alter_conf['CONDET_ENABLED']) {
         $conDet = new ConnectionDetails();
         $cells = wf_TableCell(__('Connection details'));
         $cells .= wf_TableCell($conDet->renderData($login));
         $cells .= wf_TableCell(wf_Link('?module=condetedit&username='******'skins/cableseal_small.png') . ' ' . __('Change') . ' ' . __('Connection details')));
         $rows .= wf_TableRow($cells, 'row3');
     }
     //additional comments indication
     if ($alter_conf['ADCOMMENTS_ENABLED']) {
         $adcomments = new ADcomments('USERNOTES');
         $indicatorIcon = ' ' . wf_Link('?module=notesedit&username='******'');
     } else {
         $indicatorIcon = '';
     }
     $cells = wf_TableCell(__('Notes'));
     $cells .= wf_TableCell($notes . $indicatorIcon);
     $cells .= wf_TableCell(wf_Link('?module=notesedit&username='******'skins/icon_note.gif') . ' ' . __('Notes')));
     $rows .= wf_TableRow($cells, 'row3');
     $form = wf_TableBody($rows, '100%', '0');
     show_window(__('Edit user') . ' ' . $address, $form);
     cf_FieldEditor($login);
     show_window('', web_UserControls($login));
 }