function zbs_AnnouncementsShow() { $query = "SELECT * from `zbsannouncements` WHERE `public`='1' ORDER by `id` DESC"; $all = simple_queryall($query); $result = ''; if (!empty($all)) { foreach ($all as $io => $each) { if (!isset($_COOKIE['zbsanread_' . $each['id']])) { $readControl = la_Link('?module=announcements&anmarkasread=' . $each['id'], la_img('iconz/anunread.gif', __('Mark as read'))) . ' '; } else { $readControl = la_Link('?module=announcements&anmarkasunread=' . $each['id'], la_img('iconz/anread.gif', __('Mark as unread'))) . ' '; } $result .= la_tag('h3', false, 'row1', '') . $readControl . $each['title'] . ' ' . la_tag('h3', true); $result .= la_delimiter(); if ($each['type'] == 'text') { $eachtext = strip_tags($each['text']); $result .= nl2br($eachtext); } if ($each['type'] == 'html') { $result .= $each['text']; } $result .= la_delimiter(); } } else { show_window(__('Sorry'), __('There are not any announcements.')); } show_window('', $result); }
/** * Returns payment card input form * * @return string */ function zbs_PaycardsShowForm() { $inputs = la_tag('br'); $inputs .= __('Payment card number') . ' '; $inputs .= la_TextInput('paycard', '', '', false, 25); $inputs .= la_Submit(__('Use this card')); $inputs .= la_delimiter(); $form = la_Form('', 'POST', $inputs, ''); return $form; }
/** * returns main self-credit module form * * @return string */ function zbs_ShowCreditForm() { $inputs = la_tag('center'); $inputs .= la_HiddenInput('setcredit', 'true'); $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(); $inputs .= la_Submit(__('Set me credit please')); $inputs .= la_tag('center', true); $form = la_Form("", 'POST', $inputs, ''); return $form; }
/** * Forms and returns selector with available services * * @param array $availableServices * @param string $login * @return string */ function AdServicesSelector($availableServices, $login) { $selectData['-'] = '-'; if (!empty($availableServices)) { $allSheduled = GetAllSheduled($availableServices, $login); $allActivated = GetAllActivated($availableServices, $login); foreach ($availableServices as $eachService) { $eq = false; $eachData = explode(":", $eachService); $serviceName = $eachData[0]; $serviceTagID = $eachData[1]; if (!empty($allSheduledl)) { foreach ($allSheduled as $eachShedule) { if ($eachShedule['param'] === $serviceTagID) { $eq = true; } } } if (!empty($allActivated)) { foreach ($allActivated as $eachActivated) { if ($eachActivated['tagid'] === $serviceTagID) { $eq = true; } } } if (!$eq) { $selectData[$serviceTagID] = $serviceName; } } } $selector = la_Selector('tagid', $selectData, '', '', false); $selector .= la_delimiter(); $selector .= la_CheckInput('agree', __('I am sure that I am an adult and have read everything that is written above'), false, false); $selector .= la_delimiter(); $selector .= la_Submit(__('Order')); $form = la_Form('', 'POST', $selector); return $form; }
/** * Renders user traffic stats report * * @param string $login * @return string */ function zbs_UserTraffStats($login) { $login = vf($login); $alldirs = zbs_DirectionsGetAll(); $monthnames = zbs_months_array_wz(); /* * Current month traffic stats */ $result = la_tag('h3') . __('Current month traffic stats') . la_tag('h3', true); $cells = la_TableCell(__('Traffic classes')); $cells .= la_TableCell(__('Downloaded')); $cells .= la_TableCell(__('Uploaded')); $cells .= la_TableCell(__('Total')); $rows = la_TableRow($cells, 'row1'); if (!empty($alldirs)) { foreach ($alldirs as $io => $eachdir) { $query_downup = "SELECT `D" . $eachdir['rulenumber'] . "`,`U" . $eachdir['rulenumber'] . "` from `users` WHERE `login`='" . $login . "'"; $downup = simple_query($query_downup); $cells = la_TableCell($eachdir['rulename']); $cells .= la_TableCell(zbs_convert_size($downup['D' . $eachdir['rulenumber']])); $cells .= la_TableCell(zbs_convert_size($downup['U' . $eachdir['rulenumber']])); $cells .= la_TableCell(zbs_convert_size($downup['U' . $eachdir['rulenumber']] + $downup['D' . $eachdir['rulenumber']])); $rows .= la_TableRow($cells, 'row3'); } } $result .= la_TableBody($rows, '100%', 0, ''); $result .= la_delimiter(); /* * traffic stats by previous months */ $result .= la_tag('h3') . __('Previous month traffic stats') . la_tag('h3', true); $cells = la_TableCell(__('Year')); $cells .= la_TableCell(__('Month')); $cells .= la_TableCell(__('Traffic classes')); $cells .= la_TableCell(__('Downloaded')); $cells .= la_TableCell(__('Uploaded')); $cells .= la_TableCell(__('Total')); $cells .= la_TableCell(__('Cash')); $rows = la_TableRow($cells, 'row1'); if (!empty($alldirs)) { foreach ($alldirs as $io => $eachdir) { $query_prev = "SELECT `D" . $eachdir['rulenumber'] . "`,`U" . $eachdir['rulenumber'] . "`,`month`,`year`,`cash` from `stat` WHERE `login`='" . $login . "' ORDER BY `year`,`month`"; $allprevmonth = simple_queryall($query_prev); if (!empty($allprevmonth)) { foreach ($allprevmonth as $io2 => $eachprevmonth) { $cells = la_TableCell($eachprevmonth['year']); $cells .= la_TableCell(__($monthnames[$eachprevmonth['month']])); $cells .= la_TableCell($eachdir['rulename']); $cells .= la_TableCell(zbs_convert_size($eachprevmonth['D' . $eachdir['rulenumber']])); $cells .= la_TableCell(zbs_convert_size($eachprevmonth['U' . $eachdir['rulenumber']])); $cells .= la_TableCell(zbs_convert_size($eachprevmonth['U' . $eachdir['rulenumber']] + $eachprevmonth['D' . $eachdir['rulenumber']])); $cells .= la_TableCell(round($eachprevmonth['cash'], 2)); $rows .= la_TableRow($cells, 'row3'); } } } } $result .= la_TableBody($rows, '100%', 0, ''); return $result; }
/** * 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; }
/** * * @return type form for changin mobile */ function zbs_ShowChangeMobileForm() { global $us_config; $inputs = la_tag('center'); $inputs .= la_HiddenInput('changemobile', 'true'); $inputs .= @$us_config['REMINDER_PREFIX'] . ' '; $inputs .= la_TextInput('mobile'); $inputs .= la_delimiter(); $inputs .= la_Submit(__('Change mobile')); $inputs .= la_tag('center', true); $form = la_Form("", 'POST', $inputs, ''); return $form; }
if ($us_config['SP_ENABLED']) { $spurl = $us_config['SP_URL']; $template = la_tag('div', false, '', 'style="clear: both;"') . la_tag('div', true); $template .= la_tag('center', false); $template .= ' <!-- BEGIN SPEED TEST - DO NOT ALTER BELOW--> <script type="text/javascript" src="' . $spurl . 'speedtest/swfobject.js?v=2.2"></script> <div id="mini-demo"> Speedtest.net Mini requires at least version 8 of Flash. Please <a href="http://get.adobe.com/flashplayer/">update your client</a>. </div><!--/mini-demo--> <script type="text/javascript"> var flashvars = { upload_extension: "php" }; var params = { wmode: "transparent", quality: "high", menu: "false", allowScriptAccess: "always" }; var attributes = {}; swfobject.embedSWF("' . $spurl . 'speedtest.swf?v=2.1.8", "mini-demo", "350", "200", "9.0.0", "' . $spurl . 'speedtest/expressInstall.swf", flashvars, params, attributes); </script> <!-- END SPEED TEST - DO NOT ALTER ABOVE --> '; $template .= la_tag('center', true); $notice = la_delimiter() . __('The test may not be accurate and is dependent on the type and configuration of client software. The results of tests can influence the type of browser settings firewall, flash player, active anti-virus scanning of HTTP traffic function, active downloads, etc'); show_window(__('Speed test'), $template . $notice); } else { show_window(__('Sorry'), __('Unfortunately speedtest is now disabled')); }
billing_addcash($user_login, '-' . $freezeprice); rcms_redirect("index.php"); } else { show_window(__('Error'), __('You must accept our policy')); } } else { //show some forms and notices $af_message = __('Service "account freeze" will allow you to suspend the charge of the monthly fee during your long absence - such as holidays or vacations. The cost of this service is:') . ' '; $af_message .= la_tag('b') . $freezeprice . ' ' . $af_currency . la_tag('b', true) . '. '; $af_message .= __('Be aware that access to the network will be limited to immediately after you confirm your desire to freeze the account. To unfreeze the account you need to contact the nearest office.'); // terms of service show_window(__('Account freezing'), $af_message); //account freezing form $inputs = la_CheckInput('afagree', __('I am sure that I am an adult and have read everything that is written above'), false, false); $inputs .= la_HiddenInput('dofreeze', 'true'); $inputs .= la_delimiter(); $inputs .= la_Submit(__('I want to freeze my account right now')); $af_form = la_Form('', 'POST', $inputs); show_window('', $af_form); } } else { show_window('', __('Your account has been frozen')); } } else { show_window(__('Sorry'), __('Your account is now a negative amount')); } } else { show_window(__('Sorry'), __('Your tariff does not provide this service')); } } else { show_window(__('Sorry'), __('Unfortunately account freeze is now disabled'));
/** * Renders tariffs list with subscribtion form * * @return string */ public function renderSubscribeForm() { $result = ''; $iconsPath = zbs_GetCurrentSkinPath($this->usConfig) . 'iconz/'; $result .= la_tag('b') . __('Attention!') . la_tag('b', true) . ' '; $result .= __('When activated subscription account will be charged fee the equivalent value of the subscription.') . la_delimiter(); if (!empty($this->allTariffs)) { foreach ($this->allTariffs as $io => $each) { $headerType = $each['primary'] ? 'mgheaderprimary' : 'mgheader'; $freePeriodLabel = $each['freeperiod'] ? la_img($iconsPath . 'ok_small.png', __('Available')) : la_img($iconsPath . 'unavail_small.png', __('Unavailable')); $primaryLabel = $each['primary'] ? la_img($iconsPath . 'ok_small.png') : la_img($iconsPath . 'unavail_small.png'); $tariffInfo = la_tag('div', false, $headerType) . $each['name'] . la_tag('div', true); $cells = la_TableCell(la_tag('b') . __('Fee') . la_tag('b', true)); $cells .= la_TableCell($each['fee'] . ' ' . $this->usConfig['currency']); $rows = la_TableRow($cells); $cells = la_TableCell(la_tag('b') . __('Free period') . la_tag('b', true)); $cells .= la_TableCell($freePeriodLabel); $rows .= la_TableRow($cells); $cells = la_TableCell(la_tag('b') . __('Primary') . la_tag('b', true)); $cells .= la_TableCell($primaryLabel); $rows .= la_TableRow($cells); $tariffInfo .= la_TableBody($rows, '100%', 0); $tariffInfo .= la_delimiter(); if ($this->checkBalance()) { if ($this->isUserSubscribed($this->userLogin, $each['id'])) { $subscribeControl = la_Link('?module=megogo&unsubscribe=' . $each['id'], __('Unsubscribe'), false, 'mgunsubcontrol'); } else { if ($this->checkUserProtection($each['id'])) { $subscribeControl = la_Link('?module=megogo&subscribe=' . $each['id'], __('Subscribe'), false, 'mgsubcontrol'); } else { $subscribeControl = __('The amount of money in your account is not sufficient to process subscription'); } } $tariffInfo .= $subscribeControl; } else { $tariffInfo .= __('The amount of money in your account is not sufficient to process subscription'); } $result .= la_tag('div', false, 'mgcontainer') . $tariffInfo . la_tag('div', true); } } return $result; }