Example #1
0
                 }
                 log_register("GROUPBALANCE " . $eachchild . " " . $operation . " ON " . $cash);
                 rcms_redirect("?module=corporate&userlink=" . $userlink . "&control=cash");
             }
         }
     }
 }
 //cash control end
 if ($_GET['control'] == 'tariff') {
     //group tariff operations
     $allchildusers = cu_GetAllChildUsers($userlink);
     //construct form
     $current_tariff = zb_UserGetStargazerData($parent_login);
     $current_tariff = $current_tariff['Tariff'];
     $tariffinputs = '<h3>' . __('Current tariff') . ': ' . $current_tariff . '</h3> <br>';
     $tariffinputs .= web_tariffselector('newtariff');
     $tariffinputs .= '<br>';
     $tariffinputs .= wf_CheckInput('nextmonth', 'Next month', true, false);
     $tariffinputs .= '<br>';
     $tariffinputs .= wf_Submit('Save');
     $tariffform = wf_Form('', 'POST', $tariffinputs, 'glamour');
     show_window(__('Edit tariff'), $tariffform);
     //if group tariff change
     if (wf_CheckPost(array('newtariff'))) {
         $alter_conf = rcms_parse_ini_file(CONFIG_PATH . "alter.ini");
         $tariff = $_POST['newtariff'];
         if (!isset($_POST['nextmonth'])) {
             $billing->settariff($parent_login, $tariff);
             log_register('CHANGE Tariff ' . $parent_login . ' ON ' . $tariff);
             //optional user reset
             if ($alter_conf['TARIFFCHGRESET']) {
Example #2
0
function web_gen_addform()
{
    $addinputs = web_tariffselector();
    $addinputs .= wf_TextInput('newgenocide', 'Speed', '', false, '10');
    $addinputs .= wf_Submit('Create');
    $addform = wf_Form('', 'POST', $addinputs, 'glamour');
    show_window('', $addform);
}
Example #3
0
 /**
  * Returns ajax inputs of required type
  * 
  * @return string
  */
 public function catchAjRequest()
 {
     $result = '';
     if (wf_CheckGet(array('ajinput'))) {
         $request = vf($_GET['ajinput']);
         switch ($request) {
             case 'addcash':
                 $result .= wf_HiddenInput('newschedaction', 'addcash');
                 $result .= wf_TextInput('newschedparam', __('Sum'), '', true, 5);
                 break;
             case 'corrcash':
                 $result .= wf_HiddenInput('newschedaction', 'corrcash');
                 $result .= wf_TextInput('newschedparam', __('Sum'), '', true, 5);
                 break;
             case 'setcash':
                 $result .= wf_HiddenInput('newschedaction', 'setcash');
                 $result .= wf_TextInput('newschedparam', __('Sum'), '', true, 5);
                 break;
             case 'credit':
                 $result .= wf_HiddenInput('newschedaction', 'credit');
                 $result .= wf_TextInput('newschedparam', __('New credit'), '', true, 5);
                 break;
             case 'creditexpire':
                 $result .= wf_HiddenInput('newschedaction', 'creditexpire');
                 $result .= wf_DatePickerPreset('newschedparam', curdate()) . ' ' . __('New credit expire') . wf_tag('br');
                 break;
             case 'tariffchange':
                 $result .= wf_HiddenInput('newschedaction', 'tariffchange');
                 $result .= web_tariffselector('newschedparam') . ' ' . __('Tariff name') . wf_tag('br');
                 break;
             case 'tagadd':
                 $result .= wf_HiddenInput('newschedaction', 'tagadd');
                 $allTags = array();
                 $allTagsRaw = simple_queryall("SELECT * from `tagtypes`");
                 if (!empty($allTagsRaw)) {
                     foreach ($allTagsRaw as $io => $each) {
                         $allTags[$each['id']] = $each['tagname'];
                     }
                 }
                 $result .= wf_Selector('newschedparam', $allTags, __('Tag'), '', true);
                 break;
             case 'tagdel':
                 $result .= wf_HiddenInput('newschedaction', 'tagdel');
                 $allTags = array();
                 $allTagsRaw = simple_queryall("SELECT * from `tagtypes`");
                 if (!empty($allTagsRaw)) {
                     foreach ($allTagsRaw as $io => $each) {
                         $allTags[$each['id']] = $each['tagname'];
                     }
                 }
                 $result .= wf_Selector('newschedparam', $allTags, __('Tag'), '', true);
                 break;
             case 'freeze':
                 $result .= wf_HiddenInput('newschedaction', 'freeze');
                 $result .= wf_HiddenInput('newschedparam', '');
                 break;
             case 'unfreeze':
                 $result .= wf_HiddenInput('newschedaction', 'unfreeze');
                 $result .= wf_HiddenInput('newschedparam', '');
                 break;
             case 'reset':
                 $result .= wf_HiddenInput('newschedaction', 'reset');
                 $result .= wf_HiddenInput('newschedparam', '');
                 break;
             case 'setspeed':
                 $result .= wf_HiddenInput('newschedaction', 'setspeed');
                 $result .= wf_TextInput('newschedparam', __('New speed override'), '', true, 5);
                 break;
             case 'down':
                 $result .= wf_HiddenInput('newschedaction', 'down');
                 $result .= wf_HiddenInput('newschedparam', '');
                 break;
             case 'undown':
                 $result .= wf_HiddenInput('newschedaction', 'undown');
                 $result .= wf_HiddenInput('newschedparam', '');
                 break;
             case 'ao':
                 $result .= wf_HiddenInput('newschedaction', 'ao');
                 $result .= wf_HiddenInput('newschedparam', '');
                 break;
             case 'unao':
                 $result .= wf_HiddenInput('newschedaction', 'unao');
                 $result .= wf_HiddenInput('newschedparam', '');
                 break;
         }
         $result .= wf_TextInput('newschednote', __('Notes'), '', true, 30);
         $result .= wf_Submit(__('Create'));
         if ($request == 'noaction') {
             $result = __('Please select action');
         }
     }
     die($result);
 }
Example #4
0
/**
 * Returns full tariff changing form
 * 
 * @global object $ubillingConfig
 * @param string  $fieldname
 * @param string  $fieldkey
 * @param string  $useraddress
 * @param string  $olddata
 * @return string
 */
function web_EditorTariffForm($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_tariffselector($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;
}