本文整理汇总了PHP中CSaleOrderPropsValue::GetList方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleOrderPropsValue::GetList方法的具体用法?PHP CSaleOrderPropsValue::GetList怎么用?PHP CSaleOrderPropsValue::GetList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleOrderPropsValue
的用法示例。
在下文中一共展示了CSaleOrderPropsValue::GetList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CheckFields
public static function CheckFields($ACTION, &$arFields, $ID = 0)
{
if ((is_set($arFields, "ORDER_ID") || $ACTION == "ADD") && IntVal($arFields["ORDER_ID"]) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGOPV_EMPTY_ORDER_ID"), "EMPTY_ORDER_ID");
return false;
}
if ((is_set($arFields, "ORDER_PROPS_ID") || $ACTION == "ADD") && IntVal($arFields["ORDER_PROPS_ID"]) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGOPV_EMPTY_PROP_ID"), "EMPTY_ORDER_PROPS_ID");
return false;
}
if (is_set($arFields, "ORDER_ID")) {
if (!($arOrder = CSaleOrder::GetByID($arFields["ORDER_ID"]))) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["ORDER_ID"], GetMessage("SKGOPV_NO_ORDER_ID")), "ERROR_NO_ORDER");
return false;
}
}
if (is_set($arFields, "ORDER_PROPS_ID")) {
if (!($arOrder = CSaleOrderProps::GetByID($arFields["ORDER_PROPS_ID"]))) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["ORDER_PROPS_ID"], GetMessage("SKGOPV_NO_PROP_ID")), "ERROR_NO_PROPERY");
return false;
}
if (is_set($arFields, "ORDER_ID")) {
$arFilter = array("ORDER_ID" => $arFields["ORDER_ID"], "ORDER_PROPS_ID" => $arFields["ORDER_PROPS_ID"]);
if (IntVal($ID) > 0) {
$arFilter["!ID"] = $ID;
}
$dbP = CSaleOrderPropsValue::GetList(array(), $arFilter);
if ($arP = $dbP->Fetch()) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGOPV_DUPLICATE_PROP_ID", array("#ID#" => $arFields["ORDER_PROPS_ID"], "#ORDER_ID#" => $arFields["ORDER_ID"])), "ERROR_DUPLICATE_PROP_ID");
return false;
}
}
}
return True;
}
示例2: DoSaveUserProfile
static function DoSaveUserProfile($userId, $profileId, $profileName, $personTypeId, $orderProps, &$arErrors)
{
$profileId = intval($profileId);
$arIDs = array();
if ($profileId > 0) {
$dbProfile = CSaleOrderUserProps::GetList(array(), array("ID" => $profileId), false, false, array("ID", "NAME", "USER_ID", "PERSON_TYPE_ID"));
$arProfile = $dbProfile->Fetch();
if (!$arProfile) {
$arErrors[] = array("CODE" => "PROFILE_NOT_FOUND", "TEXT" => GetMessage('SKGOUP_PROFILE_NOT_FOUND'));
return false;
}
if ($arProfile["USER_ID"] != $userId || $arProfile["PERSON_TYPE_ID"] != $personTypeId) {
$arErrors[] = array("CODE" => "PARAM", "TEXT" => GetMessage('SKGOUP_PARRAMS_ERROR'));
return false;
}
//if (strlen($profileName) > 0 && $profileName != $arProfile["NAME"])
if (strlen($profileName) > 0) {
$arFields = array("NAME" => $profileName, "USER_ID" => $userId);
CSaleOrderUserProps::Update($profileId, $arFields);
}
$dbUserPropsValues = CSaleOrderUserPropsValue::GetList(array(), array("USER_PROPS_ID" => $profileId), false, false, array("ID", "ORDER_PROPS_ID"));
while ($arUserPropsValue = $dbUserPropsValues->Fetch()) {
$arIDs[$arUserPropsValue["ORDER_PROPS_ID"]] = $arUserPropsValue["ID"];
}
}
if (!is_array($orderProps)) {
$dbOrderPropsValues = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => intval($orderProps)), false, false, array("ORDER_PROPS_ID", "VALUE"));
$orderProps = array();
while ($arOrderPropsValue = $dbOrderPropsValues->Fetch()) {
$orderProps[$arOrderPropsValue["ORDER_PROPS_ID"]] = $arOrderPropsValue["VALUE"];
}
}
$dbOrderProperties = CSaleOrderProps::GetList(array(), array("PERSON_TYPE_ID" => $personTypeId, "ACTIVE" => "Y", "UTIL" => "N", "USER_PROPS" => "Y"), false, false, array("ID", "TYPE", "NAME", "CODE"));
while ($arOrderProperty = $dbOrderProperties->Fetch()) {
$curVal = $orderProps[$arOrderProperty["ID"]];
if ($arOrderProperty["TYPE"] == "MULTISELECT" && is_array($curVal)) {
$curVal = implode(",", $curVal);
}
if (strlen($curVal) > 0) {
if ($profileId <= 0) {
if (strlen($profileName) <= 0) {
$profileName = GetMessage("SOA_PROFILE") . " " . Date("Y-m-d");
}
$arFields = array("NAME" => $profileName, "USER_ID" => $userId, "PERSON_TYPE_ID" => $personTypeId);
$profileId = CSaleOrderUserProps::Add($arFields);
}
if (array_key_exists($arOrderProperty["ID"], $arIDs)) {
$arFields = array("NAME" => $arOrderProperty["NAME"], "VALUE" => $curVal);
CSaleOrderUserPropsValue::Update($arIDs[$arOrderProperty["ID"]], $arFields);
unset($arIDs[$arOrderProperty["ID"]]);
} else {
$arFields = array("USER_PROPS_ID" => $profileId, "ORDER_PROPS_ID" => $arOrderProperty["ID"], "NAME" => $arOrderProperty["NAME"], "VALUE" => $curVal);
CSaleOrderUserPropsValue::Add($arFields);
}
}
}
foreach ($arIDs as $id) {
CSaleOrderUserPropsValue::Delete($id);
}
}
示例3: getOrderInfo
protected static function getOrderInfo($orderId)
{
// order itself
$order = \CSaleOrder::getById($orderId);
// buyer info
$siteUserId = $order['USER_ID'];
$phone = '';
$email = '';
$result = \CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $orderId));
while ($row = $result->fetch()) {
if (empty($phone) && stripos($row['CODE'], 'PHONE') !== false) {
$stPhone = static::normalizePhoneNumber($row['VALUE']);
if (!empty($stPhone)) {
$phone = sha1($stPhone);
}
}
if (empty($email) && stripos($row['CODE'], 'EMAIL') !== false) {
if (!empty($row['VALUE'])) {
$email = sha1($row['VALUE']);
}
}
}
// products info
$products = array();
$result = \CSaleBasket::getList(array(), $arFilter = array('ORDER_ID' => $orderId), false, false, array('PRODUCT_ID'));
while ($row = $result->fetch()) {
$products[] = array('product_id' => $row['PRODUCT_ID'], 'recommendation' => '0');
}
// all together
$data = array('order_id' => $orderId, 'user_id' => $siteUserId, 'phone' => $phone, 'email' => $email, 'products' => $products);
return $data;
}
示例4: getOrderPropsValue
public static function getOrderPropsValue($orderId, $fetchByCode = true)
{
static $result = array();
$hash = $orderId . '_' . $fetchByCode;
if($result[$hash] === null)
{
$result[$hash] = array();
$rs = \CSaleOrderPropsValue::GetList(array(), array('ORDER_ID' => $orderId), false, false, array('NAME', 'VALUE', 'CODE'));
while($ar = $rs->GetNext(true, false))
{
$obj = new OrderPropsValue($ar);
if($fetchByCode)
{
$result[$hash][$ar['CODE']] = $obj;
}
else
{
$result[$hash][] = $obj;
}
}
}
return $result[$hash];
}
示例5: OnBeforeEventAddHandler
public static function OnBeforeEventAddHandler(&$event, &$lid, &$arFields)
{
if ($event == "SALE_NEW_ORDER") {
$orderId = $arFields['ORDER_ID'];
$dbOrderProps = CSaleOrderPropsValue::GetList(array("CODE" => "ASC"), array("ORDER_ID" => $orderId, "CODE" => array("ORDER_PHONE", "ORDER_ADDRESS", "ORDER_ADDRESS_DETAILS", "ORDER_NAME")));
while ($arOrderProps = $dbOrderProps->GetNext()) {
$arFields[$arOrderProps['CODE']] = $arOrderProps['~VALUE'];
}
$arFields["ORDER_DESCRIPTION"] = trim(CSaleOrder::GetByID($orderId)["USER_DESCRIPTION"]);
}
}
示例6: getProperties
public function getProperties()
{
if (!isset($this->props)) {
$this->props = $this->propsRaw = array();
$res = \CSaleOrderPropsValue::GetList(array('SORT' => 'ASC'), array('ORDER_ID' => $this->id));
while ($row = $res->Fetch()) {
$this->props[$row['CODE']] = $row['VALUE'];
$this->propsRaw[] = $row;
}
}
return $this->props;
}
示例7: AddOrderProperty
function AddOrderProperty($prop_id, $value, $order)
{
if (!strlen($prop_id)) {
return false;
}
if (CModule::IncludeModule('sale')) {
if ($arOrderProps = CSaleOrderProps::GetByID($prop_id)) {
$db_vals = CSaleOrderPropsValue::GetList(array(), array('ORDER_ID' => $order, 'ORDER_PROPS_ID' => $arOrderProps['ID']));
if ($arVals = $db_vals->Fetch()) {
return CSaleOrderPropsValue::Update($arVals['ID'], array('NAME' => $arVals['NAME'], 'CODE' => $arVals['CODE'], 'ORDER_PROPS_ID' => $arVals['ORDER_PROPS_ID'], 'ORDER_ID' => $arVals['ORDER_ID'], 'VALUE' => $value));
} else {
return CSaleOrderPropsValue::Add(array('NAME' => $arOrderProps['NAME'], 'CODE' => $arOrderProps['CODE'], 'ORDER_PROPS_ID' => $arOrderProps['ID'], 'ORDER_ID' => $order, 'VALUE' => $value));
}
}
}
}
示例8: die
$arFields = CSaleOrder::GetById($order['externalId']);
// incorrect order
if ($arFields === false || empty($arFields)) {
die();
}
$LID = $arFields['LID'];
$userId = $arFields['USER_ID'];
if(isset($order['customer']['externalId']) && !is_null($order['customer']['externalId'])) {
$userId = $order['customer']['externalId'];
}
$rsOrderProps = CSaleOrderPropsValue::GetList(array(), array('ORDER_ID' => $arFields['ID']));
$arUpdateProps = array();
while ($ar = $rsOrderProps->Fetch()) {
$prop = CSaleOrderProps::GetByID($ar['ORDER_PROPS_ID']);
$arUpdateProps[ $ar['CODE'] ] = array('ID' => $ar['ID'], 'TYPE' => $prop['TYPE'], 'VALUE' => $ar['VALUE']);
}
$order['fio'] = trim(
implode(
' ',
array(
isset($order['lastName']) ? $order['lastName'] : '',
isset($order['firstName']) ? $order['firstName'] : '',
isset($order['patronymic']) ? $order['patronymic'] : '',
)
)
示例9: die
<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die();?>
<?
CModule::IncludeModule('sale');
$ORDER_ID = $GLOBALS['ORDER_ID'];
$resProp = CSaleOrderPropsValue::GetList(array(), array('ORDER_ID' => $ORDER_ID, 'CODE'=>CSalePaySystemAction::GetParamValue('ORDER_BANK')), false, false, array());
if ($arProp = $resProp->GetNext()) {
$orderId = $arProp['VALUE'];
$url = CSalePaySystemAction::GetParamValue('URL_API').'getOrderStatus.do?';
$json = file_get_contents( $url.'userName='.urlencode( CSalePaySystemAction::GetParamValue('LOGIN') ).'&password='.urlencode( CSalePaySystemAction::GetParamValue('PASS') ).'&orderId='.urlencode($orderId) );
$obj = json_decode($json);
if($obj->{'errorCode'} == 0 && $obj->{'OrderStatus'} == 2) {
// оплачено
CSaleOrder::PayOrder($ORDER_ID, 'Y');
if (CSalePaySystemAction::GetParamValue('STATUS_PAY')) {
CSaleOrder::Update($ORDER_ID, array('STATUS_ID'=>CSalePaySystemAction::GetParamValue('STATUS_PAY')));
}
return true;
}
}
return false;
示例10: InitParamArrays
function InitParamArrays($arOrder, $orderID = 0, $psParams = "", $relatedData = array(), $payment = array())
{
if (!is_array($relatedData)) {
$relatedData = array();
}
$GLOBALS["SALE_INPUT_PARAMS"] = array();
$GLOBALS["SALE_CORRESPONDENCE"] = array();
if (!is_array($arOrder) || count($arOrder) <= 0 || !array_key_exists("ID", $arOrder)) {
$arOrder = array();
$orderID = IntVal($orderID);
if ($orderID > 0) {
$arOrderTmp = CSaleOrder::GetByID($orderID);
}
if (!empty($arOrderTmp)) {
foreach ($arOrderTmp as $k => $v) {
$arOrder["~" . $k] = $v;
$arOrder[$k] = htmlspecialcharsbx($v);
}
}
} else {
if ($orderID == 0 && $arOrder['ID'] > 0) {
$orderID = $arOrder['ID'];
}
}
if (empty($payment) && $orderID > 0) {
$payment = \Bitrix\Sale\Internals\PaymentTable::getRow(array('select' => array('*'), 'filter' => array('ORDER_ID' => $orderID, '!PAY_SYSTEM_ID' => \Bitrix\Sale\PaySystem\Manager::getInnerPaySystemId())));
}
if (count($arOrder) > 0) {
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"] = $arOrder;
}
if (!empty($payment)) {
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["PAYMENT_ID"] = $payment['ID'];
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["~PAYMENT_ID"] = $payment['ID'];
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["SHOULD_PAY"] = $payment['SUM'];
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["~SHOULD_PAY"] = $payment['SUM'];
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["PAYED"] = $payment['PAID'];
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["~PAYED"] = $payment['PAID'];
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["PAY_SYSTEM_ID"] = $payment['PAY_SYSTEM_ID'];
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["~PAY_SYSTEM_ID"] = $payment['PAY_SYSTEM_ID'];
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["ORDER_PAYMENT_ID"] = $payment['ID'];
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["~ORDER_PAYMENT_ID"] = $payment['ID'];
$GLOBALS["SALE_INPUT_PARAMS"]["PAYMENT"] = $payment;
} else {
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["SHOULD_PAY"] = DoubleVal($GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["PRICE"]) - DoubleVal($GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["SUM_PAID"]);
}
$arDateInsert = explode(" ", $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["DATE_INSERT"]);
if (is_array($arDateInsert) && count($arDateInsert) > 0) {
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["DATE_INSERT_DATE"] = $arDateInsert[0];
} else {
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["DATE_INSERT_DATE"] = $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["DATE_INSERT"];
}
if (!empty($payment)) {
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["DATE_BILL_DATE"] = ConvertTimeStamp(MakeTimeStamp($payment["DATE_BILL"]), 'SHORT');
}
$userID = IntVal($GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["USER_ID"]);
if ($userID > 0) {
$dbUser = CUser::GetByID($userID);
if ($arUser = $dbUser->GetNext()) {
$GLOBALS["SALE_INPUT_PARAMS"]["USER"] = $arUser;
}
}
$arCurOrderProps = array();
if (isset($relatedData["PROPERTIES"]) && is_array($relatedData["PROPERTIES"])) {
$properties = $relatedData["PROPERTIES"];
foreach ($properties as $key => $value) {
$arCurOrderProps["~" . $key] = $value;
$arCurOrderProps[$key] = htmlspecialcharsEx($value);
}
} else {
$dbOrderPropVals = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["ID"]), false, false, array("ID", "CODE", "VALUE", "ORDER_PROPS_ID", "PROP_TYPE"));
while ($arOrderPropVals = $dbOrderPropVals->Fetch()) {
$arCurOrderPropsTmp = CSaleOrderProps::GetRealValue($arOrderPropVals["ORDER_PROPS_ID"], $arOrderPropVals["CODE"], $arOrderPropVals["PROP_TYPE"], $arOrderPropVals["VALUE"], LANGUAGE_ID);
foreach ($arCurOrderPropsTmp as $key => $value) {
$arCurOrderProps["~" . $key] = $value;
$arCurOrderProps[$key] = htmlspecialcharsEx($value);
}
}
}
if (count($arCurOrderProps) > 0) {
$GLOBALS["SALE_INPUT_PARAMS"]["PROPERTY"] = $arCurOrderProps;
}
$shipment = \Bitrix\Sale\Internals\ShipmentTable::getRow(array('select' => array('DELIVERY_ID'), 'filter' => array('ORDER_ID' => $orderID, 'SYSTEM' => 'N')));
if ($shipment) {
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["DELIVERY_ID"] = $shipment['DELIVERY_ID'];
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["~DELIVERY_ID"] = $shipment['DELIVERY_ID'];
}
$paySystemId = '';
if ($payment && $payment['PAY_SYSTEM_ID'] > 0) {
$paySystemId = $payment['PAY_SYSTEM_ID'];
} elseif (isset($arOrder['PAY_SYSTEM_ID']) && $arOrder['PAY_SYSTEM_ID'] > 0) {
$paySystemId = $arOrder['PAY_SYSTEM_ID'];
} else {
$psParams = unserialize($psParams);
if (isset($psParams['BX_PAY_SYSTEM_ID'])) {
$paySystemId = $psParams['BX_PAY_SYSTEM_ID']['VALUE'];
}
}
if ($paySystemId !== '') {
if (!isset($arOrder['PERSON_TYPE_ID']) || $arOrder['PERSON_TYPE_ID'] <= 0) {
// for crm quote compatibility
//.........这里部分代码省略.........
示例11: DoSaveOrderProps
static function DoSaveOrderProps($orderId, $personTypeId, $arOrderProps, &$arErrors)
{
$arIDs = array();
$dbResult = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $orderId), false, false, array("ID", "ORDER_PROPS_ID"));
while ($arResult = $dbResult->Fetch()) {
$arIDs[$arResult["ORDER_PROPS_ID"]] = $arResult["ID"];
}
$dbOrderProperties = CSaleOrderProps::GetList(array("SORT" => "ASC"), array("PERSON_TYPE_ID" => $personTypeId, "ACTIVE" => "Y"), false, false, array("ID", "TYPE", "NAME", "CODE", "USER_PROPS", "SORT"));
while ($arOrderProperty = $dbOrderProperties->Fetch()) {
$curVal = $arOrderProps[$arOrderProperty["ID"]];
if ($arOrderProperty["TYPE"] == "MULTISELECT" && is_array($curVal)) {
$curVal = implode(",", $curVal);
}
if (strlen($curVal) > 0) {
$arFields = array("ORDER_ID" => $orderId, "ORDER_PROPS_ID" => $arOrderProperty["ID"], "NAME" => $arOrderProperty["NAME"], "CODE" => $arOrderProperty["CODE"], "VALUE" => $curVal);
if (array_key_exists($arOrderProperty["ID"], $arIDs)) {
CSaleOrderPropsValue::Update($arIDs[$arOrderProperty["ID"]], $arFields);
unset($arIDs[$arOrderProperty["ID"]]);
} else {
CSaleOrderPropsValue::Add($arFields);
}
}
}
foreach ($arIDs as $id) {
CSaleOrderPropsValue::Delete($id);
}
}
示例12: fGetBuyerType
function fGetBuyerType($PERSON_TYPE_ID, $LID, $USER_ID = '', $ORDER_ID = 0, $formVarsSubmit = false)
{
global $locationZipID, $locationID, $DELIVERY_LOCATION, $DELIVERY_LOCATION_ZIP;
$resultHtml = "<script>locationZipID = 0;locationID = 0;</script><table width=\"100%\" id=\"order_type_props\" class=\"edit-table\">";
//select person type
$arPersonTypeList = array();
$personTypeSelect = "<select name='buyer_type_id' id='buyer_type_id' OnChange='fBuyerChangeType(this);' >";
$dbPersonType = CSalePersonType::GetList(array("SORT" => "ASC", "NAME" => "ASC"), array("ACTIVE" => "Y"));
while ($arPersonType = $dbPersonType->GetNext())
{
if (!in_array($LID, $arPersonType["LIDS"]))
continue;
if (!isset($PERSON_TYPE_ID) OR $PERSON_TYPE_ID == "")
$PERSON_TYPE_ID = $arPersonType["ID"];
$class = "";
if (intval($arPersonType["ID"]) == intval($PERSON_TYPE_ID))
$class = " selected";
$personTypeSelect .= "<option value=\"".$arPersonType["ID"]."\" ".$class.">".$arPersonType["NAME"]." [".$arPersonType["ID"]."]</option>";
}
$personTypeSelect .= "</select>";
$userComment = "";
$userDisplay = "none";
if (intval($ORDER_ID) > 0)
{
$dbOrder = CSaleOrder::GetList(
array(),
array("ID" => $ORDER_ID, "ACTIVE" => "Y"),
false,
false,
array()
);
$arOrder = $dbOrder->Fetch();
$userComment = $arOrder["USER_DESCRIPTION"];
$userDisplay = "table-row";
}
if ($formVarsSubmit && $_REQUEST["btnTypeBuyer"] == "btnBuyerNew")
$userDisplay = "none";
elseif ($formVarsSubmit && $_REQUEST["btnTypeBuyer"] == "btnBuyerExist")
$userDisplay = "table-row";
$resultHtml .= "<tr id=\"btnBuyerExistField\" style=\"display:".$userDisplay."\">
<td class=\"adm-detail-content-cell-l\" width=\"40%\">".GetMessage("NEWO_BUYER").":</td>
<td class=\"adm-detail-content-cell-r\" width=\"60%\"><div id=\"user_name\">".fGetUserName($USER_ID)."</div></td></tr>";
$resultHtml .= "<tr class=\"adm-detail-required-field\">
<td class=\"adm-detail-content-cell-l\" width=\"40%\">".GetMessage("SOE_PERSON_TYPE").":</td>
<td class=\"adm-detail-content-cell-r\" width=\"60%\">".$personTypeSelect."</td>
</tr>";
$bShowTrProfile = "none";
if ($formVarsSubmit && $_POST["btnTypeBuyer"] == "btnBuyerExist")
$bShowTrProfile = "table-row";
$resultHtml .= "<tr id=\"buyer_profile_display\" style=\"display:".$bShowTrProfile."\" class=\"adm-detail-required-field\">
<td class=\"adm-detail-content-cell-l\">".GetMessage("NEWO_BUYER_PROFILE").":</td>
<td class=\"adm-detail-content-cell-r\">
<div id=\"buyer_profile_select\">";
if ($formVarsSubmit && $_POST["btnTypeBuyer"] == "btnBuyerExist")
{
$resultHtml .= fUserProfile(intval($_POST["user_id"]), intval($_POST["buyer_type_id"]), $default = '');
}
$resultHtml .= "</div></td>
</tr>";
if ($ORDER_ID <= 0)
{
$arCountProps = fGetCountProfileProps($PERSON_TYPE_ID);
$resultHtml .= "<tr id=\"btnBuyerNewField\">";
if (count($arCountProps) < 3)
{
$resultHtml .= "<td colspan=2>
<table width=\"100%\" class=\"edit-table\" >";
if (intval($arCountProps["IS_EMAIL"]) <= 0)
$resultHtml .= "<tr class=\"adm-detail-required-field\">
<td class=\"adm-detail-content-cell-l\" width=\"40%\">".GetMessage("NEWO_BUYER_REG_MAIL")."</td>
<td class=\"adm-detail-content-cell-r\"><input type=\"text\" name=\"NEW_BUYER_EMAIL\" size=\"30\" value=\"".htmlspecialcharsbx(trim($_REQUEST["NEW_BUYER_EMAIL"]))."\" tabindex=\"1\" /></td>
</tr>";
if (intval($arCountProps["IS_PAYER"]) <= 0)
$resultHtml .= "<tr class=\"adm-detail-required-field\">
<td class=\"adm-detail-content-cell-l\">".GetMessage("NEWO_BUYER_REG_LASTNAME")."</td>
<td class=\"adm-detail-content-cell-r\"><input type=\"text\" name=\"NEW_BUYER_LAST_NAME\" size=\"30\" value=\"".htmlspecialcharsbx(trim($_REQUEST["NEW_BUYER_LAST_NAME"]))."\" tabindex=\"3\" /></td>
</tr>
<tr class=\"adm-detail-required-field\">
<td class=\"adm-detail-content-cell-l\">".GetMessage("NEWO_BUYER_REG_NAME")."</td>
<td class=\"adm-detail-content-cell-r\"><input type=\"text\" name=\"NEW_BUYER_NAME\" size=\"30\" value=\"".htmlspecialcharsbx(trim($_REQUEST["NEW_BUYER_NAME"]))."\" tabindex=\"2\" /></td>
</tr>";
$resultHtml .= "</table>
</td>";
}
$resultHtml .= "</tr>";
}
//.........这里部分代码省略.........
示例13: RemindPayment
function RemindPayment()
{
$reminder = COption::GetOptionString("sale", "pay_reminder", "");
$arReminder = unserialize($reminder);
if (!empty($arReminder)) {
$arSites = array();
$minDay = mktime();
foreach ($arReminder as $key => $val) {
if ($val["use"] == "Y") {
$arSites[] = $key;
$days = array();
for ($i = 0; $i <= floor($val["period"] / $val["frequency"]); $i++) {
$day = AddToTimeStamp(array("DD" => -($val["after"] + $val["period"] - $val["frequency"] * $i)));
if ($day < mktime()) {
if ($minDay > $day) {
$minDay = $day;
}
$day = ConvertTimeStamp($day);
$days[] = $day;
}
}
$arReminder[$key]["days"] = $days;
}
}
if (!empty($arSites)) {
$bTmpUser = False;
if (!isset($GLOBALS["USER"]) || !is_object($GLOBALS["USER"])) {
$bTmpUser = True;
$GLOBALS["USER"] = new CUser();
}
$arFilter = array("LID" => $arSites, "PAYED" => "N", "CANCELED" => "N", "ALLOW_DELIVERY" => "N", ">=DATE_INSERT" => ConvertTimeStamp($minDay));
$dbOrder = CSaleOrder::GetList(array("ID" => "DESC"), $arFilter, false, false, array("ID", "DATE_INSERT", "PAYED", "USER_ID", "LID", "PRICE", "CURRENCY"));
while ($arOrder = $dbOrder->GetNext()) {
$date_insert = ConvertDateTime($arOrder["DATE_INSERT"], CSite::GetDateFormat("SHORT"));
if (in_array($date_insert, $arReminder[$arOrder["LID"]]["days"])) {
$strOrderList = "";
$dbBasketTmp = CSaleBasket::GetList(array("NAME" => "ASC"), array("ORDER_ID" => $arOrder["ID"]), false, false, array("ID", "NAME", "QUANTITY"));
while ($arBasketTmp = $dbBasketTmp->Fetch()) {
$strOrderList .= $arBasketTmp["NAME"] . " (" . $arBasketTmp["QUANTITY"] . ")";
$strOrderList .= "\n";
}
$payerEMail = "";
$dbOrderProp = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $arOrder["ID"], "PROP_IS_EMAIL" => "Y"));
if ($arOrderProp = $dbOrderProp->Fetch()) {
$payerEMail = $arOrderProp["VALUE"];
}
$payerName = "";
$dbUser = CUser::GetByID($arOrder["USER_ID"]);
if ($arUser = $dbUser->Fetch()) {
if (strlen($payerName) <= 0) {
$payerName = $arUser["NAME"] . (strlen($arUser["NAME"]) <= 0 || strlen($arUser["LAST_NAME"]) <= 0 ? "" : " ") . $arUser["LAST_NAME"];
}
if (strlen($payerEMail) <= 0) {
$payerEMail = $arUser["EMAIL"];
}
}
$arFields = array("ORDER_ID" => $arOrder["ID"], "ORDER_DATE" => $date_insert, "ORDER_USER" => $payerName, "PRICE" => SaleFormatCurrency($arOrder["PRICE"], $arOrder["CURRENCY"]), "BCC" => COption::GetOptionString("sale", "order_email", "order@" . $_SERVER["SERVER_NAME"]), "EMAIL" => $payerEMail, "ORDER_LIST" => $strOrderList, "SALE_EMAIL" => COption::GetOptionString("sale", "order_email", "order@" . $SERVER_NAME));
$eventName = "SALE_ORDER_REMIND_PAYMENT";
$bSend = true;
foreach (GetModuleEvents("sale", "OnOrderRemindSendEmail", true) as $arEvent) {
if (ExecuteModuleEventEx($arEvent, array($arOrder["ID"], &$eventName, &$arFields)) === false) {
$bSend = false;
}
}
if ($bSend) {
$event = new CEvent();
$event->Send($eventName, $arOrder["LID"], $arFields, "N");
}
}
}
if ($bTmpUser) {
unset($GLOBALS["USER"]);
}
}
}
return "CSaleOrder::RemindPayment();";
}
示例14: Withdraw
function Withdraw($sum, $currency, $arUserCard, $orderID = 0)
{
$sum = str_replace(",", ".", $sum);
$sum = roundEx(DoubleVal($sum), SALE_VALUE_PRECISION);
if ($sum <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGUC_EMPTY_SUM"), "EMPTY_SUM");
return false;
}
$currency = Trim($currency);
if (strlen($currency) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGUC_EMPTY_CURRENCY"), "EMPTY_SUM_CURRENCY");
return false;
}
if (!is_array($arUserCard) || count($arUserCard) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGUC_NO_PARAMS"), "EMPTY_CARD_ARRAY");
return false;
}
$orderID = IntVal($orderID);
if (DoubleVal($arUserCard["SUM_MAX"]) > 0) {
$maxSum = roundEx(CCurrencyRates::ConvertCurrency($arUserCard["SUM_MAX"], $arUserCard["SUM_CURRENCY"], $currency), SALE_VALUE_PRECISION);
if ($maxSum < $sum) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#SUM1#", SaleFormatCurrency($arUserCard["SUM_MAX"], $arUserCard["SUM_CURRENCY"]), str_replace("#SUM2#", SaleFormatCurrency($sum, $currency), GetMessage("SKGUC_CROSS_BOUND"))), "MAX_SUM_LIMIT");
return false;
}
}
$arPSAction = CSalePaySystemAction::GetByID($arUserCard["PAY_SYSTEM_ACTION_ID"]);
if (!$arPSAction) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arUserCard["PAY_SYSTEM_ACTION_ID"], GetMessage("SKGUC_NO_ACTION")), "NO_PAY_SYSTEM_ACTION");
return false;
}
$psActionPath = $_SERVER["DOCUMENT_ROOT"] . $arPSAction["ACTION_FILE"];
if (!file_exists($psActionPath)) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#FILE#", $arPSAction["ACTION_FILE"], GetMessage("SKGUC_NO_PATH")), "NO_PS_PATH");
return false;
}
if (is_file($psActionPath)) {
$psActionPath = dirname($psActionPath);
}
if (!file_exists($psActionPath . "/action.php")) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#FILE#", $psActionPath . "/action.php", GetMessage("SKGUC_NO_SCRIPT")), "NO_PS_SCRIPT");
return false;
}
$INPUT_CARD_TYPE = $arUserCard["CARD_TYPE"];
$INPUT_CARD_NUM = CSaleUserCards::CryptData($arUserCard["CARD_NUM"], "D");
$INPUT_CARD_EXP_MONTH = $arUserCard["CARD_EXP_MONTH"];
$INPUT_CARD_EXP_YEAR = $arUserCard["CARD_EXP_YEAR"];
$INPUT_CARD_CODE = $arUserCard["CARD_CODE"];
$INPUT_SUM = $sum;
if (DoubleVal($arUserCard["SUM_MIN"]) > 0) {
$minSum = roundEx(CCurrencyRates::ConvertCurrency($arUserCard["SUM_MIN"], $arUserCard["SUM_CURRENCY"], $currency), SALE_VALUE_PRECISION);
if ($minSum > $sum) {
$INPUT_SUM = $minSum;
}
}
$INPUT_CURRENCY = $currency;
$GLOBALS["SALE_INPUT_PARAMS"] = array();
$dbUser = CUser::GetByID(IntVal($arUserCard["USER_ID"]));
if ($arUser = $dbUser->Fetch()) {
$GLOBALS["SALE_INPUT_PARAMS"]["USER"] = $arUser;
}
if ($orderID > 0) {
if ($arOrder = CSaleOrder::GetByID($orderID)) {
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"] = $arOrder;
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["SHOULD_PAY"] = DoubleVal($arOrder["PRICE"]) - DoubleVal($arOrder["SUM_PAID"]);
$arDateInsert = explode(" ", $arOrder["DATE_INSERT"]);
if (is_array($arDateInsert) && count($arDateInsert) > 0) {
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["DATE_INSERT_DATE"] = $arDateInsert[0];
} else {
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["DATE_INSERT_DATE"] = $arOrder["DATE_INSERT"];
}
}
$arCurOrderProps = array();
$dbOrderPropVals = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $ORDER_ID), false, false, array("ID", "CODE", "VALUE", "ORDER_PROPS_ID", "PROP_TYPE"));
while ($arOrderPropVals = $dbOrderPropVals->Fetch()) {
$arCurOrderPropsTmp = CSaleOrderProps::GetRealValue($arOrderPropVals["ORDER_PROPS_ID"], $arOrderPropVals["CODE"], $arOrderPropVals["PROP_TYPE"], $arOrderPropVals["VALUE"], LANGUAGE_ID);
foreach ($arCurOrderPropsTmp as $key => $value) {
$arCurOrderProps[$key] = $value;
}
}
if (count($arCurOrderProps) > 0) {
$GLOBALS["SALE_INPUT_PARAMS"]["PROPERTY"] = $arCurOrderProps;
}
}
$GLOBALS["SALE_CORRESPONDENCE"] = CSalePaySystemAction::UnSerializeParams($arPSAction["PARAMS"]);
include $psActionPath . "/action.php";
$INPUT_CARD_NUM = "";
if (strlen($OUTPUT_ERROR_MESSAGE) > 0) {
$GLOBALS["APPLICATION"]->ThrowException($OUTPUT_ERROR_MESSAGE, "ERROR_MESSAGE");
return false;
}
$arFields = array("LAST_STATUS" => $OUTPUT_STATUS, "LAST_STATUS_CODE" => $OUTPUT_STATUS_CODE, "LAST_STATUS_DESCRIPTION" => $OUTPUT_STATUS_DESCRIPTION, "LAST_STATUS_MESSAGE" => $OUTPUT_STATUS_MESSAGE, "LAST_SUM" => $OUTPUT_SUM, "LAST_CURRENCY" => $OUTPUT_CURRENCY, "LAST_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))));
CSaleUserCards::Update($arUserCard["ID"], $arFields);
if ($OUTPUT_STATUS == "Y") {
$OUTPUT_SUM = str_replace(",", ".", $OUTPUT_SUM);
$OUTPUT_SUM = DoubleVal($OUTPUT_SUM);
if ($OUTPUT_CURRENCY != $currency) {
$OUTPUT_SUM = roundEx(CCurrencyRates::ConvertCurrency($OUTPUT_SUM, $OUTPUT_CURRENCY, $currency), SALE_VALUE_PRECISION);
}
return $OUTPUT_SUM;
}
//.........这里部分代码省略.........
示例15: GetParam
function GetParam($iOrderID, $iPersonType, $sPPField)
{
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/epages.pickpoint/constants.php";
$arTableOptions = unserialize(COption::GetOptionString("epages.pickpoint", "OPTIONS"));
if (!isset($arTableOptions[$iPersonType][$sPPField])) {
$arData = array($arOptionDefaults[$sPPField]);
} else {
$arData = $arTableOptions[$iPersonType][$sPPField];
}
$arReturn = array();
foreach ($arData as $arOption) {
switch ($arOption["TYPE"]) {
case "ANOTHER":
$arReturn[] = $arOption["VALUE"];
break;
case "USER":
$obOrder = CSaleOrder::GetList(array(), array("ID" => $iOrderID), false, false, array("ID", "USER_ID"));
$arOrder = $obOrder->Fetch();
$obUser = CUser::GetByID($arOrder["USER_ID"]);
if ($arUser = $obUser->Fetch()) {
if ($arOption["VALUE"] == "USER_FIO") {
$arReturn[] = $arUser["LAST_NAME"] . ($arUser["NAME"] ? " " . $arUser["NAME"] : "") . ($arUser["SECOND_NAME"] ? " " . $arUser["SECOND_NAME"] : "");
} elseif (strlen($arUser[$arOption["VALUE"]])) {
$arReturn[] = $arUser[$arOption["VALUE"]];
}
}
break;
case "ORDER":
$arOrder = CSaleOrder::GetByID($iOrderID);
$arReturn[] = $arOrder[$arOption["VALUE"]];
break;
case "PROPERTY":
$obProperty = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $iOrderID, "ORDER_PROPS_ID" => $arOption["VALUE"]), false, false, array("VALUE"));
if ($arProperty = $obProperty->Fetch()) {
if (strlen($arProperty["VALUE"]) > 0) {
$arReturn[] = $arProperty["VALUE"];
}
}
break;
}
}
return $arReturn;
}