<ol class="breadcrumb breadcrumb-arrow font-trirong">
  <li><a href="javascript://"> TestC</a></li>
</ol>
<section class="ug-hero">
  <div class="ug-hero__content">
    <div class="ug-hero__icon"><clr-icon shape="users"></clr-icon></div>
    <div>
      <h2 class="ug-hero__title">TestC</h2>
    </div>
  </div>
  <div class="ug-hero__actions"> 
    <button id="add" class="ug-btn ug-btn-primary" (click)="goToAdd()">
      <clr-icon shape="plus"></clr-icon>
      <span class="ug-btn-text">ADD</span>
    </button>
   
  </div>
</section>


<div class="ug-toolbar">
  <div class="ug-toolbar__left">
    <div class="ug-search">
      <clr-icon shape="search"></clr-icon>
      <input class="ug-search__input" type="text" placeholder="SEARCH" [(ngModel)]="filterText" />
    </div>
  </div>
  <div class="ug-toolbar__right">
    <div class="ug-view-toggle">
      <button class="ug-btn ug-btn-sm" [class.ug-btn-primary]="viewMode==='cards'" (click)="setViewMode('cards')">
        <clr-icon shape="view-cards"></clr-icon>
      </button>
      <button class="ug-btn ug-btn-sm" [class.ug-btn-primary]="viewMode==='table'" (click)="setViewMode('table')">
        <clr-icon shape="table"></clr-icon>
      </button>
    </div>
  </div>
</div> 
<clr-datagrid class="ug-grid" [clrDgLoading]="loading" *ngIf="viewMode==='table'">
  <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]="'state_name'">
    <ng-container *clrDgHideableColumn="{hidden: false}">
      State name
    </ng-container>
  </clr-dg-column>




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




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




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




 <clr-dg-column [clrDgField]="'female_papulation'">
    <ng-container *clrDgHideableColumn="{hidden: false}">
      female Papulation
    </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 filteredGroups;let i = index" [clrDgItem]="user">

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


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


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


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


<clr-dg-cell>{{user.female_papulation }}</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="ug-action-item" *ngIf="medit == 'true' || medit == true" (click)="onEdit(user)">
        <clr-icon shape="edit"></clr-icon>
        EDIT
      </button> -->
      <button class="ug-action-item" (click)="onEdit(user)">
        <clr-icon shape="edit"></clr-icon>
        EDIT
      </button>
      <button class="ug-action-item ug-btn-error" (click)="onDelete(user)">
        <clr-icon shape="trash"></clr-icon>
 DELETE
      </button>
    </clr-dg-action-overflow>

</clr-dg-row>

  <clr-dg-footer class="ug-grid-footer">
    <clr-dg-pagination #pagination [clrDgPageSize]="10">
      <clr-dg-page-size [clrPageSizeOptions]="[10,20,50,100]">Record per page</clr-dg-page-size>
      {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}}
      of {{pagination.totalItems}} Records
    </clr-dg-pagination>
  </clr-dg-footer>
</clr-datagrid>

<div class="ug-cards" *ngIf="viewMode==='cards'">
  <div class="ug-card-item" *ngFor="let user of filteredGroups; let i = index">
 <div class="ug-card-item__body"> 
    
      <div class="ug-kv"><span>State name</span><strong>{{user.state_name}}</strong></div>


      <div class="ug-kv"><span>district name</span><strong>{{user.district_name}}</strong></div>


      <div class="ug-kv"><span>Papulation</span><strong>{{user.papulation}}</strong></div>


      <div class="ug-kv"><span>male Papulation</span><strong>{{user.male_papulation}}</strong></div>


      <div class="ug-kv"><span>female Papulation</span><strong>{{user.female_papulation}}</strong></div>


 </div>
    <div class="ug-card-item__footer">
      
      <button class="ug-btn ug-btn-sm ug-btn-outline" (click)="onEdit(user)">
        <clr-icon shape="edit"></clr-icon> Edit
      </button>
      <button class="ug-btn ug-btn-sm ug-btn-error" (click)="onDelete(user)">
        <clr-icon shape="trash"></clr-icon> Delete
      </button>
    </div>
  </div>
</div>


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







<clr-modal [(clrModalOpen)]="modalAdd" [clrModalSize]="'md'" [clrModalStaticBackdrop]="true">
  <h3 class="modal-title">Add TestC</h3>
  <div class="modal-body">
    <form [formGroup]="entryForm" (ngSubmit)="onSubmit()">
<div class="form-row">
            <div class="form-col">
<div class="ug-form-group">
        <label for="state_name" class="ug-form-label">State name<span class="required-field">*</span></label>
        <input type="text" id="state_name" class="ug-form-input" formControlName="state_name">
        <div *ngIf="submitted && entryForm.controls.state_name.errors" class="ug-form-error">
          <div *ngIf="submitted && entryForm.controls.state_name.errors.required">*This field is Required</div>
        </div>
      </div>
</div>
            </div>


<div class="form-row">
            <div class="form-col">
 <div class="ug-form-group">
              <label for="district_name" class="ug-form-label">district name</label>
              <textarea 
                id="district_name" 
                class="ug-form-input" 
                formControlName="district_name" 
                placeholder="Enter text" 
                rows="3"></textarea>
            </div>
</div>
            </div>

<div class="form-row">
            <div class="form-col"> 
<div class="ug-form-group">
              <label for="papulation" class="ug-form-label">Papulation<span class="required-field">*</span></label>
              <input type="number" id="papulation" class="ug-form-input" formControlName="papulation" placeholder="Enter Papulation">
              <div *ngIf="submitted && entryForm.controls.papulation.errors" class="ug-form-error">
                <div *ngIf="submitted && entryForm.controls.papulation.errors.required">*This field is Required</div>
              </div>
            </div>
 </div>
            </div>

<div class="form-row">
            <div class="form-col"> 
<div class="ug-form-group">
              <label for="male_papulation" class="ug-form-label">male Papulation<span class="required-field">*</span></label>
              <input type="number" id="male_papulation" class="ug-form-input" formControlName="male_papulation" placeholder="Enter male Papulation">
              <div *ngIf="submitted && entryForm.controls.male_papulation.errors" class="ug-form-error">
                <div *ngIf="submitted && entryForm.controls.male_papulation.errors.required">*This field is Required</div>
              </div>
            </div>
 </div>
            </div>

<div class="form-row">
            <div class="form-col"> 
<div class="ug-form-group">
              <label for="female_papulation" class="ug-form-label">female Papulation<span class="required-field">*</span></label>
              <input type="number" id="female_papulation" class="ug-form-input" formControlName="female_papulation" placeholder="Enter female Papulation">
              <div *ngIf="submitted && entryForm.controls.female_papulation.errors" class="ug-form-error">
                <div *ngIf="submitted && entryForm.controls.female_papulation.errors.required">*This field is Required</div>
              </div>
            </div>
 </div>
            </div>


      <div class="modal-footer">
        <button type="button" class="ug-btn ug-btn-outline" (click)="modalAdd = false">Cancel</button>
        <button type="submit" class="ug-btn ug-btn-primary">ADD</button>
      </div>
    </form>
  </div>
</clr-modal>

<clr-modal [(clrModalOpen)]="modalEdit" [clrModalSize]="'md'" [clrModalStaticBackdrop]="true">
  <h3 class="modal-title">Update TestC</h3>
  <div class="modal-body" *ngIf="rowSelected.id">
    



<div class="form-row">
            <div class="form-col">
              <div class="ug-form-group">
                <label for="state_name" class="ug-form-label">State name<span class="required-field">*</span></label>
                <input type="text" id="state_name" class="ug-form-input" [(ngModel)]="rowSelected.state_name" name="state_name"
                  placeholder="Enter State name">
              </div>
            </div>
          </div>


            <div class="form-col">
              <div class="ug-form-group">
                <label for="district_name" class="ug-form-label">district name</label>
                <textarea id="district_name" class="ug-form-input" [(ngModel)]="rowSelected.district_name"
                  name="district_name" placeholder="Enter text" rows="3"></textarea>
              </div>
            </div>
           


 <!-- Number Fields -->
          <div class="form-row">
            <div class="form-col">
              <div class="ug-form-group">
                <label for="papulation" class="ug-form-label">Papulation</label>
                <input type="number" id="papulation" class="ug-form-input" [(ngModel)]="rowSelected.papulation"
                  name="papulation" placeholder="Enter Papulation">
              </div>
            </div>
          </div>


 <!-- Number Fields -->
          <div class="form-row">
            <div class="form-col">
              <div class="ug-form-group">
                <label for="male_papulation" class="ug-form-label">male Papulation</label>
                <input type="number" id="male_papulation" class="ug-form-input" [(ngModel)]="rowSelected.male_papulation"
                  name="male_papulation" placeholder="Enter male Papulation">
              </div>
            </div>
          </div>


 <!-- Number Fields -->
          <div class="form-row">
            <div class="form-col">
              <div class="ug-form-group">
                <label for="female_papulation" class="ug-form-label">female Papulation</label>
                <input type="number" id="female_papulation" class="ug-form-input" [(ngModel)]="rowSelected.female_papulation"
                  name="female_papulation" placeholder="Enter female Papulation">
              </div>
            </div>
          </div>


    <div class="modal-footer">
      <button type="button" class="ug-btn ug-btn-outline" (click)="modalEdit = false">Cancel</button>
      <button type="submit" (click)="onUpdate(rowSelected.id)" class="ug-btn ug-btn-primary">Update</button>
    </div>

<clr-modal [(clrModalOpen)]="modaldelete" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
  <div class="modal-body" *ngIf="rowSelected.id">
    <div class="ug-delete-header">
      <div class="ug-delete-icon">
        <clr-icon shape="exclamation-triangle" size="48"></clr-icon>
      </div>
      <h1 class="ug-delete-title">Are You Sure Want to Delete?</h1>
      <p class="ug-delete-subtitle">This action cannot be undone</p>
    </div>

<div class="ug-delete-details"><div class="ug-delete-detail-item">
        <span class="ug-delete-detail-label">State name:</span>
        <span class="ug-delete-detail-value">{{rowSelected.state_name}}</span>
      </div>

<div class="ug-delete-detail-item">
        <span class="ug-delete-detail-label">district name:</span>
        <span class="ug-delete-detail-value">{{rowSelected.district_name}}</span>
      </div>

<div class="ug-delete-detail-item">
        <span class="ug-delete-detail-label">Papulation:</span>
        <span class="ug-delete-detail-value">{{rowSelected.papulation}}</span>
      </div>

<div class="ug-delete-detail-item">
        <span class="ug-delete-detail-label">male Papulation:</span>
        <span class="ug-delete-detail-value">{{rowSelected.male_papulation}}</span>
      </div>

<div class="ug-delete-detail-item">
        <span class="ug-delete-detail-label">female Papulation:</span>
        <span class="ug-delete-detail-value">{{rowSelected.female_papulation}}</span>
      </div>

 
    </div>

    <div class="modal-footer">
      <button type="button" class="ug-btn ug-btn-outline" (click)="modaldelete = false">Cancel</button>
      <button type="submit" (click)="delete(rowSelected.id)" class="ug-btn ug-btn-error">Delete</button>
    </div>
  </div>
</clr-modal>

<clr-modal [(clrModalOpen)]="modalCsv" [clrModalSize]="'sm'" [clrModalStaticBackdrop]="false">
  <h3 class="modal-title">Import File</h3>
  <div class="modal-body">
    <div class="ug-form-group">
      <label class="ug-form-label">Select CSV File</label>
      <input type="file" name="file" class="ug-file-input" (change)="selectFile($event)"
        accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel">
    </div>
  </div>
  <div class="modal-footer">
    <button class="ug-btn ug-btn-outline" type="button" (click)="modalCsv = false">Cancel</button>
    <button class="ug-btn ug-btn-primary" type="button" [disabled]="!selectedFiles" (click)="saveCsv()">Import</button>
  </div>
</clr-modal>









  <!-- htmlpopup -->
