87 lines
3.2 KiB
HTML
87 lines
3.2 KiB
HTML
<mat-card>
|
|
<mat-card-header>
|
|
<mat-card-title-group>
|
|
<mat-card-title>Guest List</mat-card-title>
|
|
<a mat-button [routerLink]="['/guest-book', 'new']">
|
|
<mat-icon>add_box</mat-icon>
|
|
Add
|
|
</a>
|
|
</mat-card-title-group>
|
|
</mat-card-header>
|
|
<mat-card-content>
|
|
<form [formGroup]="form" class="flex flex-col">
|
|
<div class="flex flex-row justify-around content-start items-start">
|
|
<mat-form-field class="flex-auto">
|
|
<mat-label>Date</mat-label>
|
|
<input matInput [matDatepicker]="date" (focus)="date.open()" formControlName="date" autocomplete="off" />
|
|
<mat-datepicker-toggle matSuffix [for]="date"></mat-datepicker-toggle>
|
|
<mat-datepicker #date></mat-datepicker>
|
|
</mat-form-field>
|
|
</div>
|
|
</form>
|
|
<mat-table [dataSource]="dataSource" aria-label="Elements">
|
|
<!-- SNo Column -->
|
|
<ng-container matColumnDef="sno">
|
|
<mat-header-cell *matHeaderCellDef>S. No</mat-header-cell>
|
|
<mat-cell *matCellDef="let row">{{ row.serial }}</mat-cell>
|
|
</ng-container>
|
|
|
|
<!-- Name Column -->
|
|
<ng-container matColumnDef="name">
|
|
<mat-header-cell *matHeaderCellDef>Name</mat-header-cell>
|
|
<mat-cell *matCellDef="let row">{{ row.name }}</mat-cell>
|
|
</ng-container>
|
|
|
|
<!-- Phone Column -->
|
|
<ng-container matColumnDef="phone">
|
|
<mat-header-cell *matHeaderCellDef>Phone</mat-header-cell>
|
|
<mat-cell *matCellDef="let row">{{ row.phone }}</mat-cell>
|
|
</ng-container>
|
|
|
|
<!-- Pax Column -->
|
|
<ng-container matColumnDef="pax">
|
|
<mat-header-cell *matHeaderCellDef>Pax</mat-header-cell>
|
|
<mat-cell *matCellDef="let row">{{ row.pax }}</mat-cell>
|
|
</ng-container>
|
|
|
|
<!-- Time Column -->
|
|
<ng-container matColumnDef="date">
|
|
<mat-header-cell *matHeaderCellDef>Time</mat-header-cell>
|
|
<mat-cell *matCellDef="let row">{{ row.date | localTime }}</mat-cell>
|
|
</ng-container>
|
|
|
|
<!-- Action Column -->
|
|
<ng-container matColumnDef="action">
|
|
<mat-header-cell *matHeaderCellDef class="center">Action</mat-header-cell>
|
|
<mat-cell *matCellDef="let row" class="center">
|
|
<button mat-icon-button [routerLink]="['/sales']" [queryParams]="{ guest: row.id }" *ngIf="!row.tableId">
|
|
<mat-icon>chair</mat-icon>
|
|
</button>
|
|
<button
|
|
mat-stroked-button
|
|
color="primary"
|
|
[routerLink]="['/sales', 'bill']"
|
|
[queryParams]="{ table: row.tableId, voucher: row.voucherId }"
|
|
*ngIf="row.tableId"
|
|
>
|
|
{{ row.tableName }}
|
|
</button>
|
|
<button mat-icon-button [routerLink]="['/guest-book/', row.id]">
|
|
<mat-icon>edit</mat-icon>
|
|
</button>
|
|
<button mat-icon-button color="warn" (click)="confirmDelete(row.id)">
|
|
<mat-icon>delete</mat-icon>
|
|
</button>
|
|
</mat-cell>
|
|
</ng-container>
|
|
|
|
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
|
<mat-row
|
|
*matRowDef="let row; columns: displayedColumns"
|
|
[class.accent]="row.status === 'running'"
|
|
[class.strong-accent]="row.status === 'printed'"
|
|
></mat-row>
|
|
</mat-table>
|
|
</mat-card-content>
|
|
</mat-card>
|