@extends('layouts.master')
@section('css')

@endsection
@section('content')



<div class="">
    
<div class="right_cols" role="main">
  <div class="">
    <div class="row top_tiles">
      <div class="animated flipInY col-lg-3 col-md-3 col-sm-6 col-xs-12">
        <div class="tile-stats">
          <div class="icon"><i class="fa fa-sun-o"></i></div>
          <div class="count">{{ $total }}</div>
          <h3 class="" style="color: #1ABB9C">Total Clients</h3>
        </div>
      </div>
      <div class="animated flipInY col-lg-3 col-md-3 col-sm-6 col-xs-12">
        <div class="tile-stats">
          <div class="icon"><i class="fa fa-comments-o"></i></div>
          <div class="count">{{ $sms }}</div>
          <h3 style="color: #1ABB9C">SMS Clients</h3>
          <!-- <p>Lorem ipsum psdea itgum rixt.</p> -->
        </div>
      </div>
      <div class="animated flipInY col-lg-3 col-md-3 col-sm-6 col-xs-12">
        <div class="tile-stats">
          <div class="icon"><i class="fa fa-mobile-phone"></i></div>
          <div class="count">{{ $ussd }}</div>
          <h3 style="color: #1ABB9C">USSD Client</h3>
          <!-- <p>Lorem ipsum psdea itgum rixt.</p> -->
        </div>
      </div>
      <div class="animated flipInY col-lg-3 col-md-3 col-sm-6 col-xs-12">
        <div class="tile-stats">
          <div class="icon"><i class="fa fa-bullhorn"></i></div>
          <div class="count">{{ $voice }}</div>
          <h3 style="color: #1ABB9C">Voice Clients</h3>
          <!-- <p>Lorem ipsum psdea itgum rixt.</p> -->
        </div>
      </div>
    </div>
  </div>
</div>



<div class="row">
  <div class="col-md-4">
    <div class="x_panel">
      <div class="x_title">
        <h2 class="blue">Recent Activities </h2>
        
        <div class="clearfix"></div>
      </div>
      <div class="x_content">
         <div class="dashboard-widget-content">

            <ul class="list-unstyled timeline widget">
              @if($user_activities->isEmpty() == false)
              @foreach($user_activities as $userrow)
              <li>
                <div class="block">
                  <div class="block_content">
                    <h2 class="title">
                      <a>{{ $userrow->content }}</a>
                      </h2>
                    <div class="byline">
                      <span>{{ $userrow->activity_time }}</span> 
                      <!-- by <a>Jane Smith</a> -->
                    </div>
                    <p class="excerpt"></p>
                  </div>
                </div>
              </li>
              @endforeach
              @endif
              
            </ul>
          </div>
      </div>
    </div>
  </div>              
  <div class="col-md-4">
    <div class="x_panel">
      <div class="x_title">
        <h2 class="red">Contracts Expiry Dates </h2>
        
        <div class="clearfix"></div>
      </div>
      <div class="x_content">
        @if($expiring_contracts->isEmpty() == false)
        @foreach($expiring_contracts as $row)
        <article class="media event">
          <a class="pull-left date" style="background-color: #de9a24">
            
            <p class="month" style="margin-top: -4px; margin-bottom: -4px;">{{ date("M", strtotime($row->contract_validity)) }}</p>
            <p class="day" style="font-size: 22px !important">{{ date("d", strtotime($row->contract_validity)) }}</p>
            <p class="text-center" style="color:#fff; margin-bottom: -4px; margin-top: -4px;">{{ date("Y", strtotime($row->contract_validity)) }}</p>

          </a>
          <div class="media-body">
            <a class="title" title="View Client Details" href="{{ url('clients', $row->id) }}">{{ $row->name }}</a>
            <p class="">Contract Type : {{ strtoupper($row->contract_type) }}</p>
            <p class="">Auto Renew : {{ strtoupper($row->contract_auto_renew) }}</p>

          </div>
        </article>
        @endforeach
        @else
          <article class="media event">
          <a class="pull-left date">
            <p class="month">00</p>
            <p class="day">00</p>
          </a>
          <div class="media-body">
            <a class="title" href="#"></a>
            <p>No Records</p>
          </div>
        </article>
        @endif
        
      </div>
    </div>
  </div>
  <div class="col-md-4">
    <div class="x_panel">
      <div class="x_title">
        <h2 class="green">Newly Added Clients</h2>                    
        <div class="clearfix"></div>
      </div>
      <div class="x_content">
        @if($recent_clients->isEmpty() == false)
        @foreach($recent_clients as $recentrow)
        <article class="media event">
          <a class="pull-left date" style="background-color: #de9a24">
            
            <p class="month" style="margin-top: -4px; margin-bottom: -4px;">{{ date("M", strtotime($recentrow->created_at)) }}</p>
            <p class="day" style="font-size: 22px !important">{{ date("d", strtotime($recentrow->created_at)) }}</p>
            <p class="text-center" style="color:#fff; margin-bottom: -4px; margin-top: -4px;">{{ date("Y", strtotime($recentrow->created_at)) }}</p>

          </a>
          <div class="media-body">
            <a class="title" title="View Client Details" href="{{ url('clients', $row->id) }}">{{ $recentrow->name }}</a>
            <p class="">Company Type : {{ strtoupper($recentrow->company_type) }}</p>
            <p class="">Account Manager : {{ strtoupper($recentrow->auth_user_info->name) }}</p>

          </div>
        </article>
        @endforeach
        @else
          <article class="media event">
          <a class="pull-left date">
            <p class="month">00</p>
            <p class="day">00</p>
          </a>
          <div class="media-body">
            <a class="title" href="#"></a>
            <p>No Records</p>
          </div>
        </article>
        @endif
      </div>
    </div>
  </div>

  
</div>

</div>
@endsection
@section('javascript')

  <!-- DateJS -->
  <script src="{{ url('public/assets/vendors/DateJS/build/date.js') }}"></script>
  <script src="{{ url('public/assets/js/dashboard.js') }}"></script>


@endsection