1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
iblock_catalog_change_price.php
См. документацию.
1<?php
5
6require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_before.php");
7
10{
11 die("Provided security token is invalid!");
12}
13
14if (!Loader::includeModule('catalog'))
15{
16 die('catalog module is not included!');
17}
18
19Loc::loadMessages(__FILE__);
20
21$currenciesList = Currency\CurrencyManager::getCurrencyList();
24foreach (CCatalogGroup::GetListArray() as $row)
25{
26 $row['ID'] = (int)$row['ID'];
27 $row['NAME_LANG'] = (string)$row['NAME_LANG'];
28 $priceTypeList[$row['ID']] = htmlspecialcharsbx('['.$row['NAME'].']'.($row['NAME_LANG'] != '' ? ' ' : '').$row['NAME_LANG']);
29 if ($row['BASE'] == 'Y')
30 $basePriceType = $row['ID'];
31}
32unset($row);
33
34require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_after.php");
35
36$sourcePriceType = (isset($_SESSION['CHANGE_PRICE_PARAMS']['INITIAL_PRICE_TYPE'])
37 ? (int)$_SESSION['CHANGE_PRICE_PARAMS']['INITIAL_PRICE_TYPE']
38 : 0
39);
42
43$destinationPriceType = (isset($_SESSION['CHANGE_PRICE_PARAMS']['PRICE_TYPE'])
44 ? (int)$_SESSION['CHANGE_PRICE_PARAMS']['PRICE_TYPE']
45 : 0
46);
49
50
51?>
52<style>
53 .inactive-element
54 {
55 opacity: 0.4;
56 }
57</style>
58<form method="post" id="form_SetValue">
60
61 <table style="width:100%;padding-bottom: 15px;">
62 <tr>
63 <td style="width:25.5%; padding-left:10px">
64 <input id="initialPriceTypeCheckbox" type="checkbox">
65 <label class="inactive-element" id="initialPriceTypeLabel" for="initialPriceTypeSelect">
66 <?=Loc::getMessage("IBLIST_CHPRICE_TABLE_INITIAL_PRICE_TYPE")?>
67 </label>
68 </td>
69 <td>
70 <span class="adm-select-wrap">
71 <select id="initialPriceTypeSelect" class="adm-select inactive-element" style="width: 169px;" disabled>
72 <option value="0"<?=($sourcePriceType == 0 ? ' selected' : ''); ?>><?php
73 echo Loc::getMessage('IBLIST_CHPRICE_PRICE_TYPE_EMPTY'); ?></option>
74 <?php
75 foreach ($priceTypeList as $id => $title)
76 {
77 ?><option value="<?=$id; ?>"<?=($sourcePriceType == $id ? ' selected' : ''); ?>><?php
78 echo $title; ?></option><?php
79 }
80 unset($id, $title);
81 ?>
82 </select>
83 </span>
84 </td>
85 </tr>
86 </table>
87
88 <table class="internal" id="generator_price_table" style="width:auto;margin-bottom:10px;">
89 <tbody>
90 <tr class="heading">
91 <td>
92 <label for="tablePriceTypeIdSelect">
93 <?=Loc::getMessage("IBLIST_CHPRICE_HEAD_TABLE_TYPE")?>:
94 </label>
95 </td>
96 <td>
97 <label for="tableActionChangingSelect">
98 <?=Loc::getMessage("IBLIST_CHPRICE_HEAD_TABLE_ACTION")?>:
99 </label>
100 </td>
101 <td>
102 <label>
103 <?=Loc::getMessage("IBLIST_CHPRICE_HEAD_TABLE_VALUE")?>:
104 </label>
105 </td>
106 <td>
107 <label for="tableUnitsSelect">
108 <?=Loc::getMessage("IBLIST_CHPRICE_HEAD_TABLE_UNITS")?><span style="color:red">*</span>:
109 </label>
110 </td>
111 </tr>
112 </tbody>
113 <tbody>
114 <tr id="IB_SEG_0">
115 <td width="25%">
116 <span class="adm-select-wrap">
117 <select id="tablePriceTypeIdSelect" class="adm-select" style="width: 169px;">
118 <option value="0"<?=($destinationPriceType == 0 ? ' selected' : ''); ?>><?php
119 echo Loc::getMessage('IBLIST_CHPRICE_PRICE_TYPE_EMPTY'); ?></option>
120 <?php
121 foreach ($priceTypeList as $id => $title)
122 {
123 ?><option value="<?=$id; ?>"<?= ($destinationPriceType == $id ? ' selected' : '') ?>><?php
124 echo $title; ?></option><?php
125 }
126 unset($id, $title);
127 ?>
128 </select>
129 </span>
130 </td>
131 <td width="25%">
132 <span class="adm-select-wrap">
133 <select id="tableActionChangingSelect" class="adm-select" style="width: 169px; max-width: 300px;" name="tableActionChangingSelect">
134 <option id="radio_changing_add" value="add"><?=Loc::getMessage("IBLIST_CHPRICE_TABLE_ACTION_TYPE_ADD")?></option>
135 <option id="radio_changing_sub" value="subtract"><?=Loc::getMessage("IBLIST_CHPRICE_TABLE_ACTION_TYPE_SUB")?></option>
136 </select>
137 </span>
138 </td>
139 <td width="25%">
140 <input type="text" name="tableValueChangingPriceInput" id="tableValueChangingPriceInput" class="adm-input" placeholder="0.00">
141 </td>
142 <td width="25%">
143 <span class="adm-select-wrap">
144 <select id="tableUnitsSelect" class="adm-select" style="width: 169px;">
145 <option selected value="percent">%</option>
146 <option value="multiple"><?=Loc::getMessage("IBLIST_CHPRICE_TABLE_UNIT_MULTYPLE")?></option>
147 <?php
148 foreach ($currenciesList as $currencyCode => $currencyElement)
149 {
150 ?>
151 <option
152 <?php
153 if ( isset($_SESSION['CHANGE_PRICE_PARAMS']['UNITS'])
154 && ($_SESSION['CHANGE_PRICE_PARAMS']['UNITS'] === $currencyCode) )
155 {
156 echo('selected');
157 }
158 ?> value=<?=htmlspecialcharsbx($currencyCode); ?>>
159 <?=htmlspecialcharsbx($currencyElement)?>
160 </option>
161 <?php
162 }
163 ?>
164 </select>
165 </span>
166 </td>
167 </tr>
168 </tbody>
169 </table>
170 <table width="100%" id="chp_radioTable">
171 <tr>
172 <td width="45%">
173 <p style="font-weight: bold;color: #3f4b54;padding-left: 25px;">
174 <?=Loc::getMessage('IBLIST_CHPRICE_TABLE_ACTION_RESULT_LABEL')?>:
175 </p>
176 <p>
177 <input type="radio"
178 <?php
179 if (isset($_SESSION['CHANGE_PRICE_PARAMS']['FORMAT_RESULTS'])
180 && $_SESSION['CHANGE_PRICE_PARAMS']['FORMAT_RESULTS'] === "floor")
181 {
182 echo('checked');
183 }
184 ?>
185 id="floorRadio" name="formatResultRadio" value="floor"/>
186 <label for="floorRadio">
187 <?=Loc::getMessage('IBLIST_CHPRICE_TABLE_ACTION_RESULT_FLOOR')?>
188 </label>
189 </p>
190 <p>
191 <input type="radio"
192 <?php
193 if ( empty($_SESSION['CHANGE_PRICE_PARAMS']['FORMAT_RESULTS'])
194 || ($_SESSION['CHANGE_PRICE_PARAMS']['FORMAT_RESULTS'] === "ceil") )
195 {
196 echo('checked');
197 }
198 ?>
199 id="ceilRadio" name="formatResultRadio" value="ceil"/>
200 <label for="ceilRadio">
201 <?=Loc::getMessage('IBLIST_CHPRICE_TABLE_ACTION_RESULT_CEIL')?>
202 </label>
203 </p>
204 <p>
205 <input type="radio"
206 <?php
207 if (isset($_SESSION['CHANGE_PRICE_PARAMS']['FORMAT_RESULTS'])
208 && $_SESSION['CHANGE_PRICE_PARAMS']['FORMAT_RESULTS'] === "round")
209 {
210 echo('checked');
211 }
212 ?>
213 id="roundRadio" name="formatResultRadio" value="round"/>
214 <label for="roundRadio">
215 <?=Loc::getMessage('IBLIST_CHPRICE_TABLE_ACTION_ROUND_RESULT_ROUND')?>
216 </label>
217 </p>
218 </td>
219 <td>
220 <table>
221 <tr>
222 <td style="width:50%; padding-left:10px">
223 <input id="resultMaskCheckbox" type="checkbox">
224 <label class="inactive-element" id="resultMaskLabel" for="resultMaskSelect"><?=Loc::getMessage("IBLIST_CHPRICE_TABLE_RESULT_MASK_LABEL")?></label>
225 </td>
226 <td style="padding-left: 20px">
227 <span class="adm-select-wrap">
228 <select id="resultMaskSelect" class="adm-select inactive-element" style="width: 70px;" disabled>
229 <option value="100">0.01</option>
230 <option value="20">0.05</option>
231 <option value="10">0.1</option>
232 <option value="2">0.5</option>
233 <option value="1" selected>1</option>
234 <option value="0.2">5</option>
235 <option value="0.1">10</option>
236 <option value="0.02">50</option>
237 <option value="0.01">100</option>
238 <option value="0.002">500</option>
239 <option value="0.001">1000</option>
240 </select>
241 </span>
242 </td>
243 </tr>
244 <tr>
245 <td style="width:50%; padding-left:10px">
246 <input id="differenceValueCheckbox" type="checkbox">
247 <label class="inactive-element" id="differenceValueLabel" for="differenceValueCheckbox"><?=Loc::getMessage("IBLIST_CHPRICE_TABLE_MINUS_COUNT_LABEL")?></label>
248 </td>
249 <td style="padding-left: 20px">
250 <input type="text" id="differenceValueInput" style="width: 140px;" placeholder="0.00" value="" disabled>
251 </td>
252 </tr>
253 </table>
254 <table style="width:100%;margin-top:15px;">
255 <tr class="heading">
256 <td style="width:100%">
257 <?=Loc::getMessage("IBLIST_CHPRICE_EXAMPLE_LABEL")?>
258 </td>
259 </tr>
260 </table>
261 <table style="width: 100%;">
262 <tr>
263 <?php
264 $sourceInput = "<input type='text' style='width:70px;margin:0 5px' id='exampleSourceValueInput' value='11111.11'>";
265 ?>
266 <td style="text-align: center;">
267 <?=Loc::getMessage("IBLIST_CHPRICE_EXAMPLE_VALUE",array("#VALUE_BEFORE#"=>$sourceInput))?>
268
269 <span id='resultValueSpan' style="color:#01B10E;font-weight: bold;">11111.11<span>
270 </td>
271 </tr>
272 </table>
273 </td>
274 </tr>
275 </table>
276</form>
277<div style="margin-top: 45px;">
278 <div style="position:relative">
279 <span style="color:red;position:absolute;left:-10px;">*</span>
280 <div>
281 <?=Loc::getMessage('IBLIST_CHPRICE_UNITS_NOTE_PERCENT')?>
282 </div>
283 <div>
284 <?=Loc::getMessage('IBLIST_CHPRICE_UNITS_NOTE_CURRENCY')?>
285 </div>
286 </div>
287</div>
288
289<?php
290
292 "tableReloadId" => htmlspecialcharsbx($_POST['sTableID']),
293 "alertMessages" => array(
294 "onePriceType" => Loc::getMessage('IBLIST_CHPRICE_ALERT_ONE_PRICE_TYPE'),
295 "nullValue" => Loc::getMessage('IBLIST_CHPRICE_ALERT_NOT_NULL'),
296 "equalPriceTypes" => Loc::getMessage('IBLIST_CHPRICE_ERR_EQUAL_PRICE_TYPES'),
297 "basePriceChange" => Loc::getMessage('IBLIST_CHPRICE_ERR_BASE_PRICE_SELECTED'),
298 "destinationPriceEmpty" => Loc::getMessage('IBLIST_CHPRICE_ERR_DESTINATION_PRICE_EMPTY'),
299 "sourcePriceEmpty" => Loc::getMessage('IBLIST_CHPRICE_ERR_SOURCE_PRICE_EMPTY')
300 ),
301 "basePriceType" => (string)$basePriceType
302);
303$javascriptParams = CUtil::PhpToJSObject($javascriptParams);
304\Bitrix\Main\Page\Asset::getInstance()->addJs('/bitrix/js/catalog/iblock_change_price.js');
305?>
306<script>
307 var iblockChangeScript = BX.Catalog.Admin.IblockChangePrice();
308 iblockChangeScript.init(<?=$javascriptParams?>);
309</script>
310<?php
311require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_admin.php");
return select
Определения access_edit.php:440
<?=$taskID?> selected
Определения access_edit.php:348
Определения loader.php:13
static GetListArray()
Определения cataloggroup.php:291
bx popup label bx width30 PAGE_NEW_MENU_NAME text width
Определения file_new.php:677
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
Form FILTER_ACTION disabled
Определения options.php:358
$sourcePriceType
Определения iblock_catalog_change_price.php:36
$destinationPriceType
Определения iblock_catalog_change_price.php:43
foreach( $currenciesList as $currencyCode=> $currencyElement) if(isset($_SESSION['CHANGE_PRICE_PARAMS']['FORMAT_RESULTS']) && $_SESSION['CHANGE_PRICE_PARAMS']['FORMAT_RESULTS']==="floor") if(empty( $_SESSION[ 'CHANGE_PRICE_PARAMS'][ 'FORMAT_RESULTS'])||( $_SESSION[ 'CHANGE_PRICE_PARAMS'][ 'FORMAT_RESULTS']==="ceil")) if(isset($_SESSION['CHANGE_PRICE_PARAMS']['FORMAT_RESULTS']) && $_SESSION['CHANGE_PRICE_PARAMS']['FORMAT_RESULTS']==="round") $sourceInput
$currenciesList
Определения iblock_catalog_change_price.php:21
$javascriptParams
$basePriceType
Определения iblock_catalog_change_price.php:22
$_SERVER["DOCUMENT_ROOT"]
Определения cron_frame.php:9
bitrix_sessid_post($varname='sessid', $returnInvocations=false)
Определения tools.php:4700
check_bitrix_sessid($varname='sessid')
Определения tools.php:4686
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
Определения tools.php:2701
die
Определения quickway.php:367
font style
Определения invoice.php:442
$title
Определения pdf.php:123
if(!empty($XML_DATA['PRICE'])) $priceTypeList
Определения yandex_run.php:872