<div class="content-wrapper" ng-if="!myAccess.resourcePoolList">
    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-6 offset-sm-1 offset-md-2 offset-lg-3 mt-5">
                <div class="alert alert-warning alert-dismissible">
                    <h5><i class="icon fas fa-ban"></i> Warning!</h5>
                    Unauthorised Access.
                </div>
            </div>
        </div>
    </div>
</div>
<div class="content-wrapper" ng-if="myAccess.resourcePoolList">
    <section class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <h1 class="text-danger">
                        <go-back/>
                        <i class="fas fa-users"></i> Resource Pool List
                    </h1>
                </div>
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-right">
                        <li class="breadcrumb-item"><a ng-href="{{baseurl}}/dashboard">Home</a></li>
                        <li class="breadcrumb-item active">Pools</li>
                    </ol>
                </div>
            </div>
        </div>
    </section>
    <section class="content">
        <div class="container-fluid">
            <div class="row">
                
                
                <div data-info="100% Pool (n)" class="col-md-12" ng-if="pool.name==='100% Pool'" ng-repeat="pool in poolDatas">
                    <div class="card card-warning collapsed-card card-outline {{pool.cardOutline}}">
                        <div class="card-header border-transparent">
                            <h3 class="card-title">{{pool.name}} ({{pool.data.length}})</h3>
                            <div class="card-tools">
                                <div class="btn-group btn-group-sm mt--5">
                                    <button type="button" data-table-name="Pool100" class="toggle-vis btn btn-xs btn-{{colOptions.Pool100.email ? 'dark' : 'default'}}" data-column="4" ng-click="colOptions.Pool100.email = !colOptions.Pool100.email">Email <i class="fas fa-{{colOptions.Pool100.email ? 'eye' : 'eye-slash'}}"></i></button>
                                    <button type="button" data-table-name="Pool100" class="toggle-vis btn btn-xs btn-{{colOptions.Pool100.mobile ? 'dark' : 'default'}}" data-column="5" ng-click="colOptions.Pool100.mobile = !colOptions.Pool100.mobile">Mobile <i class="fas fa-{{colOptions.Pool100.mobile ? 'eye' : 'eye-slash'}}"></i></button>
                                    <button type="button" data-table-name="Pool100" class="toggle-vis btn btn-xs btn-{{colOptions.Pool100.code ? 'dark' : 'default'}}" data-column="3" ng-click="colOptions.Pool100.code = !colOptions.Pool100.code">Code <i class="fas fa-{{colOptions.Pool100.code ? 'eye' : 'eye-slash'}}"></i></button>
                                    <button type="button" data-table-name="Pool100" class="toggle-vis btn btn-xs btn-{{colOptions.Pool100.skills ? 'dark' : 'default'}}" data-column="12" ng-click="colOptions.Pool100.skills = !colOptions.Pool100.skills">Skills <i class="fas fa-{{colOptions.Pool100.skills ? 'eye' : 'eye-slash'}}"></i></button>
                                    <button type="button" data-table-name="Pool100" class="toggle-vis btn btn-xs btn-{{colOptions.Pool100.IsCertified ? 'dark' : 'default'}}" data-column="13" ng-click="colOptions.Pool100.IsCertified = !colOptions.Pool100.IsCertified">Is Certified <i class="fas fa-{{colOptions.Pool100.IsCertified ? 'eye' : 'eye-slash'}}"></i></button>
                                    <button type="button" class="btn btn-dark" data-widget="collapse"><i class="fas fa-plus"></i></button>
                                </div>
                            </div>
                        </div>
                        <div class="card-body p-0">
                            <div class="col-sm-12">
                                <!-- <div class="col-sm- float-left"></div> -->
                                <div class="col-sm-12">
                                    <!-- <select  class="form-control" ng-model="selRevenueCenter" ng-change="selRevenue(selRevenueCenter)">
                                        <option value="0">Select Revenue Centre</option>
                                        <option ng-repeat="x in allRCs" value="{{x.revenuecenterid}}">{{x.rc_name}}</option>
                                    </select> -->
                                    <label for="revenueCenters">Select Revenue Center(s) </label>
                                    <a class="btn btn-xs btn-outline-primary" ng-click="selectAllrevenueCenters()">Select All </a>
                                    <button class="btn btn-xs btn-outline-primary" ng-click="refreshData()">Refresh List</button> 
                                    <ui-select id="revenueCenters" multiple ng-model="selRevenueCenter.ids" ng-click="getRCIds()" theme="bootstrap" title="Select  Revenue Center" class="">
                                        <ui-select-match placeholder="Select or search a Revenue Center in the list...">{{$item.rc_name}}</ui-select-match>
                                        <ui-select-choices repeat="rc.revenuecenterid as rc in allRCs | filter: $select.search">
                                            <span ng-bind-html="rc.rc_name | highlight: $select.search"></span>
                                        </ui-select-choices>
                                    </ui-select>      
                                                            
                                </div>
                                <!-- <div class="col-sm-3 float-left">
                                    <button class="btn btn-success" ng-click="selRevenue2()">Show All</button>
                                </div> -->
                            <!-- <div class="col-sm-3">
                                <select  class="form-control" ng-model="selRevenueCenter" ng-change="selRevenue(selRevenueCenter)">
                                    <option value="0">Select Revenue Centre</option>
                                    <option ng-repeat="x in allRCs" value="{{x.revenuecenterid}}">{{x.rc_name}}</option>
                                </select>
                               
                            </div> -->
                            <!-- <div class="col-sm-3 float-left">
                                <button class="btn btn-success" ng-click="resetList()">Show All</button>
                            </div> -->
                            </div>
                            <br><br>
                            <div class="table-responsive">
                                <table id="poolList{{$index}}" style="width:100%;" class="poolList table table-bordered table-striped table-sm" data-name="Pool100" data-col-hide="9">
                                    <thead>
                                    <tr>
                                        <th>#</th>
                                        <th>Name</th>
                                        <th>Batch Code</th>
                                        <th>Code</th>
                                        <th>Email</th>
                                        <th>Mobile</th>
                                        <th>Revenue Center</th>
                                        <th>Department</th>
                                        <th>Designation</th>
                                        <th>Manager</th>
                                        <th data-toggle="tooltip" title="Date of Joining">DoJ <i class="fas fa-question-circle"></i></th>
                                        <th class="nowrap" data-toggle="tooltip" title="Year of Experience">YoE <i class="fas fa-question-circle"></i></th>
                                        <th>Skills</th>
                                        <th>Is Certified</th>
                                        <th>Last Allocated Date</th>
                                        <th>Aging (Days)</th>
                                        <th ng-if="gUser.is_admin">Pool</th>
                                        <th>Actions</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr ng-if="pool.data.length==0">
                                        <td colspan="18" class="text-center">No data available in table.</td>
                                    </tr>   
                                    <tr ng-repeat="hero in pool.data track by $index">
                                        <td>{{ $index+1 }}</td>
                                        <td>
                                            <a class="nowrap" target="_blank" title="Hero Goals" href="{{'/goal-dashboard/list/'+hero.employeeid}}/"><i class="fas fa-external-link-alt"></i></a>
                                            <a class="nowrap" target="_blank" title="Hero View" href="{{'/heroes/view/'+hero.employeeid}}"><i class="fas fa-external-link-alt"></i></a> 
                                            <a class="nowrap" target="_blank" title="Hero Timeline" href="{{'/heroes/project/timeline/'+hero.employeeid}}"><i class="fas fa-external-link-alt"></i> {{hero.emp_first_name + ' ' + hero.emp_last_name}}</a>
                                            <span class=""><a target="_blank"  href="{{'/heroes/feedback/'+hero.employeeid}}"><i class="fas fa-comments"/> </a></span></td>
                                        <td><span>{{ hero.emp_batch_code ? hero.emp_batch_code  : ''}}</span></td>
                                        <td><span>{{'(' + hero.emp_code + ')'}}</span></td>
                                        <td><span class="nowrap"><a href="{{'mailto:'+hero.emp_email}}" target="_blank">{{hero.emp_email}}</a></span></td>
                                        <td><span class=""><a target="_blank" href="{{'tel:+91'+hero.emp_mobile}}">{{hero.emp_mobile}}</a></span></td>
                                        <td><span>{{ hero.rc_name }}</span></td>
                                        <td><span class="badge {{hero.emp_department.toLowerCase()}}">{{hero.emp_department}}</span></td>
                                        <td><span class="nowrap">{{hero.emp_designation}}</span></td>
                                        <td><span class="text-blue pointer" ng-click="goToSelf('heroView',{employeeid:hero.linemgr.employeeid})">{{hero.linemgr.emp_first_name + ' ' + hero.linemgr.emp_last_name}}</span></td>
                                        <td><span class="nowrap">{{hero.emp_doj | date:'dd MMM yyyy'}}</span></td>
                                        <td><span class="nowrap" ng-if="hero.emp_yoe">{{hero.emp_yoe}}</span></td>
                                        <td>
                                            <small class="badge bg-primary ml-1" ng-repeat="sk in hero.emp_skills.split(',')">{{sk}}</small>
                                        </td>
                                        <td><span class="nowrap"><a href="/mycertificate/report-heroview/{{hero.employeeid}}" target="_blank" ng-if="hero.is_certified==true && hero.cert_hero_id=='0' ">Yes (Not Uploaded)</a>  <a href="/mycertificate/report-heroview/{{hero.employeeid}}" target="_blank" ng-if="hero.is_certified==true && hero.cert_hero_id=='1' ">Yes</a>  <span ng-if="hero.is_certified==false">No</span> </span></td>
                                        <td>{{hero.lastAlloDate | datetz:'DD MMM YYYY'}}</td>
                                        <td>{{hero.aging}}</td>
                                        <td ng-if="gUser.is_admin"><span class="{{'badge '+poolStatus(hero.emp_pool)}}">{{hoursToPercent(hero.emp_pool)}}</span></td>
                                        <td>
                                            <div class="btn-group nowrap">
                                                <button type="button" class="btn btn-danger" ng-click="goToSelf('heroView',{employeeid:hero.employeeid})"><i class="fas fa-eye"></i> View</button>
                                                <button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown">
                                                    <span class="caret"></span>
                                                    <span class="sr-only">Toggle Dropdown</span>
                                                </button>
                                                <div class="dropdown-menu dropdown-menu-right" role="menu">
                                                    <button class="dropdown-item" ng-click="goToSelf('heroEdit',{employeeid:hero.employeeid})"><i class="fas fa-pen"></i> Edit</button>
                                                    <button class="dropdown-item" ng-click="goToSelf('heroProjectAdd',{employeeid:hero.employeeid})"><i class="fas fa-user"></i> Assign Project</button>
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    <!-- <tr ng-if="tArray.length0">
                                        <td colspan="18">No Data Found</td>
                                    </tr> -->
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
                <div data-info="Partial Pool (n)" class="col-md-12" ng-if="pool.name!=='100% Pool'" ng-repeat="pool in poolDatas">
                    <div class="card card-warning collapsed-card card-outline {{pool.cardOutline}}">
                        <div class="card-header border-transparent">
                            <h3 class="card-title">{{pool.name}} ({{pool.data.length}})</h3>
                            <div class="card-tools">
                                <div class="btn-group btn-group-sm mt--5">
                                    <button type="button" data-table-name="PartialPool{{$index}}" class="toggle-vis btn btn-xs btn-{{colOptions['PartialPool'+$index].email ? 'dark' : 'default'}}" data-column="2" ng-click="colOptions['PartialPool'+$index].email = !colOptions['PartialPool'+$index].email">Email <i class="fas fa-{{colOptions['PartialPool'+$index].email ? 'eye' : 'eye-slash'}}"></i></button>
                                    <button type="button" data-table-name="PartialPool{{$index}}" class="toggle-vis btn btn-xs btn-{{colOptions['PartialPool'+$index].mobile ? 'dark' : 'default'}}" data-column="3" ng-click="colOptions['PartialPool'+$index].mobile = !colOptions['PartialPool'+$index].mobile">Mobile <i class="fas fa-{{colOptions['PartialPool'+$index].mobile ? 'eye' : 'eye-slash'}}"></i></button>
                                    <button type="button" data-table-name="PartialPool{{$index}}" class="toggle-vis btn btn-xs btn-{{colOptions['PartialPool'+$index].code ? 'dark' : 'default'}}" data-column="1" ng-click="colOptions['PartialPool'+$index].code = !colOptions['PartialPool'+$index].code">Code <i class="fas fa-{{colOptions['PartialPool'+$index].code ? 'eye' : 'eye-slash'}}"></i></button>
                                    <button type="button" data-table-name="PartialPool{{$index}}" class="toggle-vis btn btn-xs btn-{{colOptions['PartialPool'+$index].skills ? 'dark' : 'default'}}" data-column="9" ng-click="colOptions['PartialPool'+$index].skills = !colOptions['PartialPool'+$index].skills">Skills <i class="fas fa-{{colOptions['PartialPool'+$index].skills ? 'eye' : 'eye-slash'}}"></i></button>
                                    <button type="button" class="btn btn-dark" data-widget="collapse"><i class="fas fa-plus"></i></button>
                                </div>
                            </div>
                        </div>
                        <div class="card-body p-0">
                            <div class="table-responsive">
                                <table id="poolList_{{$index}}" style="width:100%;" class="poollist2 table table-bordered table-striped table-sm" data-name="PartialPool{{$index}}" data-col-hide="9">
                                    <thead>
                                    <tr>
                                        <th>Name</th>
                                        <th>Code</th>
                                        <th>Email</th>
                                        <th>Mobile</th>
                                        <th>Department</th>
                                        <th>Designation</th>
                                        <th>Manager</th>
                                        <th data-toggle="tooltip" title="Date of Joining">DoJ <i class="fas fa-question-circle"></i></th>
                                        <th class="nowrap" data-toggle="tooltip" title="Year of Experience">YoE <i class="fas fa-question-circle"></i></th>
                                        <th>Skills</th>
                                        <th ng-if="gUser.is_admin">Pool</th>
                                        <th>Actions</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr ng-repeat="hero in pool.data">
                                        <td><a class="nowrap" target="_blank" href="{{'/heroes/view/'+hero.employeeid}}"><i class="fas fa-external-link-alt"></i> {{hero.emp_first_name + ' ' + hero.emp_last_name}}</a>
                                            <span class=""><a target="_blank" href="{{'/heroes/feedback/'+hero.employeeid}}"><i class="fas fa-comments"/> </a></span>
                                        </td>
                                        <td><span>{{'(' + hero.emp_code + ')'}}</span></td>
                                        <td><span class="nowrap"><a href="{{'mailto:'+hero.emp_email}}" target="_blank">{{hero.emp_email}}</a></span></td>
                                        <td><span class=""><a target="_blank" href="{{'tel:+91'+hero.emp_mobile}}">{{hero.emp_mobile}}</a></span></td>
                                        <td><span class="badge {{hero.emp_department.toLowerCase()}}">{{hero.emp_department}}</span></td>
                                        <td><span class="nowrap">{{hero.emp_designation}}</span></td>
                                        <td><span class="text-blue pointer" ng-click="goToSelf('heroView',{employeeid:hero.linemgr.employeeid})">{{hero.linemgr.emp_first_name + ' ' + hero.linemgr.emp_last_name}}</span></td>
                                        <td><span class="nowrap">{{hero.emp_doj | date:'dd MMM yyyy'}}</span></td>
                                        <td><span class="nowrap" ng-if="hero.emp_yoe">{{hero.emp_yoe}}</span></td>
                                        <td><small class="badge bg-primary ml-1" ng-repeat="sk in hero.emp_skills.split(',')">{{sk}}</small></td>
                                        <td ng-if="gUser.is_admin"><span class="{{'badge '+poolStatus(hero.emp_pool)}}">{{hoursToPercent(hero.emp_pool)}}</span></td>
                                        <td>
                                            <div class="btn-group nowrap">
                                                <button type="button" class="btn btn-danger" ng-click="goToSelf('heroView',{employeeid:hero.employeeid})"><i class="fas fa-eye"></i> View</button>
                                                <button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown">
                                                    <span class="caret"></span>
                                                    <span class="sr-only">Toggle Dropdown</span>
                                                </button>
                                                <div class="dropdown-menu dropdown-menu-right" role="menu">
                                                    <button class="dropdown-item" ng-click="goToSelf('heroEdit',{employeeid:hero.employeeid})"><i class="fas fa-pen"></i> Edit</button>
                                                    <button class="dropdown-item" ng-click="goToSelf('heroProjectAdd',{employeeid:hero.employeeid})"><i class="fas fa-user"></i> Assign Project</button>
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
               

                <div data-info="New Joinee" class="col-md-12">
                    <div class="card card-warning collapsed-card card-outline {{pool.cardOutline}}">
                        <div class="card-header border-transparent">
                            <h3 class="card-title">New Joinee ({{newJoinee.length}})</h3>

                            <div class="card-tools">

                                <div class="btn-group btn-group-sm mt--5">
                                    <button type="button" data-table-name="newJoinee" class="toggle-vis btn btn-xs btn-{{colOptions.newJoinee.email ? 'dark' : 'default'}}" data-column="3" ng-click="colOptions.newJoinee.email = !colOptions.newJoinee.email">Email <i class="fas fa-{{colOptions.newJoinee.email ? 'eye' : 'eye-slash'}}"></i></button>
                                    <button type="button" data-table-name="newJoinee" class="toggle-vis btn btn-xs btn-{{colOptions.newJoinee.mobile ? 'dark' : 'default'}}" data-column="4" ng-click="colOptions.newJoinee.mobile = !colOptions.newJoinee.mobile">Mobile <i class="fas fa-{{colOptions.newJoinee.mobile ? 'eye' : 'eye-slash'}}"></i></button>
                                    <button type="button" data-table-name="newJoinee" class="toggle-vis btn btn-xs btn-{{colOptions.newJoinee.code ? 'dark' : 'default'}}" data-column="2" ng-click="colOptions.newJoinee.code = !colOptions.newJoinee.code">Code <i class="fas fa-{{colOptions.newJoinee.code ? 'eye' : 'eye-slash'}}"></i></button>
                                    <button type="button" data-table-name="newJoinee" class="toggle-vis btn btn-xs btn-{{colOptions.newJoinee.skills ? 'dark' : 'default'}}" data-column="12" ng-click="colOptions.newJoinee.skills = !colOptions.newJoinee.skills">Skills <i class="fas fa-{{colOptions.newJoinee.skills ? 'eye' : 'eye-slash'}}"></i></button>
                                    <button type="button" data-table-name="newJoinee" class="toggle-vis btn btn-xs btn-{{colOptions.newJoinee.IsCertified ? 'dark' : 'default'}}" data-column="8" ng-click="colOptions.newJoinee.IsCertified = !colOptions.newJoinee.IsCertified">Is Certified <i class="fas fa-{{colOptions.newJoinee.IsCertified ? 'eye' : 'eye-slash'}}"></i></button>
                                    <button type="button" class="btn btn-dark" data-widget="collapse"><i class="fas fa-plus"></i></button>
                                </div>
                            </div>
                        </div>
                        <div class="card-body p-0">
                            <div class="col-sm-4"></div>
                            <div class="col-sm-4">
                                <label>Select Months</Select></label>
                                <select class="form-control" ng-model="selectMonth" ng-change="selectMonthData(selectMonth)">
                                    <option value="3">3 Months</option>
                                    <option value="6">6 Months</option>
                                    <option value="9">09 Months</option>
                                    <option value="12">12 Months</option>
                                </select>
                            </div>
                            <div class="table-responsive">
                                <table id="newJoinee" style="width:100%;" class="newJoinee table table-bordered table-striped table-sm" data-name="newJoinee" data-col-hide="9">
                                    <thead>
                                    <tr>
                                        <th>#</th>
                                        <th>Name</th>
                                        <th>Code</th>
                                        <th>Email</th>
                                        <th>Mobile</th>
                                        <th>Revenue Center</th>
                                        <th>Department</th>
                                        <th>Designation</th>
                                        <th>Is Certified</th>
                                        <th>Manager</th>
                                        <th data-toggle="tooltip" title="Date of Joining">DoJ <i class="fas fa-question-circle"></i></th>
                                        <th class="nowrap" data-toggle="tooltip" title="Year of Experience">YoE <i class="fas fa-question-circle"></i></th>
                                        <th>Skills</th>
                                        <!-- <th ng-if="gUser.is_admin">Pool</th> -->
                                        <th>Actions</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr ng-repeat="hero in newJoinee track by $index">
                                        <td>{{ $index+1 }}</td>
                                        <td><a class="nowrap" target="_blank" href="{{'/heroes/view/'+hero.id}}"><i class="fas fa-external-link-alt"></i> {{hero.emp_first_name + ' ' + hero.emp_last_name}}</a>
                                            <span class=""><a target="_blank" href="{{'/heroes/feedback/'+hero.id}}"><i class="fas fa-comments"/> </a></span></td>
                                        <td><span>{{'(' + hero.emp_code + ')'}}</span></td>
                                        <td><span class="nowrap"><a href="{{'mailto:'+hero.emp_email}}" target="_blank">{{hero.emp_email}}</a></span></td>
                                        <td><span class=""><a target="_blank" href="{{'tel:+91'+hero.emp_mobile}}">{{hero.emp_mobile}}</a></span></td>
                                        <td><span>{{ hero.rc_name }}</span></td>
                                        <td><span class="badge {{hero.dept_name.toLowerCase()}}">{{hero.dept_name}}</span></td>
                                        <td><span class="nowrap">{{hero.desg_name}}</span></td>
                                        <td><span class="nowrap"><a href="/mycertificate/report-heroview/{{hero.id}}" target="_blank" ng-if="hero.is_certified==true && hero.cert_hero_id==null ">Yes (Not Uploaded)</a>  <a href="/mycertificate/report-heroview/{{hero.id}}" target="_blank" ng-if="hero.is_certified==true && hero.cert_hero_id!=null ">Yes</a>  <span ng-if="hero.is_certified==false">No</span> </span></td>
                                        <td><span class="text-blue pointer" ng-click="goToSelf('heroView',{employeeid:hero.lm_id})">{{hero.lmf + ' ' + hero.lml}}</span></td>
                                        <td><span class="nowrap">{{hero.emp_doj | date:'dd MMM yyyy'}}</span></td>
                                        <td><span class="nowrap" ng-if="hero.emp_yoe">{{hero.emp_yoe}}</span></td>
                                        <td>
                                            <small class="badge bg-primary ml-1" ng-repeat="sk in hero.emp_skills.split(',')">{{sk}}</small>
                                        </td>
                                        <!-- <td ng-if="gUser.is_admin"><span class="{{'badge '+poolStatus(hero.emp_pool)}}">{{hoursToPercent(hero.emp_pool)}}</span></td> -->
                                        <td>
                                            <div class="btn-group nowrap">
                                                <button type="button" class="btn btn-danger" ng-click="goToSelf('heroView',{employeeid:hero.id})"><i class="fas fa-eye"></i> View</button>
                                                <button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown">
                                                    <span class="caret"></span>
                                                    <span class="sr-only">Toggle Dropdown</span>
                                                </button>
                                                <div class="dropdown-menu dropdown-menu-right" role="menu">
                                                    <button class="dropdown-item" ng-click="goToSelf('heroEdit',{employeeid:hero.id})"><i class="fas fa-pen"></i> Edit</button>
                                                    <button class="dropdown-item" ng-click="goToSelf('heroProjectAdd',{employeeid:hero.id})"><i class="fas fa-user"></i> Assign Project</button>
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
