@extends('admin.main')
@section('content')
    <style>
        .previewImage {
            height: 150px;
            width: 95%;
            overflow: hidden;
            object-fit: contain;
        }

    </style>
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                Home Carousel
                <!-- <small>Optional description</small> -->
            </h1>
            <ol class="breadcrumb">
                <li><a href="{{ url('admin') }}"><i class="fa fa-dashboard"></i> Dashboard</a></li>
                <li class="active"> Home Carousel</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content container-fluid">
            <div class="row">
                <div class="col-md-12">
                    <div class="box">
                        <div class="box-header with-border">
                            <h4 class="box-title">Home Carousel</h4>
                            {{-- <button class="btn btn-primary pull-right" data-toggle="modal" data-target="#modal_show_stores"> <i class="fa fa-plus"></i> Add</button> --}}
                        </div>
                        <div class="box-body">
                            <div class="row">

                                {{-- <div class="col-md-3">
                                <div class="form-group">
                                    <label class="control-label">Filter By Store</label>
                                    <div id="store_filter"></div>
                                </div>
                            </div> --}}
                                <div class="col-md-12">
                                    <table class="table table-bordered table-condensed">
                                        <thead>
                                            <tr>
                                                <th>Image</th>
                                                <th>Link</th>
                                                <th>Is Active</th>
                                                <th>Date Created</th>
                                                <th class="text-center">Actions</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            @if (count($carousels) > 0)
                                                @foreach ($carousels as $carousel)
                                                    <tr>
                                                        <td>{{ $carousel->Image }}</td>
                                                        <td>{{ $carousel->Link }}</td>
                                                        <td>
                                                            @if ($carousel->IsActive)
                                                                Yes
                                                            @else
                                                                No
                                                            @endif

                                                        </td>
                                                        <td>{{ $carousel->created_at }}</td>
                                                        <td class="text-center">
                                                            {{-- <div class="checkbox">
                                                                <input type="checkbox" class="input-sm" @if ($carousel->IsActive) checked @endif
                                                                    id="store_hibernate" name="store_hibernate"
                                                                    data-toggle="toggle" data-width="100px"
                                                                    data-on="<i class='fa fa-check-circle'></i> Active"
                                                                    data-off="<i class='fa fa-ban'></i> Deactivated"
                                                                    data-size="small">
                                                            </div> --}}
                                                            <button class="btn btn-xs btn-primary" type="button" data-toggle="modal" data-target="#modal_home_carousel">Edit</button>
                                                            <button class="btn btn-xs btn-danger">Delete</button>
                                                        </td>
                                                    </tr>
                                                @endforeach
                                            @else
                                                <tr>
                                                    <td colspan="4" colspan="text-center">No Record Found</td>
                                                </tr>
                                            @endif

                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- /.content -->
    </div>
    <div class="modal fade" id="modal_home_carousel" role="dialog">
    <div class="modal-dialog">
        <!-- Modal content-->
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Edit Carousel</h4>
            </div>
            <div class="modal-body">
                <div id="modal_store_order_details_body_content">
                    <p> Loading content <i class="fa fa-spinner fa-spin"></i> </p>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>
@endsection
