Overview

Packages

  • None
  • PHPShopAjaxElements
  • PHPShopAjaxElementsDepricated
  • PHPShopArray
  • PHPShopClass
    • Helper
  • PHPShopCore
  • PHPShopCoreDepricated
  • PHPShopCoreFunction
  • PHPShopDepricated
  • PHPShopElements
  • PHPShopElementsDepricated
  • PHPShopGUI
  • PHPShopInc
  • PHPShopObj
  • PHPShopParser
  • PHPShopShopCore
  • PHPShopTest

Classes

  • AjaxNotice
  • AjaxPricemail
  • AjaxReview
  • fase4_rdf
  • inwords
  • PHPShop404
  • PHPShopAdminRule
  • PHPShopAnalitica
  • PHPShopArray
  • PHPShopBannerElement
  • PHPShopBase
  • PHPShopBaseXml
  • PHPShopBonus
  • PHPShopBrandsElement
  • PHPShopCart
  • PHPShopCartElement
  • PHPShopCategory
  • PHPShopCategoryArray
  • PHPShopClients
  • PHPShopCloudElement
  • PHPShopCommerceML
  • PHPShopCompanyArray
  • PHPShopCompare
  • PHPShopCore
  • PHPShopCoreElement
  • PHPShopCoretest
  • PHPShopCssParser
  • PHPShopCurrencyElement
  • PHPShopDate
  • PHPShopDebug
  • PHPShopDelivery
  • PHPShopDeliveryArray
  • PHPShopDoc
  • PHPShopDone
  • PHPShopElements
  • PHPShopError
  • PHPShopExcel
  • PHPShopFail
  • PHPShopFile
  • PHPShopForma
  • PHPShopFrontInterface
  • PHPShopGbook
  • PHPShopGbookElement
  • PHPShopGUI
  • PHPShopIndex
  • PHPShopInterface
  • PHPShopLang
  • PHPShopLinks
  • PHPShopMail
  • PHPShopMailFile
  • PHPShopMap
  • PHPShopMath
  • PHPShopModules
  • PHPShopNav
  • PHPShopNewprice
  • PHPShopNews
  • PHPShopNewsElement
  • PHPShopNewtip
  • PHPShopObj
  • PHPShopOpros
  • PHPShopOprosElement
  • PHPShopOrder
  • PHPShopOrderDelivery
  • PHPShopOrderFunction
  • PHPShopOrderStatusArray
  • PHPShopOrm
  • PHPShopPage
  • PHPShopPageCatalogElement
  • PHPShopPageCategory
  • PHPShopPageCategoryArray
  • PHPShopPages
  • PHPShopParentNameArray
  • PHPShopParser
  • PHPShopPayment
  • PHPShopPaymentArray
  • PHPShopPaymentResult
  • PHPShopPhoto
  • PHPShopPhotoCategory
  • PHPShopPhotoCategoryArray
  • PHPShopPhotoElement
  • PHPShopPrice
  • PHPShopPricemail
  • PHPShopPrint
  • PHPShopProduct
  • PHPShopProductArray
  • PHPShopProductElements
  • PHPShopProductFunction
  • PHPShopProductIconElements
  • PHPShopProductIndexElements
  • PHPShopPromotions
  • PHPShopPush
  • PHPShopReadCsvNative
  • PHPShopRecaptchaElement
  • PHPShopRestore
  • PHPShopRssParser
  • PHPShopSearch
  • PHPShopSecurity
  • PHPShopSelection
  • PHPShopSelectioncat
  • PHPShopShop
  • PHPShopShopCatalogElement
  • PHPShopShopCore
  • PHPShopSkinElement
  • PHPShopSliderElement
  • PHPShopSort
  • PHPShopSortAjax
  • PHPShopSortArray
  • PHPShopSortCategoryArray
  • PHPShopSortElement
  • PHPShopSortSearch
  • PHPShopSpec
  • PHPShopString
  • PHPShopSuccess
  • PHPShopSystem
  • PHPShopTemplates
  • PHPShopText
  • PHPShopTextElement
  • PHPShopUnsubscribe
  • PHPShopUpdate
  • PHPShopUser
  • PHPShopUserElement
  • PHPShopUserFunction
  • PHPShopUsers
  • PHPShopUserStatus
  • PHPShopUserStatusArray
  • PHPShopValuta
  • PHPShopValutaArray
  • rateForComment
  • XMLparser

Functions

  • __
  • __hide
  • _e
  • action_order_info
  • allowedFunctions
  • array2iconv
  • avg_rate
  • calendar
  • catalog_meta
  • CheckCanGzip
  • comment_rate
  • debug
  • delivery
  • DispComment
  • evalstr
  • GetDeliveryPrice
  • getExcelInfoUid
  • GetFile
  • getFotoIconPodrobno
  • getfullname
  • getgoodname
  • getLicense
  • GetVoteValue
  • getYandexSearchSql
  • GzDocOut
  • image_gallery
  • import
  • json_encode
  • json_fix_cyr
  • json_fix_utf
  • mailcartforma
  • makeCalendar
  • message_activation
  • message_register_success
  • MessageList
  • moname
  • Nav_comment
  • Nav_messages
  • notice_add
  • notice_list
  • notice_mail
  • NumFrom
  • option_check
  • option_select
  • option_select_add
  • order_list
  • ordercartforma
  • Page_comment
  • Page_messages
  • parse_ini_file_true
  • parseDatabase
  • Parser
  • ParseTemplate
  • ParseTemplateReturn
  • PHPShopAutoLoadClass
  • phpshopparserevalstr
  • preExtractCallBack
  • product_meta
  • query_filter
  • query_multibase
  • rating
  • ratingshort
  • ratingtop
  • readDatabase
  • returnSmile
  • search_base
  • set_meta
  • setAutokeyword
  • ShowStars
  • ShowStars2
  • sort_table
  • sorttemplateexample
  • stripslashes_deep
  • SysValueReturn
  • timer
  • tmpGetFile
  • user_message
  • usercartforma
  • userdeleveryforma
  • userfiles
  • userorderdoclink
  • userorderfiles
  • userorderpaymentlink
  • utf8_win1251
  • writeLangFile
  • xml2array
  • Overview
  • Package
  • Class
  • Tree
  1:   2:   3:   4:   5:   6:   7:   8:   9:  10:  11:  12:  13:  14:  15:  16:  17:  18:  19:  20:  21:  22:  23:  24:  25:  26:  27:  28:  29:  30:  31:  32:  33:  34:  35:  36:  37:  38:  39:  40:  41:  42:  43:  44:  45:  46:  47:  48:  49:  50:  51:  52:  53:  54:  55:  56:  57:  58:  59:  60:  61:  62:  63:  64:  65:  66:  67:  68:  69:  70:  71:  72:  73:  74:  75:  76:  77:  78:  79:  80:  81:  82:  83:  84:  85:  86:  87:  88:  89:  90:  91:  92:  93:  94:  95:  96:  97:  98:  99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 
<?php

/**

 * @author PHPShop Software
 * @version 1.7
 * @package PHPShopCoreFunction

 * @return mixed
 */
function sort_table($obj, $row) {
    global $SysValue;

    $sort = $obj->PHPShopCategory->unserializeParam('sort');
    $vendor_array = unserialize($row['vendor_array']);
    $dis = $sortCat = $sortValue = null;
    $arrayVendorValue = array();
    $odnotip = $row['odnotip'];

    if (is_array($sort))
        foreach ($sort as $v) {
            $sortCat.=intval($v) . ',';
        }

    if (!empty($sortCat)) {

        //
        $PHPShopOrm = new PHPShopOrm();
        $PHPShopOrm->debug = $obj->debug;
        $result = $PHPShopOrm->query("select * from " . $SysValue['base']['sort_categories'] . " where id IN ( $sortCat 0) order by num");
        while (@$row = mysqli_fetch_assoc($result)) {
            $arrayVendor[$row['id']] = $row;
        }

        if (is_array($vendor_array))
            foreach ($vendor_array as $v) {
                foreach ($v as $value)
                    if (is_numeric($value))
                        $sortValue.=intval($value) . ',';
            }



        if (!empty($sortValue)) {

            //
            $PHPShopOrm = new PHPShopOrm();
            $PHPShopOrm->debug = $obj->debug;
            $result = $PHPShopOrm->query("select * from " . $SysValue['base']['sort'] . " where id IN ( $sortValue 0) order by num");
            while (@$row = mysqli_fetch_array($result)) {

                //
                if ($row['name'][0] == '#')
                    $arrayVendorValue[$row['category']]['name'][$row['id']] = '  <div class="sort-color" style="width:25px;height:25px;background:' . $row['name'] . ';float:left;padding:3px;margin:3px;"></div>  ';
                else
                    $arrayVendorValue[$row['category']]['name'][$row['id']] = $row['name'];

                $arrayVendorValue[$row['category']]['id'][] = $row['id'];

                if(!empty($row['page'])) {
                    $arrayVendorValue[$row['category']]['page'][$row['id']] = $row['page'];
                }

                //
                if ($arrayVendor[$row['category']]['brand']) {
                    $obj->set('brandIcon', $row['icon']);
                    $obj->set('brandName', $row['name']);
                    if ($row['page']) {
                        $PHPShopOrm->clean();
                        $res = $PHPShopOrm->query("select content from " . $SysValue['base']['page'] . " where link = '$row[page]' LIMIT 1");
                        $page = mysqli_fetch_array($res);
                        $desc = stripslashes($page['content']);
                    }

                    $obj->set('brandPageLink', '/selection/?v[' . $row['category'] . ']=' . $row['id']);
                    if (@$desc) {
                        $obj->set('brandDescr', $desc);
                    } else {
                        $obj->set('brandDescr', '');
                    }

                    $obj->set('brandUidDescription', ParseTemplateReturn('product/brand_uid_description.tpl'), true);
                }
            }

            //
            if (is_array($arrayVendor))
                foreach ($arrayVendor as $idCategory => $value) {
                     
                    if (!empty($value['product']) and strstr($odnotip, ',')) {

                        $where['id'] = ' IN (' . $odnotip . ')';
                        $where['enabled'] = "='1'";

                        $PHPShopOrm = new PHPShopOrm($GLOBALS['SysValue']['base']['products']);
                        $PHPShopOrm->debug = false;
                        $PHPShopOrm->mysql_error = false;
                        $data = $PHPShopOrm->select(array('*'), $where, false, array('limit' => 100));
                        if (is_array($data)) {
                            $sortValueName = null;
                            foreach ($data as $row) {

                                if (!isset($row['prod_seo_name']))
                                    $p_link = '/shop/UID_' . $row['id'] . '.html';
                                else
                                    $p_link = '/id/' . str_replace("_", "-", PHPShopString::toLatin($row['name'])) . '-' . $row['id'] . '.html';

                                $sortValueName.= PHPShopText::a($p_link, $row['name'],false, false, false, false, 'sort-table-product-link',$row['pic_small']) . '<br>';
                            }
                        }

                        $sortName = PHPShopText::b($value['name']);
                        $dis.=PHPShopText::tr($sortName . ': ', substr($sortValueName, 0, strlen($sortValueName) - 2));
                    }

                    elseif (!empty($arrayVendorValue[$idCategory]['name'])) {
                        if (!empty($value['name'])) {

                            //
                            if (!empty($value['page']))
                                $sortName = PHPShopText::a('/page/' . $value['page'] . '.html', $value['name']);
                            else
                                $sortName = PHPShopText::b($value['name']);

                            if (!empty($value['brand'])) {
                                $arr = array();
                                foreach ($arrayVendorValue[$idCategory]['id'] as $valueId) {
                                    $arr[] = PHPShopText::a('/selection/?v[' . $idCategory . ']=' . $valueId, $arrayVendorValue[$idCategory]['name'][$valueId]);
                                }
                                $sortValueName = implode(', ', $arr);
                            }
                            else if (isset($arrayVendorValue[$idCategory]['page'])) {
                                $arr = array();
                                foreach ($arrayVendorValue[$idCategory]['id'] as $valueId) {
                                    $arr[] = PHPShopText::a('/page/' . $arrayVendorValue[$idCategory]['page'][$valueId] . '.html', $arrayVendorValue[$idCategory]['name'][$valueId]);
                                }
                                $sortValueName = implode(', ', $arr);
                            } else {
                                $arr = array();
                                foreach ($arrayVendorValue[$idCategory]['id'] as $valueId) {
                                    $arr[] = $arrayVendorValue[$idCategory]['name'][$valueId];
                                }
                                $sortValueName = implode(', ', $arr);
                            }
                            $dis.=PHPShopText::tr($sortName . ': ', $sortValueName);
                        }
                    }
                }

            $disp = PHPShopText::table($dis, $cellpadding = 3, $cellspacing = 3, $align = '', $width = '100%', $bgcolor = false, $border = 0, $id = false, 'vendorenabled');
            $obj->set('vendorDisp', $disp);
        }
    }
}

?>
PHPShop 6.X API documentation generated by ApiGen