Exemplo n.º 1
0
function more_feedbacks($tuid, $page, $total_cnt)
{
    $per_page = 5;
    $objResponse =& new xajaxResponse();
    $tservices = new tservices();
    $feedbacks = $tservices->setPage($per_page, $page)->getFeedbacks($tuid);
    $sHtml = Template::render(ABS_PATH . '/tu/tpl.feedbacks-items.php', array('feedbacks' => $feedbacks));
    $local_cnt = $per_page * $page;
    $objResponse->call('ap_feedbacks.setContent', $sHtml, $local_cnt >= $total_cnt);
    return $objResponse;
}
 protected function _getTabTu($user, $page = 1)
 {
     require_once ABS_PATH . '/classes/tservices/tservices.php';
     require_once ABS_PATH . '/tu/models/TServiceItemIterator.php';
     $tab = null;
     $tservices = new tservices($user['uid']);
     $list = $tservices->setPage($this->limit, $page)->getShortList();
     if ($list) {
         $total = $tservices->getCount();
         $pages = ceil($total / $this->limit);
         $tab = array('elements' => new TServiceItemIterator($user, $list), 'pages' => $pages, 'page' => $page);
     }
     return $tab;
 }
Exemplo n.º 3
0
$tservices_categories = new tservices_categories();
$result = $tservices_categories->getTitleAndSubtitle(10);
assert('$result == array("spec_title" => "Веб-программирование", "group_title" => "Разработка сайтов")');
$result = $tservices_categories->getCategoryParentId(10);
assert('$result == 7');
$tservices_tags = new tservices_tags();
$result = $tservices_tags->getsByTServiceId(39);
assert('$result == array( 0 => "альбом", 1 => "бронировать", 2 => "забронировать", 3 => "заказать", 4 => "заказывать", 5 => "зарезервировать" )');
$tservices = new tservices(2);
$result = $tservices->isExistFeedbacks(27);
assert('$result == 2');
$result = $tservices->getTotalCount();
assert('$result == array("plus" => 2, "minus" => 2)');
$result = $tservices->getNearBy('next', 38);
$result = $tservices->getNearBy('prev', 38);
$result = $tservices->getCountCompleteSbrServices();
assert('$result == 5');
$result = $tservices->deleteById(750);
assert('$result == TRUE');
$result = $tservices->isExists(749);
$result = $tservices->getFeedbacks(36);
$result = $tservices->getCard(36);
$result = $tservices->setPage(5)->getShortList();
$result = $tservices->initProps();
assert('$tservices->user_id == 2');
$result = $tservices->fieldsPropsToArray();
$stop_words = new stop_words();
print_r($stop_words);
//print_r($cfile);
//var_dump($result);
exit;
Exemplo n.º 4
0
        $js_file[] = 'tservices/fineuploader.js';
        $js_file[] = 'tservices/tservices.js';
        require_once $_SERVER['DOCUMENT_ROOT'] . '/tu/yii/tinyyii.php';
        require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/tservices/functions.php';
        require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/tservices/tservices_helper.php';
        require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/tservices/tservices.php';
        require_once $_SERVER['DOCUMENT_ROOT'] . '/tu/widgets/TServiceOrderDebtMessage.php';
        $page = __paramInit('int', 'page', 'page', 1);
        if ($page <= 0) {
            $page = 1;
        }
        $is_owner = $user->uid == $uid;
        $is_perm = hasPermissions('tservices');
        $is_not_public = $is_owner || $is_perm;
        $tservices = new tservices($user->uid);
        $data = $tservices->setPage($on_page, $page)->getShortList(!$is_not_public);
        $cnt = $tservices->getCount(!$is_not_public);
        //Виджет для рендера сообщения о блокировки
        $tserviceOrderDebtMessageWidget = new TServiceOrderDebtMessage();
        $tserviceOrderDebtMessageWidget->init($user->uid);
        $inner = 'tu_inner.php';
        $activ_tab = 2;
        //SEO
        $page_title = 'Типовые услуги на FL.ru';
        //$page_descr = '';
        //$page_keyw = '';
        break;
}
if (!$user->login) {
    include ABS_PATH . '/404.php';
    exit;
Exemplo n.º 5
0
        include ABS_PATH . '/404.php';
        exit;
    }
}
//------------------------------------------------------------------------------
$user_phone_block = user_phone::getInstance()->render(user_phone::PLACE_HEADER);
//------------------------------------------------------------------------------
$_SESSION['tu_ref_uri'] = @$_SESSION['ref_uri'];
//------------------------------------------------------------------------------
//Форматирование кол-ва отзывов
if ($data['total_feedbacks']) {
    $total = intval($data['total_feedbacks']);
    $plus = intval($data['plus_feedbacks']);
    $data['perplus_feedbacks'] = $plus > 0 ? round($plus * 100 / $total) : 0;
}
$feedbacks = $tservices->setPage(feedbacks_per_page)->getFeedbacks($data['id']);
$is_feedbacks_paginator = $data['total_feedbacks'] > count($feedbacks);
//------------------------------------------------------------------------------
//SEO
SeoTags::getInstance()->initTServicesCard($data, $user_obj);
$page_title = SeoTags::getInstance()->getTitle();
$page_descr = SeoTags::getInstance()->getDescription();
$page_keyw = SeoTags::getInstance()->getKeywords();
$canonical_url = $GLOBALS['host'] . tservices_helper::card_link($data['id'], $data['title']);
//------------------------------------------------------------------------------
//Получение текстового наименования города возможной встречи
if ($data['is_meet'] === 't') {
    $city = new city();
    $data['location'] = 'г. ' . $city->getCityName($data['city']);
}
//------------------------------------------------------------------------------