<div class="custom_loader_wrapper" *ngIf="loader">
    <div class="custom_loader_ring"></div>
</div>
<header class="provider_header">
    <div class="row">
      <div class="col-md-6">
        <h4>{{'forexprovider.Forex Provider' | translate}}</h4>
      </div>
      <div class="col-md-6 textRight relative">
          <button class="logout" (click)="goToPage('maker/home')">
            <img src="assets/images/asset_home.png">
           {{'forexprovider.Home' | translate}}</button>
          <button class="logout" (click)="logout()">
              <img src="assets/images/asset_logout.png">
             {{'forexprovider.Logout' | translate}}</button>
          <img src="assets/images/asset_logo1.png">
          <span (click)="goToPage('maker/changepin')"> {{'forexprovider.Change PIN' | translate}}</span>
      </div>
    </div>
  </header>
<section>
    <div class="provider_content">
      <h3>{{'forexprovider.Manage Forex Provider' | translate}}</h3>
      <div class="provider_inner_content">
          <div class="table-responsive">   
              <div class="alert alert-danger alert-dismissible" *ngIf="error">
                  <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
                  <strong> {{'forexprovider.Warning!' | translate}}</strong> {{responseMsg}}
              </div>
              <div class="alert alert-success alert-dismissible" *ngIf="success">
                  <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
                  <strong> {{'forexprovider.Success!' | translate}}</strong>  {{'forexprovider.Forex provider removed successfully' | translate}}
                </div>
                <div class="row">
                  <div class="col"></div>
                  <div class="col" style="text-align: right"><input type="text" placeholder="{{'manageprovider.Search...' | translate}}" (input)="onSearchChange($event.target.value)" /></div>
                </div>      
              <table class="table">
                <thead>
                  <tr>
                    <th> {{'forexprovider.Provider Name' | translate}}</th>
                    <th> {{'forexprovider.Location' | translate}}</th>
                    <th> {{'forexprovider.CR Manager' | translate}}</th>
                    <th> {{'forexprovider.CR ID' | translate}}</th>
                    <th> {{'forexprovider.Contact Name' | translate}}</th>
                    <th> {{'forexprovider.Phone' | translate}}</th>
                    <th> {{'forexprovider.Email ID' | translate}}</th>
                    <th> {{'forexprovider.Status' | translate}}</th>
                    <th class="textRight">
                      <button class="add" (click)="goToPage('maker/provider_forex')">+</button>
                    </th>
                  </tr>
                </thead>
                <tbody *ngIf="providerList; else noProvider">
                  <tr *ngFor="let provider of providerList;">
                    <td>{{provider.name | titlecase}}</td>
                    <td>{{provider.location | titlecase}}</td>
                    <td>{{provider.cr_manager | titlecase}}</td>
                    <td>{{provider.cr_id}}</td>
                    <td>{{provider.contact | titlecase}}</td>
                    <td>{{provider.phone}}</td>
                    <td>{{provider.email_id}}</td>
                    <td>{{get_status(provider.status)}}</td>
                    <td class="textRight pl0 pr0">
                      <button class="edit_btn"(click)="editClick(provider.id)"></button>
                      <button class="delete_btn" (click)="deleteClick(provider.id)"></button>
                    </td>
                  </tr>
                </tbody>                
              </table>
              <div class="forex_pagination" *ngIf="meta">
                  <ul>
                      <li *ngFor="let i of getNumber(meta.total_pages); let j = index" [ngClass]="{'activeClass': meta.current_page == j+1}" (click)="getProvider(j+1)">{{j+1}}</li>
                  </ul>
                 
                </div>
              <ng-template #noProvider></ng-template>
          </div>
      </div>
    </div>
  </section>