@extends('admin.layouts.app')

@section('header-script')
@include('admin.layouts.datatable-header')
@endsection


@section('content')
<!-- Page-Title -->
<div class="col-md-12">
    <div class="col-md-12 pd-0">
        <div class="u-shadow-v21 nbr g-bg-white rounded notice-board  mg-0 wow slideInUp" data-wow-duration="3s">
            <div class="media g-mb-15">
                <div>
                    <div class="bar-title" style="text-align:center">
                        <h1><a href=""><span> Audience Question
                                </span></a></h1>
                    </div>

                    <table class="table table-dark">
                        <thead>
                            <tr>
                                <th scope="col">ক্রমিক</th>
                                <th scope="col"> পর্ব</th>
                                <th scope="col"> Question</th>
                                <th scope="col">Right Answer</th>
                                <th scope="col">ছবি</th>
                                <th scope="col"> Action</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php $i = 0; ?>
                            @if(count($audiences) > 0)

                            @foreach($audiences as $audience)
                            <tr>
                                <?php $i+=1; ?>
                                <th scope="row">{{$i}}</th>
                                <td>{{$audience->round_id}}</td>
                                <td>{{$audience->question}}</td>
                                <td>{{$audience->right_answer}}</td>
                                <td>
                                    <div>
                                        <img src="{{ URL::to('public/images/' . $audience->picture )}}" height="80"
                                            width="60" />
                                        </a>

                                    </div>
                                </td>
                                <td>
                                    <a style="width: 49%;"
                                        href="{{url('admin/audiencequestion')}}/{{$audience->id}}/edit"
                                        class="btn btn-danger btn-sm">
                                        <span class="glyphicon glyphicon-edit"> </span> Edit
                                    </a>

                                </td>
                                <td>
                                    <form class="form-horizontal" enctype="multipart/form-data" method="POST"
                                        action="{{action('AdminController@audiencequestiondelete', $audience->id)}}">
                                        {{ csrf_field() }}
                                        <a style="width: 49%;"
                                            href="{{url('admin/audiencequestion')}}/{{$audience->id}}/delete"
                                            class="btn btn-danger btn-sm">
                                            <span class="glyphicon glyphicon-trash"> </span>
                                        </a>
                                    </form>
                                </td>

                            </tr>
                            @endforeach
                            @else
                            <tr>
                                <td> No Data Found</td>
                            </tr>
                            @endif
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

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


<!-- end row -->
@endsection

@section('footer-script')
@include('admin.layouts.datatable-footer-script')
@endsection