lundi 21 novembre 2016

How to get value of check boxes in laravel

I am now creating a project. In this I am stuck. I want to get all the value of check boxes in my table. But don't know how to do it. I want to get all the value of checkbox and return to other page. I also want to show the value in next page. My code is

<div style="margin-top: 20px;">
    <table id="paymentHistory" class="table table-striped">
        <thead>
        <tr>
            <th style="width: 110px;">Booking Date</th>
            <th>Provider</th>
            <th>Client</th>
            <th>Timezone</th>
            <th>Total Amount ($)</th>
            <th>Payment Time</th>
            <th style="width: 70px;">Action</th>
        </tr>
        </thead>
        <tbody>
        @if(!empty($payments))
            @foreach($payments as $po)
                @if($po->remarks == 'paid-to-admin')
                    <?php
                    $booking = App\Models\Booking::find($po->booking_id);
                    $ac= '';
                    $date =$booking->booking_date;
                    $dt = explode('-',$date);
                    $month = $dt[0];
                    $day = $dt[1];
                    $year = $dt[2];
                    $dateString = $year.'/'.$month.'/'.$day ;
                    $newDate = strtotime($dateString);
                    $today = time();
                    if($newDate < $today - 7 * 24*60*60){
                        $ac = $booking->booking_date;
                    }
                    ?>
                    @if(!empty($ac))
                    <tr>
                        <?php if(!empty($po->booking_id)){$booking = App\Models\Booking::find($po->booking_id);} ?>

                        <td width="110"></td>

                        <td>
                            <?php
                            if(Auth::user()->id == $po->provider_id){
                                if(!empty($po->user_id)){
                                    $p_name = \App\Models\UserDetail::where('user_id', $po->user_id)->first();
                                }
                            }elseif(Auth::user()->id == $po->user_id){
                                if(!empty($po->provider_id)){
                                    $p_name = \App\Models\UserDetail::where('user_id', $po->provider_id)->first();
                                }
                            }else{}
                            ?>
                            
                            
                        </td>

                        <td>
                            <?php
                            if(Auth::user()->id == $po->user_id){
                                if(!empty($po->user_id)){
                                    $p_name = \App\Models\UserDetail::where('user_id', $po->user_id)->first();
                                }
                            }elseif(Auth::user()->id == $po->provider_id){
                                if(!empty($po->provider_id)){
                                    $p_name = \App\Models\UserDetail::where('user_id', $po->provider_id)->first();
                                }
                            }else{}
                            ?>
                            
                            
                        </td>

                        <td> </td>
                        <td>$ </td>

                        <td> </td>

                        <td>
                                <label class="check-box">
                                    <input type="checkbox"  value="" class="checkbox-input" > <span class="check-box-sign"></span>
                                </label>

                        </td>
                    </tr>
                    @endif

                @endif
            @endforeach
        @endif

        </tbody>
    </table>
    <br>
    <div class="col-md-12">
        <div class="clearfix">
            <button type="button" class="pull-right margin-0 margin-top-50 btn color-1 size-1 hover-3" id="booking_confirm">
                Submit
            </button>
        </div>
    </div>
</div>




Aucun commentaire:

Enregistrer un commentaire