当前位置: 首页>>代码示例>>PHP>>正文


PHP DoubleVal函数代码示例

本文整理汇总了PHP中DoubleVal函数的典型用法代码示例。如果您正苦于以下问题:PHP DoubleVal函数的具体用法?PHP DoubleVal怎么用?PHP DoubleVal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DoubleVal函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ConvertCurrency

 function ConvertCurrency($valSum, $curFrom, $curTo, $valDate = "")
 {
     global $DB;
     if (strlen($valDate) <= 0) {
         $valDate = date("Y-m-d");
     }
     list($dpYear, $dpMonth, $dpDay) = split("-", $valDate, 3);
     $dpDay += 1;
     $valDate = date("Y-m-d", mktime(0, 0, 0, $dpMonth, $dpDay, $dpYear));
     $curFromRate = 0;
     $curFromRateCnt = 0;
     $strSql = "SELECT C.AMOUNT, C.AMOUNT_CNT, CR.RATE, CR.RATE_CNT " . "FROM b_catalog_currency C " . "\tLEFT JOIN b_catalog_currency_rate CR " . "\t\tON (C.CURRENCY = CR.CURRENCY AND CR.DATE_RATE < '" . $valDate . "') " . "WHERE C.CURRENCY = '" . $DB->ForSql($curFrom) . "' " . "ORDER BY DATE_RATE DESC";
     $db_res = $DB->Query($strSql);
     if ($res = $db_res->Fetch()) {
         $curFromRate = DoubleVal($res["RATE"]);
         $curFromRateCnt = IntVal($res["RATE_CNT"]);
         if ($curFromRate <= 0) {
             $curFromRate = DoubleVal($res["AMOUNT"]);
             $curFromRateCnt = IntVal($res["AMOUNT_CNT"]);
         }
     }
     $curToRate = 0;
     $curToRateCnt = 0;
     $strSql = "SELECT C.AMOUNT, C.AMOUNT_CNT, CR.RATE, CR.RATE_CNT " . "FROM b_catalog_currency C " . "\tLEFT JOIN b_catalog_currency_rate CR " . "\t\tON (C.CURRENCY = CR.CURRENCY AND CR.DATE_RATE < '" . $valDate . "') " . "WHERE C.CURRENCY = '" . $DB->ForSql($curTo) . "' " . "ORDER BY DATE_RATE DESC";
     $db_res = $DB->Query($strSql);
     if ($res = $db_res->Fetch()) {
         $curToRate = DoubleVal($res["RATE"]);
         $curToRateCnt = DoubleVal($res["RATE_CNT"]);
         if ($curToRate <= 0) {
             $curToRate = DoubleVal($res["AMOUNT"]);
             $curToRateCnt = IntVal($res["AMOUNT_CNT"]);
         }
     }
     return DoubleVal(DoubleVal($valSum) * $curFromRate * $curToRateCnt / $curToRate / $curFromRateCnt);
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:35,代码来源:currency.php

示例2: PrepareCurrency4Where

 /** @deprecated  */
 function PrepareCurrency4Where($val, $key, $operation, $negative, $field, &$arField, &$arFilter)
 {
     $val = DoubleVal($val);
     $baseSiteCurrency = "";
     if (isset($arFilter["LID"]) && strlen($arFilter["LID"]) > 0) {
         $baseSiteCurrency = CSaleLang::GetLangCurrency($arFilter["LID"]);
     } elseif (isset($arFilter["CURRENCY"]) && strlen($arFilter["CURRENCY"]) > 0) {
         $baseSiteCurrency = $arFilter["CURRENCY"];
     }
     if (strlen($baseSiteCurrency) <= 0) {
         return False;
     }
     $strSqlSearch = "";
     $dbCurrency = CCurrency::GetList($by = "sort", $order = "asc");
     while ($arCurrency = $dbCurrency->Fetch()) {
         $val1 = roundEx(CCurrencyRates::ConvertCurrency($val, $baseSiteCurrency, $arCurrency["CURRENCY"]), SALE_VALUE_PRECISION);
         if (strlen($strSqlSearch) > 0) {
             $strSqlSearch .= " OR ";
         }
         $strSqlSearch .= "(D.ORDER_CURRENCY = '" . $arCurrency["CURRENCY"] . "' AND ";
         if ($negative == "Y") {
             $strSqlSearch .= "NOT";
         }
         $strSqlSearch .= "(" . $field . " " . $operation . " " . $val1 . " OR " . $field . " IS NULL OR " . $field . " = 0)";
         $strSqlSearch .= ")";
     }
     return "(" . $strSqlSearch . ")";
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:29,代码来源:delivery.php

示例3: CheckFields

 function CheckFields($ACTION, &$arFields, $ID = 0)
 {
     if ((is_set($arFields, "SITE_ID") || $ACTION == "ADD") && StrLen($arFields["SITE_ID"]) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SCGAT1_NO_SITE"), "EMPTY_SITE_ID");
         return false;
     }
     if (is_set($arFields, "RATE1")) {
         $arFields["RATE1"] = str_replace(",", ".", $arFields["RATE1"]);
         $arFields["RATE1"] = DoubleVal($arFields["RATE1"]);
     }
     if (is_set($arFields, "RATE2")) {
         $arFields["RATE2"] = str_replace(",", ".", $arFields["RATE2"]);
         $arFields["RATE2"] = DoubleVal($arFields["RATE2"]);
     }
     if (is_set($arFields, "RATE3")) {
         $arFields["RATE3"] = str_replace(",", ".", $arFields["RATE3"]);
         $arFields["RATE3"] = DoubleVal($arFields["RATE3"]);
     }
     if (is_set($arFields, "RATE4")) {
         $arFields["RATE4"] = str_replace(",", ".", $arFields["RATE4"]);
         $arFields["RATE4"] = DoubleVal($arFields["RATE4"]);
     }
     if (is_set($arFields, "RATE5")) {
         $arFields["RATE5"] = str_replace(",", ".", $arFields["RATE5"]);
         $arFields["RATE5"] = DoubleVal($arFields["RATE5"]);
     }
     return True;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:28,代码来源:affiliate_tier.php

示例4: CheckFields

 public static function CheckFields($ACTION, &$arFields, $ID = 0)
 {
     if ((is_set($arFields, "AFFILIATE_ID") || $ACTION == "ADD") && IntVal($arFields["AFFILIATE_ID"]) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SCGAT2_NO_AFF"), "EMPTY_AFFILIATE_ID");
         return false;
     }
     if ((is_set($arFields, "CURRENCY") || $ACTION == "ADD") && strlen($arFields["CURRENCY"]) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SCGAT2_NO_CURRENCY"), "EMPTY_CURRENCY");
         return false;
     }
     if ((is_set($arFields, "TRANSACT_DATE") || $ACTION == "ADD") && strlen($arFields["TRANSACT_DATE"]) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SCGAT2_NO_DATE"), "EMPTY_TRANSACT_DATE");
         return false;
     }
     if (is_set($arFields, "AMOUNT") || $ACTION == "ADD") {
         $arFields["AMOUNT"] = str_replace(",", ".", $arFields["AMOUNT"]);
         $arFields["AMOUNT"] = DoubleVal($arFields["AMOUNT"]);
     }
     if ((is_set($arFields, "DEBIT") || $ACTION == "ADD") && $arFields["DEBIT"] != "Y") {
         $arFields["DEBIT"] = "N";
     }
     if (is_set($arFields, "AFFILIATE_ID")) {
         $dbAddiliate = CSaleAffiliate::GetList(array(), array("ID" => $arFields["AFFILIATE_ID"]), false, false, array("ID"));
         if (!$dbAddiliate->Fetch()) {
             $GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["AFFILIATE_ID"], GetMessage("SCGAT2_NO_AFF1")), "ERROR_NO_AFFILIATE_ID");
             return false;
         }
     }
     return True;
 }
开发者ID:rasuldev,项目名称:torino,代码行数:30,代码来源:affiliate_transact.php

示例5: CheckFields

 function CheckFields($ACTION, &$arFields, $ID = 0)
 {
     global $DB;
     if (is_set($arFields, "FILE_ID")) {
         if (is_array($arFields['FILE_ID'])) {
             if (strlen($arFields["FILE_ID"]["name"]) <= 0 && strlen($arFields["FILE_ID"]["del"]) <= 0) {
                 unset($arFields["FILE_ID"]);
             }
             $arFile = $arFields["FILE_ID"];
         } else {
             $arFields['FILE_ID'] = intval($arFields['FILE_ID']);
             if ($arFields['FILE_ID'] > 0 && ($arFile = CFile::GetFileArray($arFields['FILE_ID']))) {
                 $res = CFile::CheckImageFile($arFile, 0, 0, 0);
                 if (strlen($res) > 0) {
                     $GLOBALS["APPLICATION"]->ThrowException($res, "ERROR_ATTACH_IMG");
                     return false;
                 }
             }
         }
         if ($arFields["IMAGE_SIZE_CHECK"] != "N" && IntVal($arFields["IMAGE_SIZE"]) > 0 && IntVal($arFields["IMAGE_SIZE"]) > COption::GetOptionString("blog", "image_max_size", 5000000)) {
             $GLOBALS["APPLICATION"]->ThrowException(GetMessage("ERROR_ATTACH_IMG_SIZE", array("#SIZE#" => DoubleVal(COption::GetOptionString("blog", "image_max_size", 5000000) / 1000000))), "ERROR_ATTACH_IMG_SIZE");
             return false;
         }
         unset($arFields["IMAGE_SIZE_CHECK"]);
     }
     return True;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:27,代码来源:blog_image.php

示例6: process

 protected function process(ViewBag $viewbag)
 {
     $movie = $this->movie;
     $list = $this->list;
     $im = imagecreate($this->W, $this->H);
     $background_color = imagecolorallocate($im, 0xc0, 0xc0, 0xc0);
     imagefilledrectangle($im, 0, 0, $this->W - 1, $this->H - 1, $background_color);
     $black = imagecolorallocate($im, 0, 0, 0);
     imagerectangle($im, 0, 0, $this->W - 1, $this->H - 1, $black);
     $red = imagecolorallocate($im, 0xc0, 0, 0);
     $max = $movie->getMaxSeek();
     $scale = DoubleVal($this->W) / DoubleVal($max);
     foreach ($list->getCutRegions() as $v) {
         $left = $v[0];
         $right = $v[1];
         if ($right == -1) {
             $right = $max;
         }
         $x1 = IntVal($left * $scale);
         $x2 = min($this->W - 1, IntVal($right * $scale));
         imagefilledrectangle($im, $x1, 1, $x2, $this->H - 2, $red);
     }
     header("Content-Type: image/png");
     header("Cache-Control: must-revalidate");
     imagepng($im);
     exit;
 }
开发者ID:roadrunner6,项目名称:mythcut,代码行数:27,代码来源:MovieStripeHandler.php

示例7: CheckFields

 public static function CheckFields($ACTION, &$arFields, $ID = 0)
 {
     if ((is_set($arFields, "USER_ID") || $ACTION == "ADD") && IntVal($arFields["USER_ID"]) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException("Empty user field", "EMPTY_USER_ID");
         return false;
     }
     if ((is_set($arFields, "CURRENCY") || $ACTION == "ADD") && strlen($arFields["CURRENCY"]) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException("Empty currency field", "EMPTY_CURRENCY");
         return false;
     }
     if ((is_set($arFields, "TRANSACT_DATE") || $ACTION == "ADD") && strlen($arFields["TRANSACT_DATE"]) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException("Empty transaction date field", "EMPTY_TRANSACT_DATE");
         return false;
     }
     if (is_set($arFields, "AMOUNT") || $ACTION == "ADD") {
         $arFields["AMOUNT"] = str_replace(",", ".", $arFields["AMOUNT"]);
         $arFields["AMOUNT"] = DoubleVal($arFields["AMOUNT"]);
     }
     if ((is_set($arFields, "DEBIT") || $ACTION == "ADD") && $arFields["DEBIT"] != "Y") {
         $arFields["DEBIT"] = "N";
     }
     if (is_set($arFields, "USER_ID")) {
         $dbUser = CUser::GetByID($arFields["USER_ID"]);
         if (!$dbUser->Fetch()) {
             $GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["USER_ID"], GetMessage("SKGUT_NO_USER")), "ERROR_NO_USER_ID");
             return false;
         }
     }
     return True;
 }
开发者ID:rasuldev,项目名称:torino,代码行数:30,代码来源:user_transact.php

示例8: CheckFields

 function CheckFields($ACTION, &$arFields)
 {
     global $DB;
     if ((is_set($arFields, "TAX_ID") || $ACTION == "ADD") && IntVal($arFields["TAX_ID"]) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGTR_EMPTY_TAX_ID"), "ERROR_NO_TAX_ID");
         return false;
     }
     if ((is_set($arFields, "PERSON_TYPE_ID") || $ACTION == "ADD") && IntVal($arFields["PERSON_TYPE_ID"]) <= 0) {
         $arFields["PERSON_TYPE_ID"] = false;
     }
     if (is_set($arFields, "VALUE") || $ACTION == "ADD") {
         $arFields["VALUE"] = str_replace(",", ".", $arFields["VALUE"]);
         $arFields["VALUE"] = DoubleVal($arFields["VALUE"]);
     }
     if ((is_set($arFields, "IS_PERCENT") || $ACTION == "ADD") && $arFields["IS_PERCENT"] != "N") {
         $arFields["IS_PERCENT"] = "Y";
     }
     if ($arFields["IS_PERCENT"] == "Y") {
         $arFields["CURRENCY"] = false;
     } elseif ($arFields["IS_PERCENT"] == "N" && (!is_set($arFields, "CURRENCY") || strlen($arFields["CURRENCY"]) <= 0)) {
         return False;
     } elseif (!is_set($arFields, "IS_PERCENT") && (is_set($arFields, "CURRENCY") && $arFields["CURRENCY"] !== false)) {
         return False;
     }
     if (is_set($arFields, "TAX_ID")) {
         if (!($arTax = CSaleTax::GetByID($arFields["TAX_ID"]))) {
             $GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["TAX_ID"], GetMessage("SKGTR_NO_TAX")), "ERROR_NO_TAX");
             return false;
         }
     }
     if (is_set($arFields, "PERSON_TYPE_ID") && $arFields["PERSON_TYPE_ID"] !== false) {
         if (!($arPersonType = CSalePersonType::GetByID($arFields["PERSON_TYPE_ID"]))) {
             $GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["PERSON_TYPE_ID"], GetMessage("SKGTR_NO_PERS_TYPE")), "ERROR_NO_PERSON_TYPE");
             return false;
         }
     }
     if ((is_set($arFields, "IS_IN_PRICE") || $ACTION == "ADD") && $arFields["IS_IN_PRICE"] != "Y") {
         $arFields["IS_IN_PRICE"] = "N";
     }
     if ((is_set($arFields, "ACTIVE") || $ACTION == "ADD") && $arFields["ACTIVE"] != "N") {
         $arFields["ACTIVE"] = "Y";
     }
     if ((is_set($arFields, "APPLY_ORDER") || $ACTION == "ADD") && IntVal($arFields["APPLY_ORDER"]) <= 0) {
         $arFields["APPLY_ORDER"] = "100";
     }
     return true;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:47,代码来源:tax_rate.php

示例9: AutoPayOrder

function AutoPayOrder($ORDER_ID)
{
    $ORDER_ID = IntVal($ORDER_ID);
    $arOrder = CSaleOrder::GetByID($ORDER_ID);
    if (!$arOrder) {
        return false;
    }
    if ($arOrder["PS_STATUS"] != "Y") {
        return false;
    }
    if ($arOrder["PAYED"] != "N") {
        return false;
    }
    if ($arOrder["CURRENCY"] == $arOrder["PS_CURRENCY"] && DoubleVal($arOrder["PRICE"]) == DoubleVal($arOrder["PS_SUM"])) {
        if (CSaleOrder::PayOrder($order["ID"], "Y", True, False)) {
            return true;
        }
    }
    return false;
}
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:20,代码来源:include.php

示例10: process

 protected function process(ViewBag $viewbag)
 {
     $thumbnailer = $this->movie->getThumbnailer();
     $viewbag->Thumbnailer = $thumbnailer;
     // List of defined cutpoints
     $max = $this->movie->getMaxSeek();
     $duration_sec = $this->movie->duration();
     $viewbag->CutList = array();
     foreach ($this->list->getCutRegions() as $v) {
         $left = $v[0];
         $right = $v[1];
         $duration_mark = ($right == -1 ? $max : $right) - $left;
         $secs = Floor(DoubleVal($duration_mark) / $max * $duration_sec);
         $c = new StdClass();
         $c->Timestamp = sprintf("%02d:%02d:%02d ", floor($secs / 3600), $secs % 3600 / 60, $secs % 60);
         $c->Left = $left;
         $c->Right = $right == -1 ? $max : $right;
         $viewbag->CutList[] = $c;
     }
     $this->SetView($this->ajax ? "MovieAjax" : "Movie");
 }
开发者ID:roadrunner6,项目名称:mythcut,代码行数:21,代码来源:MovieHandler.php

示例11: roundDB

function roundDB($value, $len=18, $dec=4)
{
	if($value>=0)
		$value = "0".$value;
	$value = roundEx(DoubleVal($value), $len);
	$value = sprintf("%01.".$dec."f", $value);
	if($len>0 && strlen($value)>$len-$dec)
		$value = trim(substr($value, 0, $len-$dec), ".");
	return $value;
}
开发者ID:nProfessor,项目名称:Mytb,代码行数:10,代码来源:tools.php

示例12: PrepareSql


//.........这里部分代码省略.........
             $strSqlSelect = "%%_DISTINCT_%% " . $strSqlSelect;
         }
     }
     // <-- SELECT
     // WHERE -->
     $arSqlSearch = array();
     if (is_array($arFilter)) {
         foreach ($arFilter as $key => $vals) {
             if (!is_array($vals)) {
                 $vals = array($vals);
             }
             $key_res = CGroup::GetFilterOperation($key);
             $key = $key_res["FIELD"];
             $strNegative = $key_res["NEGATIVE"];
             $strOperation = $key_res["OPERATION"];
             $strOrNull = $key_res["OR_NULL"];
             if (array_key_exists($key, $arFields)) {
                 $arSqlSearch_tmp = array();
                 foreach ($vals as $val) {
                     if (isset($arFields[$key]["WHERE"])) {
                         $arSqlSearch_tmp1 = call_user_func_array($arFields[$key]["WHERE"], array($val, $key, $strOperation, $strNegative, $arFields[$key]["FIELD"], $arFields, $arFilter));
                         if ($arSqlSearch_tmp1 !== false) {
                             $arSqlSearch_tmp[] = $arSqlSearch_tmp1;
                         }
                     } else {
                         if ($arFields[$key]["TYPE"] == "int") {
                             if (intval($val) <= 0) {
                                 $arSqlSearch_tmp[] = ($strNegative == "Y" ? "NOT" : "") . "(" . $arFields[$key]["FIELD"] . " IS NULL OR " . $arFields[$key]["FIELD"] . " <= 0)";
                             } else {
                                 $arSqlSearch_tmp[] = ($strNegative == "Y" ? " " . $arFields[$key]["FIELD"] . " IS NULL OR NOT " : "") . "(" . $arFields[$key]["FIELD"] . " " . $strOperation . " " . intval($val) . " )";
                             }
                         } elseif ($arFields[$key]["TYPE"] == "double") {
                             $val = str_replace(",", ".", $val);
                             if (DoubleVal($val) <= 0) {
                                 $arSqlSearch_tmp[] = ($strNegative == "Y" ? "NOT" : "") . "(" . $arFields[$key]["FIELD"] . " IS NULL OR " . $arFields[$key]["FIELD"] . " <= 0)";
                             } else {
                                 $arSqlSearch_tmp[] = ($strNegative == "Y" ? " " . $arFields[$key]["FIELD"] . " IS NULL OR NOT " : "") . "(" . $arFields[$key]["FIELD"] . " " . $strOperation . " " . DoubleVal($val) . " )";
                             }
                         } elseif ($arFields[$key]["TYPE"] == "string" || $arFields[$key]["TYPE"] == "char") {
                             if ($strOperation == "QUERY") {
                                 $arSqlSearch_tmp[] = GetFilterQuery($arFields[$key]["FIELD"], $val, "Y");
                             } else {
                                 if (strlen($val) <= 0) {
                                     $arSqlSearch_tmp[] = ($strNegative == "Y" ? "NOT" : "") . "(" . $arFields[$key]["FIELD"] . " IS NULL OR LENGTH(" . $arFields[$key]["FIELD"] . ")<=0)";
                                 } else {
                                     $arSqlSearch_tmp[] = ($strNegative == "Y" ? " " . $arFields[$key]["FIELD"] . " IS NULL OR NOT " : "") . "(" . $arFields[$key]["FIELD"] . " " . $strOperation . " '" . $DB->ForSql($val) . "' )";
                                 }
                             }
                         } elseif ($arFields[$key]["TYPE"] == "datetime") {
                             if (strlen($val) <= 0) {
                                 $arSqlSearch_tmp[] = ($strNegative == "Y" ? "NOT" : "") . "(" . $arFields[$key]["FIELD"] . " IS NULL)";
                             } else {
                                 $arSqlSearch_tmp[] = ($strNegative == "Y" ? " " . $arFields[$key]["FIELD"] . " IS NULL OR NOT " : "") . "(" . $arFields[$key]["FIELD"] . " " . $strOperation . " " . $DB->CharToDateFunction($DB->ForSql($val), "FULL") . ")";
                             }
                         } elseif ($arFields[$key]["TYPE"] == "date") {
                             if (strlen($val) <= 0) {
                                 $arSqlSearch_tmp[] = ($strNegative == "Y" ? "NOT" : "") . "(" . $arFields[$key]["FIELD"] . " IS NULL)";
                             } else {
                                 $arSqlSearch_tmp[] = ($strNegative == "Y" ? " " . $arFields[$key]["FIELD"] . " IS NULL OR NOT " : "") . "(" . $arFields[$key]["FIELD"] . " " . $strOperation . " " . $DB->CharToDateFunction($DB->ForSql($val), "SHORT") . ")";
                             }
                         }
                     }
                 }
                 if (isset($arFields[$key]["FROM"]) && strlen($arFields[$key]["FROM"]) > 0 && !in_array($arFields[$key]["FROM"], $arAlreadyJoined)) {
                     if (strlen($strSqlFrom) > 0) {
                         $strSqlFrom .= " ";
开发者ID:rasuldev,项目名称:torino,代码行数:67,代码来源:user.php

示例13: CustomizeLHEForBlogComments


//.........这里部分代码省略.........
						}
						return "";
					}
				}
			}
		};


		window.LHEDailogs['BlogImage'] = function(pObj)
		{
			var str =
				'<span class="errortext" id="lhed_blog_image_error" style="display:none;"></span>' +
				'<table width="100%"><tr>' +
				'<td class="lhe-dialog-label lhe-label-imp"><?php 
echo GetMessageJS('BLOG_IMAGE');
?>
:</td>' +
				'<td class="lhe-dialog-param">' +
				'<'+'form id="' + pObj.pLEditor.id + 'img_upload_form" action="<?php 
echo CUtil::JSEscape(POST_FORM_ACTION_URI);
?>
" method="post" enctype="multipart/form-data" style="margin: 0!important; padding: 0!important;">' +
				'<?php 
echo freetrix_sessid_post();
?>
' +
				'<input type="file" size="30" name="BLOG_UPLOAD_FILE" id="bx_lhed_blog_img_input" />' +
				'<input type="hidden" value="Y" name="blog_upload_image"/>' +
				'<input type="hidden" name="post" value="Y">' +
				'</form>'+
				'</td>' +
				'</tr><tr id="' + pObj.pLEditor.id + 'lhed_blog_notice">' +
				'<td colSpan="2" style="padding: 0 0 20px 25px !important; font-size: 11px!important;"><?php 
echo GetMessageJS('BPC_IMAGE_SIZE_NOTICE', array('#SIZE#' => DoubleVal(COption::GetOptionString("blog", "image_max_size", 1000000) / 1000000)));
?>
</td>' +
			'</tr></table>';

			return {
				title: "<?php 
echo GetMessageJS('BLOG_P_IMAGE_UPLOAD');
?>
",
				innerHTML : str,
				width: 500,
				OnLoad: function()
				{
					pObj.pForm = false;
					pObj.pInput = false;

					pObj.pInput = BX('bx_lhed_blog_img_input');
					pObj.pForm = BX(pObj.pLEditor.id + 'img_upload_form');
					pObj.pLEditor.focus(pObj.pInput);

					window.obLHEDialog.adjustSizeEx();
				},
				OnSave: function()
				{
					if (pObj.pInput && pObj.pForm && pObj.pInput.value != "")
					{
						BX.showWait('bx_lhed_blog_img_input');
						BX('lhed_blog_image_error').style.display = 'none';
						BX('lhed_blog_image_error').innerHTML = '';
						BX.ajax.submit(pObj.pForm, function(){
							BX.closeWait();
							if (window.bxBlogImageId)
开发者ID:ASDAFF,项目名称:open_bx,代码行数:67,代码来源:lhe.php

示例14: FilterCreateEx

 public static function FilterCreateEx($fname, $vals, $type, &$bFullJoin, $cOperationType = false, $bSkipEmpty = true)
 {
     global $DB;
     if (!is_array($vals)) {
         $vals = array($vals);
     }
     if (count($vals) < 1) {
         return "";
     }
     if (is_bool($cOperationType)) {
         if ($cOperationType === true) {
             $cOperationType = "N";
         } else {
             $cOperationType = "E";
         }
     }
     if ($cOperationType == "G") {
         $strOperation = ">";
     } elseif ($cOperationType == "GE") {
         $strOperation = ">=";
     } elseif ($cOperationType == "LE") {
         $strOperation = "<=";
     } elseif ($cOperationType == "L") {
         $strOperation = "<";
     } else {
         $strOperation = "=";
     }
     $bFullJoin = false;
     $bWasLeftJoin = false;
     $res = array();
     for ($i = 0; $i < count($vals); $i++) {
         $val = $vals[$i];
         if (!$bSkipEmpty || strlen($val) > 0 || is_bool($val) && $val === false) {
             switch ($type) {
                 case "string_equal":
                     if ($cOperationType == "?") {
                         if (strlen($val) > 0) {
                             $res[] = GetFilterQuery($fname, $val, "N");
                         }
                     } else {
                         if (strlen($val) <= 0) {
                             $res[] = ($cOperationType == "N" ? "NOT" : "") . "(" . $fname . " IS NULL OR " . $DB->Length($fname) . "<=0)";
                         } else {
                             $res[] = ($cOperationType == "N" ? " " . $fname . " IS NULL OR NOT " : "") . "(" . CLdapUtil::_Upper($fname) . $strOperation . CLdapUtil::_Upper("'" . $DB->ForSql($val) . "'") . ")";
                         }
                     }
                     break;
                 case "string":
                     if ($cOperationType == "?") {
                         if (strlen($val) > 0) {
                             $sr = GetFilterQuery($fname, $val, "Y", array(), "N");
                             if ($sr != "0") {
                                 $res[] = $sr;
                             }
                         }
                     } else {
                         if (strlen($val) <= 0) {
                             $res[] = ($cOperationType == "N" ? "NOT" : "") . "(" . $fname . " IS NULL OR " . $DB->Length($fname) . "<=0)";
                         } else {
                             if ($strOperation == "=") {
                                 $res[] = ($cOperationType == "N" ? " " . $fname . " IS NULL OR NOT " : "") . "(" . ($DB->type == "ORACLE" ? CLdapUtil::_Upper($fname) . " LIKE " . CLdapUtil::_Upper("'" . $DB->ForSqlLike($val) . "'") . " ESCAPE '\\'" : $fname . " " . ($strOperation == "=" ? "LIKE" : $strOperation) . " '" . $DB->ForSqlLike($val) . "'") . ")";
                             } else {
                                 $res[] = ($cOperationType == "N" ? " " . $fname . " IS NULL OR NOT " : "") . "(" . ($DB->type == "ORACLE" ? CLdapUtil::_Upper($fname) . " " . $strOperation . " " . CLdapUtil::_Upper("'" . $DB->ForSql($val) . "'") . " " : $fname . " " . $strOperation . " '" . $DB->ForSql($val) . "'") . ")";
                             }
                         }
                     }
                     break;
                 case "date":
                     if (strlen($val) <= 0) {
                         $res[] = ($cOperationType == "N" ? "NOT" : "") . "(" . $fname . " IS NULL)";
                     } else {
                         $res[] = ($cOperationType == "N" ? " " . $fname . " IS NULL OR NOT " : "") . "(" . $fname . " " . $strOperation . " " . $DB->CharToDateFunction($DB->ForSql($val), "FULL") . ")";
                     }
                     break;
                 case "number":
                     if ($cOperationType == "?") {
                         $res[] = GetFilterQuery($fname, $val);
                     } else {
                         if (strlen($val) <= 0) {
                             $res[] = ($cOperationType == "N" ? "NOT" : "") . "(" . $fname . " IS NULL)";
                         } else {
                             $res[] = ($cOperationType == "N" ? " " . $fname . " IS NULL OR NOT " : "") . "(" . $fname . " " . $strOperation . " '" . DoubleVal($val) . "')";
                         }
                     }
                     break;
                 case "number_above":
                     if (strlen($val) <= 0) {
                         $res[] = ($cOperationType == "N" ? "NOT" : "") . "(" . $fname . " IS NULL)";
                     } else {
                         $res[] = ($cOperationType == "N" ? " " . $fname . " IS NULL OR NOT " : "") . "(" . $fname . " " . $strOperation . " '" . $DB->ForSql($val) . "')";
                     }
                     break;
             }
             // we need this conditions to do INNER JOIN
             if (strlen($val) > 0 && $cOperationType != "N") {
                 $bFullJoin = true;
             } else {
                 $bWasLeftJoin = true;
             }
         }
//.........这里部分代码省略.........
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:101,代码来源:ldap_util.php

示例15: nodeHandler


//.........这里部分代码省略.........
                     $arFields = array();
                     if (!empty($v["items"][$arBasket["PRODUCT_XML_ID"]])) {
                         if ($arBasket["QUANTITY"] != $v["items"][$arBasket["PRODUCT_XML_ID"]]["QUANTITY"]) {
                             $arFields["QUANTITY"] = $v["items"][$arBasket["PRODUCT_XML_ID"]]["QUANTITY"];
                         }
                         if ($arBasket["PRICE"] != $v["items"][$arBasket["PRODUCT_XML_ID"]]["PRICE"]) {
                             $arFields["PRICE"] = $v["items"][$arBasket["PRODUCT_XML_ID"]]["PRICE"];
                         }
                         if ($arBasket["VAT_RATE"] != $v["items"][$arBasket["PRODUCT_XML_ID"]]["VAT_RATE"]) {
                             $arFields["VAT_RATE"] = $v["items"][$arBasket["PRODUCT_XML_ID"]]["VAT_RATE"];
                         }
                         if ($arBasket["DISCOUNT_PRICE"] != $v["items"][$arBasket["PRODUCT_XML_ID"]]["DISCOUNT_PRICE"]) {
                             $arFields["DISCOUNT_PRICE"] = $v["items"][$arBasket["PRODUCT_XML_ID"]]["DISCOUNT_PRICE"];
                         }
                         if (count($arFields) > 0) {
                             CSaleBasket::Update($arBasket["ID"], $arFields);
                         }
                         $v["items"][$arBasket["PRODUCT_XML_ID"]]["CHECKED"] = "Y";
                     } else {
                         CSaleBasket::Delete($arBasket["ID"]);
                     }
                 }
                 foreach ($v["items"] as $itemID => $arItem) {
                     if ($arItem["CHECKED"] != "Y") {
                         if ($arItem["TYPE"] == GetMessage("CC_BSC1_ITEM")) {
                             CModule::IncludeModule("iblock");
                             $dbIBlockElement = CIBlockElement::GetList(array(), array("XML_ID" => $itemID, "ACTIVE" => "Y", "CHECK_PERMISSIONS" => "Y"), false, false, array("ID", "IBLOCK_ID", "XML_ID", "NAME", "DETAIL_PAGE_URL"));
                             if ($arIBlockElement = $dbIBlockElement->GetNext()) {
                                 $dbIBlock = CIBlock::GetList(array(), array("ID" => $arIBlockElement["IBLOCK_ID"]));
                                 if ($arIBlock = $dbIBlock->Fetch()) {
                                     $arProps[] = array("NAME" => "Catalog XML_ID", "CODE" => "CATALOG.XML_ID", "VALUE" => $arIBlock["XML_ID"]);
                                 }
                                 $arProps[] = array("NAME" => "Product XML_ID", "CODE" => "PRODUCT.XML_ID", "VALUE" => $arIBlockElement["XML_ID"]);
                                 $arProduct = CCatalogProduct::GetByID($arIBlockElement["ID"]);
                                 $arFields = array("ORDER_ID" => $orderId, "PRODUCT_ID" => $arIBlockElement["ID"], "PRICE" => $arItem["PRICE"], "CURRENCY" => $orderInfo["CURRENCY"], "WEIGHT" => $arProduct["WEIGHT"], "QUANTITY" => $arItem["QUANTITY"], "LID" => $orderInfo["LID"], "DELAY" => "N", "CAN_BUY" => "Y", "NAME" => $arIBlockElement["~NAME"], "CALLBACK_FUNC" => "CatalogBasketCallback", "MODULE" => "catalog", "NOTES" => $arProduct["CATALOG_GROUP_NAME"], "ORDER_CALLBACK_FUNC" => "CatalogBasketOrderCallback", "CANCEL_CALLBACK_FUNC" => "CatalogBasketCancelCallback", "PAY_CALLBACK_FUNC" => "CatalogPayOrderCallback", "DETAIL_PAGE_URL" => $arIBlockElement["DETAIL_PAGE_URL"], "CATALOG_XML_ID" => $arIBlock["XML_ID"], "PRODUCT_XML_ID" => $arIBlockElement["XML_ID"], "IGNORE_CALLBACK_FUNC" => "Y", "VAT_RATE" => $arItem["VAT_RATE"]);
                                 CSaleBasket::Add($arFields);
                             } else {
                                 $this->strError .= "\n" . GetMessage("CC_BSC1_PRODUCT_NOT_FOUND") . $orderId . " - [" . $itemID . "] " . $arItem["NAME"];
                             }
                         } elseif ($arItem["TYPE"] == GetMessage("CC_BSC1_SERVICE")) {
                             if (IntVal($arItem["PRICE"]) != IntVal($orderInfo["PRICE_DELIVERY"])) {
                                 CSaleOrder::Update($orderId, array("PRICE_DELIVERY" => $arItem["PRICE"]));
                             }
                         }
                     }
                 }
                 $arOrderFields = array();
                 if ($v["AMOUNT"] != $orderInfo["PRICE"]) {
                     $arOrderFields = array("PRICE" => $v["AMOUNT"]);
                 }
                 if (DoubleVal($orderInfo["DISCOUNT_VALUE"]) > 0) {
                     $arOrderFields["DISCOUNT_VALUE"] = 0;
                 }
                 $arOrderFields["UPDATED_1C"] = "Y";
                 if (!empty($arOrderFields)) {
                     CSaleOrder::Update($orderId, $arOrderFields);
                 }
             } else {
                 $this->strError .= "\n" . GetMessage("CC_BSC1_FINAL_NOT_EDIT", array("#ID#" => $orderId));
             }
             $arAditFields = array();
             if ($v["TRAITS"][GetMessage("CC_BSC1_CANCELED")] == "true") {
                 if ($orderInfo["CANCELED"] == "N") {
                     CSaleOrder::CancelOrder($orderId, "Y", $v["COMMENT"]);
                 }
                 $arAditFields["UPDATED_1C"] = "Y";
             } else {
                 if ($orderInfo["CANCELED"] == "Y") {
                     CSaleOrder::CancelOrder($orderId, "N", $v["COMMENT"]);
                 }
                 $arAditFields["UPDATED_1C"] = "Y";
                 if (strlen($v["TRAITS"][GetMessage("CC_BSC1_1C_PAYED_DATE")]) > 1) {
                     if ($orderInfo["PAYED"] == "N") {
                         CSaleOrder::PayOrder($orderId, "Y");
                     }
                     $arAditFields["PAY_VOUCHER_DATE"] = CDatabase::FormatDate(str_replace("T", " ", $v["TRAITS"][GetMessage("CC_BSC1_1C_PAYED_DATE")]), "YYYY-MM-DD HH:MI:SS", CLang::GetDateFormat("FULL", LANG));
                     if (strlen($v["TRAITS"][GetMessage("CC_BSC1_1C_PAYED_NUM")]) > 0) {
                         $arAditFields["PAY_VOUCHER_NUM"] = $v["TRAITS"][GetMessage("CC_BSC1_1C_PAYED_NUM")];
                     }
                     $arAditFields["UPDATED_1C"] = "Y";
                 }
                 if (strlen($v["TRAITS"][GetMessage("CC_BSC1_1C_DELIVERY_DATE")]) > 1) {
                     if ($orderInfo["ALLOW_DELIVERY"] == "N") {
                         CSaleOrder::DeliverOrder($orderId, "Y");
                     }
                     $arAditFields["DATE_ALLOW_DELIVERY"] = CDatabase::FormatDate(str_replace("T", " ", $v["TRAITS"][GetMessage("CC_BSC1_1C_DELIVERY_DATE")]), "YYYY-MM-DD HH:MI:SS", CLang::GetDateFormat("FULL", LANG));
                     if (strlen($arParams["FINAL_STATUS_ON_DELIVERY"]) > 0 && $orderInfo["STATUS_ID"] != "F" && $orderInfo["STATUS_ID"] != $arParams["FINAL_STATUS_ON_DELIVERY"]) {
                         CSaleOrder::StatusOrder($orderId, $arParams["FINAL_STATUS_ON_DELIVERY"]);
                     }
                     $arAditFields["UPDATED_1C"] = "Y";
                 }
             }
             if (count($arAditFields) > 0) {
                 CSaleOrder::Update($orderId, $arAditFields);
             }
         } else {
             $this->strError .= "\n" . GetMessage("CC_BSC1_ORDER_NOT_FOUND", array("#ID#" => $orderId));
         }
     }
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:101,代码来源:component.php


注:本文中的DoubleVal函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。