@extends('main_layouts.admin_template')
@section('content')
    <div class="content-wrapper" style="min-height: 916px;">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                Edit {{ $data[0]->SportsName }}
            </h1>
            <ol class="breadcrumb">
                <li><a href="{{ url('/admin') }}"><i class="fa fa-dashboard"></i> Home</a></li>
                <li class="active">Edit {{ $data[0]->SportsName }}</li>
            </ol>
        </section>
        <!-- Main content -->
        <section class="content">
            <div class="box box-custom-color" style="min-height:450px;">
                <div class="box-body">
                    <div class="row">
                        <div class="col-sm-12">
                            <div id="updateSportsMsg"></div>
                        </div>
                        <form class="form-horizontal" id="frmUpdateSports"  enctype="multipart/form-data">
                            <div class="col-lg-12 col-sm-12">
        						<h3>Sports Information</h3>
        						<hr>
        					</div>
        					<div class="col-lg-6 col-sm-6">
                                <input type="hidden" class="form-control" id="_id" name="_id" value="{{ $data[0]->Id }}"/>
                                <div class="box-body">
                                    <div class="form-group">
                                        <label  class="col-sm-4 control-label">Sports Name</label>
                                        <div class="col-sm-8">
                                            <input type="text" class="form-control" id="_addSportsName" name="sportsName" placeholder="Sports Name" data-error="#err-sportsname"  reqiured="required" value="{{ $data[0]->SportsName }}"/>
                                            <span id="err-sportsname" style="color: #dd4b39"></span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label  class="col-sm-4 control-label">Generated URL</label>
                                        <div class="col-sm-8">
                                            <input type="text" class="form-control" id="generatedUrl" name="generatedUrl" placeholder="URL" data-error="#err-generatedUrl"  reqiured="required" value="{{ $data[0]->URL }}" />
                                            <span id="err-generatedUrl" style="color: #dd4b39"></span>
                                        </div>
                                    </div>
     							 </div>
                                  <!-- /.box-body -->
                            </div>
    						<div class="col-lg-6 col-sm-6">
                                <div class="box-body">
                                    <div class="form-group">

                                        <div class="col-sm-12">
                                            <label  class="control-label" >Image Preview <small id="label-suggest-upload">(pixel 300px x 300px)</small></label>
                                            <br><br>
                                            <img id="prev-img" src="{{ url('/public/') .'/'. $data[0]->Thumbnail }}" class="img img-responsive" alt="Preview Image" />
                                        </div>
                                    </div>
        							<div class="form-group">
        								<div class="col-sm-8">
        									<input name="previewImg" id="previewImg" class="form-control" type="file" onchange="readURL(this);" data-error="#err-previewImg" />
                                            <span id="err-previewImg" style="color: #dd4b39"></span>
        								</div>
        								<div class="col-sm-4">
        									<button type="button" onclick="clearImgEdit('{{ url('/public/') .'/'. $data[0]->Thumbnail }}');" class="btn btn-default btn-block">Clear</button>
        								</div>
        							</div>
     							 </div>
    						</div>

                            <div class="col-sm-12">
                                <hr>
                                <a href="{{ url('admin/sports') }}" class="btn btn-default">Cancel</a>
                                <button type="submit" id="updateSportsBtn" class="btn btn-primary">Update</button>
                            </div>
						</form>
                    </div>
                </div>
            </div>
        </section>
    <!-- /.content -->
    </div>
@endsection
