searchlicense.component.html 15.7 KB
<div class="row">
  <!-- main-heading -->
  <div class="col-sm-12 pageHeading" style="margin-left: 15px;">
    <h4>Search License</h4>
  </div>
  <!-- main-heading -->

  <ng-template #template>
    <div class="modal-header">
      <h4 class="modal-title pull-left">Delete</h4>
      <button type="button" class="close pull-right" aria-label="Close" (click)="modalRef.hide()">
        <span aria-hidden="true">&times;</span>
      </button>
    </div>
    <div class="modal-body">
      <p>Do you want to delete the selected license?</p>
    </div>
    <div class="modal-footer">
      <button type="button" class="btn btn-primary btn-sm" (click)="DeleteLicense(templatesuccess)">Yes</button>
      <button type="button" class="btn btn-primary btn-sm" (click)="modalRef.hide()">No</button>
    </div>
  </ng-template>

  <ng-template #templatesuccess>
    <div class="modal-header">
      <h4 class="modal-title pull-left">Confirmation</h4>
      <button type="button" class="close pull-right" aria-label="Close" (click)="modalRef.hide()">
        <span aria-hidden="true">&times;</span>
      </button>
    </div>
    <div class="modal-body" [innerHTML]="modalAlerts">
    </div>
    <div class="modal-footer">
    </div>
  </ng-template>

  <!-- container -->
  <div class="col-sm-12" style="margin-left: 0px;">

    <div class="container-fluid main-full">

      <form class="row" [formGroup]="searchLicenseFrm" (submit)="SearchRecords()">

        <div class="well no-margin-btm">

          <div class="row">

            <div class="form-group" *ngIf="alerts != ''">
              <div class="col-xs-12">
                <div class="alert alert-danger" [innerHTML]="alerts">
                </div>
              </div>
            </div>

            <div class="col-lg-4 col-sm-4">

              <div class="row">

                <div class="col-sm-12">
                  <div class="form-group marginTop5">
                    <label for="AccountNumber" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0">Account Number : </label>
                    <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
                      <input type="text" class="form-control input-sm" id="AccountNumber" formControlName="accountNumber" maxlength="16">
                    </div>
                  </div>
                </div>

                <div class="col-sm-12">
                  <div class="form-group marginTop5">
                    <label for="LicenseeFirstName" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0">Licensee First Name :</label>
                    <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
                      <input type="text" class="form-control input-sm" id="LicenseeFirstName" formControlName="licenseeFirstName" maxlength="50">
                    </div>
                  </div>
                </div>

                <div class="col-sm-12">
                  <div class="form-group marginTop5">
                    <label for="LicenseeLastName" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0">Licensee Last Name :</label>
                    <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
                      <input type="text" class="form-control input-sm" id="LicenseeLastName" formControlName="licenseeLastName" maxlength="50">
                    </div>
                  </div>
                </div>

                <div class="col-sm-12">
                  <div class="form-group marginTop5">
                    <label for="LicenseType" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0">License Type :</label>
                  </div>
                  <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
                    <select class="form-control input-sm" id="LicenseType" formControlName="licenseTypeId">
                      <option selected="selected" value="0">All</option>
                      <option *ngFor="let item of lstLicenceType" value="{{item.Id}}">
                        {{item.Title}}
                      </option>
                    </select>
                  </div>
                </div>

              </div>
            </div>

            <div class="col-lg-4 col-sm-4">
              <div class="row">

                <div class="col-sm-12">
                  <div class="form-group marginTop5">
                    <label for="InstitutionName" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0" title="Institution Name">Institution Name : </label>
                    <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
                      <input type="text" class="form-control input-sm" id="InstitutionName" formControlName="institutionName" maxlength="100">
                    </div>
                  </div>
                </div>

                <div class="col-sm-12">
                  <div class="form-group marginTop5">
                    <label for="State" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0">State (only U.S.) :</label>
                    <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
                      <select class="form-control input-sm " id="State" formControlName="stateId">
                        <option selected="selected" value="0">All</option>
                        <option *ngFor="let item of lstState" value="{{item.Id}}">
                          {{item.StateName}}
                        </option>
                      </select>
                    </div>
                  </div>
                </div>

                <div class="col-sm-12">
                  <div class="form-group marginTop5">
                    <label for="Country" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0">Country :</label>
                    <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
                      <select class="form-control input-sm" id="Country" formControlName="countryId">
                        <option selected="selected" value="0">All</option>
                        <option *ngFor="let item of lstCountry" value="{{item.Id}}">
                          {{item.CountryName}}
                        </option>
                      </select>
                    </div>
                  </div>
                </div>

                <div class="col-sm-12">
                  <div class="form-group marginTop5 margin48Top-sm">
                    <div class="checkbox text-right-lg">
                      <label class="marginR5">
                        <input type="checkbox"  formControlName="isActive"> License Active
                      </label>
                      <!--<label>
                        <input type="checkbox" checked=""> Pagination Results
                      </label>-->
                    </div>
                  </div>
                </div>

              </div>
            </div>

            <div class="col-lg-4 col-sm-4">
              <div class="row">

                <div class="col-sm-12">
                  <div class="form-group marginTop5">
                    <label for="EmailID" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0">Email ID : </label>
                    <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
                      <input type="email" class="form-control input-sm" id="EmailID" formControlName="emailId" maxlength="50">
                      <div *ngIf="searchLicenseFrm.controls.emailId.hasError('email') && searchLicenseFrm.controls.emailId.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Email is invalid</div>
                    </div>
                  </div>
                </div>

                <div class="col-sm-12">
                  <div class="form-group marginTop5">
                    <label for="SubscriptionStartDate" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0">Subscription Start Date :</label>
                    <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
                      <div id="datetimepicker1" class="input-group input-group-sm input-append date">
                        <input type="text" class="form-control" id="SubscriptionStartDate" formControlName="subscriptionStartDate" #dp1="bsDatepicker"
                               bsDatepicker [(bsValue)]="bsValue1" [minDate]="minDate" [maxDate]="maxDate" [bsConfig]="bsConfig" (bsValueChange)="DateChange(dp1)"
                               (change)="DateChange(dp1)">
                        <span class="input-group-btn add-on">
                          <button class="btn btn-default" type="button" (click)="dp1.toggle()"><i class="fa fa-calendar icon-calendar"></i></button>
                        </span>
                      </div>
                      <span class="help-block">(mm/dd/yyyy)</span>
                      <div *ngIf="dateStartInvalid && searchLicenseFrm.controls.subscriptionStartDate.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Subscription start date requires date in mm/dd/yyyy format</div>
                    </div>
                  </div>
                </div>

                <div class="col-sm-12">
                  <div class="form-group marginTop5">
                    <label for="SubscriptionEndDate" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0">Subscription End Date :</label>
                    <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
                      <div id="datetimepicker2" class="input-group input-group-sm input-append date">
                        <input type="text" class="form-control" id="SubscriptionEndDate" formControlName="subscriptionEndDate" #dp2="bsDatepicker"
                               bsDatepicker [(bsValue)]="bsValue2" [minDate]="minDate" [maxDate]="maxDate" [bsConfig]="bsConfig" (bsValueChange)="DateChange(dp2)"
                               (change)="DateChange(dp2)">
                        <span class="input-group-btn add-on">
                          <button class="btn btn-default" type="button" (click)="dp2.toggle()"><i class="fa fa-calendar icon-calendar"></i></button>
                        </span>
                      </div>
                      <span class="help-block">(mm/dd/yyyy)</span>
                      <div *ngIf="dateEndInvalid && searchLicenseFrm.controls.subscriptionEndDate.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Subscription end date requires date in mm/dd/yyyy format</div>
                    </div>
                  </div>
                </div>

                <div class="col-sm-12">
                  <div class="form-group marginTop5 margin48Top-sm text-right">
                    <button class="btn btn-primary btn-sm" [disabled]="dateStartInvalid || dateEndInvalid || this.alerts != ''"><i class="fa fa-search"></i> Search</button>
                  </div>
                </div>

              </div>
            </div>
          </div>

        </div>

        <div class="well">
          <table id="fixed_hdr2" class="table-hover  ui-widget-header sorttable" style="width: 4032px;">
            <thead>
              
              <tr>
                <th style="width: 150px">Account No.</th>
                <th style="width: 150px">Licensee Name</th>
                <th style="width: 150px">License Type</th>
                <th style="width: 150px">Account Type</th>
                <th style="width: 150px">Institution Name</th>
                <th style="width: 150px">Address</th>
                <th style="width: 150px">State (Only U.S.)</th>
                <th style="width: 150px">Country</th>
                <th style="width: 150px">Email ID</th>
                <th style="width: 200px">Subscription Start Date</th>
                <th style="width: 200px">Subscription Renewal Date</th>
                <th style="width: 200px">Subscription End Date</th>
                <th style="width: 150px">Status</th>
                <th style="width: 200px">Original Entry Date</th>
                <th style="width: 200px">Last Modified Date</th>
                <th style="width: 200px">No. of Export Images</th>
                <th style="width: 150px">Admin</th>
                <th style="width: 150px">Credit Card No.</th>
                <th style="width: 150px">Product Key</th>
              </tr>
            </thead>
            <tbody>
              <tr *ngIf="NoRecord !== ''">

                <td colspan="10"><b style="color: red;text-align: center; padding-left: 606px;"><span [innerHTML]="NoRecord"></span></b></td>
              </tr>
              <tr class="ui-widget-content" *ngFor="let item of this.searchLicenseFrm.controls['licenses'].value; let i = index" (click)="SetClickedRow(i, item)"
                  [class.active]="i == selectedRow" [class.inactive]="i != selectedRow">
                <td style="text-align: center; width: 150px">
                  <input type="hidden" value="{{item.LicenseId}}"> {{item.AccountNumber}}
                </td>
                <td style="text-align: center; width: 150px">{{item.LicenseeName}}</td>
                <td style="text-align: center; width: 150px">{{item.LicenseTypeName}}</td>
                <td style="text-align: center; width: 150px">{{item.AccountTypeName}}</td>
                <td style="text-align: center; width: 150px">{{item.InstitutionName}}</td>
                <td style="text-align: center; width: 150px">{{item.Address}}</td>
                <td style="text-align: center; width: 150px">{{item.LicenseState}}</td>
                <td style="text-align: center; width: 150px">{{item.LicenseCountry}}</td>
                <td style="text-align: center; width: 150px">{{item.EmailId}}</td>
                <td style="text-align: center; width: 200px">{{item.SubscriptionStartDate == '0001-01-01T00:00:00' ? '' : item.SubscriptionStartDate | date: 'MM/dd/yyyy'}}</td>
                <td style="text-align: center; width: 200px">{{item.RenewDate == '0001-01-01T00:00:00' ? '' : item.RenewDate | date: 'MM/dd/yyyy'}}</td>
                <td style="text-align: center; width: 200px">{{item.SubscriptionEndDate == '0001-01-01T00:00:00' ? '' : item.SubscriptionEndDate | date: 'MM/dd/yyyy'}}</td>
                <td style="text-align: center; width: 150px">
                  <span *ngIf="item.IsActive" class="label label-success">Active</span>
                  <span *ngIf="!item.IsActive" class="label label-default">Inactive</span>
                </td>
                <td style="text-align: center; width: 200px">{{item.EntryDate == '0001-01-01T00:00:00' ? '' : item.EntryDate | date: 'MM/dd/yyyy'}}</td>
                <td style="text-align: center; width: 200px">{{item.ModifyDate == '0001-01-01T00:00:00' ? '' : item.ModifyDate | date: 'MM/dd/yyyy'}}</td>
                <td style="text-align: center; width: 200px">{{item.NoOfImages}}</td>
                <td style="text-align: center; width: 150px">{{item.ClientAdmin}}</td>
                <td style="text-align: center; width: 150px">{{item.CardNumber}}</td>
                <td style="text-align: center; width: 150px">{{item.ProductKey}}</td>
              </tr>
            </tbody>
          </table>
          <admin-pager [recordCount]="recordCount" [pageNo]="pageNo" [pageLength]="pageLength" (pagerEvent)="SearchLicenses($event)"></admin-pager>
          <div class="row">
            <div class="col-lg-2 col-sm-6 pull-right">
              <div class="pull-right marginTop20">
                <button type="button" class="btn btn-primary btn-sm" (click)="openModal(template)" [disabled]="selectedRow == -1"><i class="fa fa-trash"></i> Delete</button>
                <button type="button" class="btn btn-primary btn-sm" (click)="EditLicense()" [disabled]="selectedRow == -1"><i class="fa fa-edit"></i> Edit</button>
              </div>
            </div>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>