@extends('backend.layouts.app')

@section('title', 'Edit Admin Or Agnet ')

@push('styles')

    
@endpush


@section('content')
<style type="text/css">
    .mrg{margin-left:4px}

}

.img-thumbnail {
    padding: .25rem; 
        max-height: 200px;
    border-radius: 50%;
     background-color: #fff; 
     border: 1px solid #dee2e6; 
     border-radius: .25rem; 
     max-width: 100%; 
     height: auto; 
}
</style>

  <div class="block-header">
        <ol class="breadcrumb breadcrumb-col-pink">
                                <li><a href="/admin"><i class="material-icons">home</i> Home</a></li>
                                <li><a href="{{route('admin.comptes.index')}}"><i class="material-icons">library_books</i> Admins / Agents LIST </a></li>
                                <li class="active"><i class="material-icons">mode_edit</i> Edit Admin</li>
                            </ol>
    </div>



    <div class="row clearfix">
        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
            <div class="card">
                <div class="header bg-white">
                    <h2>Edit {{ ($admin->is_admin ? "Admin" : "Agent") }}</h2>
                </div>


                        <div class="body">



<!-- -------------------------------------Details----------------------------------------------- -->
             
             <div role="tabpanel" class="tab-pane fade in active" id="Details">

             <div class="row clearfix">
                    <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
                
                     <div class="card">
                        <div class="body"  style="background-color: rgba(46,204,113,0.1) !important;">
                              <div class="img text-center">
                             <img src="{{asset('storage/admins/'.$admin->image)}}" id="preview_img" data-oldimg="" class="img-thumbnail" style="max-height: 200px;border-radius: 50%" >
                               </div><br>     
                        <dl class="row">
                        <dt class="col-md-6">Full name :</dt>
                        <dd class="col-md-6">{{$admin->name}}</dd>
                        <dt class="col-md-6">Username:</dt>
                        <dd class="col-md-6">{{$admin->username}}</dd>
                        <dt class="col-md-4">Email :</dt>
                        <dd class="col-md-8">{{$admin->email}}</dd>
                        <dt class="col-md-6">Status :</dt>
                       <dd class="col-md-6 "><span class="badge {{$admin->status?'bg-green':'bg-red'}}">{{$admin->status?'ACTIVE':'INACTIVE'}}</span></dd>
                        <dt class="col-md-6">About:</dt>
                        <dd class="col-md-6">{{$admin->about}}</dd>                       
                      </dl>
                      </div>
                      </div>

                      </div>
              





                       <div class="col-lg-8 col-md-8 col-sm-8 col-xs-12">
                      <div class="card">
 
                       <div class="body" style="border-style: inset;">
             <form method="POST" action="{{route('admin.comptes.update',$admin->id)}}" enctype="multipart/form-data">
    
                          @csrf
                        @method('PUT')

                <div class="row clearfix">
                 <div class="col-sm-6">           
                    <div class="form-group form-float">
                        <div class="form-line">
                            <input type="text" name="name" id="tag_name1" class="form-control" value="{{$admin->name}}">
                            <label class="form-label"> <strong style="color:black"> Full Name </strong></label>
                            </div>
                    </div>
                </div>
                    
                    <div class="col-sm-6">      
                     <div class="form-group form-float">
                        <div class="form-line">
                            <input type="text" name="username" id="tag_name2" class="form-control" value="{{$admin->username}}">
                            <label class="form-label"> <strong style="color:black">Username</strong>  </label>
                            </div>
                    </div>
                     </div>
                   </div>

                 
                              


                <div class="row clearfix">
                  <div class="col-sm-12">
                    <div class="form-group form-float">
                        <div class="form-line">
                            <input type="email" name="email" id="tag_name1" class="form-control" value="{{$admin->email}}">
                            <label class="form-label"> <strong style="color:black"> Email </strong> </label>
                            </div>
                    </div>
                  </div>
                  </div>


               <div class="row clearfix">
                   <div class="col-sm-6">
                     <div class="form-group form-float">
                        <div class="form-line">
                            <input type="password" name="password" id="tag_name3" class="form-control">
                            <label class="form-label"> <strong style="color:black">password</strong> </label>
                            </div>
                             </div>
                         </div>
                    <div class="col-sm-6">
                    <div class="form-group form-float">
                        <div class="form-line">
                            <input type="password" name="password_confirmation" id="tag_name5" class="form-control">
                            <label class="form-label"><strong style="color:black">Confirm password</strong></label>
                            </div>
                       </div></div>

             </div><!-- row clearfix -->

                <div class="row clearfix">
                <div class="col-sm-12">
                <label for="publish"><strong style="color:black"> About  </strong> </label>
                    <div class="form-group">
                        <div class="form-line">
                       <textarea name="about" id="about" class="form-control" rows="4" style="border:1px solid black">
                         {{$admin->about}}
                       </textarea>
                            </div>
                    </div> 
                  </div>           
                 </div>


                <div class="row clearfix">
                <div class="col-sm-12">
                <label for="publish"><strong style="color:black"> Image : </strong> </label>
                    <div class="form-group">
                        <div class="form-line">
                       <input type="file" name="image" id="tag_name6" class="form-control" accept="image/*">
                            </div>
                    </div> 
                  </div>           
                 </div>

               <div class="row clearfix">

                  <div class="col-sm-6">
                        <div class="demo-switch">
                                <div class="switch">
                                    <label><input type="checkbox" id="is_admin" name="is_admin" {{$admin->is_admin == true ? 'checked' : ''}}  ><span class="lever"></span>Is Admin</label>
                                </div>
                            </div>
                    </div>

                  <div class="col-sm-6">
                        
                        <div class="demo-switch">
                                <div class="switch">
                                    <label><input type="checkbox" id="status" name="status" {{$admin->status == true ? 'checked' : ''}}  ><span class="lever"></span>Status</label>
                                </div>
                            </div>
                    </div>

               </div>   



        <button type="submit" class="btn btn-indigo btn-block m-t-15 waves-effect"><i class="material-icons">save </i> Save</button>



            </form>            
        </div> 



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



                            
                        </div><!-- tab-content -->
                    </div><!-- end body -->
            </div>
            <!-- #END# Example Tab -->
</div>
</div>
</div>



@endsection