
@extends('layout.master')

@section('content')

<div class="main-mobile-header doc-mobile-header">
      <a id="menuLink" href="#" class="menu-link"><i class="ri-menu-line"></i></a>
    </div>

   

    



     <div class="main main-app p-3 p-lg-4">
     	
        <div class="mb-4">
          <ol class="breadcrumb fs-sm mb-1">
            <li class="breadcrumb-item"><a href="#">Dashboard</a></li>
            <li class="breadcrumb-item active" aria-current="page">Edit Battery</li>
          </ol>
        </div>

      

      <div class="">
        
        <div class="row">

          <div class="col-lg-8">
            <h2 class="main-title">Edit Battery</h2>
            
          </div>
          <div style="text-align: right;" class="col-lg-4 text-right">
           <!--  <button type="button" class="btn btn-primary">Add Taxmaster</button> -->
            <!-- <a href="/form" class="btn btn-primary">Add Taxmaster</a>
 -->
          </div>

        </div>

        <hr class="main-separator">        
    
            
        <div class="card card-shadow-apply">
    <div class="card-body">
        <form method="POST" action="/battery/{{ $battery->id }}/update">
    @csrf
    
    <div class="row">
        <div class="col-md-4">
            <div class="mb-3">
                <label class="form-label">Battery ID</label>
                <input type="text" name="battery_id" class="form-control" value="{{ $battery->battery_id }}" required>
            </div>
        </div>
        <div class="col-md-4">
            <div class="mb-3">
                <label class="form-label">Brand</label>
                <input type="text" name="brand" class="form-control" value="{{ $battery->brand }}" required>
            </div>
        </div>
 
        <!-- <div class="col-md-4">
            <div class="mb-3">
                <label class="form-label">Model</label>
                <input type="text" name="model" class="form-control" value="{{ $battery->model }}" required>
            </div>
        </div>
        <div class="col-md-4">
            <div class="mb-3">
                <label class="form-label">Voltage</label>
                <input type="number" name="voltage" step="0.01" class="form-control" value="{{ $battery->voltage }}" required>
            </div>
        </div> -->
    
        <!-- <div class="col-md-4">
            <div class="mb-3">
                <label class="form-label">CCA (Cold Cranking Amps)</label>
                <input type="number" name="cca" class="form-control" value="{{ $battery->cca }}" required>
            </div>
        </div>
        <div class="col-md-4">
            <div class="mb-3">
                <label class="form-label">Reserve Capacity</label>
                <input type="number" name="reserve_capacity" class="form-control" value="{{ $battery->reserve_capacity }}" required>
            </div>
        </div> -->
    
        <div class="col-md-4">
            <div class="mb-3">
                <label class="form-label">Purchase Date</label>
                <input type="date" name="purchase_date" class="form-control" value="{{ $battery->purchase_date }}" required>
            </div>
        </div>
        <div class="col-md-4">
            <div class="mb-3">
                <label class="form-label">Purchase Cost</label>
                <input type="number" name="purchase_cost" step="0.01" class="form-control" value="{{ $battery->purchase_cost }}" required>
            </div>
        </div>
    
        <div class="col-md-4">
            <div class="mb-3">
                <label class="form-label">Installation Date</label>
                <input type="date" name="installation_date" class="form-control" value="{{ $battery->installation_date }}" required>
            </div>
        </div>
        <div class="col-md-4">
            <div class="mb-3">
                <label class="form-label">Vehicle ID</label>
                <input type="number" name="vehicle_id" class="form-control" value="{{ $battery->vehicle_id }}" required>
            </div>
        </div>
    </div>
    
    <!-- Add the rest of the fields here -->
    
    <div class="mb-3">
        <label class="form-label">Notes/Comments</label>
        <textarea name="notes_comments" class="form-control">{{ $battery->notes_comments }}</textarea>
    </div>
    
    <div class="mb-3">
        <label class="form-label">Status</label>
        <input type="text" name="status" class="form-control" value="{{ $battery->status }}" required>
    </div>
    
    <div class="mb-3">
        <button type="submit" class="btn btn-primary">Update Battery</button>
    </div>
</form>

    </div>
</div>






        <br><br><br>

        

      </div><!-- container -->

     
    <style>
    tbody tr:hover {background-color: #F5F5F5;}
    .card-example>.card-body::before {
    content: ""
    }
    </style>


<script>

</script>


<script>
    $(document).ready(function() {
        $("#tour_package").validate({
            rules: {
                package_name: {
                    required: true,
                    maxlength: 20,
                },
                destination: {
                    required: true,
                    maxlength: 20,
                },
                days: {
                    required: true,
                    maxlength: 20,
                },
                hotel_type: {
                    required: true,
                    maxlength: 20,
                },
                meal: {
                    required: true,
                    maxlength: 20,
                },
                currency: {
                    required: true,
                    maxlength: 20,
                },
                price_per_person: {
                    required: true,
                    maxlength: 20,
                },
            },
            messages: {
                package_name: {
                    required: "Package Name is required",
                    maxlength: "Package Name cannot be more than 20 characters"
                },

                destination: {
                    required: "Destination  is required",
                    maxlength: "Destination  cannot be more than 20 characters",
                },

                days: {
                    required: "Day is required",
                    maxlength: "Day cannot be more than 20 characters",
                },

                hotel_type: {
                    required: "Hotel is required",
                    maxlength: "Hotel cannot be more than 20 characters",
                },

                meal: {
                    required: "Meal Price is required",
                    maxlength: "Meal Price cannot be more than 20 characters",
                },

                currency: {
                    required: "Currency is required",
                    maxlength: "Currency cannot be more than 20 characters",
                },

                price_per_person: {
                    required: "Price is required",
                    maxlength: "Price cannot be more than 20 characters",
                },

            }
        });
    });

    $('.select2').select2();
</script>

@endsection

