<?php
/**@var \Magetop\Advancepreview\Block\Adminhtml\Product\Edit\PreviewDailyShipping $block */
//echo get_class($block);
$productId = $block->getRequest()->getParam('id',0);
$urls = $block->getAjaxUrl();
$uploadUrl = $urls['save_url'];
$itemsUrl = $urls['item_url'];
$editUrl = $urls['edit_url'];
$dellUrl = $urls['dell_url'];
?>
<?php if($productId > 0) : ?>
    <input type="hidden" id="txt-preview-daily-shipping-upload-url" value="<?php echo $uploadUrl; ?>">
    <input type="hidden" id="txt-preview-daily-shipping-items-url" value="<?php echo $itemsUrl; ?>">
    <input type="hidden" id="txt-preview-daily-shipping-edit-url" value="<?php echo $editUrl; ?>">
    <input type="hidden" id="txt-preview-daily-shipping-dell-url" value="<?php echo $dellUrl; ?>">
    <input type="hidden" id="txt-product-daily-shipping-id" value="<?php echo $productId; ?>">

<button type="button" id="btn-add-product-daily-shipping-preview"><?php echo __('Add Item') ?></button>
    <div id="product-daily-shipping-review-message"></div>
<div style="text-align: center; margin-top: 10px; font-size: 1.8em;"><?php echo __('Daily Shipping List') ?></div>
<div id="preview-product-daily-shipping-lists-content">

</div>
<div id="preview-product-daily-shipping-form-content" style="display: none">

</div>

<script>
    require([
        'jquery',
        'preview_daily_shipping_form'
    ],function ($, dailyShippingForm) {
        dailyShippingForm.init();
    })
</script>
<?php else: ?>
<p><?php echo __('Please create product before configuring Daily Shipping') ?></p>
<?php endif; ?>
