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); }
/** * Renders new/unread announcements notification * * @return void */ function zbs_AnnouncementsNotice() { $result = ''; if (zbs_AnnouncementsAvailable()) { $cells = la_TableCell(la_Link('?module=announcements', la_img('iconz/alert.gif'), true, '')); $cells .= la_TableCell(la_Link('?module=announcements', __('Some announcements are available'), true, '')); $rows = la_TableRow($cells); $result .= la_TableBody($rows, '70%', 0, ''); show_window('', $result); } }
/** * Renders previously generated user documents * * @return string */ public function renderUserDocuments() { $cells = la_TableCell(__('ID')); $cells .= la_TableCell(__('Date')); $cells .= la_TableCell(__('Document name')); $rows = la_TableRow($cells, 'row1'); if (!empty($this->userDocuments)) { foreach ($this->userDocuments as $io => $each) { $cells = la_TableCell($each['id']); $cells .= la_TableCell($each['date']); @($templateName = $this->templates[$each['templateid']]['name']); $downloadLink = la_Link('?module=zdocs&documentdownload=' . $each['id'], $templateName, false, ''); $cells .= la_TableCell($downloadLink); $rows .= la_TableRow($cells, 'row3'); } } $result = la_TableBody($rows, '100%', '0', ''); return $result; }
} } // try unsubscribe service if (la_CheckGet(array('unsubscribe'))) { $unsubscribeResult = $megogo->pushUnsubscribeRequest($_GET['unsubscribe']); if (!$unsubscribeResult) { rcms_redirect('?module=megogo'); } else { show_window(__('Sorry'), __($unsubscribeResult)); } } //view button if is some subscriptions here if ($megogo->haveSubscribtions()) { show_window(__('Your subscriptions'), $megogo->renderSubscribtions()); show_window('', la_Link($megogo->getAuthButtonURL(), __('Go to MEGOGO'), true, 'mgviewcontrol')); show_window('', la_tag('br')); } //default sub/unsub form show_window(__('Available subscribtions'), $megogo->renderSubscribeForm()); //user guide link if (isset($us_config['MG_GUIDE_URL'])) { if (!empty($us_config['MG_GUIDE_URL'])) { show_window('', la_Link($us_config['MG_GUIDE_URL'], __('Instructions for subscription'), false, 'mgguidecontrol')); } } } else { show_window(__('Sorry'), __('You can not use this service')); } } else { show_window(__('Sorry'), __('This module is disabled')); }
// Load libs include 'modules/engine/api.mysql.php'; include 'modules/engine/api.lightastral.php'; include 'modules/engine/api.compat.php'; include 'modules/engine/api.signup.php'; $dbConnect = new MySQLDB(); $signup = new SignupService($snConfig['confcache'], $snConfig['cachetimeout']); //show form by default if (!la_CheckPost(array('createrequest'))) { if (!la_CheckGet(array('success'))) { show_window('', $signup->renderForm()); } else { show_window(__('Thank you'), __('Your inquiry will be dealt with in the shortest possible time, and you will be contacted by our representative for details of connection.')); } } else { //or create request $request = $signup->createRequest(); if ($request) { rcms_redirect("?success=yeah"); } else { show_window(__('Error'), __('All fields marked with an asterisk (*) are required') . '. ' . la_Link('index.php', __('Try again'))); } } if ($snConfig['debug']) { // Page gentime end $mtime = explode(' ', microtime()); $totaltime = $mtime[0] + $mtime[1] - $starttime; show_window(__('Debug'), 'GT: ' . round($totaltime, 4) . ' QC: ' . $query_counter); } sn_ShowTemplate(); // render data into template
/** * Returns available tickets list * * @global string $user_login * @return string */ function zbs_TicketsShowMy() { global $user_login; $allmytickets = zbs_TicketsGetAllMy($user_login); $cells = la_TableCell(__('ID')); $cells .= la_TableCell(__('Date')); $cells .= la_TableCell(__('Status')); $cells .= la_TableCell(__('Actions')); $rows = la_TableRow($cells, 'row1'); if (!empty($allmytickets)) { foreach ($allmytickets as $io => $eachticket) { if ($eachticket['status']) { $ticketstatus = la_img('iconz/anread.gif') . ' ' . __('Closed'); } else { $ticketstatus = la_img('iconz/anunread.gif') . ' ' . __('Open'); } $cells = la_TableCell($eachticket['id']); $cells .= la_TableCell($eachticket['date']); $cells .= la_TableCell($ticketstatus); $cells .= la_TableCell(la_Link('?module=ticketing&showticket=' . $eachticket['id'], __('View'))); $rows .= la_TableRow($cells, 'row2'); } } $result = la_TableBody($rows, '100%', 0); return $result; }
/** * sets ISP name and others propertys to external scope * * @return void */ public function setTemplateData() { global $templateData; $templateData['ISP_NAME'] = $this->optionIspName; $templateData['ISP_URL'] = $this->optionIspUrl; $templateData['ISP_LOGO'] = $this->optionIspLogo; if (!empty($this->optionIspName) and !empty($this->optionIspUrl) and !empty($this->optionIspLogo)) { $templateData['ISP_LINK'] = la_Link($this->optionIspUrl, la_img($this->optionIspLogo, $this->optionIspName), false); } else { $templateData['ISP_LINK'] = ''; } $templateData['SIDEBAR_TEXT'] = $this->optionSidebarText; $templateData['GREETING_TEXT'] = $this->optionGreetingText; }
<?php $user_ip = zbs_UserDetectIp('debug'); $user_login = zbs_UserGetLoginByIp($user_ip); $us_config = zbs_LoadConfig(); if ($us_config['ZL_ENABLED']) { $zl_options = $us_config['ZL_OPTIONS']; if (!empty($zl_options)) { $zl_options = explode(',', $zl_options); $rows = ''; if (!empty($zl_options)) { foreach ($zl_options as $eachlink) { $ldata = explode('|', $eachlink); $icon = $ldata[0]; $url = $ldata[1]; $title = $ldata[2]; $cells = la_TableCell(la_Link($url, la_img($icon))); $cells .= la_TableCell(la_tag('h3') . la_Link($url, $title) . la_tag('h3', true)); $rows .= la_TableRow($cells); } } $result = la_TableBody($rows, '', 0); show_window(__('Downloads'), $result); } } else { show_window(__('Sorry'), __('Unfortunately downloads are 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; }