@extends('layouts.app')

@section('title')
Edit Unit Blockage Criteria
@stop

@section('breadcrumb')
<ol class="breadcrumb pull-right">
        <li><a href="{{route('home')}}"><i class="fa fa-dashboard"></i> Home</a></li>
        <li><a href="{{route('unitblockage.index')}}"><i class="fa fa-dashboard"></i> Unit Blockage Criteriat</a></li>
       
        <li class="active">Edit</li>
</ol>
@stop
@section('css')

<link href="https://cdn.datatables.net/1.10.24/css/jquery.dataTables.min.css" rel="stylesheet">
<link href="https://cdn.datatables.net/buttons/1.7.0/css/buttons.dataTables.min.css"  rel="stylesheet">

 
      <style type="text/css">
   .whitebox3 {
    background: #fff;
    padding: 18px 25px 10px 25px;
    margin-bottom: 30px;
    border-radius: 4px;
    }
    .circle {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        overflow: hidden;
        margin: 0 auto;
    }
    .box-title{
        font-weight: 700;
        font-size: 18px;
    }
    </style>
    

@stop

@section('content')


<div class="container-fluid">
    <form method="post" action="{{ route('unitblockage.update') }}" class="form-horizontal" id="receipt_form" enctype="multipart/form-data">
        {{ csrf_field() }}
        <input type='hidden' name='id' value="{{$unit_blockage->id}}">
        <div class="row">
            <div class="col-lg-12 col-sm-12 col-xs-12">
                @if ($errors->any())
                    <div class="white-box">
                        <h2>Errors</h2>
                        <ul>
                            {!! implode(
                                '',
                                $errors->all('<li><span
                                 class="help-block"><strong>:message</strong></span></li>'),
                            ) !!}
                        </ul>
                    </div>
                @endif
                <div class="whitebox3">
                <h3 class="box-title m-b-0">
                <i class="fa fa-plus-circle" aria-hidden="true"></i> Edit Unit Blockage Criteria</h3>
                <p class="text-muted m-b-30 font-13" style="height: 5px;"> Update the information </p>
                    <hr>



                    <div class="col-md-6" style="margin-top: 20px; margin-bottom: 20px;">
                       
                        <div class="form-group">
                            <label for="exampleInputuname" class="control-label col-md-4">Criteria Name 
                                <span style="color: red">*</span>
                            </label>
                            <div class="col-md-8">
                                <div class="input-group" style="width: 400px;">
                                    <input type="text" class="form-control" name="criteria"
                                          id="criteria" placeholder="add..." value='{{$unit_blockage->criteria_no}}'>
                                    @if ($errors->has('criteria'))
                                        <span class="help-block">
                                            <strong>{{ $errors->first('criteria') }}</strong>
                                        </span>
                                    @endif
                                </div>
                            </div> 
                        </div>

                        <div class="form-group">
                            <label for="exampleInputuname" class="control-label col-md-4">Add Number Of Days 
                                <span style="color: red">*</span>
                            </label>
                            <div class="col-md-8">
                                <div class="input-group" style="width: 400px;">
                                    <input type="number" class="form-control" name="number_of_days"
                                          id="number_of_days" placeholder="add..." value="{{$unit_blockage->total_days}}">
                                    @if ($errors->has('number_of_days'))
                                        <span class="help-block">
                                            <strong>{{ $errors->first('number_of_days') }}</strong>
                                        </span>
                                    @endif
                                </div>
                            </div> 
                        </div>

                        <div class="form-group">
                            <label for="exampleInputuname" class="control-label col-md-4">Add Due Amount
                                <span style="color: red">*</span>
                            </label>
                            <div class="col-md-8">
                                <div class="input-group" style="width: 400px;">
                                   
                                    <input type="number" class="form-control" name="due_amount"
                                    id="due_amount" placeholder="add..." value="{{$unit_blockage->total_amount}}">
                              @if ($errors->has('due_amount'))
                                  <span class="help-block">
                                      <strong>{{ $errors->first('due_amount') }}</strong>
                                  </span>
                              @endif
                                </div>
                            </div> 
                        </div>

                       
                        <div class="form-group">
                            <label for="exampleInputuname" class="control-label col-md-4">Status
                                
                            </label>
                            <div class="col-md-8">
                                <div class="input-group" style="width: 400px;">
                                     <select name='status' class='form-control'>
 
                                        @if($unit_blockage->status == 1)
                                        <option value='0'>In Active</option>
                                        <option value='1' selected>Active</option>
                                        @else
                                        <option value='0' selected>In Active</option>
                                        <option value='1' >Active</option>
                                        @endif
                                     </select>
                                    @if ($errors->has('description'))
                                        <span class="help-block">
                                            <strong>{{ $errors->first('description') }}</strong>
                                        </span>
                                    @endif
                                </div>
                            </div> 
                        </div>

                       
                       
                        <div class="form-group">
                            <label for="exampleInputuname" class="control-label col-md-4">Description
                                
                            </label>
                            <div class="col-md-8">
                                <div class="input-group" style="width: 400px;">
                                     <textarea name='description' style="width: 400px; height: 100px;"
                                     class='form-control' placeholder="add..." >{{$unit_blockage->description}}</textarea>
                                    @if ($errors->has('description'))
                                        <span class="help-block">
                                            <strong>{{ $errors->first('description') }}</strong>
                                        </span>
                                    @endif
                                </div>
                            </div> 
                        </div>


                            <div class=" col-sm-5" style="margin-left: 280px;">
                                <button type="submit" class="btn btn-info waves-effect waves-light m-t-10"
                                    style="width: 100%;">Save</button>
                            </div>


                    </div>
                    <div class="clearfix"></div>


                    <div class="clearfix"></div>
                    
                    
                </div>
            </div>
        </div>
    </form>
</div>

            
  
</div>


 

@stop

@section('js')
<script>
    function readURL(input) {
            if (input.files && input.files[0]) {
                var reader = new FileReader();

                reader.onload = function (e) {
                    $('#blah')
                        .attr('src', e.target.result)
                        .width(60)
                        .height(60);
                };

                reader.readAsDataURL(input.files[0]);
            }
        }
    </script>

   
@stop