@extends('layouts.dashboard')

@section('page_title')
	Bill and Payments
@endsection

@section('page_header_title')
Bill and Payments
@endsection

@section('page_body')

{{ Breadcrumbs::render('billandpayments') }}

<div class="row" style = "margin-bottom:10px;">
  <div class = "col-md-4">

  {{ Form::open(array('route' => 'billandpayments', 'id' => 'form_billandpayments', 'class' => 'cls_form' , 'method' => 'GET' , 'enctype'=>'multipart/form-data'
)) }}
<label>Expense Type:</label>
<select name="expense_type" class ="form-control form-control-sm" onchange="submitBillForm()">

  @foreach($billexpensetypes as $ty)
    <option value="{{$ty}}" @if($selected == $ty) selected @endif >{{$ty}}</option>
  @endforeach
</select>
{{ Form::close() }}
</div>
</div>



<div class="row row-cards row-deck">




              @foreach($categories as $row)
              <div class="col-md-3 col-sm-6">
                 <a  href="{{route('bill_category',['id' => Crypt::encrypt($row->id)])}}" style = "text-decoration: none;" >
                <div class="card box" >
                      <div class="card-status card-status-left bg-blue"></div>
                  <div class="card-body report-card text-center">
                    <div class ="col-md-12">
                        <h4> {{$row->name}}</h4>
                         </div>
                  </div>
                </div>
                </a>
              </div>
              @endforeach

              <div class="col-md-3 col-sm-6">
                 <a  data-toggle="modal" data-target="#md_add_category" style = "text-decoration: none;" >
                <div class="card box" >
                      <div class="card-status card-status-left bg-blue"></div>
                  <div class="card-body report-card text-center">
                    <div class ="col-md-12">
                        <h4> Others / Add new</h4>
                         </div>
                  </div>
                </div>
                </a>
              </div>

</div>

@endsection

@section('page_modal')
@include('bills.modals.add_category')
@endsection

@section('page_script')
<script>

function submitBillForm()
{
  $("#form_billandpayments").submit();
}

</script>
@endsection
