<ol class="breadcrumb breadcrumb-arrow font-trirong">
  <li><a href="javascript://"> Visa Application</a></li>
</ol>
<div class="dg-wrapper">
  <div class="clr-row">
    <div class="clr-col-8">
      <h3>Visa Application </h3>
    </div>
    <div class="clr-col-4" style="text-align: right;">
      <button *ngIf="cardButton" id="add" class="btn btn-primary btn-icon" (click)="changeView()">
        <clr-icon *ngIf="!isCardview" shape="grid-view"></clr-icon> <clr-icon *ngIf="isCardview"
          shape="bars"></clr-icon>
      </button>
      <!-- button -->
      <button id="add" class="btn btn-primary" (click)="goToAdd(product)">
        <clr-icon shape="plus"></clr-icon>ADD
      </button>

      <button id="add" class="btn btn-primary" (click)="gotositebuilder()">
        <clr-icon shape="plus"></clr-icon>SiteBuilder
      </button>
    </div>
  </div>
  <ng-container *ngIf="!isCardview"> <!-- GET ALL --> <clr-datagrid [clrDgLoading]="loading"
      [(clrDgSelected)]="selected">
      <clr-dg-placeholder>
        <ng-template #loadingSpinner>
          <clr-spinner>Loading ... </clr-spinner>
        </ng-template>
        <div *ngIf="error;else loadingSpinner">{{error}}</div>
      </clr-dg-placeholder>

      <clr-dg-column [clrDgField]="' name'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Name
        </ng-container></clr-dg-column>


      <clr-dg-column [clrDgField]="' description'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Description
        </ng-container></clr-dg-column>


      <clr-dg-column [clrDgField]="' active'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Active
        </ng-container></clr-dg-column>


      <clr-dg-column [clrDgField]="' visa_entry_type'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Visa Entry
          Type
        </ng-container></clr-dg-column>


      <clr-dg-column [clrDgField]="' visa_duration'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Visa
          Duration
        </ng-container></clr-dg-column>


      <clr-dg-column [clrDgField]="' visa_processing'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Visa
          Processing
        </ng-container></clr-dg-column>


      <clr-dg-column [clrDgField]="' travel_start_date'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Travel
          start date
        </ng-container></clr-dg-column>


      <clr-dg-column [clrDgField]="' travel_end_date'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Travel end
          date
        </ng-container></clr-dg-column>


      <clr-dg-column [clrDgField]="' passport_number'"> <ng-container *clrDgHideableColumn="{hidden: false}"> passport
          Number
        </ng-container></clr-dg-column>


      <clr-dg-column [clrDgField]="' passport_issue_date'"> <ng-container *clrDgHideableColumn="{hidden: false}">
          Passport issue date
        </ng-container></clr-dg-column>


      <clr-dg-column [clrDgField]="' passport_expiry_date'"> <ng-container *clrDgHideableColumn="{hidden: false}">
          Passport expiry date
        </ng-container></clr-dg-column>


      <clr-dg-column [clrDgField]="' email'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Email
        </ng-container></clr-dg-column>


      <clr-dg-column [clrDgField]="' phone_number'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Phone Number
        </ng-container></clr-dg-column>


      <clr-dg-column [clrDgField]="' birth_place'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Birth Place
        </ng-container></clr-dg-column>


      <clr-dg-column [clrDgField]="' date_of_birth'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Date of
          Birth
        </ng-container></clr-dg-column>


      <clr-dg-column [clrDgField]="' gender'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Gender
        </ng-container></clr-dg-column>


      <clr-dg-column [clrDgField]="' profession'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Profession
        </ng-container></clr-dg-column>


      <clr-dg-column [clrDgField]="' visa_cost'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Visa cost
        </ng-container></clr-dg-column>


      <clr-dg-column [clrDgField]="' referrer'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Referrer
        </ng-container></clr-dg-column>


      <clr-dg-column [clrDgField]="' nationality'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Nationality
        </ng-container></clr-dg-column>


      <clr-dg-column [clrDgField]="' supplier'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Supplier
        </ng-container></clr-dg-column>


      <clr-dg-column [clrDgField]="' agent'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Agent
        </ng-container></clr-dg-column>


      <!-- who column -->
      <clr-dg-column> <ng-container *clrDgHideableColumn="{hidden: false}">
          <clr-icon shape="bars"></clr-icon> Action
        </ng-container></clr-dg-column>
      <!-- end -->

      <clr-dg-row *clrDgItems="let user of product" [clrDgItem]="user">

        <clr-dg-cell>{{user. name }}</clr-dg-cell>


        <clr-dg-cell (click)="goToReplaceStringdescription (user.description)"
          style="cursor: pointer; align-items: center;"><clr-icon shape="details"></clr-icon>
        </clr-dg-cell>


        <clr-dg-cell>{{user. active }}</clr-dg-cell>


        <clr-dg-cell>{{user. visa_entry_typename }}</clr-dg-cell>


        <clr-dg-cell>{{user. visa_durationname }}</clr-dg-cell>


        <clr-dg-cell>{{user. visa_processingname }}</clr-dg-cell>


        <clr-dg-cell>{{user. travel_start_date }}</clr-dg-cell>


        <clr-dg-cell>{{user. travel_end_date }}</clr-dg-cell>


        <clr-dg-cell>{{user. passport_number }}</clr-dg-cell>


        <clr-dg-cell>{{user. passport_issue_date }}</clr-dg-cell>


        <clr-dg-cell>{{user. passport_expiry_date }}</clr-dg-cell>


        <clr-dg-cell>{{user. email }}</clr-dg-cell>


        <clr-dg-cell>{{user. phone_number }}</clr-dg-cell>


        <clr-dg-cell>{{user. birth_place }}</clr-dg-cell>


        <clr-dg-cell>{{user. date_of_birth }}</clr-dg-cell>


        <clr-dg-cell>{{user. gendername }}</clr-dg-cell>


        <clr-dg-cell>{{user. profession }}</clr-dg-cell>


        <clr-dg-cell>{{user. visa_cost }}</clr-dg-cell>


        <clr-dg-cell>{{user. referrername }}</clr-dg-cell>


        <clr-dg-cell>{{user. nationalityname }}</clr-dg-cell>


        <clr-dg-cell>{{user. suppliername }}</clr-dg-cell>


        <clr-dg-cell>{{user. agentname }}</clr-dg-cell>


        <!-- who column -->
        <clr-dg-cell>
          <clr-signpost>
            <span style="cursor: pointer;" clrSignpostTrigger><clr-icon shape="help" class="success"
                style="color: rgb(0, 130, 236);"></clr-icon></span>
            <clr-signpost-content [clrPosition]="'left-middle'" *clrIfOpen>
              <h5 style="margin-top: 0">Who Column</h5>
              <div>Account ID: <code class="clr-code">{{user.accountId}}</code></div>
              <div>Created At: <code class="clr-code">{{user.createdAt| date}}</code></div>
              <div>Created By: <code class="clr-code">{{user.createdBy}}</code></div>
              <div>Updated At: <code class="clr-code">{{user.updatedAt | date}}</code></div>
              <div>Updated By: <code class="clr-code">{{user.updatedBy}}</code></div>
            </clr-signpost-content>
          </clr-signpost>
        </clr-dg-cell>

        <!-- who colmn -->

        <clr-dg-action-overflow>
          <button class="action-item" (click)="onEdit(user)">Edit</button>
          <button class="action-item" (click)="onDelete(user)">Delete</button>
        </clr-dg-action-overflow>
      </clr-dg-row>
      <clr-dg-footer>
        <clr-dg-pagination #pagination [clrDgPageSize]="10">
          <clr-dg-page-size [clrPageSizeOptions]="[10,20,50,100]">Users per page</clr-dg-page-size>
          {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}}
          of {{pagination.totalItems}} users
        </clr-dg-pagination>
      </clr-dg-footer>
    </clr-datagrid> </ng-container>
  <ng-template #showInfo>
    <div class="alert alert-info" role="alert">
      <div class="alert-items">
        <div class="alert-item static">
          <span class="alert-text">
            <clr-icon class="alert-icon" shape="info-circle"></clr-icon>
            Data could be found. Loading..
            <clr-spinner [clrMedium]="true">Loading ...</clr-spinner>
          </span>
        </div>
      </div>
    </div>
  </ng-template><ng-container *ngIf="isCardview">
    <div *ngIf="product; else showInfo" class="clr-row clr-align-items-start clr-justify-content-start">
      <div *ngFor="let app of product| filter:search; let index = i" class="clr-col-auto">
        <div class="clr-row">
          <div class="clr-col-lg-12 clr-col-md-4 clr-col-sm-4 clr-col-12" style="width: 410px;">
            <div class="card" style="padding: 10px; "
              [style.background-color]="cardmodal.cardColor !== '' ? cardmodal.cardColor : 'white'">
              <div class="card-body"
                style="display: grid; grid-template-columns: repeat(13, 1fr); grid-template-rows: repeat(7, 1fr); gap: 5px;">
                <ng-container *ngFor="let item of dashboardArray">
                  <div [style.gridColumn]="item.x + 1" [style.gridRow]="item.y + 1"
                    [style.gridColumnEnd]="item.x + item.cols + 1" [style.gridRowEnd]="item.y + item.rows + 1">
                    <div *ngIf="item.name === 'textField'" class="title-card card-title"
                      [style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
                      [style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
                      [style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
                      [style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
                      [style.font-style]="item.italic == true ? 'Italic' : 'normal'"
                      [style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' : 
          (item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
                      [style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
                      [style.color]="item.textcolor !== '' ? item.textcolor : 'black'"
                      [style.background-color]="item.conditionValue ==  app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
                      [style.color]="item.conditionValue ==  app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor">
                      {{beforeText(item.fieldtext)}}
                      {{ app[transform(item.fieldtext) ] }}
                      {{afterText(item.fieldtext)}}
                    </div>

                    <div *ngIf="item.name === 'dateField'" class="title-card card-title"
                      [style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
                      [style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
                      [style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
                      [style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
                      [style.font-style]="item.italic == true ? 'Italic' : 'normal'"
                      [style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' : 
          (item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
                      [style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
                      [style.color]="item.textcolor !== '' ? item.textcolor : 'black'"
                      [style.background-color]="item.conditionValue ==  app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
                      [style.color]="item.conditionValue ==  app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor">
                      {{beforeText(item.fieldtext)}}
                      {{ app[transform(item.fieldtext) ] | date}}
                      {{afterText(item.fieldtext)}}
                    </div>
                    <div *ngIf="item.name === 'numberField'" class="title-card card-title"
                      [style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
                      [style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
                      [style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
                      [style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
                      [style.font-style]="item.italic == true ? 'Italic' : 'normal'"
                      [style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' : 
          (item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
                      [style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
                      [style.color]="item.textcolor !== '' ? item.textcolor : 'black'"
                      [style.background-color]="item.conditionValue ==  app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
                      [style.color]="item.conditionValue ==  app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor">
                      {{beforeText(item.fieldtext)}}
                      {{ app[transform(item.fieldtext) ]}}
                      {{afterText(item.fieldtext)}}
                    </div>

                    <div *ngIf="item.name === 'Line'" class="title-card card-title"
                      [style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
                      [style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
                      [style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
                      [style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
                      [style.font-style]="item.italic == true ? 'Italic' : 'normal'"
                      [style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' : 
          (item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
                      [style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
                      [style.color]="item.textcolor !== '' ? item.textcolor : 'black'">
                      <hr>
                    </div>


                    <div *ngIf="item.name === 'Icon'" class="icon-card"
                      [style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
                      [style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
                      [style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
                      [style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
                      [style.font-style]="item.italic == true ? 'Italic' : 'normal'"
                      [style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' : 
          (item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
                      [style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
                      [style.color]="item.textcolor !== '' ? item.textcolor : 'black'">
                      <clr-icon [attr.shape]="item.iconName"></clr-icon>
                    </div>

                    <div *ngIf="item.name == 'Image'"
                      [style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
                      [style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
                      [style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
                      [style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
                      [style.font-style]="item.italic == true ? 'Italic' : 'normal'"
                      [style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' : 
          (item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
                      [style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
                      [style.color]="item.textcolor !== '' ? item.textcolor : 'black'"
                      [style.background-color]="item.conditionValue ==  app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
                      [style.color]="item.conditionValue ==  app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor">
                      <img id="filePreview" [src]="item.imageURL" alt="File Preview"
                        [style.width]="item.imagewidth !== '' ? item.imagewidth + 'px' : '100px'"
                        [style.height]="item.imagewidth !== '' ? item.imagewidth + 'px' : '100px'"></div>
                  </div>
                </ng-container>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </ng-container>
</div>



<clr-modal [(clrModalOpen)]="rsModaldescription" [clrModalSize]="'xl'" [clrModalStaticBackdrop]="true">
  <div class="modal-body">
    <textarea class="form-control" style="width:100%; height: 400px;" readonly>{{rowSelected}}</textarea>
  </div>
</clr-modal>









































<!-- //		EDIT DATA......... -->
<clr-modal [(clrModalOpen)]="modalEdit" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
  <h3 class="modal-title">Update Visa Application <!--update button -->











































  </h3>
  <div class="modal-body" *ngIf="rowSelected.id">
    <h2 class="heading">{{rowSelected.id}}</h2>
    <!-- button -->
    <form>
      <div class="clr-row">
        <div class="clr-col-sm-12">
          <label>Name</label>
          <input class="clr-input" type="text" [(ngModel)]="rowSelected.name" name="name" />
        </div>

        <div class="clr-col-sm-12">
          <label> Description</label>
          <textarea cols="10" rows="2" [(ngModel)]="rowSelected.description" name="description "
            placeholder="Textarea">  </textarea>
        </div>

        <div class="clr-col-sm-12">
          <label> Active</label>
          <input type="checkbox" name="active" clrToggle [(ngModel)]="rowSelected.active" />
        </div>



        <div class="clr-col-sm-12">
          <label>Visa Entry Type</label>
          <select name="visa_entry_type" [(ngModel)]="rowSelected.visa_entry_type">
            <option [value]="null">Choose visa_entry_type</option>
            <option *ngFor=" let item of selectvisa_entry_type" [value]="item.id">{{item.name }}</option>
          </select>
        </div>





        <div class="clr-col-sm-12">
          <label>Visa Duration</label>
          <select name="visa_duration" [(ngModel)]="rowSelected.visa_duration">
            <option [value]="null">Choose visa_duration</option>
            <option *ngFor=" let item of selectvisa_duration" [value]="item.id">{{item.name }}</option>
          </select>
        </div>





        <div class="clr-col-sm-12">
          <label>Visa Processing</label>
          <select name="visa_processing" [(ngModel)]="rowSelected.visa_processing">
            <option [value]="null">Choose visa_processing</option>
            <option *ngFor=" let item of selectvisa_processing" [value]="item.id">{{item.name }}</option>
          </select>
        </div>



        <div class="clr-col-sm-12">
          <label>Travel start date</label>
          <input id="name" class="clr-input" type="date" [(ngModel)]="rowSelected.travel_start_date"
            name="travel_start_date" />
        </div>

        <div class="clr-col-sm-12">
          <label>Travel end date</label>
          <input id="name" class="clr-input" type="date" [(ngModel)]="rowSelected.travel_end_date"
            name="travel_end_date" />
        </div>

        <div class="clr-col-sm-12">
          <label>passport Number</label>
          <input id="name" class="clr-input" type="number" [(ngModel)]="rowSelected.passport_number"
            name="passport_number" />
        </div>

        <div class="clr-col-sm-12">
          <label>Passport issue date</label>
          <input id="name" class="clr-input" type="date" [(ngModel)]="rowSelected.passport_issue_date"
            name="passport_issue_date" />
        </div>

        <div class="clr-col-sm-12">
          <label>Passport expiry date</label>
          <input id="name" class="clr-input" type="date" [(ngModel)]="rowSelected.passport_expiry_date"
            name="passport_expiry_date" />
        </div>

        <div class="clr-col-sm-12">
          <label> Email</label>
          <input id="name" class="clr-input" type="email" [(ngModel)]="rowSelected.email " name="email"
            pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$">
          <div *ngIf="rowSelected.email && !isValidemail(rowSelected.email )" class="error_mess">
            * Email must be a valid email address.
          </div>
        </div>

        <div class="clr-col-sm-12">
          <label> Phone Number</label>
          <input id="name" class="clr-input" type="Text" [(ngModel)]="rowSelected.phone_number " name="phone_number"
            pattern="((\\+)?([1-9]{2}))?[1-9]{1}[0-9]{9}$" />
          <div *ngIf="rowSelected.phone_number  && !isValidPhone_number(rowSelected.phone_number)" class="error_mess">
            * Please Follow your pattern,+91 Enter 10 digit Mobile Number.
          </div>
        </div>

        <div class="clr-col-sm-12">
          <label>Birth Place</label>
          <input class="clr-input" type="text" [(ngModel)]="rowSelected.birth_place" name="birth_place" />
        </div>

        <div class="clr-col-sm-12">
          <label>Date of Birth</label>
          <input id="name" class="clr-input" type="date" [(ngModel)]="rowSelected.date_of_birth" name="date_of_birth" />
        </div>



        <div class="clr-col-sm-12">
          <label>Gender</label>
          <select name="gender" [(ngModel)]="rowSelected.gender">
            <option [value]="null">Choose gender</option>
            <option *ngFor=" let item of selectgender" [value]="item.id">{{item.name }}</option>
          </select>
        </div>



        <div class="clr-col-sm-12">
          <label>Profession</label>
          <input class="clr-input" type="text" [(ngModel)]="rowSelected.profession" name="profession" />
        </div>

        <!-- currency field start -->
        <div class="clr-col-sm-12">
          <label> Visa cost</label>
          <input type="number" class="clr-input" [(ngModel)]="rowSelected.visa_cost" name="visa_cost"
            (blur)="formatCurrencyvisa_cost()" [value]="rowSelected.visa_cost  | removeCommas">
        </div>
        <!-- currency field end -->



        <div class="clr-col-sm-12">
          <label>Referrer</label>
          <select name="referrer" [(ngModel)]="rowSelected.referrer">
            <option [value]="null">Choose referrer</option>
            <option *ngFor=" let item of selectreferrer" [value]="item.id">{{item.name }}</option>
          </select>
        </div>





        <div class="clr-col-sm-12">
          <label>Nationality</label>
          <select name="nationality" [(ngModel)]="rowSelected.nationality">
            <option [value]="null">Choose nationality</option>
            <option *ngFor=" let item of selectnationality" [value]="item.id">{{item.name }}</option>
          </select>
        </div>





        <div class="clr-col-sm-12">
          <label>Supplier</label>
          <select name="supplier" [(ngModel)]="rowSelected.supplier">
            <option [value]="null">Choose supplier</option>
            <option *ngFor=" let item of selectsupplier" [value]="item.id">{{item.name }}</option>
          </select>
        </div>





        <div class="clr-col-sm-12">
          <label>Agent</label>
          <select name="agent" [(ngModel)]="rowSelected.agent">
            <option [value]="null">Choose agent</option>
            <option *ngFor=" let item of selectagent" [value]="item.id">{{item.name }}</option>
          </select>
        </div>



      </div>



      <!-- form code start -->
      <div *ngIf="checkFormCode">
        <h4 style="font-weight: 300;display: inline;">Extension</h4>
        <br>
        <hr>
        <div class="clr-row">
          <div class="clr-col-4" *ngFor="let field of additionalFieldsFromBackend">
            <ng-container *ngIf="field.formCode === formcode" [ngSwitch]="field.fieldType">
              <!-- Text Input --> <label *ngSwitchCase="'text'">{{ field.fieldName }}</label>
              <input *ngSwitchCase="'text'" [type]="field.fieldType" name="{{ field.extValue }}"
                [(ngModel)]="rowSelected[field.extValue]" class="clr-input" />

              <!-- Date Input --> <label *ngSwitchCase="'date'">{{ field.fieldName }}</label>
              <input *ngSwitchCase="'date'" [type]="field.fieldType" name="{{ field.extValue }}"
                [(ngModel)]="rowSelected[field.extValue]" class="clr-input" />

              <!-- Textarea --> <label *ngSwitchCase="'textarea'">{{ field.fieldName }}</label>
              <textarea *ngSwitchCase="'textarea'" name="{{ field.extValue }}" [(ngModel)]="rowSelected[field.extValue]"
                col="10" row="2"></textarea>

              <!-- Checkbox --> <label *ngSwitchCase="'checkbox'">{{ field.fieldName }}</label><br>
              <input *ngSwitchCase="'checkbox'" [type]="field.fieldType" name="{{ field.extValue }}"
                [(ngModel)]="rowSelected[field.extValue]" class="clr-checkbox" />
            </ng-container>
          </div>
        </div>
      </div>

      <!-- form code end -->
      <div class="modal-footer">
        <button type="button" class="btn btn-outline" (click)="modalEdit = false">Cancel</button>
        <button type="submit" class="btn btn-primary" (click)="onUpdate(rowSelected.id)">Update</button>
      </div>
    </form>
  </div>
</clr-modal>
<clr-modal [(clrModalOpen)]="modaldelete" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
  <div class="modal-body" *ngIf="rowSelected.id">
    <h1 class="delete">Are You Sure Want to delete?</h1>
    <h2 class="heading">{{rowSelected.id}}</h2>
    <div class="modal-footer">
      <button type="button" class="btn btn-outline" (click)="modaldelete = false">Cancel</button>
      <button type="button" (click)="delete(rowSelected.id)" class="btn btn-primary">Delete</button>
    </div>
  </div>
</clr-modal>
<!-- ADD FORM ..... -->
<clr-modal [(clrModalOpen)]="modalAdd" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
  <h3 class="modal-title">Add Visa Application












































    <!-- aeroplane icon -->
    &nbsp; &nbsp; &nbsp; &nbsp;
    <a *ngIf="userrole.includes('ROLE_ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip"
      aria-haspopup="true" class="tooltip tooltip-sm tooltip-bottom-left">
      <a id="build_extension" [routerLink]="['../extension/all']"
        [queryParams]="{ formCode: 'Visa_application_formCode' }">
        <clr-icon shape="airplane" size="32"></clr-icon>
      </a>
      <span class="tooltip-content">Form Extension</span>
    </a>
  </h3>
  <div class="modal-body">
    <form [formGroup]="entryForm">
      <div class="clr-row" style="height: fit-content;">

        <div class="clr-col-sm-12">
          <label> Name</label>
          <input class="clr-input" type="text" formControlName="name" />
        </div>

        <div class="clr-col-sm-12">
          <label> Description</label>
          <textarea cols="10" rows="2" formControlName="description" placeholder="Textarea">  </textarea>
        </div>

        <div class="clr-col-sm-12">
          <label> Active</label>
          <input type="checkbox" formControlName="active" clrToggle />
        </div>



        <div class="clr-col-sm-12">
          <label> Visa Entry Type</label>
          <select formControlName="visa_entry_type">
            <option [value]="null">Choose Visa Entry Type</option>
            <option *ngFor="let item of selectvisa_entry_type" [value]="item.id">{{item.name}}</option>
          </select>
        </div>





        <div class="clr-col-sm-12">
          <label> Visa Duration</label>
          <select formControlName="visa_duration">
            <option [value]="null">Choose Visa Duration</option>
            <option *ngFor="let item of selectvisa_duration" [value]="item.id">{{item.name}}</option>
          </select>
        </div>





        <div class="clr-col-sm-12">
          <label> Visa Processing</label>
          <select formControlName="visa_processing">
            <option [value]="null">Choose Visa Processing</option>
            <option *ngFor="let item of selectvisa_processing" [value]="item.id">{{item.name}}</option>
          </select>
        </div>



        <div class="clr-col-sm-12">
          <label> Travel start date</label>
          <input class="clr-input" type="date" formControlName="travel_start_date" />
        </div>

        <div class="clr-col-sm-12">
          <label> Travel end date</label>
          <input class="clr-input" type="date" formControlName="travel_end_date" />
        </div>

        <div class="clr-col-sm-12">
          <label> passport Number</label>
          <input class="clr-input" type="number" formControlName="passport_number" />
          <div *ngIf="submitted && entryForm.controls.passport_number.errors" class="error_mess">
            <div *ngIf="submitted && entryForm.controls.passport_number.errors.required" class="error_mess">*This field
              is Required</div>
          </div>
        </div>

        <div class="clr-col-sm-12">
          <label> Passport issue date</label>
          <input class="clr-input" type="date" formControlName="passport_issue_date" />
        </div>

        <div class="clr-col-sm-12">
          <label> Passport expiry date</label>
          <input class="clr-input" type="date" formControlName="passport_expiry_date" />
        </div>

        <div class="clr-col-sm-12">
          <label> Email</label>
          <input class="clr-input" type="email" formControlName="email"
            pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$">
          <div *ngIf="entryForm.controls['email'].errors" class="error_mess">
            <div *ngIf="entryForm.controls['email'].hasError('pattern')" class="error_mess">* Email must be a valid
              email address
            </div>
          </div>
        </div>

        <div class="clr-col-sm-12">
          <label> Phone Number</label>
          <input class="clr-input" type="text" formControlName="phone_number"
            pattern="((\+)?([1-9]{2}))?[1-9]{1}[0-9]{9}$" />
          <div *ngIf="submitted && entryForm.controls['phone_number'].errors" class="error_mess">
            <div *ngIf="submitted && entryForm.controls['phone_number'].hasError('pattern')" class="error_mess">* Please
              Follow your pattern,+91 Enter 10 digit Mobile Number.
            </div>
          </div>
        </div>

        <div class="clr-col-sm-12">
          <label> Birth Place</label>
          <input class="clr-input" type="text" formControlName="birth_place" />
        </div>

        <div class="clr-col-sm-12">
          <label> Date of Birth</label>
          <input class="clr-input" type="date" formControlName="date_of_birth" />
        </div>



        <div class="clr-col-sm-12">
          <label> Gender</label>
          <select formControlName="gender">
            <option [value]="null">Choose Gender</option>
            <option *ngFor="let item of selectgender" [value]="item.id">{{item.name}}</option>
          </select>
        </div>



        <div class="clr-col-sm-12">
          <label> Profession</label>
          <input class="clr-input" type="text" formControlName="profession" />
        </div>

        <!-- currency field start -->
        <div class="clr-col-sm-12">
          <label> Visa cost</label>
          <input type="number" class="clr-input" formControlName="visa_cost"
            [value]="entryForm.value.visa_cost | number:'1.2-2' | removeCommas">
        </div>
        <!-- currency field end -->



        <div class="clr-col-sm-12">
          <label> Referrer</label>
          <select formControlName="referrer">
            <option [value]="null">Choose Referrer</option>
            <option *ngFor="let item of selectreferrer" [value]="item.id">{{item.name}}</option>
          </select>
        </div>





        <div class="clr-col-sm-12">
          <label> Nationality</label>
          <select formControlName="nationality">
            <option [value]="null">Choose Nationality</option>
            <option *ngFor="let item of selectnationality" [value]="item.id">{{item.name}}</option>
          </select>
        </div>





        <div class="clr-col-sm-12">
          <label> Supplier</label>
          <select formControlName="supplier">
            <option [value]="null">Choose Supplier</option>
            <option *ngFor="let item of selectsupplier" [value]="item.id">{{item.name}}</option>
          </select>
        </div>





        <div class="clr-col-sm-12">
          <label> Agent</label>
          <select formControlName="agent">
            <option [value]="null">Choose Agent</option>
            <option *ngFor="let item of selectagent" [value]="item.id">{{item.name}}</option>
          </select>
        </div>




      </div>














































      <!-- form code start -->
      <div *ngIf="checkFormCode">
        <h4 style="font-weight: 300;display: inline;">Extension</h4>
        <br>
        <hr>
        <div class="clr-row">
          <div class="clr-col-4" *ngFor="let field of additionalFieldsFromBackend">
            <ng-container *ngIf="field.formCode === formcode" [ngSwitch]="field.fieldType">
              <!-- Text Input --> <label *ngSwitchCase="'text'">{{ field.fieldName }}</label>
              <input *ngSwitchCase="'text'" [type]="field.fieldType" [formControlName]="field.extValue"
                class="clr-input" />
              <!-- Date Input --> <label *ngSwitchCase="'date'">{{ field.fieldName }}</label>
              <input *ngSwitchCase="'date'" [type]="field.fieldType" [formControlName]="field.extValue"
                class="clr-input" />
              <!-- Textarea --> <label *ngSwitchCase="'textarea'">{{ field.fieldName }}</label>
              <textarea *ngSwitchCase="'textarea'" [formControlName]="field.extValue" col="10" row="2"></textarea>
              <!-- Checkbox --> <label *ngSwitchCase="'checkbox'">{{ field.fieldName }}</label><br>
              <input *ngSwitchCase="'checkbox'" [type]="field.fieldType" [formControlName]="field.extValue"
                class="clr-checkbox" />
            </ng-container>
          </div>
        </div>
      </div>
      <!-- form code end -->
      <div class="modal-footer">
        <button type="button" class="btn btn-outline" (click)="modalAdd = false">Cancel</button>
        <button type="submit" class="btn btn-primary" (click)="onSubmit()">ADD</button>
      </div>
    </form>
  </div>
</clr-modal>












































<!-- htmlpopup -->