@extends('admin.app')

@section('page_title','All Type Educator') 

@section('page_location')
<ol class="breadcrumb">
      <li><a href="javascript:void('0');"><i class="fa fa-dashboard"></i> Home</a></li>
      <li><a href="javascript:void('0');">All  Educator</a></li>
      <li class="active">all</li>
</ol>
@endsection

@section('main-content')
  <div class="row">
            <div class="col-xs-12">
                  <div class="box">
                        <div class="box-header">
                              {{-- <h3 class="box-title" style="float: left;">View All Content Type</h3> --}}
                              {{-- {{ route('user.index') }} --}}
                              <!-- /.box-header -->
                                 @php $i=1; @endphp
                              @if(isset($educators))
                              <div class="box-body table-responsive no-padding">
                                    <table class="table table-hover">
                                          <tbody>
                                                <tr>
                                                      <th>Id</th>
                                                      <th>Coaching classes</th>
                                                      <th>Office address</th>
                                                      <th>Website address</th>
                                                      <th>City</th>
                                                      <th>State</th>
                                                      <th>Pincode</th>
                                                       <th>Pan no</th>
                                                        <th>Gst</th>
                                                         <th>Entity</th>
                                                         <th>Logo</th>
                                                         <th>Description</th>
                                                       <th>Status</th>
                                                      <th>Action</th>
                                                </tr>
                                                  @foreach($educators as $value)
                                          
                                                <td style="">{{ $i++ }}</td>
                                              
                                                <td style="">
                                                    {{ $value->coaching_classes }}
                                                </td>   
                                                 <td style="">
                                                    {{ $value->office_address }}
                                                </td>  
                                                 <td style="">
                                                    {{ $value->website_address }}
                                                </td>   
                                                 <td style="">
                                                    {{ $value->city }}
                                                </td>   
                                                 <td style="">
                                                    {{ $value->state }}
                                                </td>  
                                                 <td style="">
                                                    {{ $value->pincode }}
                                                </td>   
                                                 <td style="">
                                                    {{ $value->pan_no }}
                                                </td>    
                                                 <td style="">
                                                    {{ $value->gst_no }}
                                                </td>  
                                                  <td style="">
                                                    {{ $value->entity }}
                                                </td> 
                                                <td>
                                                  @php 
                                $photos =array();
                                if( !empty($value->logos))
                                {
                                  $photos = unserialize( $value->logos);
                                  if(count($photos)>0)
                                  {
                                    
                                    $img_path=url('/logo/'.$photos['photo1']); 
                                    echo '<img src="'.$img_path.'" width="100px">';
                                  }
                                  
                                }                             
                               @endphp
                             </td> 
                                                <td style="">
                                                     {{ strip_tags( html_entity_decode(stripslashes($value->description),ENT_QUOTES,"UTF-8") ) }}
                                                </td>                                           
                                                
                                                <td>
                                                      @if ($value->status== 1)
                                                      <span class="label label-success">Active</span>
                                                      @elseif($value->status== 0)
                                                      <span class="label label-danger">Inactive</span>
                                                      @endif
                                                </td>
                                                <td>                                                    
                                                      <a href="<?php echo url('/admin/educator/'.$value->id.'/edit');?>" title="Edit" style="color: black;">
                                                      <span class="pull-right-container">
                                                        <i class="fa fa-edit"></i>
                                                      </span>
                                                      </a>
                                                      <form action="{{ route('educator.destroy', $value->id ) }}" method="POST">
                                                          {{ method_field('DELETE') }}
                                                          {{ csrf_field() }}
                                                          <button><i class="fa fa-trash"></i> </button>
                                                      </form>
                                                                                                            
                                                     
                                                </td>
                                          </tr>
                                          @endforeach
                                    </tbody>
                              </table>
                              @endif
                        </div>
                  </div>
                  <!-- /.box -->
            </div>
      </div>
@endsection