@extends('layout.app')

@section('content')

<div class="card">
    <div class="card-body">
        {{-- @dd($employee) --}}
        <form action="{{ route('payrollEmployee.update', $employee->id) }}" method="post" enctype="multipart/form-data">
            @csrf
            @method('PUT')
            <div class="row">
                <div class="col-md-12">
                    <h3><u>Employee Information</u></h3>
                    <hr>
                </div>
                <div class="col-md-4">
                    <label for="name">Employee Id</label>
                    <input type="text" class="form-control" name="name" value="{{ $employee->id }}" readonly>
                </div>
                <div class="col-md-4">
                    <label for="name">Employee Name</label>
                    <input type="text" class="form-control" name="name" value="{{ $employee->name }}">
                </div>
                <div class="col-md-4">
                    <label for="name">Employee Email</label>
                    <input type="text" class="form-control" name="email" value="{{ $employee->email }}">
                </div>
                <div class="col-md-4 mt-3">
                    <label for="name">Employee Phone</label>
                    <input type="number" class="form-control" name="mobile_personal" value="{{ $employee->mobile_personal }}">
                </div>
                <div class="col-md-4 mt-3">
                    <label for="name">Employee Address</label>
                    <input type="text" class="form-control" name="current_address" value="{{ $employee->current_address }}">
                </div>
                <div class="col-md-4 mt-3">
                    <label for="name">Employee NID</label>
                    <input type="number" class="form-control" name="nid" value="{{ $employee->nid }}">
                </div>
                <div class="col-md-4 mt-3">
                    <label for="name">Employee Department</label>
                    <input type="text" class="form-control" name="department" value="{{ $employee->department }}">
                </div>
                <div class="col-md-4 mt-3">
                    <label for="name">Employee Designation</label>
                    <input type="text" class="form-control" name="current_designation" value="{{ $employee->current_designation }}">
                </div>
                <div class="col-md-4 mt-3">
                    <label for="name">Joining Date</label>
                    <input type="date" class="form-control" name="join_date" value="{{ $employee->join_date }}">
                </div>
                <div class="col-md-4 mt-3">
                    <label for="name">Blood Group</label>
                    <input type="text" class="form-control" name="blode_group" value="{{ $employee->blode_group }}">
                </div>
                <div class="col-md-12 mt-4">
                    <h3><u>Employee Finance Information</u></h3>
                    <hr>
                </div>
                <div class="col-md-4">
                    <label for="name">Basic Salary</label>
                    <input type="number" class="form-control" name="current_salary" value="{{ $employee->current_salary }}">
                </div>
                <div class="col-md-4">
                    <label for="name">House Allowance</label>
                    <input type="number" class="form-control" name="house_allowance" value="{{ $employee->house_allowance }}">
                </div>
                <div class="col-md-4">
                    <label for="name">TA/DA Allowance</label>
                    <input type="number" class="form-control" name="transport_allowance" value="{{ $employee->transport_allowance }}">
                </div>
                <div class="col-md-4 mt-3">
                    <label for="name">Other Allowance</label>
                    <input type="number" class="form-control" name="other_allowance" value="{{ $employee->other_allowance }}">
                </div>
                <div class="col-md-4 mt-3">
                    <label for="name">Bonous</label>
                    <input type="number" class="form-control" name="bonous" value="{{ $employee->bonous }}">
                </div>
                <div class="col-md-4 mt-3">
                    <label for="name">Advance Salary</label>
                    <input type="number" class="form-control" name="advance_salary" value="{{ $employee->advance_salary }}">
                </div>

                <div class="col-md-12 mt-4">
                    <h3><u>Employee working Information</u></h3>
                    <hr>
                </div>
                <div class="col-md-4 mt-3">
                    <label for="name">Working Day</label>
                    <input type="number" class="form-control" name="working_day" value="{{ $employee->working_day }}">
                </div>
                <div class="col-md-4 mt-3">
                    <label for="name">Absent Day</label>
                    <input type="number" class="form-control" name="absent_day"value="{{ $employee->absent_day }}">
                </div>
                <div class="col-md-4 mt-3">
                    <label for="name">Salary Generate</label>
                    <select class="form-control" name="salary_generate" id="">
                        <option {{ ($employee->salary_generate == 1) ? 'selected' : '' }} value="1">Active</option>
                        <option {{ ($employee->salary_generate == 0) ? 'selected' : '' }} value="0">Inactive</option>
                    </select>
                </div>

            </div>
            <button class="btn btn-success mt-3" style="float: right" type="submit">Update Employee</button>
        </form>
    </div>
</div>

@endsection
