Exemplo n.º 1
0
 public function __construct()
 {
     $this->loadTemplates();
     $this->altcfg = zbs_LoadConfig();
     $this->tEMPLATES_PATH = $this->altcfg['DOCX_STORAGE'] . 'pl_docx/';
     $this->dOCUMENTS_PATH = $this->altcfg['DOCX_STORAGE'] . 'pl_cache/';
 }
Exemplo n.º 2
0
function zbs_ShowUserPayments($login)
{
    $usConfig = zbs_LoadConfig();
    if ($usConfig['PAYMENTS_ENABLED']) {
        $allpayments = zbs_CashGetUserPayments($login);
        $cells = la_TableCell(__('Date'));
        $cells .= la_TableCell(__('Payment'));
        $cells .= la_TableCell(__('Balance'));
        $rows = la_TableRow($cells, 'row1');
        if (!empty($allpayments)) {
            foreach ($allpayments as $io => $eachpayment) {
                if ($usConfig['PAYMENTSTIMEHIDE']) {
                    $timestamp = strtotime($eachpayment['date']);
                    $cleanDate = date("Y-m-d", $timestamp);
                    $dateCells = $cleanDate;
                } else {
                    $dateCells = $eachpayment['date'];
                }
                $cells = la_TableCell($dateCells);
                $cells .= la_TableCell($eachpayment['summ']);
                $cells .= la_TableCell($eachpayment['balance']);
                $rows .= la_TableRow($cells, 'row2');
            }
        }
        $result = la_TableBody($rows, '100%', 0);
        show_window(__('Last payments'), $result);
    } else {
        $result = __('This module is disabled');
        show_window(__('Sorry'), $result);
    }
}
Exemplo n.º 3
0
/**
 * Marks payment card ad used in database and pushes its price to user account
 * 
 * @global string $user_ip
 * @global string $user_login
 * @param string $cardnumber
 */
function zbs_PaycardUse($cardnumber)
{
    global $user_ip;
    global $user_login;
    $cardnumber = vf($cardnumber);
    $us_config = zbs_LoadConfig();
    $carddata = zbs_PaycardGetParams($cardnumber);
    $cardcash = $carddata['cash'];
    $ctime = curdatetime();
    $carduse_q = "UPDATE `cardbank` SET\n        `usedlogin` = '" . $user_login . "',\n        `usedip` = '" . $user_ip . "',\n        `usedate`= '" . $ctime . "',\n        `used`='1'\n         WHERE `serial` ='" . $cardnumber . "';\n        ";
    nr_query($carduse_q);
    zbs_PaymentLog($user_login, $cardcash, $us_config['PC_CASHTYPEID'], "CARD:" . $cardnumber);
    billing_addcash($user_login, $cardcash);
    rcms_redirect("index.php");
}
Exemplo n.º 4
0
/**
 * 
 * needs SC_VSCREDIT=1 in userstats.ini
 * @param type $login user's login
 * @return price for all virtual services if such exists for user
 */
function zbs_VServicesGetPrice($login)
{
    $us_config = zbs_LoadConfig();
    $price = 0;
    if (isset($us_config['SC_VSCREDIT'])) {
        if ($us_config['SC_VSCREDIT']) {
            $tag_query = "SELECT * FROM `tags` WHERE `login` =  '" . $login . "' ";
            $alltags = simple_queryall($tag_query);
            $VS_query = "SELECT * FROM `vservices`";
            $allVS = simple_queryall($VS_query);
            if (!empty($alltags)) {
                foreach ($alltags as $io => $eachtag) {
                    foreach ($allVS as $each => $ia) {
                        if ($eachtag['tagid'] == $ia['tagid']) {
                            $price += $ia['price'];
                        }
                    }
                }
            }
        }
    }
    return $price;
}
Exemplo n.º 5
0
 /**
  * Check what type of apply date set in config and create suitable date string
  * 
  * @param string $applyDateType
  * @return string
  */
 function GetFullApplyDate()
 {
     $us_config = zbs_LoadConfig();
     $applyDateType = $us_config['ADSERVICE_DATE'];
     if ($applyDateType == 'nextday') {
         $applyDate = date('Y-m-d', strtotime("+1 day", time()));
     } else {
         $alldays = date('t');
         $curday = date('d');
         $leftdays = $alldays - $curday + 1;
         $applyDate = date('Y-m-d', strtotime("+" . $leftdays . " day", time()));
     }
     return $applyDate;
 }
Exemplo n.º 6
0
/**
 * Returns custom style background code
 * 
 * @return string
 */
function zbs_CustomBackground()
{
    $usConf = zbs_LoadConfig();
    $tilesPath = 'tiles/';
    $result = '';
    if (isset($usConf['BACKGROUND'])) {
        if ($usConf['BACKGROUND'] != 'DEFAULT' and !empty($usConf['BACKGROUND'])) {
            $customBackground = $usConf['BACKGROUND'];
            $availTiles = rcms_scandir($tilesPath);
            $availTiles = array_flip($availTiles);
            if ($customBackground == 'RANDOM') {
                $customBackground = array_rand($availTiles);
            }
            if (isset($availTiles[$customBackground])) {
                $result = '<style> body { background: #080808 url(' . $tilesPath . '/' . $customBackground . ') repeat; } </style> ';
            } else {
                $result = '<!-- Custom background tile file not found -->';
            }
        }
    }
    return $result;
}
Exemplo n.º 7
0
/**
 * Returns calendar widget with preset date
 * 
 * @param string $field field name to insert calendar
 * 
 * @return string
 *  
 */
function la_DatePickerPreset($field, $date)
{
    $inputid = la_InputId();
    $us_config = zbs_LoadConfig();
    $curlang = $us_config['lang'];
    $skinPath = zbs_GetCurrentSkinPath($us_config);
    $iconsPath = $skinPath . 'iconz/';
    $result = '<script>
	$(function() {
		$( "#' . $inputid . '" ).datepicker({
			showOn: "both",
                        buttonImage: "' . $iconsPath . 'icon_calendar.gif",
			buttonImageOnly: true,
                        dateFormat:  "yy-mm-dd",
                        showAnim: "slideDown"
		});
               
                    
                $.datepicker.regional[\'english\'] = {
		closeText: \'Done\',
		prevText: \'Prev\',
		nextText: \'Next\',
		currentText: \'Today\',
		monthNames: [\'January\',\'February\',\'March\',\'April\',\'May\',\'June\',
		\'July\',\'August\',\'September\',\'October\',\'November\',\'December\'],
		monthNamesShort: [\'Jan\', \'Feb\', \'Mar\', \'Apr\', \'May\', \'Jun\',
		\'Jul\', \'Aug\', \'Sep\', \'Oct\', \'Nov\', \'Dec\'],
		dayNames: [\'Sunday\', \'Monday\', \'Tuesday\', \'Wednesday\', \'Thursday\', \'Friday\', \'Saturday\'],
		dayNamesShort: [\'Sun\', \'Mon\', \'Tue\', \'Wed\', \'Thu\', \'Fri\', \'Sat\'],
		dayNamesMin: [\'Su\',\'Mo\',\'Tu\',\'We\',\'Th\',\'Fr\',\'Sa\'],
		weekHeader: \'Wk\',
		dateFormat: \'dd/mm/yy\',
		firstDay: 1,
		isRTL: false,
		showMonthAfterYear: false,
		yearSuffix: \'\'};
                    
                $.datepicker.regional[\'russian\'] = {
		closeText: \'Закрыть\',
		prevText: \'&#x3c;Пред\',
		nextText: \'След&#x3e;\',
		currentText: \'Сегодня\',
		monthNames: [\'Январь\',\'Февраль\',\'Март\',\'Апрель\',\'Май\',\'Июнь\',
		\'Июль\',\'Август\',\'Сентябрь\',\'Октябрь\',\'Ноябрь\',\'Декабрь\'],
		monthNamesShort: [\'Янв\',\'Фев\',\'Мар\',\'Апр\',\'Май\',\'Июн\',
		\'Июл\',\'Авг\',\'Сен\',\'Окт\',\'Ноя\',\'Дек\'],
		dayNames: [\'воскресенье\',\'понедельник\',\'вторник\',\'среда\',\'четверг\',\'пятница\',\'суббота\'],
		dayNamesShort: [\'вск\',\'пнд\',\'втр\',\'срд\',\'чтв\',\'птн\',\'сбт\'],
		dayNamesMin: [\'Вс\',\'Пн\',\'Вт\',\'Ср\',\'Чт\',\'Пт\',\'Сб\'],
		weekHeader: \'Нед\',
		dateFormat: \'dd.mm.yy\',
		firstDay: 1,
		isRTL: false,
		showMonthAfterYear: false,
		yearSuffix: \'\'};
                    
                $.datepicker.regional[\'ukrainian\'] = {
		closeText: \'Закрити\',
		prevText: \'&#x3c;\',
		nextText: \'&#x3e;\',
		currentText: \'Сьогодні\',
		monthNames: [\'Січень\',\'Лютий\',\'Березень\',\'Квітень\',\'Травень\',\'Червень\',
		\'Липень\',\'Серпень\',\'Вересень\',\'Жовтень\',\'Листопад\',\'Грудень\'],
		monthNamesShort: [\'Січ\',\'Лют\',\'Бер\',\'Кві\',\'Тра\',\'Чер\',
		\'Лип\',\'Сер\',\'Вер\',\'Жов\',\'Лис\',\'Гру\'],
		dayNames: [\'неділя\',\'понеділок\',\'вівторок\',\'середа\',\'четвер\',\'п’ятниця\',\'субота\'],
		dayNamesShort: [\'нед\',\'пнд\',\'вів\',\'срд\',\'чтв\',\'птн\',\'сбт\'],
		dayNamesMin: [\'Нд\',\'Пн\',\'Вт\',\'Ср\',\'Чт\',\'Пт\',\'Сб\'],
		weekHeader: \'Тиж\',
		dateFormat: \'dd/mm/yy\',
		firstDay: 1,
		isRTL: false,
		showMonthAfterYear: false,
		yearSuffix: \'\'};
                
	$.datepicker.setDefaults($.datepicker.regional[\'' . $curlang . '\']);
      

	});
	</script>
        
        <input type="text" id="' . $inputid . '" name="' . $field . '" value="' . $date . '" size="10">
        ';
    return $result;
}
Exemplo n.º 8
0
<?php

$user_ip = zbs_UserDetectIp('debug');
$user_login = zbs_UserGetLoginByIp($user_ip);
$us_config = zbs_LoadConfig();
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'] . '&nbsp;' . 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.'));
    }
Exemplo n.º 9
0
 /**
  * Loads userstats.ini into protected property for further usage
  * 
  * @return void
  */
 protected function loadCfg()
 {
     $this->usCfg = zbs_LoadConfig();
 }
Exemplo n.º 10
0
/**
 * Returns current skin path
 * 
 * @param array $usConfig preloaded usrstats config as array
 * 
 * @return string
 */
function zbs_GetCurrentSkinPath($usConfig = array())
{
    if (empty($usConfig)) {
        $usConfig = zbs_LoadConfig();
    }
    $basePath = 'skins/';
    $skinName = 'default';
    if (isset($usConfig['SKIN'])) {
        $skinName = $usConfig['SKIN'];
    }
    $result = $basePath . $skinName . '/';
    return $result;
}
Exemplo n.º 11
0
/**
 * Pushes native redirect
 * 
 * @param string $url
 * @param bool $header
 */
function rcms_redirect($url, $header = false)
{
    if ($header) {
        @header('Location: ' . $url);
    } else {
        print '<script language="javascript">document.location.href="' . $url . '";</script>';
    }
}
$ContentContainer = '';
$statsconfig = zbs_LoadConfig();
// set default lang
$lang = $statsconfig['lang'];
if ($statsconfig['allowclang']) {
    // if language change is allowed
    if (isset($_GET['changelang'])) {
        $lang = $_GET['changelang'];
    } else {
        if (isset($_COOKIE['zbs_lang'])) {
            $lang = $_COOKIE['zbs_lang'];
        }
    }
}
setcookie("zbs_lang", $lang, time() + 2592000);
$langglobal = zbs_LoadLang($lang);
//setting auth cookies subroutine
Exemplo n.º 12
0
<?php

$usConfig = zbs_LoadConfig();
if ($usConfig['TRAFFIC_ENABLED']) {
    $user_ip = zbs_UserDetectIp('debug');
    $user_login = zbs_UserGetLoginByIp($user_ip);
    show_window(__('Traffic stats'), zbs_UserTraffStats($user_login));
} else {
    show_window(__('Sorry'), __('This module is disabled'));
}