@extends('admin.main')
@section('content')
<style>
.badge-error {
  background-color: #b94a48;
}
</style>
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
    <h1>
        List of Stores
        <!-- <small>Optional description</small> -->
    </h1>
    <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> Dashboard</a></li>
        <li class="active"> List of Stores</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">List of Stores</h4>
                        </div>
                        <div class="box-body">
                            <div class="row">
                                <div class="col-sm-12">
                                    <div class="well">
                                        <form class="form-horizontal" role="search" id="frm_search_store">
                                            <div class="col-lg-7">
                                                <div class="form-group">
                                                    <div class="col-sm-12">
                                                        <div class="input-group">
                                                            <input type="text" class="form-control" placeholder="Search Store" value="{{ $keyword }}" name="q">
                                                            <div class="input-group-btn">
                                                                <button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-lg-5">
                                                <div class="form-group">
                                                    <label  class="col-sm-7 control-label">Sort: </label>
                                                    <div class="col-sm-5">
                                                        <select class="form-control" name="s" id="select_sort_stores">
                                                            <option @if($filter == "latest") selected @endif value="latest">Recently Added</option>
                                                            <option @if($filter == "al-asc") selected @endif value="al-asc">Store Name A &rarr; Z</option>
                                                            <option @if($filter == "al-desc") selected @endif value="al-desc">Store Name Z &rarr; A</option>
                                                        </select>
                                                    </div>
                                                </div>
                                            </div>
                                        </form>
                                        <div class="clearfix"></div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                @if(count($teamstore_array) > 0)
                                    @foreach ($teamstore_array as $teamstore)
                                        <div class="item  col-xs-4 col-lg-3">
                                            <div class="thumbnail" style="padding: 5px;">
                                                <div class="store-logo">
                                                    <a href="{{ config('site_config.images_directory') . 'teamstore/'. $teamstore->StoreUrl . '/' . $teamstore->StoreLogo  }}"  data-toggle="lightbox">
                                                        <img class="img_store_logo_img"  id="img_store_banner" src="{{ config('site_config.images_directory') . 'teamstore/'. $teamstore->ImageFolder . '/' . $teamstore->StoreLogo  }}" style="max-width: 100%; max-height: 100%; ">
                                                    </a>
                                                </div>
                                                <div class="caption">
                                                    <h4 class="group inner list-group-item-heading" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
                                                        {{ $teamstore->StoreName }}
                                                    </h4>
                                                    <p class="group inner list-group-item-text">
                                                        <!-- Product description... Lorem ipsum dolor sit amet, consectetuer adipiscing elit,
                                                        sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. -->
                                                    </p>
                                                    <div class="row">
                                                        <div class="col-xs-12 col-md-6">
                                                            @if($teamstore->IsActive == "true")
                                                                <p><span class="badge badge-success">Public</span> @if($teamstore->Password != null)<i class="fa fa-lock" title="Password Protected"></i>@endif</p>
                                                            @else
                                                                <p><span class="badge badge-error">Private</span> @if($teamstore->Password != null)<i class="fa fa-lock" title="Password Protected"></i>@endif</p>
                                                            @endif
                                                        </div>
                                                    </div>
                                                    <div class="row">
                                                        <div class="col-xs-12 col-md-12">
                                                            <a href="{{ url('admin') . '/view-store/' . $teamstore->Id }}" class="btn btn-success btn-block">View / Edit</a>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    @endforeach
                                    
                                @else
                                    <div class="col-sm-12">
                                        <h3 style="color: #b5b5b5;">No Record Found</h3>
                                    </div>
                                @endif
                            </div>
                            
                        </div>
                        <div class="box-footer">   
                            <div class="row">
                                <div class="col-sm-12">
                                    <div class="text-center">
                                        {{ $teamstore_array->links() }}
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </section>
    <!-- /.content -->
</div>
@endsection