Your IP : 216.73.216.170


Current Path : /home/bitrix/ext_www/el.sanatorio.yacl.site/
Upload File :
Current File : /home/bitrix/ext_www/el.sanatorio.yacl.site/tezistest.php

<?
define("NOT_CHECK_PERMISSIONS", true);
if (!$_SERVER["DOCUMENT_ROOT"]) {
    $_SERVER["DOCUMENT_ROOT"] = realpath(__DIR__);
} else {
   die ('Script for console only');
}

require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php");
require_once $_SERVER["DOCUMENT_ROOT"] . '/local/php_interface/include/classes/morev/bootstrap.php';

$tezis = new Tezis();
//$delay = 60;
//$maxInterval = 86400;
//$lastBotWorkedTime = \Bitrix\Main\Config\Option::get('main', 'tezisbot_worked', 0);
//$realDelay = $delay;
//if ($lastBotWorkedTime && time() - $lastBotWorkedTime > $delay) {
//    $realDelay = time() - $lastBotWorkedTime;
//}
//
//$realDelay = time() - strtotime('29.07.2021 11:36:23');
//okp($realDelay);
//okp($tezis->getSessionId());
okp($tezis->test());
// return;
try {
//    if ($realDelay > $maxInterval + 60) {
//        $tezis->getLastAssignments($realDelay, $realDelay - $maxInterval);
//        \Bitrix\Main\Config\Option::set('main', 'tezisbot_worked', time() - $realDelay + $maxInterval);
//    } else {
        $tezis->getLastAssignments($realDelay, 0);
//        \Bitrix\Main\Config\Option::set('main', 'tezisbot_worked', time());
//    }
    okp('Success! Delay: ' . $realDelay);
    okp('Max interval: ' . $maxInterval);
} catch (Exception $e) {
    okp($e->getMessage());
}