



<div class="modal fade" id="baggageModal" tabindex="-1" role="dialog" aria-labelledby="fareRuleModalLabel" aria-hidden="true">
          <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
              <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLabel">Select your prefered meal(s)</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                  <span aria-hidden="true">&times;</span>
                </button>
              </div>
              <div class="modal-body">
                <!-- Modal content goes here -->
            <?php
            $flight_det = json_decode($flight_details);
          $connect = 0;
           // print_r($flight_details);
            if(!empty($flight_det)):
            $fly_info = $flight_det->tripInfos[0]->sI; 
           endif;
          $search_data = $flight_det->searchQuery;
          $adultCount = $search_data->paxInfo->ADULT;
          $childCount = $search_data->paxInfo->CHILD;
               
                  
                  
                 // $ssrinfo = $flight_det->tripInfos[0];
                  $segment_info = $flight_det->tripInfos[0]->sI;
                //  print_r($segment_info);
                  
            ?>
            <!-- traveller addon baggage -->
            <div class="review-flight py-3">
                <div class="container">
                    <div class="row">
                        <div class="col-12">
                            <!-- add baggage details flight depart -->
                            <div class="theme-box-shadow theme-border-radius bg-light mb-3 pb-0">
                                <div class="tab-content" id="pills-tabContent">
                                    <!-- flight departure baggage addon -->
                                    <div class="tab-pane fade show active" id="pills-home" role="tabpanel"
                                        aria-labelledby="pills-home-tab">
                                        <div class="row g-0 mb-3">
                                            
                                            
                                           
                      <?php if(!empty($segment_info)) { foreach($segment_info as $segment){ ?>
                              <div class="col-md-4" >           
                             <div class="p-2 border theme-border-radius d-flex align-items-center"
                                        id="pills-profile-tab" data-bs-toggle="pill" data-bs-target="#pills-profile"
                                        role="tab" aria-controls="pills-profile" aria-selected="false">
                                      
                                        <div class="flex-grow-1 ms-2">
                                            <div class="fw-bold"><?=$segment->da->code?> - <?=$segment->aa->code?></div>
                                           <!-- <div class="font-small text-danger">Selection pending</div>-->
                                        </div>
                                    </div>                
                                  </div>     
                              <div class="col-12 p-3">                    
                            <?php for ($i = 1; $i <= $adultCount; $i++) : ?>
                                <div class="row">
                                    <div class="col-6 p-3">
                                        <label>Select Baggage for Adult <?php echo $i; ?></label>
                                        <?php
                                        $ssrinfo = $segment->ssrInfo;
                                        if(isset($ssrinfo->BAGGAGE)) {
                                         $bg_details = $ssrinfo->BAGGAGE;    
                                        }else{
                                        $bg_details = '';    
                                        } 
                                        ?>
                                        <select class="form-control">
                                            <option value="">Please Select</option>
                                            <?php if(!empty($bg_details)): foreach ($bg_details as $bg) : ?>
                                                <option value="<?= isset($bg->code) ? $bg->code : ''; ?>">
                                                    <?= isset($bg->desc) ? $bg->desc : ''; ?>
                                                </option>
                                            <?php endforeach;endif; ?>
                                        </select>
                                    </div>
                                </div>
                            <?php endfor; ?>


                                   <?php for ($j = 1; $j <= $childCount; $j++) : ?>
                                    <div class="row">
                                         <div class="col-6 p-3">
                                         <label>Select Baggage for Child <?php echo $j; ?></label>
                                      <?php
                                        $ssrinfo = $segment->ssrInfo;
                                        if(isset($ssrinfo->BAGGAGE)) {
                                         $bg_details = $ssrinfo->BAGGAGE;    
                                        }else{
                                        $bg_details = '';    
                                        }                                                  
                                        
                                        ?>
                                        <select class="form-control">
                                             <option value="">Please Select</option>
                                            <?php if(!empty($bg_details)): foreach ($bg_details as $bg) : ?>
                                                <option value="<?= isset($bg->code) ? $bg->code : ''; ?>">
                                                    <?= isset($bg->desc) ? $bg->desc : ''; ?>
                                                </option>
                                            <?php endforeach;endif; ?>
                                        </select>
                                    </div>
                                </div>
                                 <?php endfor; ?>
                                  </div>   
                                                                                           
                                         <?php   $connect++;  } }else{
                                                echo 'No meal information available ';
                                            } ?>
                                           
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>

                </div>
            </div>
              </div>
              <div class="modal-footer">
                   <button type="button" class="btn btn-primary">Confirm</button>
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
              </div>
            </div>
          </div>
        </div>
        </div>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js"></script>
 <script src="<?php echo base_url(); ?>assets/front/assets/js/bootstrap.bundle.min.js"></script>
      <script src="<?php echo base_url(); ?>assets/front/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <!--This page JavaScript -->
    <script src="<?php echo base_url(); ?>assets/front/js/owl.carousel.min.js"></script>
    <!--Data Calendar js -->
    <script src="<?php echo base_url(); ?>assets/front/js/jquery-ui.js"></script>
    <!--Traveler counter js -->
    <script src="<?php echo base_url(); ?>assets/front/js/counter.js"></script>
    <script src="<?php echo base_url(); ?>assets/front/js/main.js"></script>
    <!-- animation aos library -->
    <script src="<?php echo base_url(); ?>assets/front/js/aos.js"></script>
