如何为个人ID添加模态显示数据?

时间:2019-04-15 21:26:34

标签: codeigniter

当用户单击“更多详细信息href”时,我想要。他们应该在模态框上获得此详细信息。

<ul class="list-tickets">
<?php foreach ($searchFlights as $searchFlight) {
    //One Way Logic
    $stopInfo_O  = "";
    $stopCount_O = 0;

    $AirlineLogo_O      = $this->search_model->getAirlinelogo($searchFlight->airline_idO);
    $finalDepartdate_O  = $searchFlight->departure_dateO;
    $DepartAirpot_O     = $this->search_model->getAirportCode($searchFlight->depart_airportidO);
    $totalFlightTime_O  = $searchFlight->total_flighttimeO;
    $finalArrivaldate_O = $searchFlight->arrival_dateO;
        $totalBaggage_O = $searchFlight->baggageO;
        $stopOvertime1 = $searchFlight->stopover1_staydurationO;
                    $className0 = $searchFlight->classNameO;

    $ArrivalAirpot_O    = $this->search_model->getAirportCode($searchFlight->arrival_airportidO);
    $flightPrice        = $searchFlight->flightPrice;

    if($searchFlight->operatedby_airlineidO == "0") {
        $operatedAirlinename = "";
    } else {
        $operatedAirlinename  = $this->search_model->getAirlinename($searchFlight->operatedby_airlineidO);
    }
    //Stops Handling Oneway
    if(empty($searchFlight->stopover1_airportidO) && empty($searchFlight->stopover2_airportidO)){ $stopInfo_O = "Direct"; }

    if($searchFlight->stopover1_airportidO != 0){ $stopCount_O++; }

    if($searchFlight->stopover2_airportidO != 0){ $stopCount_O++; }

    if($stopCount_O>0){
        $stopInfo_O .= $stopCount_O." Stop ";
        //Stop oneway 1
        $stopInfo_O .= $this->search_model->getAirportCode($searchFlight->stopover1_airportidO);
        if($stopCount_O == 2) {
            //Stop One Way 2
            $stopInfo_O .= ", ".$this->search_model->getAirportCode($searchFlight->stopover2_airportidO);
        }
    }

    ?>

    <li class="list-item">
        <div class="list-item-inner">
            <div class="list-item-main">
                <!-- Oneway Section -->
                <div class="list-item-top">
                    <div class="list-item-logo">
                        <img src="<?= base_url(); ?>uploads/<?php echo $AirlineLogo_O; ?>" alt="">
                    </div>
                    <div class="list-item-content">
                        <div class="list-item-content-left">
                            <!-- Final Departure Dates-->
                            <div class="text-bold text-base">
                                <?php echo $finalDepartdate_O; ?>
                            </div>
                            <!-- Departure Airport -->
                            <span class="small reveal-block">
                                        <?php echo $DepartAirpot_O; ?>
                                    </span>
                        </div>
                        <div class="list-item-content-line-wrapper small">
                            <!-- Total Flight Time -->
                            <div class="list-item-content-line-top">
                                <?php echo $totalFlightTime_O; ?>
                            </div>
                            <div class="list-item-content-line"></div>
                            <!-- Stops info -->
                            <div class="list-item-content-line-bottom text-primary">
                               <p title="<?php echo $stopOvertime1; ?>"><?php echo $stopInfo_O; ?> </p>
                            </div>
                        </div>
                        <div class="list-item-content-right">
                            <!-- Final Arrival date -->
                            <div class="text-bold text-base">
                                <?php echo $finalArrivaldate_O; ?>
                            </div>
                            <!-- Arrival Airport -->
                            <span class="small reveal-block">
                                        <?php echo $ArrivalAirpot_O; ?>
                                    </span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="list-item-footer ticket-holder-dt">
                <h5 class="text-bold list-item-price"><?php echo COMMON_CurrencySymbol." ".$flightPrice;?></h5>
                <span class="ticket-include"></span>
                <span class="ticket-type">One way</span>
                <a class="btn btn-info btn-xs btn-no-shadow" href="<?= base_url(); ?>searchflights/bookFlight?id=<?php echo $searchFlight->id; ?>">
                    Book Now
                </a>
                <br>
                <a href="">
                       More detail <!-- I want when user click on it. they should get this detail on modal the box -->
                </a>

                <br>
                   <?php echo  $className0; ?> Class
            </div>

        </div>

         <div class="small text-gray-light list-item-subtitle">Operated by <?php echo $operatedAirlinename; ?></div>
      <div  class="tripbaggage">Baggage: <?php echo  $totalBaggage_O; ?></div>

<?php } ?>

1 个答案:

答案 0 :(得分:0)

您可以通过为for循环或 通过实现Ajax请求以显示相应ID的详细信息。