Example #1
0
/**
 * Returns complete tariff moving form
 * 
 * @param string $login
 * @param array  $tc_tariffsallowed
 * @param float  $tc_priceup
 * @param float  $tc_pricedown
 * @param float  $tc_pricesimilar
 * @param string $us_currency
 * @return string
 */
function zbs_TariffChangeForm($login, $tc_tariffsallowed, $tc_priceup, $tc_pricedown, $tc_pricesimilar, $us_currency)
{
    global $us_config;
    $user_tariff = zbs_UserGetTariff($login);
    $alltariffs = zbs_TariffGetAllPrices();
    $form = '
        ' . __('Your current tariff is') . ': ' . __($user_tariff) . ' ' . __('with monthly fee') . ' ' . $alltariffs[$user_tariff] . ' ' . $us_currency . '<br>
        ' . __('The cost of switching to a lower rate monthly fee') . ': ' . $tc_pricedown . ' ' . $us_currency . '<br>
        ' . __('The cost of switching to a higher monthly fee tariff') . ': ' . $tc_priceup . ' ' . $us_currency . '<br>
        ' . __('The cost of the transition rate for the same monthly fee') . ': ' . $tc_pricesimilar . ' ' . $us_currency . '<br>
        ' . la_tag('br') . '
        ' . zbs_TariffGetShowPrices($tc_tariffsallowed, $us_currency, $user_tariff, $tc_priceup, $tc_pricedown, $tc_pricesimilar) . '
        ' . la_tag('br') . '
        ';
    $inputs = __('New tariff') . ' ' . zbs_TariffSelector($tc_tariffsallowed, $user_tariff) . la_delimiter();
    $inputs .= la_CheckInput('agree', __('I am sure that I am an adult and have read everything that is written above'), false, false);
    $inputs .= la_delimiter();
    $nmChangeFlag = true;
    if (isset($us_config['TC_RIGHTNOW'])) {
        if ($us_config['TC_RIGHTNOW']) {
            $nmChangeFlag = false;
        }
    }
    $sumbitLabel = $nmChangeFlag ? __('I want this tariff next month') : __('I want this tariff right now');
    $inputs .= la_Submit($sumbitLabel);
    $form .= la_Form('', 'POST', $inputs, '');
    return $form;
}
Example #2
0
 $sc_minday = $us_config['SC_MINDAY'];
 $sc_maxday = $us_config['SC_MAXDAY'];
 $sc_term = $us_config['SC_TERM'];
 $sc_price = $us_config['SC_PRICE'];
 $sc_cashtypeid = $us_config['SC_CASHTYPEID'];
 $sc_monthcontrol = $us_config['SC_MONTHCONTROL'];
 $sc_allowed = array();
 $vs_price = zbs_VServicesGetPrice($user_login);
 //allowed tariffs option
 if (isset($us_config['SC_TARIFFSALLOWED'])) {
     if (!empty($us_config['SC_TARIFFSALLOWED'])) {
         $sc_allowed = explode(',', $us_config['SC_TARIFFSALLOWED']);
         $sc_allowed = array_flip($sc_allowed);
     }
 }
 $tariff = zbs_UserGetTariff($user_login);
 $tariffprice = zbs_UserGetTariffPrice($tariff);
 $tariffprice += $vs_price;
 $cday = date("d");
 //welcome message
 $wmess = __('If you wait too long to pay for the service, here you can get credit for') . ' ' . $sc_term . ' ' . __('days. The price of this service is') . ': ' . $sc_price . ' ' . $us_currency . '. ';
 if (isset($us_config['SC_VSCREDIT'])) {
     if ($us_config['SC_VSCREDIT']) {
         $wmess .= __('Also you promise to pay for the current month, in accordance with your service plan') . ".";
     } else {
         $wmess .= __('Also you promise to pay for the current month, in accordance with your service plan') . "." . __('Additional services are not subject to credit') . ".";
     }
 }
 show_window(__('Credits'), $wmess);
 //if day is something like that needed
 if ($cday <= $sc_maxday and $cday >= $sc_minday) {