<?php
/**@var \Magetop\Advancepreview\Block\Adminhtml\Product\Edit\PreviewDiscount $block */
$previewId = $block->getRequest()->getParam('discount_id',0);
$productId = $block->getRequest()->getParam('product_id',0);
$discountData = $block->getDiscountById($previewId, $productId);
?>

<form action="/" method="post" id="preview-product-discount-form" enctype="multipart/form-data">
    <input type="hidden" name="form_key" value="<?php echo $block->getFormKey(); ?>">
    <input type="hidden" name="product_id" value="<?php echo $productId; ?>">
    <input type="hidden" name="discount_id" value="<?php echo $discountData['discount_id']; ?>">
    <label for="txt-preview-discount-title"><?php echo __('Title') ?></label>
    <input type="text" id="txt-preview-discount-title" name="discount_title" value="<?php echo $discountData['discount_title']; ?>" placeholder="<?php echo __('Discount Title') ?>" class="admin__control-text" data-validate='{"required":true}'>
    <label for="txt-preview-discount-price"><?php echo __('Price') ?></label>
    <input type="number" id="txt-preview-discount-price" name="discount_price" value="<?php echo $discountData['discount_price']; ?>" placeholder="<?php echo __('Discount Price') ?>" class="admin__control-text" data-validate='{"required":true}'>
    <button type="button" id="btn-save-preview-discount"><?php echo __('Save') ?></button>
    <button type="button" id="btn-close-preview-discount"><?php echo __('Close') ?></button>
</form>
