<?php
$session = new \Zend\Session\Container('userlogin');
$user_id = $session->userData['user_id'];
$adultFare = 0;
$childFare = 0;
$taxFare = 0;
$totaladultFare = 0;
$totalchildFare = 0;
$totalFare = 0;
$totalPrice = 0;
$cartCount = 0;

if (!empty($sessionCartIds)) {
    $cartCount = count($sessionCartIds);
}else{
    $cartCount = 0;
}
    /*foreach ($sessionCartIds as $val) {
        $data1 = $payData[$val['s_id']];
        //echo '<pre>';print_r($data['tourfaredata']);
        if (!empty($data1['tourfaredata'])) {
            $fareData = json_decode($data1['tourfaredata'], true);
            $adultFare += $fareData[0]['adult_price'];
            $childFare += $fareData[0]['child_price'];
            $totaladultFare = $adultFare * $data['adults'];
            $totalchildFare = $childFare * $data['childs'];
            $totalFare = $totaladultFare + $totalchildFare;

            if ($data1['tax_type'] == 2) {
                if ($data1['tax_per_fixed'] == 1) { // percentage
                    $taxValue = $data1['tax_value'];
                    $taxFare += round(($totalFare * $taxValue) / 100);
                } else {
                    $taxFare += $data1['tax_value'];
                }
            } else {
                $taxFare = 0;
            }
        } else {
            $adultFare = 0;
            $childFare = 0;
            $totaladultFare = 0;
            $totalchildFare = 0;
            $totalFare = 0;
            $taxFare = 0;
        }
    }
    $totalPrice = round($totalFare + $taxFare);*/
//}



    if (!empty($sightData['tourfaredata'])) {
        $fareData = json_decode($sightData['tourfaredata'], true);
        $adultFare = $fareData[0]['adult_price'];
        $childFare = $fareData[0]['child_price'];
        $totaladultFare = $fareData[0]['adult_price'] * $data['adults'];
        $totalchildFare = $fareData[0]['child_price'] * $data['childs'];
        $totalFare = $totaladultFare + $totalchildFare;
        $guideAvailable = $fareData[0]['is_guide_available'];
    } else {
        $adultFare = 0;
        $childFare = 0;
        $totaladultFare = 0;
        $totalchildFare = 0;
        $totalFare = $totaladultFare + $totalchildFare;
        $guideAvailable =0;
    }

    if ($sightData['tax_type'] == 2) {
        if ($sightData['tax_per_fixed'] == 1) { // percentage
            $taxFare = round(($totalFare * $sightData['tax_value']) / 100);
        } else {
            $taxFare = $sightData['tax_value'];
        }
    } else {
        $taxFare = 0;
    }

    $totalPrice = round($totalFare + $taxFare);
    
    if (!empty($sightData['meal'])) {
         $meal = json_decode($sightData['meal'], true);
    } else {
         $meal = "";
    }
    
    

?>

<div class="col-md-3 banner-bottom-grid pull-right payment-div">
    <div style="float: right;"><a href="<?php echo $this->url('sight-seeing', ['action' => 'cart-list']); ?>">Cart (<span class="cart-count"><?php echo $cartCount; ?></span>)</a></div>
    <div class="top-destinations-grids margin0">
        <div class="top-destinations-bottom padding_margin0">
            <div class="td-grids">
                <div class="left-div-form border_bottom">
                    <h4>Payment Detail</h4>
                </div>
                <form id="payment-detail-form">
                    <div class="infopay">

                        <div class="left-div-form">
                            <div class="title">Adult Price</div>
                            <div class="price">
                                <span class=""></span><span class="adult-fare"><?php echo $adultFare; ?></span>
                                <input type="hidden" name="adult_fare" id="adult-fare" value="<?php echo $adultFare; ?>">
                            </div>
                        </div>

                        <div class="left-div-form">
                            <div class="title">Child Price</div>
                            <div class="price">
                                <span class=""></span><span class="child-fare"><?php echo $childFare; ?></span>
                                <input type="hidden" name="child_fare" id="child-fare" value="<?php echo $childFare; ?>">
                            </div>
                        </div>

                        <div class="left-div-form">
                            <div class="title">No of Adults</div>
                            <div class="price">
                                <span class=""></span><span><?php echo $data['adults']; ?></span>
                            </div>
                        </div>

                        <div class="left-div-form">
                            <div class="title">No of Childs</div>
                            <div class="price">
                                <span class=""></span><span><?php echo $data['childs']; ?></span>
                            </div>
                        </div>

                        <div class="left-div-form">
                            <div class="title">Total Adult Price</div>
                            <div class="price">
                                <span class=""></span><span class="total-adult-fare"><?php echo $totaladultFare; ?></span>
                                <input type="hidden" name="total_adult_fare" id="total-adult-fare" value="<?php echo $totaladultFare; ?>">
                            </div>
                        </div>

                        <div class="left-div-form">
                            <div class="title">Total Child Price</div>
                            <div class="price">
                                <span class=""></span><span class="total-child-price"><?php echo $totalchildFare; ?></span>
                                <input type="hidden" name="total_child_price" id="total-child-price" value="<?php echo $totalchildFare; ?>">
                            </div>
                        </div>

                        <div class="left-div-form">
                            <div class="title red_text" title="Only for booking amount">Running Amount</div>
                            <div class="price red_text" title="Only for booking amount"><span class="WebRupee"></span> <span class="running-amt"> <?php echo $totalFare; ?></span> </div>
                            <input type="hidden" name="running_amt" id="running-amt" value="<?php echo $totalFare; ?>">
                        </div>





                        <div class="left-div-form">
                            <div class="title">Tax</div>
                            <div class="price"> <span class="tax-price"><?php echo $taxFare; ?></span> </div>
                            <input type="hidden" name="tax_price" id="tax-price" value="<?php echo $taxFare; ?>">
                        </div>


                        <div class="clear"></div>
                        <div class="left-div-form">
                            <div class="title">Payable Amount</div>
                            <div class="price"> <i class="fa fa-inr"></i> <span class="total-price"><?php echo $totalPrice; ?></span><span id="usdvalue"></span> </div>
                            <input type="hidden" name="total_price" id="total-price" value="<?php echo $totalPrice; ?>">
                        </div>
                        <div class="left-div-form">

                            <div class="radio-inline specs padding-left0 widthpercent100">
                                <div class="radioWrap">
                                    <input type="text" name="coupon_code" placeholder="Coupan Code" class="height34px" id="coupon-code" onClick="">
                                    <input type="hidden" name="coupon_code_id" id="coupon-code-id">
                                    <input type="hidden" name="coupon_discount_type" id="coupon-discount-type">
                                    <input type="hidden" name="coupon_discount_value" id="coupon-discount-value">
                                    <div class="coupon-code-msg"></div>
                                </div>
                                <div class="pull-right">
                                    <div id="apply_coupancode" class="pull-right padding0"><a class="apply-coupon"> Apply</a></div>
                                </div>
                                <div id="coupan_disount"></div>
                                <small id="booklater_conditions_local"></small>
                            </div>
                        </div>
                        <div class="left-div-form">
                            <div class="title"><span class="WebRupee"><b>Discount</b></span></div>
                            <div class="price"><span class="WebRupee"><span class="WebRupee">  </span></span><span class="total-discount">0</span></div>
                            <input type="hidden" name="total_discount" id="total-discount" value="0">
                        </div>
                        <div class="left-div-form">
                            <div class="title"><span class="WebRupee"><b>Total Charge</b></span></div>
                            <div class="price"><span class="WebRupee"><span class="WebRupee"> <i class="fa fa-inr"></i> </span></span><span class="total-charge"><?php echo $totalPrice; ?></span></div>
                            <input type="hidden" name="total_charge" id="total-charge" value="<?php echo $totalPrice; ?>">
                            <input type="hidden" name="currency_type" id="currency-type" value="1">
                        </div>
                        <div class="left-div-form">
                            <!--<label class="booking-check"><a href="javascript: void(0);" class="terms-color" onclick="termsCondition()">Terms & Conditions</a>
                                <input type="checkbox" checked="checked" disabled="">
                                <span class="checkmark"></span>
                            </label>-->


                            <?php if (empty($form->getMessages())) { ?>
                                <div id="accordion_login" class="title widthpercent100">
                                    <?php if (empty($user_id)) { ?>
                                        <div class="overviueimg31"><a class="guestlogin" id="asguest">As a Guest</a></div>
                                        <div class="overviueimg32">or</div>
                                        <div class="overviueimg31"><a href="<?php echo $this->url('login'); ?>" data-target="#ajax-modal" data-toggle="modal" data-remote="true" data-keyboard="false" data-backdrop="static" class="aslogin">As login</a></div>
                                        <div></div>
                                    <?php } else { if($pageType=="list" || $pageType=="detail" ){ ?>
                                        <div class="overviueimg31"><a href="<?php echo $this->url('sight-seeing', ['action' => 'cart-list']); ?>" class="aslogin">Continue</a></div>
                                        <?php } elseif ($cartCount>0 && $pageType=="cart") { ?>
                                        <input type="hidden" id="continue-sight-submit" action="<?php echo $this->url('sight-seeing', ['action' => 'continue-submit']); ?>">
                                        <div class="overviueimg31"><a href="#" class="aslogin continue-sight-submit">Continue</a></div>
                                        <?php }} ?>
                                </div>
                            <?php } ?>
                        </div>
                    </div>
                </form>
                <div class="clearfix"> </div>
            </div>
        </div>
    </div>
</div>
                    
                    <div class="col-md-3 col-sm-5 wow fadeInDown" data-wow-duration="1000ms" data-wow-delay="600ms">
                    		
                        <div class="col-sm-12 col-md-12 col-xl-12 margin5 redio rihgt-box">                                                     
   			<span class="packagelabel"><h2>Inclusions</h2></span>
    			<!--<div class="incluson-icon"><i class="fa fa-hotel"></i> Hotel</div>-->
                        <?php if(isset($sightData['transfer']) && $sightData['transfer']==1) { ?>
                        <div class="incluson-icon"><i class="fa fa-car"></i> Transfers</div>
                        <?php }?>
                        
                        <?php if(isset($guideAvailable) && $guideAvailable==1) { ?>
                        <div class="incluson-icon"><i class="fa fa-user"></i> Guide</div>
                        <?php }?>
                        
                        <?php if(!empty($meal)) {  foreach($meal as $mealVal){ ?>
                        <div class="incluson-icon"><i class="<?php echo $mealVal['meal_icon'];?>"></i> <?php echo $mealVal['meal_name'];?></div>
                                     
                        <?php } } ?>
                        <!--<div class="incluson-icon"><i class="fa fa-building"></i> City tour</div>
                        <div class="incluson-icon"><i class="fa fa-camera"></i> Sightseeing</div>-->
                        </div>
                        
                        
                        <div class="col-sm-12 col-md-12 col-xl-12 margin5 redio rihgt-box center">
                          
                            
                    <div class="packagelabel">
                    <h2 style="margin-top:10px; margin-bottom:0;"> <span class="colorred"> <i class="fa fa-inr" aria-hidden="true"></i>
                    <?php echo $totalPrice; ?></span>
                    <br>
                    <span style="font-size:11px;">for <?php echo $data['adults'];?> Adult <?php echo $data['childs'];?> child Excludes Taxes</span>
                    </h2>
                    </div>
 <div class="col-sm-12 margin5 padding-bot0">
                                    	<div class="col-sm-12 compare-div  margin5 padding-bot0" style="margin-left:10%;">
                                   
                                   	<div class="col-sm-6 campare-whichlist widthpercent48 widthpercent45" style="width:48%;">
                                    	<a href="javascript: void(0);" rel="<?php echo $sightData['s_id']; ?>" title="Add Compare" class="font-size25 add_compare">
                                        <i class="fa fa-balance-scale"></i></a><i class="fa fa-plus-circle"></i> </div>
                                        <div class="col-sm-6 campare-whichlist padding-left0 widthpercent38">
                                        <a href="javascript: void(0);" onclick="addWishList('<?php echo $data['master_package_type']; ?>', '<?php echo $sightData['s_id']; ?>')" class="font-size25" title="Add Wish List"><i class="fa fa-heart"></i></a><i class="fa fa-plus-circle plus-circle"></i>
                                        
                                         
                                        </div>
                                    </div>
                                    
                                    </div>
    						<div class="packagelabel colorred"> <a href="review.html" class="btn-primary">Book Now</a></div>
    						
                            
                        </div>
                        
                        
                        <div class="col-sm-12 col-md-12 col-xl-12 margin5 redio rihgt-box" >
                          
                            
   							
 
                      <div class="col-sm-12 padding0">
                     <div class="packagelabel"> <h2 style="margin-top:5px;"> Enquiry Now </h2></div>
<div style="margin-right:5px;display: inline-block;margin-bottom: 5px;">
 <a href="#"  class="contact-iccons" title="Send Enquiry"><i class="fa fa-envelope" aria-hidden="true"></i></a>
<br>
<span class="font-size10px">Send Enquiry</span>
</div>
 <div style="margin-right:5px;display: inline-block;margin-bottom: 5px;">
<a href="#"  class="contact-iccons" title="Gat a Call Back"><i class="fa fa-phone" aria-hidden="true"></i></a>
<br> <span class="font-size10px">Gat a Call Back </span>
</div>
                     <span style="margin-right:5px;display: inline-block;margin-bottom: 5px;">
<a href="#"  class="contact-iccons" title="Refer a Friend"><i class="fa fa-user-plus"></i>
</a>
<br>
 <span class="font-size10px">Refer a Friend</span>
</span>
                                        
                                    </div>
                            
                 
                        
                    </div>
                         <?php if(!empty($sightData['youtube_url'])) { ?>
                        <div class="col-sm-12 col-md-12 col-xl-12 margin5 redio rihgt-box">     
                      <div class="col-sm-12 padding0">
                     <span class="packagelabel"> <h2 style="margin-top:5px;"> You Tube </h2></span>
                     
                      <iframe width="230" height="200" src="<?php echo $sightData['youtube_url'];?>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
                      </div>                          
                    </div>
                    <?php } ?>
                    	<div class="col-sm-12 col-md-12 col-xl-12 margin5 redio rihgt-box">
                          
                            
   							
 
                      <div class="col-sm-12 padding0">
                     <span class="packagelabel"> <h2 style="margin-top:5px;"> Location on Map Now </h2></span>
                     
                      <div id="map"></div>

                                        
                                    </div>
                            
                 
                        
                    </div>
                    
                </div>
    