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: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 
<?php

if (!defined("OBJENABLED")) {
    require_once(dirname(__FILE__) . "/obj.class.php");
}

/**

 * @author PHPShop Software
 * @version 1.2
 * @package PHPShopObj
 */
class PHPShopUser extends PHPShopObj {

    /**


     */
    function __construct($objID) {
        $this->objID = $objID;
        $this->cache = false;
        $this->objBase = $GLOBALS['SysValue']['base']['shopusers'];
        parent::__construct();
    }

    /**


     * @return string 
     */
    function getParam($str) {
        return str_replace("\"", "&quot;", parent::getParam($str));
    }

    /**

     * @return string 
     */
    function getAdresList() {
        $data_adres = unserialize(parent::getParam('data_adres'));
        if (!is_array($data_adres) OR !count($data_adres['list']))
            return "";

        foreach ($data_adres['list'] as $index => $data_adres_one) {
            $dis = "";
            foreach ($data_adres_one as $key => $value) {
                if ($value)
                    $dis .= " ," . $value;
            }
            if ($dis) {
                if ($index == $data_adres['main'])
                    $sel = 'selected="selected"';
                else
                    $sel = "";
                $disp .= '<option value="' . $index . '" ' . $sel . '>' . substr($dis, 2) . '</option>';
            }
        }
        if ($disp)
            $disp = '
                <b>'.__('').'</b>    
                <select name="adres_id" id="adres_id" class="form-control selectpicker show-menu-arrow">
                <option value="none">'.__('').'</option>
                ' . $disp . '
                </select><br>
                <input type="checkbox" name="adres_this_default" value="1">  '.__('').'
                <input type="hidden" class="adresListJson" value=\'' . PHPShopString::json_safe_encode($data_adres['list']) . '\'>
                ';
        return $disp;
    }

    /**


     * @return string 
     */
    function getValue($str) {
        return $this->getParam($str);
    }

    /**

     * @return string
     */
    function getName() {
        return $this->getParam("name");
    }

    /**

     * @return string
     */
    function getPersonalDiscount() {
        return $this->getParam("cumulative_discount");
    }


    /**

     * @return int 
     */
    function getStatus() {
        return $this->getParam("status");
    }

    /**

     * @return string 
     */
    function getStatusName() {
        $PHPShopUserStatus = new PHPShopUserStatus($this->getStatus());
        return $PHPShopUserStatus->getParam("name");
    }

    /**

     * @return float 
     */
    function getDiscount() {
        $PHPShopUserStatus = new PHPShopUserStatus($this->getStatus());
        return $PHPShopUserStatus->getDiscount();
    }
    
    /**

     * @return int
     */
    function getBonus(){
        return intval($this->getParam("bonus"));
    }
    
}

/**

 * @author PHPShop Software
 * @version 1.0
 * @package PHPShopObj
 */
class PHPShopUserStatus extends PHPShopObj {

    /**



     */
    function __construct($objID, $import_data = null) {
        $this->objID = $objID;
        $this->cache = true;
        $this->objBase = $GLOBALS['SysValue']['base']['table_name28'];
        parent::__construct('id', $import_data);
    }

    /**

     * @return int
     */
    function getPrice() {
        return parent::getParam("price");
    }

    /**

     * @return float
     */
    function getDiscount() {
        //
        $discount_status = parent::getParam("discount");
        //
        $PHPShopUser = new PHPShopUser($_SESSION['UsersId']);
        $discount_user = $PHPShopUser->getPersonalDiscount();
        //
        $discount = max($discount_status, $discount_user);

        return $discount;
    }

}

/**

 * @author PHPShop Software
 * @version 1.0
 * @package PHPShopClass
 */
class PHPShopUserFunction {

    /**


     * @return array
     */
    static function ChekDiscount($mysum) {
        global $PHPShopSystem,$link_db;

        $maxsum = 0;
        $userdiscount = 0;
        $maxdiscount = 0;

        $sql = "select * from " . $GLOBALS['SysValue']['base']['table_name23'] . " where sum < '$mysum' and enabled='1'";
        $result = mysqli_query($link_db,$sql);
        while ($row = mysqli_fetch_array($result)) {
            $sum = $row['sum'];
            if ($sum > $maxsum) {
                $maxsum = $sum;
                $maxdiscount = $row['discount'];
            }
        }

        if (!empty($_SESSION['UsersStatus'])) {
            $PHPShopUserStatus = new PHPShopUserStatus($_SESSION['UsersStatus']);
            $userdiscount = $PHPShopUserStatus->getDiscount();
        }
        else
            $userdiscoun = 0;

        if ($userdiscount > $maxdiscount)
            $maxdiscount = $userdiscount;

        $sum = $mysum - ($mysum * @$maxdiscount / 100);
        $format = $PHPShopSystem->getSerilizeParam("admoption.price_znak");
        $array = array(0 + @$maxdiscount, number_format($sum, $format, ".", ""));

        return $array;
    }

}


/**

 * @author PHPShop Software
 * @version 1.0
 * @package PHPShopArray
 */
class PHPShopUserStatusArray extends PHPShopArray {

    function __construct() {
        $this->objBase=$GLOBALS['SysValue']['base']['shopusers_status'];
        $this->objSQL=array('enabled'=>"='1'");
        parent::__construct('id',"name",'discount','price');
    }
    
    
    
    
}
?>
PHPShop 6.X API documentation generated by ApiGen