usagereport.component.html 8.81 KB
<style>
  :host /deep/ ng2-smart-table {
    font-size: 12px;
  }
</style>
<div class="row"  style="margin-right: auto;">
  <div class="col-sm-12 pageHeading" style="margin-left: 15px;">
    <h4>Usage Report</h4>
  </div>
  <div class="col-sm-12">

    <div class="container-fluid main-full">
      <div class="row" style="margin-right:-40px">        
        <div class="well no-margin-btm">
            <div class="col-xs-12" *ngIf="alerts !== ''">
                <div class="alert alert-danger" [innerHTML]="alerts">
                </div>

              </div>
          <div class="row" [formGroup]="UsageReportForm">
            <div class="col-lg-4 col-sm-4">
              <div class="row">
                <div class="col-sm-12">
                  <div class="form-group marginTop5">
                    <label for="sFromDate" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0">From Date :</label>
                    <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
                      <div id="sFromDate" class="input-group input-group-sm input-append date">
                        <input type="text" class="form-control" formControlName="sFromDate" 
						#dp1="bsDatepicker" bsDatepicker [(bsValue)]="bsValue1" (bsValueChange)="FromDateChange(dp1)" (change)="FromDateChange(dp1)"
						[bsConfig]="bsConfig" placeholder="mm/dd/yyyy">
                        <span class="input-group-btn add-on">
                          <button class="btn btn-default" type="button" (click)="dp1.toggle()"><i class="fa fa-calendar"></i></button>
                        </span>
                      </div>
                    </div>

                  </div>
                </div>

                <div class="col-sm-12">
                  <div class="form-group marginTop5">
                    <label for="sToDate" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0">To Date :</label>
                    <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
                      <div id="sToDate" class="input-group input-group-sm input-append date">
                        <input type="text" class="form-control" formControlName="sToDate" 
						#dp2="bsDatepicker" bsDatepicker [(bsValue)]="bsValue2" (bsValueChange)="ToDateChange(dp2)" (change)="ToDateChange(dp2)"
						[bsConfig]="bsConfig" placeholder="mm/dd/yyyy">
                        <span class="input-group-btn add-on">
                          <button class="btn btn-default" type="button" (click)="dp2.toggle()"><i class="fa fa-calendar"></i></button>
                        </span>
                      </div>
                    </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="AccountNumber" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0">Account Number :</label>
                  </div>
                  <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
                    <input [attr.disabled]="DisableAccountNumberControl?'':null" type="text" class="form-control input-sm" id="acc-num" placeholder="" formControlName="sAccountNumber">
                  </div>
                </div>

                <div class="col-sm-12">
                  <div class="form-group marginTop5">
                    <label for="Zip" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0">Zip :</label>
                  </div>
                  <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
                    <input type="text" class="form-control input-sm" id="zip" placeholder="" formControlName="sZip">
                  </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="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="iState">
                        <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="State" 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="State" formControlName="iCountry">
                        <option selected="selected" value="0">All</option>
                        <option *ngFor="let country of lstCountry" value="{{country.Id}}">{{ country.CountryName }}</option>
                      </select>
                    </div>
                  </div>

                </div>

                <div class="col-sm-12">
                  <div class="form-group marginTop5 text-right">
                    <button class="btn btn-primary btn-sm" data-toggle="modal" (click)="SearchRecords()" [disabled]="!UsageReportForm.valid || alerts != ''"><i class="fa fa-file"></i>  Generate Report</button>
                    <!--modal-->
                    <div class="modal fade bs-example-modal-sm text-left" tabindex="-1" role="dialog" id="mymodal">
                      <div class="modal-dialog modal-sm" role="document">
                        <div class="modal-content">
                          <div class="modal-header annotation-modal-header ui-draggable-handle">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                            <h4 class="modal-title" id="">Alert</h4>
                          </div>
                          <div class="modal-body">
                            <h5>Account number does not exist in the system.</h5>
                          </div>
                          <div class="modal-footer">
                            <div class="row">
                              <div class="col-sm-12"><button class="btn btn-primary btn-sm">Ok</button></div>
                            </div>
                          </div>

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

          </div>
          

        </div>

        <div class="well">
		<table id="fixed_hdr2" class="table-hover  ui-widget-header sorttable">
		<thead>
		  <tr>
			<th id="LoginId">User Name</th>
			<th id="FirstName">First Name</th>
			<th id="LastName">Last Name</th>
			<th id="AccountNumber">Account Number</th>
			<th id="InstitutionName">Institution Name</th>
			<th id="CardNumber">Card Number</th>
			<th id="UserType">User Type</th>
			<th id="LicenseZip">Zip</th>
			<th id="LicenseState">State(only U.S.)</th>
			<th id="LicenseCountry">Country</th>
			<th id="TotalLogins">Total Login</th>
			<th id="LicenseCreationDate">Org. Entry Date</th>
			<th id="LastLogin">Last Login Date</th>
		  </tr>
		</thead>
		<tbody>
		  <tr *ngIf="NoRecord !== ''">

			<td colspan="6"><b style="color: red;text-align: center; padding-left: 606px;"><span [innerHTML]="NoRecord"></span></b></td>
		  </tr>
		  <tr *ngFor="let usage of lstUserUsageReport">
			<td>{{usage.LoginId}}</td>
			<td>{{usage.FirstName}}</td>
			<td>{{usage.LastName}}</td>
			<td>{{usage.AccountNumber}}</td>
			<td>{{usage.InstitutionName}}</td>
			<td>{{usage.CardNumber}}</td>
			<td>{{usage.UserType}}</td>
			<td>{{usage.LicenseZip}}</td>
			<td>{{usage.LicenseState}}</td>
			<td>{{usage.LicenseCountry}}</td>
			<td>{{usage.TotalLogins}}</td>
			<td>{{usage.LicenseCreationDate | date: 'MM/dd/yyyy'}}</td>
			<td>{{usage.LastLogin | date: 'MM/dd/yyyy'}}</td>
		  </tr>
		</tbody>
	  </table>
          <admin-pager [recordCount]="recordCount" [pageNo]="pageNo" [pageLength]="pageLength" (pagerEvent)="GetUsageReport($event)"></admin-pager>
          <div class="row">
            <div class="col-sm-12 marginTop20 text-center">
              <button type="button" class="btn btn-primary btn-sm" [ngClass]="{disabled : !buttonStatus}" (click)="ExportEvent()"><i class="fa fa-file-excel-o"></i>  Export To CSV</button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>