コード例 #1
0
 public static function SaveStep()
 {
     if ('' == self::$strSessID) {
         self::$strSessID = 'DC' . time();
     }
     if (!array_key_exists(self::$strSessID, $_SESSION) || !is_array($_SESSION[self::$strSessID])) {
         $_SESSION[self::$strSessID] = array();
     }
     if (0 < self::$intErrors) {
         $_SESSION[self::$strSessID]['ERRORS_COUNT'] = self::$intErrors;
     }
     if (!empty(self::$arErrors)) {
         $_SESSION[self::$strSessID]['ERRORS'] = self::$arErrors;
     }
 }
コード例 #2
0
 public static function SaveStep()
 {
     if (self::$strSessID == '') {
         self::$strSessID = 'DC' . time();
     }
     if (!isset($_SESSION[self::$strSessID]) || !is_array($_SESSION[self::$strSessID])) {
         $_SESSION[self::$strSessID] = array();
     }
     if (self::$intErrors > 0) {
         $_SESSION[self::$strSessID]['ERRORS_COUNT'] = self::$intErrors;
     }
     if (!empty(self::$arErrors)) {
         $_SESSION[self::$strSessID]['ERRORS'] = self::$arErrors;
     }
 }
コード例 #3
0
    if (isset($_REQUEST['max_execution_time']) && 0 < intval($_REQUEST['max_execution_time'])) {
        $max_execution_time = intval($_REQUEST['max_execution_time']);
    }
    COption::SetOptionString("catalog", "max_execution_time", $max_execution_time);
    $converted = isset($_REQUEST['converted']) ? intval($_REQUEST['converted']) : 0;
    $last_id = isset($_REQUEST['last_id']) ? intval($_REQUEST['last_id']) : 0;
    $maxMessage = isset($_REQUEST['maxMessage']) ? intval($_REQUEST['maxMessage']) : 0;
    $maxMessagePerStep = isset($_REQUEST['maxMessagePerStep']) ? intval($_REQUEST['maxMessagePerStep']) : 20;
    if ($converted == 0 && $maxMessage == 0) {
        $maxMessage = CCatalogDiscountConvert::GetCountFormat();
    }
    $strSessID = isset($_REQUEST['DC']) ? $_REQUEST['DC'] : '';
    CCatalogDiscountConvert::$intLastConvertID = $last_id;
    CCatalogDiscountConvert::$intConvertPerStep = 0;
    CCatalogDiscountConvert::$intConverted = $converted;
    CCatalogDiscountConvert::$strSessID = $strSessID;
    CCatalogDiscountConvert::ConvertFormatDiscount($maxMessagePerStep, $max_execution_time);
    if (!CCatalogDiscountConvert::$boolEmptyList) {
        $aboutMinute = ($maxMessage - CCatalogDiscountConvert::$intConverted) / CCatalogDiscountConvert::$intConvertPerStep * $max_execution_time / 60;
        $strAbout = $aboutMinute >= 1 ? str_replace('#MIN#', ceil($aboutMinute), GetMessage('CAT_DISC_CONVERT_TOTAL_MIN')) : str_replace('#SEC#', ceil($aboutMinute * 60), GetMessage('CAT_DISC_CONVERT_TOTAL_SEC'));
        CAdminMessage::ShowMessage(array("MESSAGE" => GetMessage("CAT_DISC_CONVERT_IN_PROGRESS"), "DETAILS" => str_replace(array('#COUNT#', '#PERCENT#', '#TIME#'), array($converted, ceil(CCatalogDiscountConvert::$intConverted / $maxMessage * 100), $strAbout), GetMessage('CAT_DISC_CONVERT_TOTAL')), "HTML" => true, "TYPE" => "OK"));
        ?>
<script type="text/javascript">
			BX.closeWait();
			DoNext(<?php 
        echo CCatalogDiscountConvert::$intConverted;
        ?>
, <?php 
        echo CCatalogDiscountConvert::$intLastConvertID;
        ?>
, <?php