@extends('adminlte::page')
@section('content_header')
    <h1>Template</h1>
@stop
<script src="//code.jquery.com/jquery.js"></script>
@section('content')
<div class="row">
  <!--row starts-->
  <div class="col-md-12">
    <div class="panel panel-primary">
      <div class="panel-heading">
          <h3 class="panel-title">
             Show Template Data
          </h3>
      </div>
      <div class="panel-body">
        <form class="form-horizontal" action="{{ url('updatetemplatedata') }}" method="post" id="template" onsubmit="return validation();">
          <!-- CSRF Token -->
          <input type="hidden" name="_token" value="{{csrf_token()}}">
          <input type="hidden" name="template_id" value="{{$template->id}}">
                    <div class="form-group">
                        <label class="col-md-1 control-label" for="addr">Tile</label>
                        <div class="col-md-9">
                            <input id="title" name="title" class="form-control" value="{{$template->title}}">
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-1 control-label" for="addr">Top</label>
                        <div class="col-md-5">
                            <input id="top" name="top" class="form-control" value="{{$template->top}}">
                        </div>
                        <div class="col-md-4">
                          <select name="top_type" id="top_type" class="form-control">
                            <option value="0">Select One</option>
                            @if($template->top_type==1)
                            <option value="1" selected>Date</option>
                            @else
                            <option value="1">Date</option>
                            @endif

                             @if($template->top_type==2)
                            <option value="2" selected>Number</option>
                            @else
                           <option value="2">Number</option>
                            @endif

                             @if($template->top_type==3)
                            <option value="3" selected>Text</option>   
                            @else
                            <option value="3">Text</option>   
                            @endif


                            @if($template->top_type==4)
                            <option value="4" selected>Long Text</option>   
                            @else
                            <option value="4">Long Text</option>   
                            @endif

                            
                            

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

                    <div class="form-group">
                        <label class="col-md-1 control-label" for="addr">Top1</label>
                        <div class="col-md-5">
                            <input id="top1" name="top1" class="form-control" value="{{$template->top1}}">
                        </div>
                         <div class="col-md-4">
                          <select name="top1_type" id="top1_type" class="form-control">
                            <option value="0">Select One</option>
                            @if($template->top1_type==1)
                            <option value="1" selected>Date</option>
                            @else
                            <option value="1">Date</option>
                            @endif

                             @if($template->top1_type==2)
                            <option value="2" selected>Number</option>
                            @else
                           <option value="2">Number</option>
                            @endif

                             @if($template->top1_type==3)
                            <option value="3" selected>Text</option>   
                            @else
                            <option value="3">Text</option>   
                            @endif


                            @if($template->top1_type==4)
                            <option value="4" selected>Long Text</option>   
                            @else
                            <option value="4">Long Text</option>   
                            @endif

                            
                            

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

                    <div class="form-group">
                        <label class="col-md-1 control-label" for="addr">Top2</label>
                        <div class="col-md-5">
                            <input id="top2" name="top2" class="form-control" value="{{$template->top2}}">
                        </div>
                         <div class="col-md-4">
                          <select name="top2_type" id="top2_type" class="form-control">
                            <option value="0">Select One</option>
                            @if($template->top2_type==1)
                            <option value="1" selected>Date</option>
                            @else
                            <option value="1">Date</option>
                            @endif

                             @if($template->top2_type==2)
                            <option value="2" selected>Number</option>
                            @else
                           <option value="2">Number</option>
                            @endif

                             @if($template->top2_type==3)
                            <option value="3" selected>Text</option>   
                            @else
                            <option value="3">Text</option>   
                            @endif


                            @if($template->top2_type==4)
                            <option value="4" selected>Long Text</option>   
                            @else
                            <option value="4">Long Text</option>   
                            @endif

                            
                            

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

                    <div class="form-group">
                        <label class="col-md-1 control-label" for="addr">Top3</label>
                        <div class="col-md-5">
                            <input id="top3" name="top3" class="form-control" value="{{$template->top3}}">
                        </div>
                         <div class="col-md-4">
                          <select name="top3_type" id="top3_type" class="form-control">
                            <option value="0">Select One</option>
                            @if($template->top3_type==1)
                            <option value="1" selected>Date</option>
                            @else
                            <option value="1">Date</option>
                            @endif

                             @if($template->top3_type==2)
                            <option value="2" selected>Number</option>
                            @else
                           <option value="2">Number</option>
                            @endif

                             @if($template->top3_type==3)
                            <option value="3" selected>Text</option>   
                            @else
                            <option value="3">Text</option>   
                            @endif


                            @if($template->top3_type==4)
                            <option value="4" selected>Long Text</option>   
                            @else
                            <option value="4">Long Text</option>   
                            @endif

                            
                            

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

                    <div class="form-group">
                        <label class="col-md-1 control-label" for="addr">Mid</label>
                        <div class="col-md-5">
                            <input id="mid" name="mid" class="form-control" value="{{$template->mid}}">
                        </div>
                         <div class="col-md-4">
                          <select name="mid_type" id="mid_type" class="form-control">
                            <option value="0">Select One</option>
                            @if($template->mid_type==1)
                            <option value="1" selected>Date</option>
                            @else
                            <option value="1">Date</option>
                            @endif

                             @if($template->mid_type==2)
                            <option value="2" selected>Number</option>
                            @else
                           <option value="2">Number</option>
                            @endif

                             @if($template->mid_type==3)
                            <option value="3" selected>Text</option>   
                            @else
                            <option value="3">Text</option>   
                            @endif


                            @if($template->mid_type==4)
                            <option value="4" selected>Long Text</option>   
                            @else
                            <option value="4">Long Text</option>   
                            @endif

                            
                            

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

                    <div class="form-group">
                        <label class="col-md-1 control-label" for="addr">Mid1</label>
                        <div class="col-md-5">
                            <input id="mid1" name="mid1" class="form-control" value="{{$template->mid1}}">
                        </div>
                        <div class="col-md-4">
                          <select name="mid1_type" id="mid1_type" class="form-control">
                            <option value="0">Select One</option>
                            @if($template->mid1_type==1)
                            <option value="1" selected>Date</option>
                            @else
                            <option value="1">Date</option>
                            @endif

                             @if($template->mid1_type==2)
                            <option value="2" selected>Number</option>
                            @else
                           <option value="2">Number</option>
                            @endif

                             @if($template->mid1_type==3)
                            <option value="3" selected>Text</option>   
                            @else
                            <option value="3">Text</option>   
                            @endif


                            @if($template->mid1_type==4)
                            <option value="4" selected>Long Text</option>   
                            @else
                            <option value="4">Long Text</option>   
                            @endif

                            
                            

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

                    <div class="form-group">
                        <label class="col-md-1 control-label" for="addr">Mid2</label>
                        <div class="col-md-5">
                            <input id="mid2" name="mid2" class="form-control" value="{{$template->mid2}}">
                        </div>
                        <div class="col-md-4">
                          <select name="mid2_type" id="mid2_type" class="form-control">
                            <option value="0">Select One</option>
                            @if($template->mid2_type==1)
                            <option value="1" selected>Date</option>
                            @else
                            <option value="1">Date</option>
                            @endif

                             @if($template->mid2_type==2)
                            <option value="2" selected>Number</option>
                            @else
                           <option value="2">Number</option>
                            @endif

                             @if($template->mid2_type==3)
                            <option value="3" selected>Text</option>   
                            @else
                            <option value="3">Text</option>   
                            @endif


                            @if($template->mid2_type==4)
                            <option value="4" selected>Long Text</option>   
                            @else
                            <option value="4">Long Text</option>   
                            @endif

                            
                            

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

                    <div class="form-group">
                        <label class="col-md-1 control-label" for="addr">Mid3</label>
                        <div class="col-md-5">
                            <input id="mid3" name="mid3" class="form-control" value="{{$template->mid3}}">
                        </div>
                        <div class="col-md-4">
                          <select name="mid3_type" id="mid3_type" class="form-control">
                            <option value="0">Select One</option>
                            @if($template->mid3_type==1)
                            <option value="1" selected>Date</option>
                            @else
                            <option value="1">Date</option>
                            @endif

                             @if($template->mid3_type==2)
                            <option value="2" selected>Number</option>
                            @else
                           <option value="2">Number</option>
                            @endif

                             @if($template->mid3_type==3)
                            <option value="3" selected>Text</option>   
                            @else
                            <option value="3">Text</option>   
                            @endif


                            @if($template->mid3_type==4)
                            <option value="4" selected>Long Text</option>   
                            @else
                            <option value="4">Long Text</option>   
                            @endif

                            
                            

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

                    <div class="form-group">
                        <label class="col-md-1 control-label" for="addr">Bottom</label>
                        <div class="col-md-5">
                            <input id="bottom" name="bottom" class="form-control" value="{{$template->bottom}}">
                        </div>
                        <div class="col-md-4">
                          <select name="bottom_type" id="bottom_type" class="form-control">
                            <option value="0">Select One</option>
                            @if($template->bottom_type==1)
                            <option value="1" selected>Date</option>
                            @else
                            <option value="1">Date</option>
                            @endif

                             @if($template->bottom_type==2)
                            <option value="2" selected>Number</option>
                            @else
                           <option value="2">Number</option>
                            @endif

                             @if($template->bottom_type==3)
                            <option value="3" selected>Text</option>   
                            @else
                            <option value="3">Text</option>   
                            @endif


                            @if($template->bottom_type==4)
                            <option value="4" selected>Long Text</option>   
                            @else
                            <option value="4">Long Text</option>   
                            @endif

                            
                            

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

                    <div class="form-group">
                        <label class="col-md-1 control-label" for="addr">Bottom1</label>
                        <div class="col-md-5">
                            <input id="bottom1" name="bottom1" class="form-control" value="{{$template->bottom1}}">
                        </div>
                        <div class="col-md-4">
                          <select name="bottom1_type" id="bottom1_type" class="form-control">
                            <option value="0">Select One</option>
                            @if($template->bottom1_type==1)
                            <option value="1" selected>Date</option>
                            @else
                            <option value="1">Date</option>
                            @endif

                             @if($template->bottom1_type==2)
                            <option value="2" selected>Number</option>
                            @else
                           <option value="2">Number</option>
                            @endif

                             @if($template->bottom1_type==3)
                            <option value="3" selected>Text</option>   
                            @else
                            <option value="3">Text</option>   
                            @endif


                            @if($template->bottom1_type==4)
                            <option value="4" selected>Long Text</option>   
                            @else
                            <option value="4">Long Text</option>   
                            @endif

                            
                            

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

                    <div class="form-group">
                        <label class="col-md-1 control-label" for="addr">Bottom2</label>
                        <div class="col-md-5">
                            <input id="bottom2" name="bottom2" class="form-control" value="{{$template->bottom2}}">
                        </div>
                        <div class="col-md-4">
                          <select name="bottom2_type" id="bottom2_type" class="form-control">
                            <option value="0">Select One</option>
                            @if($template->bottom2_type==1)
                            <option value="1" selected>Date</option>
                            @else
                            <option value="1">Date</option>
                            @endif

                             @if($template->bottom2_type==2)
                            <option value="2" selected>Number</option>
                            @else
                           <option value="2">Number</option>
                            @endif

                             @if($template->bottom2_type==3)
                            <option value="3" selected>Text</option>   
                            @else
                            <option value="3">Text</option>   
                            @endif


                            @if($template->bottom2_type==4)
                            <option value="4" selected>Long Text</option>   
                            @else
                            <option value="4">Long Text</option>   
                            @endif

                            
                            

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

                    <div class="form-group">
                        <label class="col-md-1 control-label" for="addr">Bottom3</label>
                        <div class="col-md-5">
                            <input id="bottom3" name="bottom3" class="form-control" value="{{$template->bottom3}}">
                        </div>
                        <div class="col-md-4">
                          <select name="bottom3_type" id="bottom3_type" class="form-control">
                            <option value="0">Select One</option>
                            @if($template->bottom3_type==1)
                            <option value="1" selected>Date</option>
                            @else
                            <option value="1">Date</option>
                            @endif

                             @if($template->bottom3_type==2)
                            <option value="2" selected>Number</option>
                            @else
                           <option value="2">Number</option>
                            @endif

                             @if($template->bottom3_type==3)
                            <option value="3" selected>Text</option>   
                            @else
                            <option value="3">Text</option>   
                            @endif


                            @if($template->bottom3_type==4)
                            <option value="4" selected>Long Text</option>   
                            @else
                            <option value="4">Long Text</option>   
                            @endif
                          </select>
                          </div>
                    </div>
                    <!-- Form actions -->
                    <div class="form-position">
                        <div class="col-md-7 text-right">
                             <a href="{{url('template')}}"><button type="button" class="btn btn-responsive btn-danger btn-sm">Back</button></a>
                            <button type="submit" id="btn" class="btn btn-responsive btn-warning btn-sm">Update</button>
                        </div>
                    </div>
            </form>
        </div>
    </div>
  </div>
  <!--md-12 ends-->
</div>
<script>
function validation()
{
    if(document.getElementById('title').value=="")
    {
        alert(" Please select the title");
        document.getElementById('title').focus();
        return false;
    }
    document.getElementById("btn").disabled='true';
    return true;
}
</script>                     
@stop