    <link href="<?php echo base_url();?>assets/css/package-custom-style.css" rel="stylesheet" type="text/css" />
    <!-- ============================================================== -->
    <!-- Start right Content here -->
    <!-- ============================================================== -->
    <div class="main-content">

        <div class="page-content">
            <div class="container-fluid">

                <!-- start page title -->
                <div class="row">
                    <div class="col-12">
                        <div class="page-title-box d-flex align-items-center justify-content-between">
                            <h3 style="color: #40dcfd; text-transform: lowercase;">Digital Pass</h3>
                        </div>
                    </div>
                </div>
                <!-- end page title -->

                <div class="row justify-content-center">
                    <div class="col-lg-6">
                        <div class="text-center">
                            <h4 style="color: #40dcfd;">Choose from our Selection of Digital Passes</h4>
                        </div>
                    </div>
                </div>
                
                <div class="pt-2" id="alert"></div>

                <div class="row pt-2">
                    <?php 
                        if(count($purchase_list) > 0){
                            foreach($purchase_list as $key => $val){
                    ?>
                    <div class="col-xl-3 col-md-6">
                        <div class="card plan-box">
                            <div class="card-body p-3">
                                <div class="media">
                                    <img src="http://d1z6a3vjnfowyr.cloudfront.net/<?php echo $val["package"];?>" style="width: 100%; height: 100%; border-radius: 5px;">
                                </div>
                                <div class="media">
                                    <h5 style="margin: 10px auto 0px auto;"><?php echo $val['title'];?></h5>
                                </div>
                                <div class="py-3">
                                    <div class="price-box">
                                        <?php 
                                            if($val['discount'] != 0){
                                                $discount_price = $val['price'] * $val['discount'] / 100;
                                        ?>
                                        <p class="special-price"> 
                                            <span class="price-label">Special Price</span> 
                                            <span class="price"> <?php echo $val['symbol'];?><?php echo ($val['price'] - $discount_price);?> </span> 
                                        </p>
                                        <p class="old-price"> 
                                            <span class="price-label">Regular Price:</span> 
                                            <span class="price"> <?php echo $val['symbol'];?><?php echo $val['price'];?> </span> 
                                        </p>
                                        <?php
                                            }else{
                                        ?>
                                        <p class="special-price"> 
                                            <span class="price-label">Regular Price:</span> 
                                            <span class="price"> <?php echo $val['symbol'];?><?php echo $val['price'];?> </span> 
                                        </p>
                                        <?php
                                            }
                                        ?> 
                                    </div>
                                </div>
                                
                                <div class="input-group mb-3" id="datepick<?php echo $val['id'];?>" style="display: none;">
                                    <input type="text" class="form-control" id="activate_date<?php echo $val['id'];?>" placeholder="Activate Date" data-provide="datepicker" data-date-format="yyyy-mm-dd">
                                    <div class="input-group-append">
                                        <span class="input-group-text">
                                            <i class="mdi mdi-calendar"></i>
                                        </span>
                                    </div>
                                </div>
                                
                                <div class="text-center plan-btn">
                                    <a href="javascript:;" class="btn btn-primary btn-sm waves-effect waves-light" id="buy_btn<?php echo $val['id'];?>" onclick="buy_func('<?php echo $val["id"];?>')">Buy Now</a>
                                    <?php 
                                        if($val['discount'] != 0){
                                            $discount_price = $val['price'] * $val['discount'] / 100;
                                    ?>
                                                <a href="javascript:;" class="btn btn-primary btn-sm waves-effect waves-light" id="continue_btn<?php echo $val['id'];?>" style="display:none;" onclick="continue_func('<?php echo $val["id"];?>', '<?php echo($val['price'] - $discount_price);?>', '<?php echo $val["currency_rate"];?>', '<?php echo $val["validity"];?>')">Continue</a>
                                    <?php
                                        }else{
                                    ?>
                                                <a href="javascript:;" class="btn btn-primary btn-sm waves-effect waves-light" id="continue_btn<?php echo $val['id'];?>" style="display:none;" onclick="continue_func('<?php echo $val["id"];?>', '<?php echo $val["price"];?>', '<?php echo $val["currency_rate"];?>', '<?php echo $val["validity"];?>')">Continue</a>
                                    <?php
                                        }
                                    ?> 
                                </div>

                                <div class="plan-features mt-3">
                                    <?php 
                                        if($val['type'] == 1){
                                            echo '<p> Unlimited</p>';
                                            echo '<p><img src="'.base_url().'assets/images/icon/photo.png" style="width: 35px;"> Unlimited Photo</p>';
                                            echo '<p><img src="'.base_url().'assets/images/icon/video.png" style="width: 35px;"> Unlimited Video</p>';
                                            echo 'Validity: '.$val['validity'];
                                        }else if($val['title'] == 0){
                                            echo '<p> Limited</p>';
                                            echo '<p><img src="'.base_url().'assets/images/icon/photo.png" style="width: 35px;">'.$val['image'].' Photo</p>';
                                            echo '<p><img src="'.base_url().'assets/images/icon/video.png" style="width: 35px;">'.$val['video'].' Video</p>';                                            
                                            echo 'Validity: '.$val['validity'];
                                        }
                                    ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <?php
                            }
                        }else{
                    ?>                        
                        <div class="col-md-12 text-center" style="color: #40dcfd;">No Digital Pass Data</div>
                    <?php
                        }
                    ?>
                </div>
                <!-- end row -->
            </div> <!-- container-fluid -->
        </div>
        <!-- End Page-content -->

        <script>
            function buy_func(id){
                $("#buy_btn"+id+"").hide();
                $("#continue_btn"+id+"").show();
                $("#datepick"+id+"").show();
            }

            function continue_func(package_id, price, currency_rate, validity){
                var shtml = '';
                
                var activate_date = $("#activate_date"+package_id+"").val();
                var usd_price = price * currency_rate;
                
                var today = new Date();
                var yyyy = today.getFullYear();
                var mm = today.getMonth() + 1;
                var dd = today.getDate();
                
                if(mm < 10)
                    mm = '0'+mm;
                if(dd < 10)
                    dd = '0'+dd;
                    
                var current_date = yyyy+'-'+mm+'-'+dd;
                
                if(activate_date >= current_date){
                    document.location.href = "<?php echo base_url();?>PurchaseController/purchase?guest_id="+'<?php echo $userdata["id"]?>'+"&package_id="+package_id+"&from_date="+activate_date+"&validity="+validity+"&price="+usd_price;
                }else{
                    shtml += '<div class="alert alert-info fade in alert-dismissible show">';
                    shtml +=    '<button type="button" class="close" data-dismiss="alert" aria-label="Close">';
                    shtml +=        '<span aria-hidden="true" style="font-size:20px">×</span>';
                    shtml +=    '</button>Activate Date is incorrect.'; 
                    shtml += '</div>';
                    $("#alert").html(shtml);
                }
            }
        </script>