<?php
/** @var \Magetop\Advancepreview\Block\Adminhtml\Product\Edit\PreviewDiscount $block */
$productId = $block->getRequest()->getParam('product_id',0);
$discounts = $block->getDailyShippingProductId($productId);
//print_r($previews->getData());
?>
<table style="width:100%" id="table-product-daily-shipping-review-list">
    <tr>
        <th><?php echo __('Delivery Type') ?></th>
        <th><?php echo __('Delivery days') ?></th>
         <th><?php echo __('Delivery charge %') ?></th>
        <th><?php echo __('Created At') ?></th>
        <th><?php echo __('Edit') ?></th>
        <th><?php echo __('Delete') ?></th>
    </tr>
    <?php foreach ($discounts as $discount) : ?>
    <tr>
        <td><?php echo $discount->getData('delivery_type') ?></td>
        <td><?php echo $discount->getData('delivery_days') ?></td>
           <td><?php echo $discount->getData('amount') ?></td>
        <td><?php echo $discount->getData('created_at') ?></td>
        <td><span class="preview-daily-shipping-item-edit" discount-id="<?php echo $discount->getId(); ?>"><?php echo __('Edit') ?></span></td>
        <td><span class="preview-daily-shipping-item-delete" discount-id="<?php echo $discount->getId(); ?>"><?php echo __('Delete') ?></span></td>
    </tr>
    <?php endforeach; ?>
</table>
