@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" id="example">
                                      <thead>
                                        <th>Id</th>
                                        <th>Coaching classes</th>
                                        <th>Discount(%)</th>
                                        <th>Referal Discount(%)</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 id="action_th">Action</th> 
                                      </thead>
                                      <tbody>
                                                 @foreach($educators as $value)
                                                <tr>
                                                <td style="">{{ $i++ }}</td>
                                              
                                                <td style="">
                                                    {{ $value->coaching_classes }}
                                                </td>   
                                                <td style="">
                                                            {{ $value->discount }}
                                                </td>
                                                <td style="">
                                                     {{ $value->referal_discount }}
                                                </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="">
                                                     @php
                                                      $description = strip_tags( html_entity_decode(stripslashes($value->description),ENT_QUOTES,"UTF-8")) 
                                                      @endphp
                                                     {{ str_limit($description, $limit = 50, $end = '...') }}
                                                   </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 class="action_box">
                                            @if(checkPermission(GetRoleID(Auth::user()->id),'edit-educator'))                                                  
                                                      <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>
                                                 @endif 
                                             @if(checkPermission(GetRoleID(Auth::user()->id),'delete-educator'))
                                                      <form action="{{ route('educator.destroy', $value->id ) }}" method="POST">
                                                          {{ method_field('DELETE') }}
                                                          {{ csrf_field() }}
                                                          <button><i class="fa fa-trash"></i> </button>
                                                      </form>
                                                 @endif                                                               
                                               </td>
                                          </tr>
                                          @endforeach
                                    </tbody>
                              </table>
                              @endif
                        </div>
                  </div>
                  <!-- /.box -->
            </div>
      </div>
@endsection