@extends('layouts.admin')

@section('content')




        <!-- Content Wrapper. Contains expense content -->
        <div class="content-wrapper" style="margin-left:10px !important;">
            <!-- Content Header (expense header) -->
            <section class="content-header">
                <div class="container-fluid">
                    <div class="row mb-2">
                        <div class="col-sm-6">
                            <h1>Edit expense</h1>
                        </div>
                        <div class="col-sm-6">
                            <ol class="breadcrumb float-sm-right">
                                <li class="breadcrumb-item"><a href="#">Home</a></li>
                                <li class="breadcrumb-item active">CMS</li>
                            </ol>
                        </div>
                    </div>
                </div><!-- /.container-fluid -->
            </section>









            <!-- Main content -->
            <section class="content">
                <div class="row">
                    <div class="col-md-12">
                        <div class="success">
                            @if(session()->has('success'))
                                <div class="alert alert-success">
                                    {{ session()->get('success') }}
                                </div>
                            @endif


                        </div>
                        <form action="{{url('/admin/expenses/')}}/{{ $expense->id }}" method="post" enctype="multipart/form-data">
                            @csrf
                            @method('PUT')
      

<?php /*
$expense_types = \App\expense_types::all();
?>
                            <label for="expense_type">رقم السيارة</label>

<select name="expense_id" class="form-control" required="required">
    <option selected="selected" value="{{$expense->expense_id}}">
     @if($expense->expense_type <> null)
            {{ $expense->expense_type->title }}
     @endif
    </option>
@foreach($expense_types as $r)
        <option value="{{$r->id}}">{{$r->title}}</option>
@endforeach
</select>
<br> */ ?>


                        <div class="form-group">
                            <label for="expense_name">اسم المنصرف </label>
                            <input type="text" value="{{$expense->expense_name}}" name="expense_name" id="expense_name" class="form-control" id="expense_name" placeholder="Enter expense_name">
                            @error('expense_name') {{ $message }} @enderror

                        </div>

                        <div class="form-group">
                            <label for="expense_date"> تاريخ المنصرف </label>
                            <input type="date" value="{{$expense->expense_date}}"  name="expense_date" id="expense_date" class="form-control" id="" placeholder="Enter expense_date">
                            @error('expense_date') {{ $message }} @enderror

                        </div>



                        <div class="form-group">
                            <label for="expense_price">سعر المنصرف</label>
                            <input type="number"  value="{{$expense->expense_price}}" name="expense_price" class="form-control" id="expense_price" placeholder="Enter expense_price">
                            @error('car_no') {{ $message }} @enderror

                        </div>


                        <div class="form-group">
                            <label for="car_no">ملاحظات</label>
                            <textarea class="form-control" name="expense_note">{{$expense->expense_note}}</textarea>

                        </div>


                        <div class="expensed-footer">
                        <button class="btn btn-primary">تحديث</button>
                        </div>


                        </form>


                    </div>
                    <!-- /.col-->
                </div>
                <!-- ./row -->
            </section>
            <!-- /.content -->
        </div>
        <!-- /.content-wrapper -->





@endsection
