$control->BeginCustomField($prefix . 'PERIOD', Loc::getMessage('BX_SALE_DISCOUNT_COUPON_FIELD_PERIOD'), false); ?> <tr id="tr_COUPON_PERIOD"> <td width="40%"><?php echo $control->GetCustomLabelHTML(); ?> </td> <td width="60%"><?php $periodValue = ''; $activeFrom = $coupon['ACTIVE_FROM'] instanceof Main\Type\DateTime ? $coupon['ACTIVE_FROM']->toString() : ''; $activeTo = $coupon['ACTIVE_TO'] instanceof Main\Type\DateTime ? $coupon['ACTIVE_TO']->toString() : ''; if ($activeFrom != '' || $activeTo != '') { $periodValue = CAdminCalendar::PERIOD_INTERVAL; } $calendar = new CAdminCalendar(); echo $calendar->CalendarPeriodCustom($prefix . 'ACTIVE_FROM', $prefix . 'ACTIVE_TO', $activeFrom, $activeTo, true, 19, true, array(CAdminCalendar::PERIOD_EMPTY => Loc::getMessage('BX_SALE_DISCOUNT_COUPON_PERIOD_EMPTY'), CAdminCalendar::PERIOD_INTERVAL => Loc::getMessage('BX_SALE_DISCOUNT_COUPON_PERIOD_INTERVAL')), $periodValue); unset($activeTo, $activeFrom, $periodValue); ?> </td> </tr><?php $control->EndCustomField($prefix . 'PERIOD'); $control->BeginCustomField($prefix . 'USER_ID', Loc::getMessage('BX_SALE_DISCOUNT_COUPON_FIELD_USER_ID'), false); ?> <tr id="tr_USER_ID"> <td width="40%"><?php echo $control->GetCustomLabelHTML(); ?> </td> <td width="60%"><?php echo FindUserID($prefix . 'USER_ID', $coupon['USER_ID'] > 0 ? $coupon['USER_ID'] : '', '', $couponFormID); ?>
$tabControl->AddCheckBoxField("ACTIVE", GetMessage("DSC_ACTIVE") . ":", false, "Y", $arDiscount['ACTIVE'] == "Y"); $tabControl->AddEditField("NAME", GetMessage("DSC_NAME") . ":", true, array("size" => 50, "maxlength" => 255), htmlspecialcharsbx($arDiscount['NAME'])); $tabControl->AddDropDownField("SITE_ID", GetMessage('DSC_SITE') . ':', true, $arSiteList, $arDiscount['SITE_ID']); $tabControl->BeginCustomField("PERIOD", GetMessage('DSC_PERIOD') . ":", false); ?> <tr id="tr_PERIOD"> <td width="40%"><?php echo $tabControl->GetCustomLabelHTML(); ?> </td> <td width="60%"><?php $periodValue = ''; if ('' != $arDiscount['ACTIVE_FROM'] || '' != $arDiscount['ACTIVE_TO']) { $periodValue = CAdminCalendar::PERIOD_INTERVAL; } echo CAdminCalendar::CalendarPeriodCustom('ACTIVE_FROM', 'ACTIVE_TO', $arDiscount['ACTIVE_FROM'], $arDiscount['ACTIVE_TO'], true, 19, true, array(CAdminCalendar::PERIOD_EMPTY => GetMessage('BT_CAT_DISCOUNT_EDIT_CALENDARE_PERIOD_EMPTY'), CAdminCalendar::PERIOD_INTERVAL => GetMessage('BT_CAT_DISCOUNT_EDIT_CALENDARE_PERIOD_INTERVAL')), $periodValue); ?> </td> </tr><?php $tabControl->EndCustomField("PERIOD", '<input type="hidden" name="ACTIVE_FROM" value="' . htmlspecialcharsbx($arDiscount['ACTIVE_FROM']) . '">' . '<input type="hidden" name="ACTIVE_TO" value="' . htmlspecialcharsbx($arDiscount['ACTIVE_FROM']) . '">'); $tabControl->BeginCustomField("VALUE_TYPE", GetMessage('DSC_TYPE') . ":", true); ?> <tr id="tr_VALUE_TYPE" class="adm-detail-required-field"> <td width="40%"><?php echo $tabControl->GetCustomLabelHTML(); ?> </td> <td width="60%"> <select name="VALUE_TYPE" id="ob_value_type"><?php foreach (CCatalogDiscount::GetDiscountTypes(true) as $key => $value) { ?>
$tabControl->AddDropDownField("LID", GetMessage('SDEN_SITE') . ':', true, $arSiteList, $arDiscount['LID']); $tabControl->AddEditField("NAME", GetMessage("BT_SALE_DISCOUNT_EDIT_FIELDS_NAME") . ":", false, array("size" => 50, "maxlength" => 255), htmlspecialcharsbx($arDiscount['NAME'])); $tabControl->BeginCustomField("PERIOD", GetMessage('SDEN_PERIOD') . ":", false); ?> <tr id="tr_PERIOD"> <td width="40%"><?php echo $tabControl->GetCustomLabelHTML(); ?> </td> <td width="60%"><?php global $ACTIVE_FROM_FILTER_PERIOD; $ACTIVE_FROM_FILTER_PERIOD = ""; if ('' != $arDiscount['ACTIVE_FROM'] || '' != $arDiscount['ACTIVE_TO']) { $ACTIVE_FROM_FILTER_PERIOD = CAdminCalendar::PERIOD_INTERVAL; } echo CAdminCalendar::CalendarPeriodCustom("ACTIVE_FROM", "ACTIVE_TO", $arDiscount['ACTIVE_FROM'], $arDiscount['ACTIVE_TO'], true, 19, true, array(CAdminCalendar::PERIOD_EMPTY => GetMessage('BT_SALE_DISCOUNT_EDIT_CALENDARE_PERIOD_EMPTY'), CAdminCalendar::PERIOD_INTERVAL => GetMessage('BT_SALE_DISCOUNT_EDIT_CALENDARE_PERIOD_INTERVAL'))); ?> </td> </tr><?php $tabControl->EndCustomField("PERIOD", '<input type="hidden" name="ACTIVE_FROM" value="' . htmlspecialcharsbx($arDiscount['ACTIVE_FROM']) . '">' . '<input type="hidden" name="ACTIVE_TO" value="' . htmlspecialcharsbx($arDiscount['ACTIVE_FROM']) . '">'); $tabControl->AddEditField("PRIORITY", GetMessage("BT_SALE_DISCOUNT_EDIT_FIELDS_PRIORITY") . ":", false, array("size" => 20, "maxlength" => 20), intval($arDiscount['PRIORITY'])); $tabControl->AddEditField("SORT", GetMessage("BT_SALE_DISCOUNT_EDIT_FIELDS_SORT"), false, array('size' => 10, 'maxlength' => 20), intval($arDiscount['SORT'])); $tabControl->BeginCustomField("LAST_DISCOUNT", GetMessage('BT_SALE_DISCOUNT_EDIT_FIELDS_LAST_DISCOUNT') . ":", false); ?> <tr id="tr_LAST_DISCOUNT"> <td width="40%"><?php echo $tabControl->GetCustomLabelHTML(); ?> </td> <td width="60%"> <input type="hidden" value="N" name="LAST_DISCOUNT">
echo Loc::getMessage('SALE_BASKET_DISCOUNT_FILTER_RANGE_FROM'); ?> <input type="text" name="order_id_from" id="order_id_from" size="5"> <?php echo Loc::getMessage('SALE_BASKET_DISCOUNT_FILTER_RANGE_TO'); ?> <input type="text" name="order_id_to" id="order_id_to" size="5"> </td> </tr> <tr id="tr_filter_date" style="display: none;"> <td width="40%"><?php echo Loc::getMessage('SALE_BASKET_DISCOUNT_FILTER_DATE_RANGE'); ?> </td> <td><?php $calendar = new CAdminCalendar(); echo $calendar->CalendarPeriodCustom('order_date_from', 'order_date_to', '', '', false, 19, true); ?> </td> </tr> <?php $tabControl->Buttons(); ?> <input type="button" id="start_button" value="<?php echo Loc::getMessage('SALE_BASKET_DISCOUNT_UPDATE_BTN'); ?> "<?php echo $ordersCounter > 0 ? '' : ' disabled'; ?> > <input type="button" id="stop_button" value="<?php echo Loc::getMessage('SALE_BASKET_DISCOUNT_STOP_BTN');