@extends('layouts.app')

@section('content')

<!-- Content wrapper scroll start -->
<div class="content-wrapper-scroll">

<!-- Content wrapper start -->
<div class="content-wrapper">

    <!-- Row start -->
    <div class="row gutters">
        <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">

            <!-- Card start -->
            <div class="card">
                <div class="card-header-lg">
                    <h4>Account Settings</h4>
                </div>
                <div class="card-body">
    
                    <div class="row gutters">
                        <div class="col-xl-8 col-lg-8 col-md-12 col-sm-12 col-12">
                            <div class="row gutters">
                                <div class="col-xl-4 col-lg-4 col-md-4 col-sm-4 col-12">
                                    <img src="/img/user1.png" class="img-fluid change-img-avatar" alt="Image">
                                </div>
                                <div class="col-xl-8 col-lg-8 col-md-8 col-sm-8 col-12">
                                    <div id="dropzone-sm" class="mb-4">
                                        <form action="#" class="dropzone needsclick dz-clickable" id="demo-upload">

                                            <div class="dz-message needsclick">
                                                <button type="button" class="dz-button">Change Image.</button>
                                            </div>

                                        </form>
                                    </div>
                                </div>
                                <div class="col-xl-6 col-lg-6 col-md-6 col-sm-6 col-12">
                                    <!-- Field wrapper start -->
                                    <div class="field-wrapper">
                                        <input type="text" class="form-control" name="username" value="{{auth()->user()->name}}">
                                        <div class="field-placeholder">Full Name</div>
                                    </div>
                                    <!-- Field wrapper end -->
                                </div>
                                <div class="col-xl-6 col-lg-6 col-md-6 col-sm-6 col-12">
                                    <!-- Field wrapper start -->
                                    <div class="field-wrapper">
                                        <input type="text" class="form-control" value="{{auth()->user()->branch}}">
                                        <div class="field-placeholder">Assigned Outlet</div>
                                    </div>
                                    <!-- Field wrapper end -->
                                </div>
                                <div class="col-xl-6 col-lg-6 col-md-6 col-sm-6 col-12">
                                    <!-- Field wrapper start -->
                                    <div class="field-wrapper">
                                        <input type="email" class="form-control" value="{{auth()->user()->email}}">
                                        <div class="field-placeholder">Email</div>
                                    </div>
                                    <!-- Field wrapper end -->
                                </div>
                                <div class="col-xl-6 col-lg-6 col-md-6 col-sm-6 col-12">
                                    <!-- Field wrapper start -->
                                    <div class="field-wrapper">
                                        <input type="text" class="form-control" value="{{auth()->user()->sales_person_category}}">
                                        <div class="field-placeholder">Sales category</div>
                                    </div>
                                    <!-- Field wrapper end -->
                                </div>
                            </div>
                        </div>
                        <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12">
                            <div class="account-settings-block">
                                <div class="settings-block">
                                @if(auth()->user()->role == "Sales Person")
                                    <div class="settings-block-title">My Report Summary</div>
                                    @endif
                                    <div class="settings-block-body">
                                        <div class="pricing-chnage-plan">
                                         <!-- Top Actions - DateRange and Buttons -->
                                        @if(auth()->user()->role == "Sales Person")
                                        <form action="{{route('dateReportByUser')}}" method="GET">
                                                @csrf
                                        <div class="d-flex justify-content-end">
                                            <!-- Field wrapper start -->
                                            
                                            <div class="field-wrapper m-0">
                                                <div class="input-group">
                                                    <input type="text" name="user_id" id="user_id" hidden value="{{auth()->user()->id}}">
                                                    <input type="text" name="date" class="form-control custom-daterange2">
                                                    <span class="input-group-text">
                                                        <i class="icon-calendar1"></i>
                                                    </span>
                                                </div>
                                                <div class="field-placeholder">Select Date</div>
                                            </div>
                                            <!-- Field wrapper end -->
                                            <button type="submit" class="btn btn-primary"><i class="fa fa-eye" aria-hidden="true"></i></button>
                                        </div>
                                    </form>
                                    @endif

                                        </div>
                                    </div>
                                </div>
                                <div class="settings-block">
                                    <div class="settings-block-title">Change Password</div>
                                    <div class="settings-block-body">
                                        <div class="list-group">
                                        <form action="{{route('changePassword', auth()->user()->id)}}" method="post">
                								@csrf
											<div aria-labelledby="chngPwd" data-bs-parent="#settingsAccordion">
												<div class="accordion-body">
													<div class="field-wrapper">
														<input type="text" name="old_password" required>
														<div class="field-placeholder">Current Password</div>
													</div>
													<div class="field-wrapper">
														<input type="password" name="password" required>
														<div class="field-placeholder">New Password</div>
													</div>
													<div class="field-wrapper">
														<input type="password" name="password_confirmation" required>
														<div class="field-placeholder">Confirm Password</div>
													</div>
													<div class="field-wrapper m-0">
														<button class="btn btn-primary stripes-btn">Save</button>
													</div>

												</div>
											</div>
										</form>
                                            
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                </div>
            </div>
            <!-- Card end -->

        </div>
    </div>
    <!-- Row end -->

</div>
<!-- Content wrapper end -->
@endsection