<?php
$session = new \Zend\Session\Container('userlogin');
$user_id = $session->userData['user_id'];
?>
<section id="main_form1" class="padding12top margin-bot50px">
    <div class="container">
        <div class="row offer-dertail">
            <div class="col-sm-6">
                <h2>Offers</h2>
            </div>
            <div class="view-controls-list col-sm-6 text-right padding-top10px" id="viewcontrols">
                <a class="gridview current" id="grid"><i class="fa fa-th fa-2x"></i></a>
                <a class="listview" id="list"><i class="fa fa-list fa-2x"></i></a>
            </div>

            <div class="col-sm-12 no-padding pull-left" id="offer-grid">
                <?php

                foreach($couponList as $val) {?>

                <div class="col-sm-3 center offer-div">
                    <img src="/upload/offer/1.jpg" width="100%">
                    <div class="loginmodal-container offder-maindiv">
                        <h1 class="center font-bold">Delhi Offer</h1>
                        <h1 class="linhight35 font-bold offer-price-color"><i class="fa fa-inr"></i> <?php echo $val['discount_amount'] ?></h1>
                        <a href="#" class="btn btn-danger white margin-top60px">View More</a>

                    </div>

                    <div class="loginmodal-container offder-maindiv hover-div disable_none" style="background: url(/upload/offer/offer-bg1.png) repeat; z-index:99999;">
                        <h2 class="center font-bold white font-size25">Off</h2>
                        <h2 class="font-bold offer-price-color white font-size25"><i class="fa fa-inr"></i> <?php echo $val['discount_amount'] ?></h2>

                        <div class="col-sm-12 no-padding left white">
                            <div class="col-sm-5">Min Booking:</div>
                            <div  class="col-sm-7"><i class="fa fa-inr"></i> <?php echo $val['minimum_booking_amount'] ?></div>
                        </div>
                        <div class="col-sm-12 no-padding left white">
                            <div class="col-sm-5">Valid Date: </div>
                            <div  class="col-sm-7"><?php echo date('d M Y', strtotime($val['valid_from_date'])); ?>- <?php echo date('d M Y', strtotime($val['valid_to_date'])); ?></div>
                        </div>
                        <div class="col-sm-12 no-padding left white">
                            <div class="col-sm-5">Valid Time: </div>
                            <div  class="col-sm-7"><?php echo date('h:ia', strtotime($val['valid_from_date'])); ?> - 	<?php echo date('h:ia', strtotime($val['valid_to_date'])); ?></div>
                        </div>
                        <div class="col-sm-12 no-padding left white margin-bot10px">
                            <div class="col-sm-5">Week Ways:</div>
                            <div  class="col-sm-7">
                                <?php
                                $weekdays= explode(',',$val['master_week_days_id']);
                                foreach($weekdays as $key=>$val1){
                                if (array_key_exists($val1,$daysList))
                                {
                                    echo $daysList[$val1].', ';
                                }
                                }
                                ?>
                            </div>
                        </div>
                        <div class="col-sm-12 no-padding bg-gray left white">
                            <div class="col-sm-5">Promo Code
                                <br> <P class="p1"> <strong><?php echo $val['name']; ?></strong></P>
                            </div>
                            <div  class="col-sm-7 textright padding-bot10px padding-top10px">
                                <button class="btn btn-danger white btnCopyToClipboard">Copy</button>
                            </div>
                        </div>

                    </div>

                </div>

                <?php } ?>
            </div>

            <div class="col-sm-12  table-responsive disable_none" id="offer-list">
                <table class="table table-hover table-striped tablecen" id="bootstrap-table" style="border:1px solid #ddd;">
                    <thead>

                        <tr>
                            <th align="left"></td>
                            <td align="left"><strong>Promo Code</strong></td>
                            <td align="left"><strong>Validity</strong></td>
                            <td align="left"><strong>Week Days</strong></td>
                            <td align="left"><strong>Booking Type</strong></td>
                            <td align="left"><strong>Booking Amount</strong></td>
                            <td align="left"><strong>Discount</strong></td>
                        </tr>

                    </thead>
                    <tbody>
                        <?php foreach($couponList as $val) {?>
                        <tr>
                            <td align="left"><img src="/upload/offer/1.jpg" width="100" height="60"></td>
                            <td align="left"> <P class="p1"><strong><?php echo $val['name']; ?></strong></p>
                                <button class="btn btn-danger white btnCopyToClipboard">Copy</button></td>
                            <td align="left"><?php echo date('d M Y', strtotime($val['valid_from_date'])); ?> - <?php echo date('d M Y', strtotime($val['valid_to_date'])); ?> <br><?php echo date('h:ia', strtotime($val['valid_from_date'])); ?> - <?php echo date('h:ia', strtotime($val['valid_to_date'])); ?></td>
                            <td align="left"><?php
                                $weekdays= explode(',',$val['master_week_days_id']);
                                foreach($weekdays as $key=>$val1){
                                if (array_key_exists($val1,$daysList))
                                {
                                    echo $daysList[$val1].', ';
                                }
                                }
                                ?></td>
                            <td align="left" width="18%">Local, Point To Point, Airport Transfer</td>
                            <td align="left"> <i class="fa fa-inr"></i> <?php echo $val['minimum_booking_amount'] ?></td>
                            <td align="left"> <i class="fa fa-inr"></i> <?php echo $val['discount_amount'] ?></td>
                        </tr>

                        <?php }?>
                    </tbody>
                </table>
            </div>
        </div>


    </div>

</section>