<?php 
   $workshops = $this->getCollection();
?>

<section class="bac-mdg">
    <div class="container-fluid">
        <?php if ($workshops->getSize() > 0) { ?>
            <?php foreach ($workshops as $key => $workshop) { ?>
                <div class="row">
                    <!-- Left Content -->
                    <div class="col-md-8 left-content">
                        <div class="bac-banner">
                            <img class="card-img-top work-shop-mdg-img" src="<?php echo $this->getViewFileUrl('Webarian_Workshop::images/banner-work-shop.png'); ?>" alt="">
                        </div>
                    </div>
                    <!-- Right Content -->
                    <div class="col-md-4 right-content">
                     <div class="workshop-content">
                        <?php
                        $newDate = $workshop->getData('date');
                        $strtotime = strtotime($newDate);
                        $eventDate = date('d M, Y', $strtotime);
                        ?>
                        <h3 class="work-text-first"><?php echo $workshop->getData('title') ?></h3>
                        <p class="work-para work-pt">Date &amp; Duration:</p>
                        <p class="work-para-sub marked"><?php echo $eventDate ?> <mark class="left-border-text"><?php echo $workshop->getData('duration') ?> onwards</mark></p>
                        <p class="work-para-sub work-pt"><strong class="bold-text-pl">Capacity:</strong><?php echo $workshop->getData('capacity') ?> people</p>
                        <p class="work-para-sub work-pt"><strong class="bold-text-pl">For age:</strong><?php echo $workshop->getData('age') ?></p>
                        <p class="work-para-sub work-pt"><strong class="bold-text-pl">Ticket Price:</strong>Rs. <?php echo $workshop->getData('price') + 0; ?>/-</p>
                        <p class="work-para-sub work-pt"><strong> Venue </strong></p>
                        <p class="work-para-sub"><?php echo $workshop->getData('address') ?> </p>
                        <p class="work-para-sub">
                              <a href="<?php echo $this->getUrl('workshop/register/index', array('id'=> $workshop->getData('workshop_id'))) ?>" class="btn btn-bac-prim-rn">Register Now</a>
                        </p>
                     </div>
                  </div>
                </div>
            <?php } ?>
        <?php } ?>
    </div>
</section>
<?php 
  echo $this->getLayout()->createBlock("Magento\Framework\View\Element\Template")->setTemplate("Webarian_Workshop::workshop-section.phtml")->toHtml();
?>