1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
proxyadminresult.php
См. документацию.
1<?php
3{
4 private $parameters = array();
5 private $entityName = '';
6
7 public function __construct($parameters, $entityName, $tableId)
8 {
9 $this->parameters = $parameters;
10 $this->entityName = $entityName;
11 parent::__construct(array(), $tableId);
12 }
13
14 function NavStart($nPageSize = 0, $bShowAll = true, $iNumPage = false)
15 {
16 $nSize = self::GetNavSize($this->table_id, $nPageSize);
17
18 if(!is_array($nPageSize))
19 $nPageSize = array();
20
21 $nPageSize["nPageSize"] = $nSize;
22 if (isset($_REQUEST["mode"]) && $_REQUEST["mode"] === "excel")
23 {
24 $nPageSize["NavShowAll"] = true;
25 }
26
27 $this->nInitialSize = $nPageSize["nPageSize"];
28
29 if(is_array($nPageSize))
30 $this->InitNavStartVars($nPageSize);
31 else
32 $this->InitNavStartVars(intval($nPageSize), $bShowAll, $iNumPage);
33
34 // force to db resource type, although we got empty array on input
35 $en = $this->entityName;
36
37 $runtime = $this->parameters['runtime'] ?? [];
38 if (!is_array($runtime))
39 {
40 $runtime = [];
41 }
42 $filter = $this->parameters['filter'] ?? [];
43 if (!is_array($filter))
44 {
45 $filter = [];
46 }
47
48 // to increase perfomance, have to throw away unused (in filter) runtimes
49 foreach ($runtime as $fld => $desc)
50 {
51 $found = false;
52 foreach($filter as $condition => $value)
53 {
54 if(mb_strpos($condition, $fld) !== false)
55 {
56 $found = true;
57 break;
58 }
59 }
60
61 if (!$found)
62 {
63 unset($runtime[$fld]);
64 }
65 }
66
67 $count = $en::getList(array(
68 'filter' => $filter,
69 'select' => array('REC_CNT'),
70 'runtime' => array_merge($runtime, array(
71 'REC_CNT' => array(
72 'data_type' => 'integer',
73 'expression' => array(
74 'count(*)'
75 )
76 )
77 ))
78 ))->fetch();
79 $this->NavRecordCount = $count['REC_CNT'];
80
81 // the following code was taken from DBNavStart()
82
83 // here we could use Bitrix\Main\DB\Paginator
84
85 //calculate total pages depend on rows count. start with 1
86 $this->NavPageCount = floor($this->NavRecordCount/$this->NavPageSize);
87 if($this->NavRecordCount % $this->NavPageSize > 0)
88 $this->NavPageCount++;
89
90 //page number to display. start with 1
91 $this->calculatePageNumber();
92
93 $parameters = $this->parameters;
94 $parameters['limit'] = $this->NavPageSize;
95 $parameters['offset'] = ($this->NavPageNomer - 1) * $this->NavPageSize;
96
97 $res = $en::getList($parameters);
98 $this->arResult = array();
99 while($item = $res->Fetch())
100 $this->arResult[] = $item;
101 }
102}
104{
105 private $parameters = array();
106 private $entityName = '';
107
108 public function __construct($parameters, $entityName, $tableId)
109 {
110 $this->parameters = $parameters;
111 $this->entityName = $entityName;
112 parent::__construct(array(), $tableId);
113 }
114
115 function NavStart($nPageSize = 0, $bShowAll = true, $iNumPage = false)
116 {
117 $nSize = self::GetNavSize($this->table_id, $nPageSize);
118
119 if(!is_array($nPageSize))
120 $nPageSize = array();
121
122 $nPageSize["nPageSize"] = $nSize;
123 if (isset($_REQUEST["mode"]) && $_REQUEST["mode"] === "excel")
124 {
125 $nPageSize["NavShowAll"] = true;
126 }
127
128 $this->nInitialSize = $nPageSize["nPageSize"];
129
130 if(is_array($nPageSize))
131 $this->InitNavStartVars($nPageSize);
132 else
133 $this->InitNavStartVars(intval($nPageSize), $bShowAll, $iNumPage);
134
135 // force to db resource type, although we got empty array on input
136 $en = $this->entityName;
137
138 $runtime = $this->parameters['runtime'] ?? [];
139 if (!is_array($runtime))
140 {
141 $runtime = [];
142 }
143 $filter = $this->parameters['filter'] ?? [];
144 if (!is_array($filter))
145 {
146 $filter = [];
147 }
148
149 // to increase perfomance, have to throw away unused (in filter) runtimes
150 foreach($runtime as $fld => $desc)
151 {
152 $found = false;
153 foreach($filter as $condition => $value)
154 {
155 if(mb_strpos($condition, $fld) !== false)
156 {
157 $found = true;
158 break;
159 }
160 }
161
162 if(!$found)
163 unset($runtime[$fld]);
164 }
165
166 $count = $en::getList(array(
167 'filter' => $filter,
168 'select' => array('REC_CNT'),
169 'runtime' => array_merge($runtime, array(
170 'REC_CNT' => array(
171 'data_type' => 'integer',
172 'expression' => array(
173 'count(*)'
174 )
175 )
176 ))
177 ))->fetch();
178 $this->NavRecordCount = $count['REC_CNT'];
179
180 // the following code was taken from DBNavStart()
181
182 // here we could use Bitrix\Main\DB\Paginator
183
184 //calculate total pages depend on rows count. start with 1
185 $this->NavPageCount = floor($this->NavRecordCount/$this->NavPageSize);
186 if($this->NavRecordCount % $this->NavPageSize > 0)
187 $this->NavPageCount++;
188
189 //page number to display. start with 1
190 $this->calculatePageNumber();
191
192 $parameters = $this->parameters;
193 $parameters['limit'] = $this->NavPageSize;
194 $parameters['offset'] = ($this->NavPageNomer - 1) * $this->NavPageSize;
195
196 $res = $en::getList($parameters);
197 $this->arResult = array();
198 while($item = $res->Fetch())
199 $this->arResult[] = $item;
200 }
201}
$count
Определения admin_tab.php:4
Определения admin_lib.php:2054
static GetNavSize($table_id=false, $nPageSize=20)
Определения admin_lib.php:2097
static GetNavSize($table_id=false, $nPageSize=20, $listUrl='')
Определения admin_ui_list.php:1946
$bShowAll
Определения dbresult.php:21
InitNavStartVars($nPageSize=0, $bShowAll=true, $iNumPage=false)
Определения dbresult.php:822
calculatePageNumber(int $defaultNumber=1, bool $useSession=true, bool $checkOutOfRange=false)
Определения dbresult.php:911
$NavPageSize
Определения dbresult.php:22
__construct($parameters, $entityName, $tableId)
Определения proxyadminresult.php:7
NavStart($nPageSize=0, $bShowAll=true, $iNumPage=false)
Определения proxyadminresult.php:14
__construct($parameters, $entityName, $tableId)
Определения proxyadminresult.php:108
NavStart($nPageSize=0, $bShowAll=true, $iNumPage=false)
Определения proxyadminresult.php:115
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$res
Определения filter_act.php:7
$_REQUEST["admin_mnu_menu_id"]
Определения get_menu.php:8
$filter
Определения iblock_catalog_list.php:54
if(mb_strlen($order)< 6) $desc
Определения payment.php:44