@extends('admin')
   
@section('css')


    <!-- Plugin stylesheets -->
  
   

    <!-- Plugin stylesheets -->
   
   
    <link href="{{ asset('admin/plugins/tables/dataTables/jquery.dataTables.css')}}" type="text/css" rel="stylesheet" />
    <link href="{{ asset('admin/plugins/tables/dataTables/TableTools.css')}}" type="text/css" rel="stylesheet" />

@endsection

@section('content')
   @include('admin_header')

    <div id="wrapper">

        <!--Responsive navigation button-->  
        <div class="resBtn">
            <a href="#"><span class="icon16 minia-icon-list-3"></span></a>
        </div>
        
        <!--Left Sidebar collapse button-->  
        <div class="collapseBtn leftbar">
             <a href="#" class="tipR" title="Hide Left Sidebar"><span class="icon12 minia-icon-layout"></span></a>
        </div>

        <!--Sidebar background-->
        <div id="sidebarbg"></div>
        <!--Sidebar content-->
       @include('admin_left_menu')
            <div id="content" class="clearfix">
                
            
          <div class="col-md-12">
              <div class="heading"><h3>My Users</h3></div>
          </div>
                 <div class="col-md-12 reul_msg">
          @if (Session::get('error_msg'))
              <div class="alert alert-danger">
                 <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                   <span aria-hidden="true">&times;</span>
                 </button>
                  {{Session::get('error_msg')}}
              </div>
          @endif
          @if (Session::get('succ_msg'))
              <div class="alert alert-success">
                 <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                   <span aria-hidden="true">&times;</span>
                 </button>
                  {{Session::get('succ_msg')}}
              </div>
          @endif
          </div>
             <div class="row">
                        <div class="col-lg-12">
                            <div class="panel panel-default gradient">
                                <div class="panel-heading">
                                    <h4>
                                        <span>Users List</span>
                                    </h4>
                                </div>
                                <div class="panel-body noPad clearfix">
                                    <table cellpadding="0" cellspacing="0" border="0" class="tableTools display table table-bordered" width="100%">
                                        <thead>
                                           <tr>
					       <th>S.No</th>
                                               <th>Name</th>
						<th>Email</th>
						
						<th>city</th>
						
                                                <th>selected profile</th>
                                                <th>Profile completed</th>
<!--                                                <th>activated</th>-->
                                                <th>Created At</th>
                                                <th>Actions</th>
					</tr>
                                        </thead>
                                        <tbody>
                                           @if($data->count() > 0)
                                           {{--*/ $i = 1 /*--}}
                                            @foreach($data as $pic)
                                             <tr>
                                             <td>{{$i}}</td>
                                             <td>{{$pic->name}}</td>
                                             <td>{{$pic->email}}</td>
                                            
                                             <td>{{$pic->city}}</td>
                                            
                                             <td>@if($pic->selected_profile=='T'){{'Talent'}}@endif @if($pic->selected_profile=='O'){{'Organization'}}@endif</td>
                                             <td>{{$pic->profile_completed}}</td>
<!--                                             <td>@if($pic->activated=='1'){{'Yes'}}@else {{'No'}}@endif</td>-->
                                             <td>{{ date('m/d/Y', strtotime($pic->created_at)) }}</td>
                                             <td><a href="<?php echo URL::to('/admin/user_edit/'.$pic->id.''); ?>" title="Edit"><span><i class="icon-edit"></i></span></a>
                                                 <a  href="javascript:void(0)" data-id="{{$pic->id}}"  class="chk_del" title="Delete"><i class="icon-remove-sign"></i></a>
                                               </td>
                                            </tr>
                                            {{--*/ $i++ /*--}}
                                             @endforeach 

                                        @endif
					
                                        </tbody>
                                       
                                    </table>
                                </div>

                            </div><!-- End .panel -->

                        </div><!-- End .span12 -->

                    </div><!-- End .row -->   
        
                <input type="hidden" name="_token" value="{{{ Session::getToken() }}}">
            </div>
    </div><!-- End #wrapper -->
    @endsection
    @section('js')
   
 
    <script src="{{ asset('js/maskedinput/jquery.maskedinput.min.js')}}"></script>
    <script src="{{ asset('js/bootbox.js')}}"></script>
  
    
    <script type="text/javascript" language="javascript">


$(document).ready(function() {
	
//for delete users

        $(document).on('click','.chk_del',function()
        {
          var pic_id = $(this).attr("data-id");
          bootbox.confirm("Are you sure, you want to delete User?", function(result)
          {
            if(result)location.href = '{{url("admin/users/")}}/'+pic_id+"/delete";
          });  
        });
 //end of delete users
 
        
 } );
        </script>
      

    <script type="text/javascript" src="{{ asset('admin/plugins/misc/nicescroll/jquery.nicescroll.min.js')}}"></script>
 
    <!-- Table plugins -->
    <script type="text/javascript" src="{{ asset('admin/plugins/tables/dataTables/jquery.dataTables.min.js')}}"></script>
 
   
    <script type="text/javascript" src="{{ asset('admin/plugins/tables/responsive-tables/responsive-tables1.js')}}"></script><!-- Make tables responsive -->

    <!-- Init plugins -->
   
    <script type="text/javascript" src="{{ asset('admin/js/datatable.js')}}"></script><!-- Init plugins only for page -->
   
    @endsection