Пример #1
0
    ?>
</td>
			<td width="60%" id="td_COUPON_VALUE">
				<input type="text" id="COUPON" name="COUPON" size="32" maxlength="32" value="<?php 
    echo htmlspecialcharsbx($arCoupon['COUPON']);
    ?>
" />&nbsp;
				<input type="button" value="<?php 
    echo GetMessage("DSC_CPN_GEN");
    ?>
" id="COUPON_GENERATE">
			</td>
		</tr><?php 
    $tabControl->EndCustomField('COUPON', '<input type="hidden" name="COUPON" value="' . htmlspecialcharsbx($arCoupon['COUPON']) . '">');
    $tabControl->AddCalendarField('DATE_APPLY', GetMessage("DDSC_CPN_DATE") . ':', $arCoupon['DATE_APPLY']);
    $tabControl->AddTextField("DESCRIPTION", GetMessage("DSC_CPN_DESCRIPTION") . ':', htmlspecialcharsbx($arCoupon['DESCRIPTION']), array("cols" => 50, 'rows' => 6));
    $tabControl->Buttons(false, '');
    $tabControl->Show();
    $tabControl->ShowWarnings("subcoupons_edit", $obMessages);
    ?>
<script type="text/javascript">
	BX.ready(function(){
		var obCouponValue = BX('COUPON');
		var obCouponBtn = BX('COUPON_GENERATE');
		if (!!obCouponValue && !!obCouponBtn)
		{
			BX.bind(obCouponBtn, 'click', function(){
				BX.showWait();
				var url = '/bitrix/tools/generate_coupon.php?lang='+'<?php 
    echo urlencode(LANGUAGE_ID);
    ?>