
<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>{{'currencyedit.Currency Management' | translate}}</h4>
    </div>
    <div class="col-md-6 textRight relative">
        <button class="logout" (click)="goToPage('maker/home')">
          <img src="assets/images/asset_home.png">
         {{'currencyedit.Home' | translate}}</button>
        <button class="logout" (click)="logout()">
            <img src="assets/images/asset_logout.png">
           {{'currencyedit.Logout' | translate}}</button>
        <img src="assets/images/asset_logo1.png">
        <span (click)="goToPage('maker/changepin')">{{'currencyedit.Change PIN' | translate}}</span>
    </div>
  </div>
</header>
<section>
  <div class="provider_content">
    
    <h3> {{'currencyedit.Edit Currency' | translate}}</h3>
    <div class="provider_inner_content">
          <div class="alert alert-success alert-dismissible" *ngIf="success">
            <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
            <strong> {{'currencyedit.Success!' | translate}}</strong> {{'currencyedit.Currency updated successfully' | translate}}
          </div>
          <div class="alert alert-danger alert-dismissible" *ngIf="error">
              <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
              <strong> {{'currencyedit.Warning!' | translate}}</strong> {{responseError}}
          </div>
      <form [formGroup]="currencyForm" (ngSubmit)="currencyProcess()" autocomplete="off">        
        <div class="row">
            <div class="col">
              <div class="provider_data_content">
                  <p> {{'currencyedit.Name' | translate}}</p>
                  <input class="provider_input" placeholder="" type="text" formControlName="name">
              </div>
              <div class="s_error" *ngIf="!currencyForm.controls['name'].valid && currencySubmit">
                  <div class="s_validation" *ngIf="currencyForm.controls['name'].hasError('required')">{{error_msg.required}} </div>
              </div>
            </div>
            <div class="col">
                <div class="provider_data_content">
                    <p> {{'currencyedit.Symbol' | translate}}</p>
                    <input class="provider_input" placeholder="" type="text" formControlName="symbol">
                </div>
                <div class="s_error" *ngIf="!currencyForm.controls['symbol'].valid && currencySubmit">
                    <div class="s_validation" *ngIf="currencyForm.controls['symbol'].hasError('required')">{{error_msg.required}} </div>
                </div>
            </div>
            <div class="col">
              
                <div class="provider_data_content">
                    <p> {{'currencyedit.Flag' | translate}}</p>
                    <img [src]="getImage()" *ngIf="image_url" />
                    <div class="provider_choose_btn">
                       {{'currencyedit.Choose Flag' | translate}}
                      <input class="" placeholder="" type="file"  formControlName="flag" (change)="onFileChange($event)">
                    </div>
                </div>
                <div class="s_error" *ngIf="!currencyForm.controls['flag'].valid && currencySubmit">
                    <div class="s_validation" *ngIf="currencyForm.controls['flag'].hasError('required')">{{error_msg.required}} </div>
                </div>
            </div>
          </div>
          <div class="row">
              <div class="col">
                <div class="provider_data_content">
                    <p> {{'currencyedit.Rate' | translate}}</p>
                    <input class="provider_input" placeholder="" type="number" formControlName="rate">
                </div>
                <div class="s_error" *ngIf="!currencyForm.controls['rate'].valid && currencySubmit">
                    <div class="s_validation" *ngIf="currencyForm.controls['rate'].hasError('required')">{{error_msg.required}} </div>
                </div>
              </div>

              <div class="col">
                  <div class="provider_data_content">
                      <p> {{'currencyedit.Forex Multiple' | translate}}</p>
                      <input class="provider_input" placeholder="" type="number" formControlName="start_from">
                  </div>
                  <div class="s_error" *ngIf="!currencyForm.controls['start_from'].valid && currencySubmit">
                      <div class="s_validation" *ngIf="currencyForm.controls['start_from'].hasError('required')">{{error_msg.required}} </div>
                  </div>
                </div> 
                <div class="col"></div>
          </div>             
            <!-- <div class="row">
                <div class="col">
                  <div class="add_provider_btn_bay p0">
                      <button class="edit_btn floatRight" (click)="goToPage('maker/editprovider')">Edit</button>
                    <div class="clear"></div>
                  </div>
                </div>
              </div> -->
            <div class="row">
              <div class="col">
                <div class="add_provider_btn_bay">
                  <button class="save_btn floatRight"> {{'currencyedit.Save' | translate}}</button>
                  <button class="cancel_btn floatRight" (click)="cancelClick()"> {{'currencyedit.Cancel' | translate}}</button>
                  <div class="clear"></div>
                </div>
              </div>
            </div>
        </form>
    </div>
  </div>
</section>