@extends('backend.layouts.master')

@section('main-content')

<div class="card">
      <div class="row">
         <div class="col-md-12">
            @include('backend.layouts.notification')
         </div>
     </div>
    <h5 class="card-header">Edit Withdraw Request</h5>
    <div class="card-body">
      <form method="post" action="{{route('request.update',$withdrawRequest->id)}}">
        @csrf 
        <div class="form-group">
          <label for="inputTitle" class="col-form-label">User Name <span class="text-danger">*</span></label>
          <input type="hidden" name="user_id" value="{{ $withdrawRequest->user_id }}" >
          <input id="inputTitle" type="text" placeholder="Enter title" readonly value="{{ $user->name }}" class="form-control" required>
          @error('user_id')
          <span class="text-danger">{{$message}}</span>
          @enderror
        </div>

        <div class="form-group">
          <label for="email" class="col-form-label">Email <span class="text-danger">*</span></label>
          <input id="email" type="text" placeholder="Enter email" readonly value="{{ $user->email }}" class="form-control" required>
          @error('email')
          <span class="text-danger">{{$message}}</span>
          @enderror
        </div>

        <div class="form-group">
          <label for="transaction">Transaction <span class="text-danger">*</span></label>
          <input id="transaction" type="text" name="transaction" placeholder="Transaction" readonly value="{{ $withdrawRequest->transaction }}" class="form-control" required>
          @error('transaction')
          <span class="text-danger">{{$message}}</span>
          @enderror
        </div>

        <div class="form-group">
          <label for="points">Points <span class="text-danger">*</span></label>
          <input id="points" type="number" name="points" placeholder="Points" readonly value="{{ $withdrawRequest->points }}" class="form-control" required>
          @error('points')
          <span class="text-danger">{{$message}}</span>
          @enderror
        </div>

        <div class="form-group">
          <label for="remarks">Remarks <span class="text-danger">[Add transaction prove here, that customer can verify]</span></label>
          <input id="remarks" type="text" name="remarks" placeholder="Add your transaction hash here" value="{{ $withdrawRequest->remarks }}" class="form-control">
          @error('remarks')
          <span class="text-danger">{{$message}}</span>
          @enderror
        </div>
       
        <div class="form-group">
          <label for="status" class="col-form-label">Status <span class="text-danger">*</span></label>
          <select name="status" class="form-control" required>
            <option value="pending" @if($withdrawRequest->status == 'pending') selected @endif >Pending</option>
            <option value="processing" @if($withdrawRequest->status == 'processing') selected @endif >Processing</option>
            <option value="completed" @if($withdrawRequest->status == 'completed') selected @endif >Completed</option>
          </select>
          @error('status')
          <span class="text-danger">{{$message}}</span>
          @enderror
        </div>
        <div class="form-group mb-3">
           <button class="btn btn-success" type="submit">Update</button>
        </div>
      </form>
    </div>
</div>

@endsection

@push('styles')
<link rel="stylesheet" href="{{asset('backend/summernote/summernote.min.css')}}">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.1/css/bootstrap-select.css" />

@endpush
@push('scripts')
<script src="/vendor/laravel-filemanager/js/stand-alone-button.js"></script>
<script src="{{asset('backend/summernote/summernote.min.js')}}"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.1/js/bootstrap-select.min.js"></script>

<script>
    $('#lfm').filemanager('image');

    $('#lfm2').filemanager('files');

    $(document).ready(function() {
    $('#summary').summernote({
      placeholder: "Write short description.....",
        tabsize: 2,
        height: 150
    });
    });
    $(document).ready(function() {
      $('#description').summernote({
        placeholder: "Write detail Description.....",
          tabsize: 2,
          height: 150
      });
    });
</script>

@endpush