Exemplo n.º 1
0
 function GetCity($arFields)
 {
     $iPPID = IntVal($arFields["PP_ID"]) ? IntVal($arFields["PP_ID"]) : 0;
     $iID = 0;
     $iBXCityID = 0;
     $sCode = strlen($arFields["CODE"]) ? $arFields["CODE"] : "";
     $iPrice = 0;
     $sActive = "N";
     if ($iPPID) {
         $obPPCity = CPickpoint::SelectCityByPPID($iPPID);
         if ($arPPCity = $obPPCity->Fetch()) {
             $iBXID = $arPPCity["BX_ID"];
             if ($arPPCity["ACTIVE"] == "Y") {
                 $sActive = "Y";
             }
             $arBXCity = CPickpoint::SelectCityByID($iBXID);
             $iPrice = FloatVal($arPPCity["PRICE"]);
             $sCode = $arBXCity["CITY_NAME"];
         } else {
             $arCity = CPickpoint::SelectCityByCode($sCode);
             $iBXID = $arCity["ID"];
         }
     } else {
         $arCity = CPickpoint::SelectCityByCode($sCode);
         $iBXID = $arCity["ID"];
         $iPPID = 0;
     }
     #ID#
     #CODE (BX or PP ? exists)#
     #PP_ID#
     #BX_ID#
     #PRICE#
     return array("ID" => $iID, "CODE" => $sCode, "PP_ID" => $iPPID, "BX_ID" => $iBXID, "PRICE" => $iPrice, "ACTIVE" => $sActive);
 }
Exemplo n.º 2
0
 function __GetLocationPrice($LOCATION_ID, $arConfig)
 {
     if (!CheckPickpointLicense(COption::GetOptionString("epages.pickpoint", "pp_ikn_number", ""))) {
         return false;
     }
     $obCity = CPickpoint::SelectCityByBXID($LOCATION_ID);
     if ($arCity = $obCity->Fetch()) {
         if ($arCity["ACTIVE"] == "Y") {
             return FloatVal($arCity["PRICE"]);
         }
     }
     return false;
 }
 public function run($args)
 {
     if (!isset($args[0])) {
         echo "./yiic importstatistik [dateiname]\n";
         die;
     }
     $sql = Yii::app()->db->createCommand();
     $sql->delete('statistik_datensaetze', ["quelle = " . StatistikDatensatz::QUELLE_BEVOELKERUNG]);
     $arr = $this->csv_to_array($args[0]);
     $floatize = function ($in) {
         if (trim($in) == "") {
             return null;
         }
         return FloatVal(str_replace(",", ".", $in));
     };
     foreach ($arr as $i => $row) {
         if ($i % 100 == 0) {
             echo $i . "\n";
         }
         $dat = new StatistikDatensatz();
         $dat->quelle = StatistikDatensatz::QUELLE_BEVOELKERUNG;
         $dat->indikator_gruppe = $row["INDIKATOR_GRUPPE"];
         $dat->indikator_bezeichnung = $row["INDIKATOR_BEZEICHNUNG"];
         $dat->indikator_auspraegung = $row["INDIKATOR_AUSPRAEGUNG"];
         $dat->indikator_wert = $floatize($row["INDIKATOR_WERT"]);
         $dat->basiswert_1 = $floatize($row["BASISWERT_1"]);
         $dat->basiswert_1_name = $row["NAME_BASISWERT1"];
         $dat->basiswert_2 = $floatize($row["BASISWERT_2"]);
         $dat->basiswert_2_name = $row["NAME_BASISWERT2"];
         $dat->basiswert_3 = $floatize($row["BASISWERT_3"]);
         $dat->basiswert_3_name = $row["NAME_BASISWERT3"];
         $dat->basiswert_4 = $floatize($row["BASISWERT_4"]);
         $dat->basiswert_4_name = $row["NAME_BASISWERT4"];
         $dat->basiswert_5 = $floatize($row["BASISWERT_5"]);
         $dat->basiswert_5_name = $row["NAME_BASISWERT5"];
         $dat->jahr = $row["JAHR"];
         $dat->gliederung = $row["GLIEDERUNG"];
         $dat->gliederung_nummer = $row["NUMMER"];
         $dat->gliederung_name = $row["NAME"];
         if (!$dat->save()) {
             var_dump($dat->getErrors());
         }
     }
 }
 /**
  * @param $dbarray_or_id
  * @throws Exception
  */
 function __construct($dbarray_or_id)
 {
     if (is_numeric($dbarray_or_id) && count($this->PRIMARY_KEY) == 1) {
         $dbarray_or_id = q("SELECT * FROM %s%s%s WHERE %s=%d", CALDAV_SQL_DB, CALDAV_SQL_PREFIX, $this->SRC_TABLE, $this->PRIMARY_KEY[0], IntVal($dbarray_or_id));
         if (count($dbarray_or_id) == 0) {
             throw new Exception("Not found");
         }
         $dbarray_or_id = $dbarray_or_id[0];
     }
     if (is_array($dbarray_or_id)) {
         foreach ($this->_string_fields as $field) {
             $this->{$field} = $dbarray_or_id[$field];
         }
         foreach ($this->_int_fields as $field) {
             $this->{$field} = IntVal($dbarray_or_id[$field]);
         }
         foreach ($this->_float_fields as $field) {
             $this->{$field} = FloatVal($dbarray_or_id[$field]);
         }
     } else {
         throw new Exception("Not found");
     }
 }
Exemplo n.º 5
0
 /**
  * get sku for product
  *
  * @param integer $USER_ID
  * @param string  $LID
  * @param integer $PRODUCT_ID
  * @param string  $PRODUCT_NAME
  * @return array
  */
 function GetProductSku($USER_ID, $LID, $PRODUCT_ID, $PRODUCT_NAME = '', $CURRENCY = '')
 {
     $USER_ID = IntVal($USER_ID);
     $PRODUCT_ID = IntVal($PRODUCT_ID);
     if ($PRODUCT_ID <= 0) {
         return false;
     }
     $LID = trim($LID);
     if (strlen($LID) <= 0) {
         return false;
     }
     $PRODUCT_NAME = trim($PRODUCT_NAME);
     $arResult = array();
     $arOffers = array();
     $arGroups = CUser::GetUserGroup($USER_ID);
     $dbProduct = CIBlockElement::GetList(array(), array("ID" => $PRODUCT_ID), false, false, array('IBLOCK_ID', 'IBLOCK_SECTION_ID', 'PREVIEW_PICTURE', 'DETAIL_PICTURE'));
     $arProduct = $dbProduct->Fetch();
     static $arOffersIblock = array();
     if (!is_set($arOffersIblock[$arProduct["IBLOCK_ID"]])) {
         $mxResult = CCatalogSKU::GetInfoByProductIBlock($arProduct["IBLOCK_ID"]);
         if (is_array($mxResult)) {
             $arOffersIblock[$arProduct["IBLOCK_ID"]] = $mxResult["IBLOCK_ID"];
         }
     }
     if ($arOffersIblock[$arProduct["IBLOCK_ID"]] > 0) {
         static $arCacheOfferProperties = array();
         if (!is_set($arCacheOfferProperties[$arOffersIblock[$arProduct["IBLOCK_ID"]]])) {
             $dbOfferProperties = CIBlock::GetProperties($arOffersIblock[$arProduct["IBLOCK_ID"]], array(), array("!XML_ID" => "CML2_LINK"));
             while ($arOfferProperties = $dbOfferProperties->Fetch()) {
                 $arCacheOfferProperties[$arOffersIblock[$arProduct["IBLOCK_ID"]]][] = $arOfferProperties;
             }
         }
         $arOfferProperties = $arCacheOfferProperties[$arOffersIblock[$arProduct["IBLOCK_ID"]]];
         $arIblockOfferProps = array();
         $arIblockOfferPropsFilter = array();
         if (is_array($arOfferProperties)) {
             foreach ($arOfferProperties as $val) {
                 $arIblockOfferProps[] = array("CODE" => $val["CODE"], "NAME" => $val["NAME"]);
                 $arIblockOfferPropsFilter[] = $val["CODE"];
             }
         }
         $arOffers = CIBlockPriceTools::GetOffersArray($arProduct["IBLOCK_ID"], $PRODUCT_ID, array("ID" => "DESC"), array("NAME"), $arIblockOfferPropsFilter, 0, array(), 1, array(), $USER_ID, $LID);
         $arSku = array();
         $minItemPrice = 0;
         $minItemPriceFormat = "";
         $arSkuId = array();
         $arImgSku = array();
         foreach ($arOffers as $arOffer) {
             $arSkuId[] = $arOffer['ID'];
         }
         if (count($arSkuId) > 0) {
             $res = CIBlockElement::GetList(array(), array("ID" => $arSkuId), false, false, array("ID", "NAME", "PREVIEW_PICTURE", "DETAIL_PICTURE", "DETAIL_PAGE_URL", "IBLOCK_TYPE_ID"));
             while ($arOfferImg = $res->Fetch()) {
                 $arImgSku[$arOfferImg["ID"]] = $arOfferImg;
             }
         }
         foreach ($arOffers as $arOffer) {
             $arPrice = CCatalogProduct::GetOptimalPrice($arOffer['ID'], 1, $arGroups, "N", array(), $LID);
             if (count($arPrice) <= 0) {
                 break;
             } elseif (strlen($CURRENCY) > 0) {
                 $arPrice["PRICE"]["PRICE"] = CCurrencyRates::ConvertCurrency($arPrice["PRICE"]["PRICE"], $arPrice["PRICE"]["CURRENCY"], $CURRENCY);
                 if ($arPrice["DISCOUNT_PRICE"] > 0) {
                     $arPrice["DISCOUNT_PRICE"] = CCurrencyRates::ConvertCurrency($arPrice["DISCOUNT_PRICE"], $arPrice["PRICE"]["CURRENCY"], $CURRENCY);
                 }
                 $arPrice["PRICE"]["CURRENCY"] = $CURRENCY;
             }
             $arSkuTmp = array();
             $arOffer["CAN_BUY"] = "N";
             if ($arCatalogProduct = CCatalogProduct::GetByID($arOffer['ID'])) {
                 if ($arCatalogProduct["CAN_BUY_ZERO"] != "Y" && ($arCatalogProduct["QUANTITY_TRACE"] == "Y" && doubleval($arCatalogProduct["QUANTITY"]) <= 0)) {
                     $arOffer["CAN_BUY"] = "N";
                 } else {
                     $arOffer["CAN_BUY"] = "Y";
                 }
             }
             $arSkuTmp["ImageUrl"] = '';
             if ($arOffer["CAN_BUY"] == "Y") {
                 $productImg = "";
                 if (isset($arImgSku[$arOffer['ID']]) && count($arImgSku[$arOffer['ID']]) > 0) {
                     if (strlen($PRODUCT_NAME) <= 0) {
                         $PRODUCT_NAME = $arImgSku[$arOffer['ID']]["NAME"];
                     }
                     if ($arImgSku[$arOffer['ID']]["PREVIEW_PICTURE"] != "") {
                         $productImg = $arImgSku[$arOffer['ID']]["PREVIEW_PICTURE"];
                     } elseif ($arImgSku[$arOffer['ID']]["DETAIL_PICTURE"] != "") {
                         $productImg = $arImgSku[$arOffer['ID']]["DETAIL_PICTURE"];
                     }
                     if ($productImg == "") {
                         if ($arProduct["PREVIEW_PICTURE"] != "") {
                             $productImg = $arProduct["PREVIEW_PICTURE"];
                         } elseif ($arProduct["DETAIL_PICTURE"] != "") {
                             $productImg = $arProduct["DETAIL_PICTURE"];
                         }
                     }
                     if ($productImg != "") {
                         $arFile = CFile::GetFileArray($productImg);
                         $productImg = CFile::ResizeImageGet($arFile, array('width' => 80, 'height' => 80), BX_RESIZE_IMAGE_PROPORTIONAL, false, false);
                         $arSkuTmp["ImageUrl"] = $productImg["src"];
                     }
                 }
             }
             if ($minItemPrice === 0 || $arPrice["DISCOUNT_PRICE"] < $minItemPrice) {
                 $minItemPrice = $arPrice["DISCOUNT_PRICE"];
                 $minItemPriceFormat = SaleFormatCurrency($arPrice["DISCOUNT_PRICE"], $arPrice["PRICE"]["CURRENCY"]);
             }
             foreach ($arIblockOfferProps as $arCode) {
                 if (array_key_exists($arCode["CODE"], $arOffer["PROPERTIES"])) {
                     if (is_array($arOffer["PROPERTIES"][$arCode["CODE"]]["VALUE"])) {
                         $arSkuTmp[] = implode("/", $arOffer["PROPERTIES"][$arCode["CODE"]]["VALUE"]);
                     } else {
                         $arSkuTmp[] = $arOffer["PROPERTIES"][$arCode["CODE"]]["VALUE"];
                     }
                 }
             }
             $arCatalogProduct = CCatalogProduct::GetByID($arOffer['ID']);
             $arSkuTmp["BALANCE"] = FloatVal($arCatalogProduct["QUANTITY"]);
             $discountPercent = 0;
             $arSkuTmp["USER_ID"] = $USER_ID;
             $arSkuTmp["ID"] = $arOffer["ID"];
             $arSkuTmp["NAME"] = CUtil::JSEscape($arOffer["NAME"]);
             $arSkuTmp["PRODUCT_NAME"] = CUtil::JSEscape($PRODUCT_NAME);
             $arSkuTmp["PRODUCT_ID"] = $PRODUCT_ID;
             $arSkuTmp["LID"] = CUtil::JSEscape($LID);
             $arSkuTmp["MIN_PRICE"] = $minItemPriceFormat;
             $arSkuTmp["URL_EDIT"] = CUtil::JSEscape("/bitrix/admin/iblock_element_edit.php?ID=" . $PRODUCT_ID . "&type=" . $arImgSku[$arOffer['ID']]["IBLOCK_TYPE_ID"] . "&lang=" . LANG . "&IBLOCK_ID=" . $arProduct["IBLOCK_ID"] . "&find_section_section=" . $arProduct["IBLOCK_SECTION_ID"]);
             $arSkuTmp["DISCOUNT_PRICE"] = '';
             $arSkuTmp["DISCOUNT_PRICE_FORMATED"] = '';
             $arSkuTmp["PRICE"] = $arPrice["PRICE"]["PRICE"];
             $arSkuTmp["PRICE_FORMATED"] = CurrencyFormatNumber($arPrice["PRICE"]["PRICE"], $arPrice["PRICE"]["CURRENCY"]);
             $arPriceType = GetCatalogGroup($arPrice["PRICE"]["CATALOG_GROUP_ID"]);
             $arSkuTmp["PRICE_TYPE"] = $arPriceType["NAME_LANG"];
             $arSkuTmp["VAT_RATE"] = $arPrice["PRICE"]["VAT_RATE"];
             if (count($arPrice["DISCOUNT"]) > 0) {
                 $discountPercent = IntVal($arPrice["DISCOUNT"]["VALUE"]);
                 $arSkuTmp["DISCOUNT_PRICE"] = $arPrice["DISCOUNT_PRICE"];
                 $arSkuTmp["DISCOUNT_PRICE_FORMATED"] = CurrencyFormatNumber($arPrice["DISCOUNT_PRICE"], $arPrice["PRICE"]["CURRENCY"]);
             }
             $arCurFormat = CCurrencyLang::GetCurrencyFormat($arPrice["PRICE"]["CURRENCY"]);
             $arSkuTmp["VALUTA_FORMAT"] = str_replace("#", '', $arCurFormat["FORMAT_STRING"]);
             $arSkuTmp["DISCOUNT_PERCENT"] = $discountPercent;
             $arSkuTmp["CURRENCY"] = $arPrice["PRICE"]["CURRENCY"];
             $arSkuTmp["CAN_BUY"] = $arOffer["CAN_BUY"];
             $arSku[] = $arSkuTmp;
         }
         if ((!is_array($arIblockOfferProps) || empty($arIblockOfferProps)) && is_array($arSku) && !empty($arSku)) {
             $arIblockOfferProps[0] = array("CODE" => "TITLE", "NAME" => GetMessage("SKU_TITLE"));
             foreach ($arSku as $key => $val) {
                 $arSku[$key][0] = $val["NAME"];
             }
         }
         $arResult["SKU_ELEMENTS"] = $arSku;
         $arResult["SKU_PROPERTIES"] = $arIblockOfferProps;
         $arResult["OFFERS_IBLOCK_ID"] = $arOffersIblock[$arProduct["IBLOCK_ID"]];
     }
     //if OFFERS_IBLOCK_ID > 0
     return $arResult;
 }
Exemplo n.º 6
0
                    $Message = $IsSelect['Summ'] >= FloatVal($ServerSettings['Params']['ExceptionsPaidInvoices']) ? SPrintF('Сумма ваших оплаченных счетов больше %s, SMS для вас бесплатны', $Comp) : $Message;
                    #-------------------------------------------------------------------------------
                    break;
                    #-------------------------------------------------------------------------------
                #-------------------------------------------------------------------------------
                default:
                    return ERROR | @Trigger_Error(100);
            }
            #-------------------------------------------------------------------------------
        }
        #-------------------------------------------------------------------------------
        $Row2 = array(new Tag('TD', array('colspan' => SizeOf($Methods) + 1, 'class' => 'Standard', 'style' => 'background-color:#FDF6D3;'), $Message));
        #-------------------------------------------------------------------------------
    }
    #-------------------------------------------------------------------------------
    if (FloatVal($ServerSettings['Params']['ExceptionsPaidInvoices']) == 0 && $__USER['Params']['NotificationMethods']['SMS']['Confirmed'] > 0) {
        unset($Row2);
    }
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Row = array(new Tag('TD', array('class' => 'Head'), 'Тип сообщения'));
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$uNotifies = array();
#-------------------------------------------------------------------------------
foreach (Array_Keys($Methods) as $MethodID) {
    #-------------------------------------------------------------------------------
    $Method = $Methods[$MethodID];
    #-------------------------------------------------------------------------------
 /**
  * @param Antrag[] $antraege
  * @param int $typ
  * @return array
  */
 protected function antraege2geodata(&$antraege, $typ = 0)
 {
     $geodata = $geodata_overflow = [];
     $geodata_nach_dok = [];
     foreach ($antraege as $ant) {
         foreach ($ant->dokumente as $dokument) {
             foreach ($dokument->orte as $ort) {
                 if ($ort->ort->to_hide == 0) {
                     $name = $ant->getName();
                     if (strlen($name) > 150) {
                         $name = mb_substr($name, 0, 148) . "...";
                     }
                     $str = "<div class='antraglink'>" . CHtml::link($name, $ant->getLink()) . "</div>";
                     $str .= "<div class='ort_dokument'>";
                     $str .= "<div class='ort'>" . CHtml::encode($ort->ort->ort) . "</div>";
                     $str .= "<div class='dokument'>" . CHtml::link($dokument->getName(), $dokument->getLinkZumDokument()) . "</div>";
                     $str .= "</div>";
                     $str = mb_convert_encoding($str, 'UTF-8', 'UTF-8');
                     if (!isset($geodata_nach_dok[$dokument->id])) {
                         $geodata_nach_dok[$dokument->id] = [];
                     }
                     $geodata_nach_dok[$dokument->id][] = [FloatVal($ort->ort->lat), FloatVal($ort->ort->lon), $str, $typ];
                 }
             }
         }
     }
     foreach ($geodata_nach_dok as $dok_geo) {
         if (count($dok_geo) >= 10) {
             $geodata_overflow[] = $dok_geo;
         } else {
             foreach ($dok_geo as $d) {
                 $geodata[] = $d;
             }
         }
     }
     return [$geodata, $geodata_overflow];
 }
Exemplo n.º 8
0
         $arPrice = CCatalogProduct::GetOptimalPrice($arItems["ID"], 1, $arBuyerGroups, "N", array(), $LID);
         $arCurFormat = CCurrencyLang::GetCurrencyFormat($arPrice["PRICE"]["CURRENCY"]);
         $priceValutaFormat = str_replace("#", '', $arCurFormat["FORMAT_STRING"]);
         if (!is_array($arPrice["DISCOUNT"]) || count($arPrice["DISCOUNT"]) <= 0) {
             $arPrice["DISCOUNT_PRICE"] = 0;
             $price = $arPrice["PRICE"]["PRICE"];
         } else {
             $price = $arPrice["DISCOUNT_PRICE"];
         }
         $summaFormated = CurrencyFormatNumber($price, $arPrice["PRICE"]["CURRENCY"]);
         $currentTotalPriceFormat = CurrencyFormatNumber($price, $arPrice["PRICE"]["CURRENCY"]);
         $balance = 0;
         $weight = 0;
         if ($ar_res = CCatalogProduct::GetByID($arItems["ID"])) {
             $balance = FloatVal($ar_res["QUANTITY"]);
             $weight = FloatVal($ar_res["WEIGHT"]);
         }
         $discountPercent = 0;
         if ($arPrice["DISCOUNT_PRICE"] > 0) {
             $discountPercent = ($arPrice["PRICE"]["PRICE"] - $arPrice["DISCOUNT_PRICE"]) * 100 / $arPrice["PRICE"]["PRICE"];
             $discountPercent = roundEx($discountPercent, SALE_VALUE_PRECISION);
             $priceDiscount = $arPrice["PRICE"]["PRICE"] - $arPrice["DISCOUNT_PRICE"];
         }
         $urlEdit = "/bitrix/admin/iblock_element_edit.php?ID=" . $arItems["ID"] . "&type=" . $arItems["IBLOCK_TYPE_ID"] . "&lang=" . LANG . "&IBLOCK_ID=" . $arItems["IBLOCK_ID"] . "&find_section_section=" . IntVal($arItems["IBLOCK_SECTION_ID"]);
         $arParams = array('id' => $arItems["ID"], 'name' => CUtil::JSEscape($arItems["NAME"]), 'url' => CUtil::JSEscape($arItems["DETAIL_PAGE_URL"]), 'urlImg' => CUtil::JSEscape($ImgUrl), 'urlEdit' => CUtil::JSEscape($urlEdit), 'price' => CUtil::JSEscape($price), 'priceFormated' => CUtil::JSEscape($price), 'priceBase' => CUtil::JSEscape($arPrice["PRICE"]["PRICE"]), 'priceBaseFormat' => CUtil::JSEscape($arPrice["PRICE"]["PRICE"]), 'valutaFormat' => CUtil::JSEscape($priceValutaFormat), 'priceDiscount' => CUtil::JSEscape($priceDiscount), 'summaFormated' => CUtil::JSEscape($summaFormated), 'priceTotalFormated' => CUtil::JSEscape($currentTotalPriceFormat), 'discountPercent' => CUtil::JSEscape($discountPercent), 'balance' => CUtil::JSEscape($balance), 'quantity' => floatval($arGetProduct[$arItems["ID"]]), 'module' => 'catalog', 'currency' => CUtil::JSEscape($arPrice["PRICE"]["CURRENCY"]), 'weight' => $weight, 'vatRate' => DoubleVal('0'), 'priceType' => '', 'catalogXmlID' => '', 'productXmlID' => '', 'skuProps' => CUtil::PhpToJSObject($arSkuProps), 'productProviderClass' => 'CCatalogProductProvider');
         $arParams = CUtil::PhpToJSObject($arParams);
         echo "FillProductFields(0, " . $arParams . ", 0);\n";
     }
     //end while
 }
 //end if
<?php

/**
 * @var Termin $termin
 */
$this->pageTitle = $termin->getName(true);
$assets_base = $this->getAssetsBase();
foreach ($termin->tagesordnungspunkte as $ergebnis) {
    $geo = $ergebnis->get_geo();
    foreach ($geo as $g) {
        $geodata[] = [FloatVal($g->lat), FloatVal($g->lon), str_replace(".", ".<br>", trim($ergebnis->top_nr, "."))];
    }
}
?>
<html>
<head>
	<link rel="stylesheet" href="/js/Leaflet/leaflet.css"/>
	<link rel="stylesheet" href="/css/jquery-ui-1.11.0.custom.min.css"/>
	<style>

		.leaflet-popup-content-wrapper {
			border-radius: 10px;
		}

		.leaflet-popup .ort {
			float: right;
		}

		.leaflet-popup .ort_dokument {
			border-top: solid 1px #999;
			margin-top: 6px;
Exemplo n.º 10
0
                                    } else {
                                        $val = $res ? "Y" : "N";
                                    }
                                    $arBasket["STORES"][$storeId]["BARCODE"][] = $arRes["BARCODE"];
                                    $arBasket["STORES"][$storeId]["BARCODE_FOUND"][] = $val;
                                } else {
                                    $arBasket["STORES"][$storeId]["QUANTITY"] = $arRes["QUANTITY"];
                                    $arBasket["STORES"][$storeId]["QUANTITY_DEDUCTED"] = $arRes["DEDUCTED"] == "Y" ? "Y" : "N";
                                }
                            }
                        }
                    }
                    $arBasket["HAS_SAVED_QUANTITY"] = "Y";
                    $arBasket["HAS_SAVED_BARCODES"] = true;
                    $ind++;
                }
            }
        }
    }
    $arResult["BASKET"][$arBasket["ID"]] = $arBasket;
}
if (CModule::IncludeModule('catalog')) {
    $rsCatProd = CCatalogProduct::GetList(array(), array("ID" => $arProdIds), false, false, array("ID", "QUANTITY"));
    while ($arCatProd = $rsCatProd->Fetch()) {
        if ($arResult["BASKET"][$arProdIdsPrIds[$arCatProd["ID"]]]["MODULE"] == "catalog") {
            $arResult["BASKET"][$arProdIdsPrIds[$arCatProd["ID"]]]["BALANCE"] = FloatVal($arCatProd["QUANTITY"]);
        }
    }
}
$arResult["USE_STORES"] = $useStores;
$this->IncludeComponentTemplate($templatePage);
     $dbStoreProduct = CCatalogStoreProduct::GetList(array(), array("PRODUCT_ID" => $arItems["ID"], "STORE_ID" => $storeFromId));
     if ($arStoreProduct = $dbStoreProduct->Fetch()) {
         $amountToStore = $arStoreProduct["AMOUNT"];
     }
 }
 $arCatalogProduct["BARCODE"] = '';
 if ($arCatalogProduct["BARCODE_MULTI"] == 'N') {
     $dbBarCodes = CCatalogStoreBarCode::getList(array(), array("PRODUCT_ID" => $arItems["ID"]));
     while ($arBarCode = $dbBarCodes->Fetch()) {
         $arCatalogProduct["BARCODE"][] = $arBarCode["BARCODE"];
     }
 }
 if (is_array($arCatalogProduct["BARCODE"])) {
     $arCatalogProduct["BARCODE"] = implode(', ', $arCatalogProduct["BARCODE"]);
 }
 $balance = $storeFromId > 0 ? FloatVal($arCatalogProduct["QUANTITY"]) . " / " . FloatVal($amountToStore) : FloatVal($arCatalogProduct["QUANTITY"]);
 $row->AddField("BALANCE", $balance);
 $row->AddViewField("PREVIEW_PICTURE", CFileInput::Show('NO_FIELDS[' . $arItems['ID'] . '][PREVIEW_PICTURE]', $arItems['PREVIEW_PICTURE'], array("IMAGE" => "Y", "PATH" => "Y", "FILE_SIZE" => "Y", "DIMENSIONS" => "Y", "IMAGE_POPUP" => "Y", "MAX_SIZE" => $maxImageSize, "MIN_SIZE" => $minImageSize), array('upload' => false, 'medialib' => false, 'file_dialog' => false, 'cloud' => false, 'del' => false, 'description' => false)));
 $row->AddViewField("DETAIL_PICTURE", CFileInput::Show('NO_FIELDS[' . $arItems['ID'] . '][DETAIL_PICTURE]', $arItems['DETAIL_PICTURE'], array("IMAGE" => "Y", "PATH" => "Y", "FILE_SIZE" => "Y", "DIMENSIONS" => "Y", "IMAGE_POPUP" => "Y", "MAX_SIZE" => $maxImageSize, "MIN_SIZE" => $minImageSize), array('upload' => false, 'medialib' => false, 'file_dialog' => false, 'cloud' => false, 'del' => false, 'description' => false)));
 $bCanBuy = true;
 if ($arCatalogProduct["CAN_BUY_ZERO"] != "Y" && ($arCatalogProduct["QUANTITY_TRACE"] == "Y" && doubleval($arCatalogProduct["QUANTITY"]) <= 0)) {
     $bCanBuy = false;
 }
 if ($addDefault == "Y" || $bCanBuy && $addDefault == "N") {
     $arParams = array('id' => $arItems["ID"], 'quantity' => $QUANTITY, 'type' => $arCatalogProduct["TYPE"], 'barcode' => $arCatalogProduct["BARCODE"], 'name' => $arItems['NAME']);
     if ($boolSubscribe) {
         $arParams['url'] = $arItems['DETAIL_PAGE_URL'];
     }
     $arParams = CUtil::PhpToJSObject($arParams);
     foreach (GetModuleEvents("sale", "OnProductSearchForm", true) as $arEvent) {
         $arParams = ExecuteModuleEventEx($arEvent, array($arItems["ID"], $arParams));
Exemplo n.º 12
0
    $arFilter["GROUPS_ID"] = $filter_group;
}
if (isset($filter_universal) && strlen($filter_universal) > 0) {
    $arFilter["%NAME_SEARCH"] = trim($filter_universal);
}
if (FloatVal($filter_price_all_from) > 0) {
    $arFilter[">=ORDER_SUM"] = FloatVal($filter_price_all_from);
}
if (FloatVal($filter_price_all_to) > 0) {
    $arFilter["<=ORDER_SUM"] = FloatVal($filter_price_all_to);
}
if (FloatVal($filter_quantity_all_from) > 0) {
    $arFilter[">=ORDER_COUNT"] = FloatVal($filter_quantity_all_from);
}
if (FloatVal($filter_quantity_all_to) > 0) {
    $arFilter["<ORDER_COUNT"] = FloatVal($filter_quantity_all_to);
}
if (isset($_GET["del_filter"]) && $_GET["del_filter"] == "Y") {
    $arfiltertmp = $arFilter;
    $arFilter = array();
    $arFilter["LID"] = $arfiltertmp["LID"];
    $arFilter["CURRENCY"] = $arfiltertmp["CURRENCY"];
}
$arSitesShop = array();
foreach ($arSites as $key => $val) {
    $site = COption::GetOptionString("sale", "SHOP_SITE_" . $key, "");
    if ($key == $site) {
        $arSitesShop[] = array("ID" => $key, "NAME" => $val["NAME"]);
    }
}
if (empty($arSitesShop)) {
Exemplo n.º 13
0
             $currentPrice = $currentPrice - $currentDiscount;
         }
     }
     $vatRate = $arPrice["PRICE"]["VAT_RATE"];
     $fieldValue = FormatCurrency($currentPrice, $arPrice["PRICE"]["CURRENCY"]);
     if (DoubleVal($nearestQuantity) != DoubleVal($QUANTITY)) {
         $fieldValue .= str_replace("#CNT#", $nearestQuantity, GetMessage("SOPS_PRICE1"));
     }
 }
 if (strlen($BASE_LANG_CURR) <= 0) {
     $arCurFormat = CCurrencyLang::GetCurrencyFormat($arPrice["PRICE"]["CURRENCY"]);
     $priceValutaFormat = str_replace("#", '', $arCurFormat["FORMAT_STRING"]);
 }
 $row->AddField("PRICE", $fieldValue);
 $arCatalogProduct = CCatalogProduct::GetByID($arItems["ID"]);
 $balance = FloatVal($arCatalogProduct["QUANTITY"]);
 $row->AddField("BALANCE", $balance);
 $URL = CIBlock::ReplaceDetailUrl($arItems["DETAIL_PAGE_URL"], $arItems, true);
 $arPriceType = GetCatalogGroup($arPrice["PRICE"]["CATALOG_GROUP_ID"]);
 $PriceType = $arPriceType["NAME_LANG"];
 $productImg = "";
 if ($arItems["PREVIEW_PICTURE"] != "") {
     $productImg = $arItems["PREVIEW_PICTURE"];
 } elseif ($arItems["DETAIL_PICTURE"] != "") {
     $productImg = $arItems["DETAIL_PICTURE"];
 }
 $ImgUrl = "";
 if ($productImg != "") {
     $arFile = CFile::GetFileArray($productImg);
     $productImg = CFile::ResizeImageGet($arFile, array('width' => 80, 'height' => 80), BX_RESIZE_IMAGE_PROPORTIONAL, false, false);
     $ImgUrl = $productImg["src"];
     case 'exception':
         return ERROR | @Trigger_Error(400);
     case 'array':
         Debug("[comp/www/Administrator/PaymentsSystemsStatistics]: общая сумма за {$Year} = " . $Total['Summ']);
         break;
     default:
         return ERROR | @Trigger_Error(101);
 }
 $Tr->AddChild(new Tag('TD', array('align' => 'right', 'class' => 'Standard', 'style' => 'background-color:#FDF6D3;'), new Tag('NOBR', Number_Format($Total['Summ'], 2, '.', ' '))));
 #-------------------------------------------------------------------------------
 # ячейка со средним за год
 # если это текущий год - то расчёт будет иным
 if (Date('Y', Time()) == $Year) {
     $AvgVal = Round(FloatVal($Total['Summ']) / (Date('z', Time()) + 1), 2);
 } else {
     $AvgVal = Round(FloatVal($Total['Summ']) / (Date('z', $TimeEnd) + 1), 2);
 }
 $Tr->AddChild(new Tag('TD', array('align' => 'right', 'class' => 'Standard', 'style' => 'background-color:#B9CCDF;'), new Tag('NOBR', Number_Format($AvgVal, 2, '.', ' '))));
 #-------------------------------------------------------------------------------
 # перебираем все платёжные системы, считаем для них суммы
 foreach ($PaymentSystems as $PaymentSystem) {
     $Columns = array('SUM(`Summ`) AS `Summ`');
     $Where = "`StatusID` = 'Payed' AND `PaymentSystemID` = '" . $PaymentSystem['PaymentSystemID'] . "' AND `StatusDate` BETWEEN {$TimeBegin} AND {$TimeEnd}";
     $Summ = DB_Select('Invoices', $Columns, array('UNIQ', 'Where' => $Where));
     switch (ValueOf($Total)) {
         case 'error':
             return ERROR | @Trigger_Error(500);
         case 'exception':
             return ERROR | @Trigger_Error(400);
         case 'array':
             Debug("[comp/www/Administrator/PaymentsSystemsStatistics]: сумма для " . $PaymentSystem['PaymentSystemID'] . " за {$Year} = " . $Summ['Summ']);
 $amountToStore = 0;
 $arCatalogProduct = CCatalogProduct::GetByID($arItems["ID"]);
 if ($STORE_FROM_ID > 0) {
     $dbStoreProduct = CCatalogStoreProduct::GetList(array(), array("PRODUCT_ID" => $arItems["ID"], "STORE_ID" => $STORE_FROM_ID));
     if ($arStoreProduct = $dbStoreProduct->Fetch()) {
         $amountToStore = $arStoreProduct["AMOUNT"];
     }
 }
 $arCatalogProduct["BARCODE"] = '';
 if ($arCatalogProduct["BARCODE_MULTI"] == 'N') {
     $dbBarCodes = CCatalogStoreBarCode::getList(array(), array("PRODUCT_ID" => $arItems["ID"]));
     if ($arBarCode = $dbBarCodes->Fetch()) {
         $arCatalogProduct["BARCODE"] = $arBarCode["BARCODE"];
     }
 }
 $balance = $STORE_FROM_ID > 0 ? FloatVal($arCatalogProduct["QUANTITY"]) . " / " . FloatVal($amountToStore) : FloatVal($arCatalogProduct["QUANTITY"]);
 $row->AddField("BALANCE", $balance);
 $URL = CIBlock::ReplaceDetailUrl($arItems["DETAIL_PAGE_URL"], $arItems, true);
 $arPriceType = GetCatalogGroup($arPrice["PRICE"]["CATALOG_GROUP_ID"]);
 $PriceType = $arPriceType["NAME_LANG"];
 $productImg = "";
 if ($arItems["PREVIEW_PICTURE"] != "") {
     $productImg = $arItems["PREVIEW_PICTURE"];
 } elseif ($arItems["DETAIL_PICTURE"] != "") {
     $productImg = $arItems["DETAIL_PICTURE"];
 }
 $ImgUrl = "";
 if ($productImg != "") {
     $arFile = CFile::GetFileArray($productImg);
     $productImg = CFile::ResizeImageGet($arFile, array('width' => 80, 'height' => 80), BX_RESIZE_IMAGE_PROPORTIONAL, false, false);
     $ImgUrl = $productImg["src"];
Exemplo n.º 16
0
 /**
  * @param float $lng
  * @param float $lat
  * @param float $radius
  * @return $this
  */
 public function addGeoKrit($lng, $lat, $radius)
 {
     $this->krits[] = ["typ" => "geo", "lng" => FloatVal($lng), "lat" => FloatVal($lat), "radius" => FloatVal($radius)];
     return $this;
 }
Exemplo n.º 17
0
     if (DoubleVal($arOrder["PRICE"]) == DoubleVal($orderSumAmount)) {
         $code = "0";
     } else {
         $code = "100";
         //неверные параметры
         $techMessage = "Сумма заказа не верна.";
     }
 } elseif ($action == "PaymentSuccess") {
     $strPS_STATUS_DESCRIPTION = "";
     $strPS_STATUS_DESCRIPTION .= "номер плательщика - " . $customerNumber . "; ";
     $strPS_STATUS_DESCRIPTION .= "дата платежа - " . $paymentDateTime . "; ";
     $strPS_STATUS_DESCRIPTION .= "код подтверждения платежа - " . $orderIsPaid . "; ";
     $strPS_STATUS_MESSAGE = "";
     $arFields = array("PS_STATUS" => "Y", "PS_STATUS_CODE" => substr($action, 0, 5), "PS_STATUS_DESCRIPTION" => $strPS_STATUS_DESCRIPTION, "PS_STATUS_MESSAGE" => $strPS_STATUS_MESSAGE, "PS_SUM" => $orderSumAmount, "PS_CURRENCY" => $orderSumCurrencyPaycash, "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))));
     // You can comment this code if you want PAYED flag not to be set automatically
     if (FloatVal($arOrder["PRICE"]) == FloatVal($orderSumAmount) && IntVal($orderIsPaid) == 1) {
         if ($changePayStatus == "Y") {
             if ($arOrder["PAYED"] == "Y") {
                 $code = "0";
             } else {
                 if (!CSaleOrder::PayOrder($arOrder["ID"], "Y", true, true)) {
                     $code = "1000";
                     $techMessage = "Ошибка оплаты заказа.";
                 } else {
                     $code = "0";
                 }
             }
         }
     } else {
         $code = "200";
         //неверные параметры
Exemplo n.º 18
0
function fGetFormatedProduct($USER_ID, $LID, $arData, $currency, $type = '')
{
    global $crmMode;
    $result = "";
    if (!is_array($arData["ITEMS"]) || count($arData["ITEMS"]) <= 0) {
        return $result;
    }
    $result = "<table width=\"100%\">";
    if (CModule::IncludeModule('catalog') && CModule::IncludeModule('iblock')) {
        $arProductId = array();
        $arDataTab = array();
        $arSkuParentChildren = array();
        $arSkuParentId = array();
        $arSkuParent = array();
        foreach ($arData["ITEMS"] as $items) {
            if ($items["MODULE"] == "catalog") {
                $arProductId[$items["PRODUCT_ID"]] = $items["PRODUCT_ID"];
                $arDataTab[$items["PRODUCT_ID"]] = $items;
                $arParent = CCatalogSku::GetProductInfo($items["PRODUCT_ID"]);
                if ($arParent) {
                    $arSkuParentChildren[$items["PRODUCT_ID"]] = $arParent["ID"];
                    $arSkuParentId[$arParent["ID"]] = $arParent["ID"];
                }
            }
        }
        $res = CIBlockElement::GetList(array(), array("ID" => $arSkuParentId), false, false, array("ID", "IBLOCK_ID", "IBLOCK_SECTION_ID", "PREVIEW_PICTURE", "DETAIL_PICTURE", "NAME", "DETAIL_PAGE_URL"));
        while ($arItems = $res->GetNext()) {
            $arSkuParent[$arItems["ID"]] = $arItems;
        }
        $dbProduct = CIBlockElement::GetList(array(), array("ID" => $arProductId), false, false, array('ID', 'IBLOCK_ID', 'IBLOCK_SECTION_ID', 'DETAIL_PICTURE', 'PREVIEW_PICTURE', 'IBLOCK_TYPE_ID'));
        while ($arProduct = $dbProduct->Fetch()) {
            $imgCode = 0;
            $arDataTab[$arProduct['ID']]['IBLOCK_ID'] = $arProduct['IBLOCK_ID'];
            $arDataTab[$arProduct['ID']]['IBLOCK_SECTION_ID'] = $arProduct['IBLOCK_SECTION_ID'];
            $arDataTab[$arProduct['ID']]['DETAIL_PICTURE'] = $arProduct['DETAIL_PICTURE'];
            $arDataTab[$arProduct['ID']]['PREVIEW_PICTURE'] = $arProduct['PREVIEW_PICTURE'];
            $arDataTab[$arProduct['ID']]['IBLOCK_TYPE_ID'] = $arProduct['IBLOCK_TYPE_ID'];
            $items = $arDataTab[$arProduct['ID']];
            if ($items["PREVIEW_PICTURE"] == "" && $items["DETAIL_PICTURE"] == "" && is_set($arSkuParentChildren[$items["PRODUCT_ID"]])) {
                $idTmp = $arSkuParentChildren[$items["PRODUCT_ID"]];
                $items["DETAIL_PICTURE"] = $arSkuParent[$idTmp]["DETAIL_PICTURE"];
                $items["PREVIEW_PICTURE"] = $arSkuParent[$idTmp]["PREVIEW_PICTURE"];
            }
            if ($items["DETAIL_PICTURE"] > 0) {
                $imgCode = $items["DETAIL_PICTURE"];
            } elseif ($items["PREVIEW_PICTURE"] > 0) {
                $imgCode = $items["PREVIEW_PICTURE"];
            }
            $arSkuProperty = CSaleProduct::GetProductSkuProps($items["PRODUCT_ID"]);
            $items["NAME"] = htmlspecialcharsex($items["NAME"]);
            $items["EDIT_PAGE_URL"] = htmlspecialcharsex($items["EDIT_PAGE_URL"]);
            $items["CURRENCY"] = htmlspecialcharsex($items["CURRENCY"]);
            if ($imgCode > 0) {
                $arFile = CFile::GetFileArray($imgCode);
                $arImgProduct = CFile::ResizeImageGet($arFile, array('width' => 80, 'height' => 80), BX_RESIZE_IMAGE_PROPORTIONAL, false, false);
            }
            if (is_array($arImgProduct)) {
                $imgUrl = $arImgProduct["src"];
                $imgProduct = "<a href=\"" . $items["EDIT_PAGE_URL"] . "\" target=\"_blank\"><img src=\"" . $imgUrl . "\" alt=\"\" title=\"" . $items["NAME"] . "\" ></a>";
            } else {
                $imgProduct = "<div class='no_foto'>" . GetMessage('NO_FOTO') . "</div>";
            }
            $arCurFormat = CCurrencyLang::GetCurrencyFormat($items["CURRENCY"]);
            $priceValutaFormat = str_replace("#", '', $arCurFormat["FORMAT_STRING"]);
            $currentTotalPrice = $items["PRICE"] + $items["DISCOUNT_PRICE"];
            $discountPercent = 0;
            if ($items["DISCOUNT_PRICE"] > 0) {
                $discountPercent = IntVal($items["DISCOUNT_PRICE"] * 100 / $currentTotalPrice);
            }
            $ar_res = CCatalogProduct::GetByID($items["PRODUCT_ID"]);
            $balance = FloatVal($ar_res["QUANTITY"]);
            $arParams = array();
            $arParams["id"] = $items["PRODUCT_ID"];
            $arParams["name"] = $items["NAME"];
            $arParams["url"] = $items["DETAIL_PAGE_URL"];
            $arParams["urlEdit"] = $items["EDIT_PAGE_URL"];
            $arParams["urlImg"] = $imgUrl;
            $arParams["price"] = FloatVal($items["PRICE"]);
            $arParams["priceBase"] = FloatVal($currentTotalPrice);
            $arParams["priceBaseFormat"] = CurrencyFormatNumber(FloatVal($currentTotalPrice), $items["CURRENCY"]);
            $arParams["priceFormated"] = CurrencyFormatNumber(FloatVal($items["PRICE"]), $items["CURRENCY"]);
            $arParams["valutaFormat"] = $priceValutaFormat;
            $arParams["priceDiscount"] = FloatVal($items["DISCOUNT_PRICE"]);
            $arParams["priceTotalFormated"] = SaleFormatCurrency($currentTotalPrice, $items["CURRENCY"]);
            $arParams["discountPercent"] = $discountPercent;
            $arParams["summaFormated"] = CurrencyFormatNumber($items["PRICE"], $items["CURRENCY"]);
            $arParams["quantity"] = 1;
            $arParams["module"] = $items["MODULE"];
            $arParams["currency"] = $items["CURRENCY"];
            $arParams["weight"] = 0;
            $arParams["vatRate"] = 0;
            $arParams["priceType"] = "";
            $arParams["balance"] = $balance;
            $arParams['skuProps'] = CUtil::PhpToJSObject($arSkuProperty);
            $arParams["catalogXmlID"] = "";
            $arParams["productXmlID"] = "";
            $arParams["callback"] = "CatalogBasketCallback";
            $arParams["orderCallback"] = "CatalogBasketOrderCallback";
            $arParams["cancelCallback"] = "CatalogBasketCancelCallback";
            $arParams["payCallback"] = "CatalogPayOrderCallback";
            $result .= "<tr id='more_" . $type . "_" . $items["ID"] . "'>\n\t\t\t\t\t\t\t<td class=\"tab_img\" >" . $imgProduct . "</td>\n\t\t\t\t\t\t\t<td class=\"tab_text\">\n\t\t\t\t\t\t\t\t<div class=\"order_name\"><a href=\"" . $items["EDIT_PAGE_URL"] . "\" target=\"_blank\" title=\"" . $items["NAME"] . "\">" . $items["NAME"] . "</a></div>\n\t\t\t\t\t\t\t\t<div class=\"order_price\">\n\t\t\t\t\t\t\t\t\t" . GetMessage('NEWO_SUBTAB_PRICE') . ": <b>" . SaleFormatCurrency($items["PRICE"], $currency) . "</b>\n\t\t\t\t\t\t\t\t</div>";
            $arResult = CSaleProduct::GetProductSku($USER_ID, $LID, $items["PRODUCT_ID"], $items["NAME"]);
            if (count($arResult["SKU_ELEMENTS"]) > 0) {
                foreach ($arResult["SKU_ELEMENTS"] as $key => $val) {
                    $arTmp = array();
                    foreach ($val as $k => $v) {
                        if (is_numeric($k)) {
                            $arTmp[$arResult["SKU_PROPERTIES"][$k]["NAME"]] = $v;
                        }
                    }
                    $arResult["SKU_ELEMENTS"][$key]["SKU_PROPS"] = CUtil::PhpToJSObject($arTmp);
                }
            }
            $arResult["POPUP_MESSAGE"] = array("PRODUCT_ADD" => GetMEssage('NEWO_POPUP_TO_BUSKET'), "PRODUCT_ORDER" => GetMEssage('NEWO_POPUP_TO_ORDER'), "PRODUCT_NOT_ADD" => GetMEssage('NEWO_POPUP_DONT_CAN_BUY'), "PRODUCT_PRICE_FROM" => GetMessage('NEWO_POPUP_FROM'));
            if (count($arResult["SKU_ELEMENTS"]) <= 0) {
                $result .= "<a href=\"javascript:void(0);\" class=\"get_new_order\" onClick=\"fAddToBusketMoreProduct('" . $type . "', " . CUtil::PhpToJSObject($arParams) . ");return false;\"><span></span>" . GetMessage('NEWO_SUBTAB_ADD_BUSKET') . "</a><br>";
            } else {
                $result .= "<a href=\"javascript:void(0);\" class=\"get_new_order\" onClick=\"fAddToBusketMoreProductSku(" . CUtil::PhpToJsObject($arResult['SKU_ELEMENTS']) . ", " . CUtil::PhpToJsObject($arResult['SKU_PROPERTIES']) . ", 'busket', " . CUtil::PhpToJsObject($arResult["POPUP_MESSAGE"]) . ");\"><span></span>" . GetMessage('NEWO_SUBTAB_ADD_BUSKET') . "</a><br>";
            }
            if (!$crmMode) {
                if (count($arResult["SKU_ELEMENTS"]) > 0) {
                    $result .= "<a href=\"javascript:void(0);\" class=\"get_new_order\" onClick=\"fAddToBusketMoreProductSku(" . CUtil::PhpToJsObject($arResult['SKU_ELEMENTS']) . ", " . CUtil::PhpToJsObject($arResult['SKU_PROPERTIES']) . ", 'neworder', " . CUtil::PhpToJsObject($arResult["POPUP_MESSAGE"]) . ");\"><span></span>" . GetMessage('NEWO_SUBTAB_ADD_ORDER') . "</a>";
                } else {
                    $cntProd = floatval($items["QUANTITY"]) > 0 ? floatval($items["QUANTITY"]) : 1;
                    $url = "/bitrix/admin/sale_order_new.php?lang=" . LANG . "&user_id=" . $USER_ID . "&LID=" . $LID . "&product[" . $items["PRODUCT_ID"] . "]=" . $cntProd;
                    $result .= "<a href=\"" . $url . "\" target=\"_blank\" class=\"get_new_order\"><span></span>" . GetMessage('NEWO_SUBTAB_ADD_ORDER') . "</a>";
                }
            }
            $result .= "</td></tr>";
        }
        //end foreach
    }
    //end if
    if ($arData["CNT"] > 2 && $arData["CNT"] != count($arData["ITEMS"])) {
        $result .= "<tr><td colspan='2' align='right' class=\"more_product\">";
        if ($type == "busket") {
            $result .= "<a href='javascript:void(0);' onClick='fGetMoreBusket(\"Y\");' class=\"get_more\">" . GetMessage('NEWO_SUBTAB_MORE') . "<span></span></a>";
        } elseif ($type == "viewed") {
            $result .= "<a href='javascript:void(0);' onClick='fGetMoreViewed(\"Y\");' class=\"get_more\">" . GetMessage('NEWO_SUBTAB_MORE') . "<span></span></a>";
        } else {
            $result .= "<a href='javascript:void(0);' onClick='fGetMoreRecom();' class=\"get_more\">" . GetMessage('NEWO_SUBTAB_MORE') . "<span></span></a>";
        }
        $result .= "</td></tr>";
    }
    $result .= "</table>";
    return $result;
}
Exemplo n.º 19
0
                    /** @var Antrag $ant */
                    if (in_array($ant->id, $antrag_ids)) {
                        continue;
                    }
                    $antrag_ids[] = $ant->id;
                    echo "<li>Verwandter Antrag: " . CHtml::link($ant->getName(true), $ant->getLink()) . "</li>\n";
                } else {
                    echo "<li>Verwandter Antrag: " . CHtml::encode(RISTools::korrigiereTitelZeichen($ant)) . "</li>\n";
                }
            }
            echo "</ul>";
        }
        echo "</li>";
        $geo = $ergebnis->get_geo();
        foreach ($geo as $g) {
            $geodata[] = array(FloatVal($g->lat), FloatVal($g->lon), $ergebnis->top_nr . ": " . $ergebnis->getName(true));
        }
    }
    ?>
        </ol>
        <script>
            $(function () {
                var geodata = <?php 
    echo json_encode($geodata);
    ?>
;
                if (geodata.length > 0) $(function () {
                    var $map = $("#map").AntraegeKarte({
                        assetsBase: <?php 
    echo json_encode($this->getAssetsBase());
    ?>
Exemplo n.º 20
0
function GetConfigReal(&$cfg_elem, $key)
{
    if (isset($cfg_elem[$key][0])) {
        return FloatVal($cfg_elem[$key][0]);
    } else {
        return FALSE;
    }
}
Exemplo n.º 21
0
         if (StrLen($filter_order_date_up_to) < 11) {
             $arDate["HH"] = 23;
             $arDate["MI"] = 59;
             $arDate["SS"] = 59;
         }
         $filter_order_date_up_to = date($DB->DateFormatToPHP(CSite::GetDateFormat("FULL", SITE_ID)), mktime($arDate["HH"], $arDate["MI"], $arDate["SS"], $arDate["MM"], $arDate["DD"], $arDate["YYYY"]));
         $arOrderFilter["DATE_UPDATE_TO"] = $filter_order_date_up_to;
     } else {
         $filter_order_date_up_to = "";
     }
 }
 if (strlen($filter_summa_from) > 0) {
     $arOrderFilter[">=PRICE"] = FloatVal($filter_summa_from);
 }
 if (strlen($filter_summa_to) > 0) {
     $arOrderFilter["<=PRICE"] = FloatVal($filter_summa_to);
 }
 if (strlen($filter_order_prod_name) > 0) {
     $arOrderFilter["%BASKET.NAME"] = $filter_order_prod_name;
 }
 $getListParams = array('filter' => $arOrderFilter, 'order' => $arOrderSort, 'select' => array("ID", "LID", "STATUS_ID", "DATE_STATUS", "PAYED", "DATE_PAYED", "PRICE", "DATE_UPDATE", "DATE_INSERT", "CURRENCY"));
 $usePageNavigation = true;
 $navyParams = CDBResult::GetNavParams(CAdminResult::GetNavSize($sTableID));
 if ($navyParams['SHOW_ALL']) {
     $usePageNavigation = false;
 } else {
     $navyParams['PAGEN'] = (int) $navyParams['PAGEN'];
     $navyParams['SIZEN'] = (int) $navyParams['SIZEN'];
 }
 if ($usePageNavigation) {
     $getListParams['limit'] = $navyParams['SIZEN'];
Exemplo n.º 22
0
<?php

#-------------------------------------------------------------------------------
/** @author Великодный В.В. (Joonte Ltd.) */
/******************************************************************************/
/******************************************************************************/
$__args_list = array('Summ');
/******************************************************************************/
eval(COMP_INIT);
/******************************************************************************/
/******************************************************************************/
if (FloatVal($Summ) == 0) {
    #-------------------------------------------------------------------------------
    $Color = 'EEEEEE';
    #-------------------------------------------------------------------------------
} elseif (FloatVal($Summ) < 0) {
    #-------------------------------------------------------------------------------
    $Color = 'FFCCFF';
    #-------------------------------------------------------------------------------
} else {
    #-------------------------------------------------------------------------------
    $Color = 'D5F66C';
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return array('bgcolor' => SPrintF('#%s', $Color));
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
Exemplo n.º 23
0
#-------------------------------------------------------------------------------
$Invoices =& $Config['Invoices'];
#-------------------------------------------------------------------------------
if (!isset($Invoices['PaymentSystems'])) {
    $Invoices['PaymentSystems'] = array();
}
#-------------------------------------------------------------------------------
$PaymentSystems =& $Invoices['PaymentSystems'];
#-------------------------------------------------------------------------------
foreach ($cPaymentSystems as $PaymentSystemID => $PaymentSystem) {
    #-------------------------------------------------------------------------------
    foreach ($Courses as $Course) {
        #-------------------------------------------------------------------------------
        if (isset($PaymentSystems[$PaymentSystemID]) && @$Course['CharCode'] == $PaymentSystem['Valute'] && $PaymentSystem['IsCourseUpdate']) {
            #-------------------------------------------------------------------------------
            $Current = (string) SPrintF('%01.6g', FloatVal(Str_Replace(',', '.', @$Course['Value'])) / @$Course['Nominal']);
            #-------------------------------------------------------------------------------
            $PaymentSystems[$PaymentSystemID]['Course'] = $Current;
            #-------------------------------------------------------------------------------
        }
        #-------------------------------------------------------------------------------
    }
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
$Path = System_Element('config/Config.xml');
if (Is_Error($Path)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$IsWrite = IO_Write($Path, To_XML_String($Config), TRUE);
Exemplo n.º 24
0
/**
 * Return a rounded pixel equivalent for a labeled CSS/SVG length.
 * http://www.w3.org/TR/SVG11/coords.html#UnitIdentifiers
 *
 * @param string $length
 * @return int Length in pixels
 */
function wfScaleSVGUnit($length)
{
    static $unitLength = array('px' => 1.0, 'pt' => 1.25, 'pc' => 15.0, 'mm' => 3.543307, 'cm' => 35.43307, 'in' => 90.0, '' => 1.0, '%' => 2.0);
    if (preg_match('/^(\\d+)(em|ex|px|pt|pc|cm|mm|in|%|)$/', $length, $matches)) {
        $length = FloatVal($matches[1]);
        $unit = $matches[2];
        return round($length * $unitLength[$unit]);
    } else {
        // Assume pixels
        return round(FloatVal($length));
    }
}
Exemplo n.º 25
0
 /**
  * @param float $lng
  * @param float $lat
  * @return OrtGeo
  */
 public static function findClosest($lng, $lat)
 {
     // SQRT(POW(69.1 * (fld_lat - ( $lat )), 2) + POW(69.1 * (($lon) - fld_lon) * COS(fld_lat / 57.3 ), 2 )) AS distance
     $lat = FloatVal($lat);
     $lng = FloatVal($lng);
     $result = Yii::app()->db->createCommand("SELECT *, SQRT(POW(69.1 * (lat - ( " . $lat . ")), 2) + POW(69.1 * (({$lng}) - lon) * COS(lat / 57.3 ), 2 )) AS distance FROM orte_geo ORDER BY distance ASC LIMIT 0,1")->queryAll();
     $res = new OrtGeo();
     $res->setAttributes($result[0]);
     return $res;
 }
Exemplo n.º 26
0
										<td class="COLUMN_QUANTITY">
											<?echo $arItem["QUANTITY"]."&nbsp".$measure?>
										</td>
										<?
									}

									if ($columnCode == "COLUMN_REMAINING_QUANTITY")
									{
										?>
										<td class="COLUMN_REMAINING_QUANTITY">
											<?
											$balance = 0;
											if ($arItem["MODULE"] == "catalog" && $bUseCatalog)
											{
												$ar_res = CCatalogProduct::GetByID($arItem["PRODUCT_ID"]);
												$balance = FloatVal($ar_res["QUANTITY"]);
											}
											?>
											<?echo $balance?>
										</td>
										<?
									}

									if ($columnCode == "COLUMN_PROPS")
									{
										?>
										<td class="COLUMN_PROPS">
											<?
											if (!empty($arBasketProps[$arItem["ID"]]) && is_array($arBasketProps[$arItem["ID"]]))
											{
												foreach ($arBasketProps[$arItem["ID"]] as &$val)
Exemplo n.º 27
0
    $ChargeFree = TRUE;
}
#-------------------------------------------------------------------------------
// Проверяем пользователя на исключения оплаты, сумма оплаченных счетов.
#-------------------------------------------------------------------------------
if (FloatVal($ServerSettings['Params']['ExceptionsPaidInvoices']) >= 0) {
    #-------------------------------------------------------------------------------
    $IsSelect = DB_Select('InvoicesOwners', 'SUM(`Summ`) AS `Summ`', array('UNIQ', 'Where' => SPrintF('`UserID` = %u AND `IsPosted` = "yes"', $UserID)));
    switch (ValueOf($IsSelect)) {
        case 'error':
            return ERROR | @Trigger_Error(500);
        case 'exception':
            return ERROR | @Trigger_Error(400);
        case 'array':
            #-------------------------------------------------------------------------------
            if ($IsSelect['Summ'] >= FloatVal($ServerSettings['Params']['ExceptionsPaidInvoices'])) {
                $ChargeFree = true;
            }
            //Debug(SPrintF('[comp/Tasks/SMS]: Оплаченных счетов (%s)', $IsSelect['Summ']));
            #-------------------------------------------------------------------------------
            break;
            #-------------------------------------------------------------------------------
        #-------------------------------------------------------------------------------
        default:
            return ERROR | @Trigger_Error(100);
    }
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
// Проверяем пользователя на исключения оплаты, активные заказы хостинга.
Exemplo n.º 28
0
         $active = GetMessage('SPS_PRODUCT_ACTIVE');
         $arSkuActions[] = array("TEXT" => GetMessage("SPS_SELECT"), "DEFAULT" => "Y", "ACTION" => $tableId . '_helper.SelEl(' . CUtil::PhpToJSObject($arParams) . ', this);');
         $active = $val["ACTIVE"] == 'Y' ? GetMessage('SPS_PRODUCT_ACTIVE') : GetMessage('SPS_PRODUCT_NO_ACTIVE');
         $rowSku->AddActions($arSkuActions);
         $rowSku->AddField("BALANCE", $balance);
         $rowSku->AddField("ACTIVE", $active);
         $rowSku->AddField("ACTION", '<a class="select-sku">' . GetMessage('SPS_SELECT') . '</a>');
         addPropsCell($rowSku, $arSelectedProps, $val);
     }
 } else {
     if ($arItems['TYPE'] == 'S') {
         $icon = 'folder';
     } elseif (!empty($arCatalogProduct['IS_GROUP'])) {
         $icon = 'f4';
     }
     $balance = isset($arCatalogProduct["STORE_AMOUNT"]) ? FloatVal($arCatalogProduct["QUANTITY"]) . " / " . FloatVal($arCatalogProduct["STORE_AMOUNT"]) : FloatVal($arCatalogProduct["QUANTITY"]);
     $row->AddField("BALANCE", $arItems['TYPE'] != 'S' ? $balance : '');
     if ($arItems['TYPE'] != 'S') {
         $ratio = isset($arCatalogProduct['MEASURE_RATIO']) ? $arCatalogProduct['MEASURE_RATIO'] : 1;
         $measure = isset($arCatalogProduct['MEASURE']['SYMBOL_RUS']) ? '&nbsp;' . $arCatalogProduct['MEASURE']['SYMBOL_RUS'] : '';
         $arParams = array('id' => $arItems["ID"], 'type' => $arCatalogProduct["TYPE"], 'name' => $arItems['NAME'], 'full_quantity' => $arCatalogProduct['QUANTITY'], 'measureRatio' => isset($arCatalogProduct['MEASURE_RATIO']) ? $arCatalogProduct['MEASURE_RATIO'] : 1, 'measure' => isset($arCatalogProduct['MEASURE']['~SYMBOL_RUS']) ? $arCatalogProduct['MEASURE']['~SYMBOL_RUS'] : '', 'quantity' => $ratio);
         $row->AddField("QUANTITY", '<input type="text" id="' . $tableId . '_qty_' . $arItems["ID"] . '" value="' . $ratio . '" size="5" />' . $measure);
         unset($measure, $ratio);
         $arActions[] = array("TEXT" => GetMessage("SPS_SELECT"), "DEFAULT" => "Y", "ACTION" => $tableId . '_helper.SelEl(' . CUtil::PhpToJSObject($arParams) . ', this);');
         $row->AddField("ACTION", '<a class="select-sku">' . GetMessage('SPS_SELECT') . '</a>');
     } else {
         $arActions[] = array("TEXT" => GetMessage("SPS_SELECT"), "DEFAULT" => "Y", "ACTION" => $tableId . '_helper.onSectionClick(' . $arItems["ID"] . ',\'' . CUtil::JSEscape($arItems['NAME']) . '\');');
     }
     foreach ($arPrices as $price) {
         $row->AddViewField("PRICE" . $price['ID'], CCurrencyLang::CurrencyFormat($arItems['PRICES'][$price['ID']]['PRICE'], $arItems['PRICES'][$price['ID']]['CURRENCY'], true));
     }
Exemplo n.º 29
0
    }
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# проверяем наличие утилиты htmldoc
$Result = Exec('htmldoc --version 2>&1');
#-------------------------------------------------------------------------------
if (!Preg_Match('/not\\sfound/', $Result)) {
    #-------------------------------------------------------------------------------
    if (Preg_Match('/[0-9]+\\.[0-9]+\\.[0-9]/', $Result, $HtmlDoc)) {
        #-------------------------------------------------------------------------------
        $HtmlDoc = Current($HtmlDoc);
        #-------------------------------------------------------------------------------
        Debug(SPrintF('[comp/Tasks/GC/CheckSoftWare]: htmldoc version: %s', $HtmlDoc));
        #-------------------------------------------------------------------------------
        if (FloatVal($HtmlDoc) < 1.8) {
            if ($Settings['IsEvent']) {
                $Messages[] = 'Несовместимая версия htmldoc. Требуется версия htmldoc 1.8+';
            }
        }
        #-------------------------------------------------------------------------------
    } else {
        #-------------------------------------------------------------------------------
        $Messages[] = 'Не удалось определить версию htmldoc. Попробуйте, выполнить следующу команду "htmldoc --version".';
        #-------------------------------------------------------------------------------
    }
    #-------------------------------------------------------------------------------
} else {
    #-------------------------------------------------------------------------------
    $Messages[] = 'Приложение htmldoc не найдено.';
    #-------------------------------------------------------------------------------