コード例 #1
0
ファイル: storeassist.php プロジェクト: Satariall/izurit
 public static function AgentCountDayOrders()
 {
     global $DB;
     if (Bitrix\Main\Loader::includeModule("sale")) {
         //count orders
         $arFilter = array("STATUS_ID" => array("F", "P"), "PAYED" => "Y");
         $dateFromTs = MakeTimeStamp(date("d", time() - 3600 * 24 * 2) . "." . date("m", time() - 3600 * 24 * 2) . "." . date("Y", time() - 3600 * 24 * 2) . " 23:59:59", "DD.MM.YYYY HH:MI:SS");
         $dateToTs = MakeTimeStamp(date("d") . "." . date("m") . "." . date("Y") . " 00:00:00", "DD.MM.YYYY HH:MI:SS");
         $arFilter[">DATE_STATUS"] = date($DB->DateFormatToPHP(CSite::GetDateFormat("FULL", SITE_ID)), $dateFromTs);
         $arFilter["<DATE_STATUS"] = date($DB->DateFormatToPHP(CSite::GetDateFormat("FULL", SITE_ID)), $dateToTs);
         $dbOrders = CSaleOrder::GetList(array(), $arFilter);
         $numOrders = $dbOrders->SelectedRowsCount();
         $newNumOrders = array("newDay" => $numOrders);
         $curNumOrders = Bitrix\Main\Config\Option::get("storeassist", "num_orders", "");
         if ($curNumOrders) {
             $curNumOrders = unserialize($curNumOrders);
         }
         $newNumOrders["prevDay"] = isset($curNumOrders["newDay"]) ? $curNumOrders["newDay"] : 0;
         Bitrix\Main\Config\Option::set("storeassist", "num_orders", serialize($newNumOrders), "");
         //count progress
         $progress = Bitrix\Main\Config\Option::get("storeassist", "progress_percent", 0);
         $newProgress = 0;
         if ($newNumOrders["newDay"] >= $newNumOrders["prevDay"] && $newNumOrders["newDay"] > 0) {
             $newProgress = ++$progress > 10 ? 10 : $progress;
         } else {
             $newProgress = --$progress > 0 ? $progress : 0;
         }
         Bitrix\Main\Config\Option::set("storeassist", "progress_percent", $newProgress, "");
     }
     return "CStoreAssist::AgentCountDayOrders();";
 }
コード例 #2
0
ファイル: component.php プロジェクト: mrdeadmouse/u136006
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
if (!CModule::IncludeModule('voximplant')) {
    return;
}
if ($_SERVER["REQUEST_METHOD"] == "POST" && check_bitrix_sessid()) {
    if (isset($_POST["BLACKLIST_SETTINGS_BUTTON"])) {
        Bitrix\Main\Config\Option::set("voximplant", "blacklist_auto", isset($_POST["BLACKLIST_AUTO"]) ? "Y" : "N");
        $arBlacklistTime = isset($_POST["BLACKLIST_TIME"]) && intval($_POST["BLACKLIST_TIME"]) && $_POST["BLACKLIST_TIME"] > 0 ? intval($_POST["BLACKLIST_TIME"]) : 5;
        Bitrix\Main\Config\Option::set("voximplant", "blacklist_time", $arBlacklistTime);
        $arBlacklistCount = isset($_POST["BLACKLIST_COUNT"]) && intval($_POST["BLACKLIST_COUNT"]) && $_POST["BLACKLIST_COUNT"] > 0 ? intval($_POST["BLACKLIST_COUNT"]) : 5;
        Bitrix\Main\Config\Option::set("voximplant", "blacklist_count", $arBlacklistCount);
        Bitrix\Main\Config\Option::set("voximplant", "blacklist_user_id", $USER->GetID());
        LocalRedirect(POST_FORM_ACTION_URI);
    }
    if (isset($_POST["BLACKLIST_ADD_BUTTON"])) {
        $newNumber = substr($_POST["BLACKLIST_NEW_NUMBER"], 0, 20);
        $newNumber = CVoxImplantPhone::Normalize($newNumber);
        if ($newNumber) {
            $dbBlacklist = Bitrix\Voximplant\BlacklistTable::getList(array("filter" => array("PHONE_NUMBER" => $newNumber)));
            if (!$dbBlacklist->Fetch()) {
                Bitrix\Voximplant\BlacklistTable::add(array("PHONE_NUMBER" => $newNumber));
            }
            LocalRedirect(POST_FORM_ACTION_URI);
        } else {
            $arResult["ERROR"] = GetMessage("VI_BLACKLIST_NUMBER_ERROR");
        }
    }
コード例 #3
0
<?php

Bitrix\Main\Config\Option::set("catalog", "product_form_simple_search", "N");
$arFilter['PARAM2'] = $this->getIblockId();
if (!empty($arFilter['SECTION_ID'])) {
    $arFilter['PARAMS'] = array('iblock_section' => $arFilter['SECTION_ID']);
}
$obSearch = new \CSearch();
$obSearch->Search($arFilter);
$cnt = 0;
$activeSectionId = $this->getSectionId();
while ($ar = $obSearch->Fetch()) {
    if (strpos($ar['ITEM_ID'], 'S') === 0) {
        $sectionId = preg_replace('#[^0-9]+#', '', $ar['ITEM_ID']);
        if ($sectionId != $activeSectionId) {
            $arSearchedSectionIds[] = $sectionId;
        }
    } else {
        $arSearchedIds[] = $ar['ITEM_ID'];
    }
    if (++$cnt >= 100) {
        break;
    }
}
コード例 #4
0
ファイル: converter.php プロジェクト: Satariall/izurit
         unset($reportSettings);
     }
     if (empty($error)) {
         $message = Loc::getMessage('SALE_CONVERTER_AJAX_STEP_UPDATE_BASKET');
         $type = 'PROCESS';
         // SITE_START
         COption::SetOptionString("main", "site_stopped", "N");
         $result['NEXT_STEP'] = ++$ajax_step;
     } else {
         $message = Loc::getMessage('SALE_CONVERTER_AJAX_STEP_UPDATE_REPORT');
         $result['ERROR'] = true;
         $type = 'ERROR';
         $message .= "<br>" . $error;
     }
     $result['DATA'] = $message;
     Bitrix\Main\Config\Option::set("main", "~sale_converted_15", 'Y');
     CAdminNotify::DeleteByTag('SALE_ORDER_MASTER_CONVERT');
     break;
 case 22:
     if ($DB->TableExists('b_sale_basket')) {
         if ($DB->type == 'MYSQL') {
             if (!$DB->Query('ALTER TABLE b_sale_basket CHANGE PRICE PRICE DECIMAL(18,4) not null', true)) {
                 $error .= $DB->GetErrorMessage();
             }
             if (!$DB->Query('ALTER TABLE b_sale_basket CHANGE DISCOUNT_PRICE DISCOUNT_PRICE DECIMAL(18,4) not null', true)) {
                 $error .= $DB->GetErrorMessage();
             }
             if (!$DB->Query('ALTER TABLE b_sale_basket CHANGE QUANTITY QUANTITY DECIMAL(18,4) not null', true)) {
                 $error .= $DB->GetErrorMessage();
             }
             if (!$DB->Query("SELECT BASE_PRICE FROM b_sale_basket WHERE 1=0", true)) {