HOme Page
<div class="main-container" style="max-width: 600px; margin: 50px auto; padding: 30px; background: #f4f6f8; border-radius: 10px; font-family: 'Segoe UI', sans-serif; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); text-align: center;">
<div class="top-row">
<h1 style="color: #2c3e50; font-size: 28px; margin-bottom: 20px;">Online Restaurant Management System</h1>
</div>
<hr class="divider" style="border: none; border-top: 2px solid #ccc; margin: 20px 0;" />
<div class="button-box" style="display: flex; flex-direction: column; gap: 20px; align-items: center;">
<a routerLink="/add" class="menu-button add" style="text-decoration: none; background: #27ae60; color: white; padding: 12px 25px; border-radius: 6px; font-size: 16px; font-weight: bold; box-shadow: 0 3px 6px rgba(0,0,0,0.1);">ADD MENU</a>
<a routerLink="/view" class="menu-button view" style="text-decoration: none; background: #2980b9; color: white; padding: 12px 25px; border-radius: 6px; font-size: 16px; font-weight: bold; box-shadow: 0 3px 6px rgba(0,0,0,0.1);">VIEW MENU</a>
</div>
<footer class="footer" style="margin-top: 30px; color: #888; font-size: 14px;">
<small>© 2025 EmpId 2797212 Om</small>
</footer>
</div>
---------------------------------------------------------------
ADD MENu
<div class="main-container" style="max-width: 800px; margin: 50px auto; padding: 30px; background-color: #f9fbfc; border-radius: 10px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); font-family: 'Segoe UI', sans-serif;">
<div class="top-row" style="text-align: center;">
<h1 style="margin-bottom: 10px; color: #2c3e50;">Online Restaurant Management System</h1>
</div>
<hr style="margin: 20px 0; border: none; border-top: 2px solid #ccc;" />
<div class="foorm-container">
<h2 style="text-align: center; color: #34495e; margin-bottom: 25px;">Add Menu</h2>
<form (ngSubmit)="submitMenu()" #form="ngForm" style="display: flex; flex-direction: column; gap: 18px;">
<!-- Menu Name -->
<div>
<label>Menu Name:</label><br />
<input type="text" [(ngModel)]="menu.menuName" name="menuName" required minlength="3" #menuName="ngModel"
style="width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 5px;" />
<div *ngIf="menuName.invalid && menuName.touched" style="color: red; font-size: 13px;">
Menu Name is required (min 3 characters).
</div>
</div>
<!-- Description -->
<div>
<label>Description:</label><br />
<textarea [(ngModel)]="menu.description" name="description" rows="3"
style="width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 5px;"></textarea>
</div>
<!-- Category -->
<div>
<label>Category:</label><br />
<input type="text" [(ngModel)]="menu.category" name="category" required minlength="30"
style="width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 5px;" />
</div>
<!-- Type -->
<div>
<label>Type:</label><br />
<select [(ngModel)]="menu.type" name="type" required
style="width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 5px;">
<option value="Veg">Veg</option>
<option value="Non-Veg">Non-Veg</option>
</select>
</div>
<!-- Cost -->
<div>
<label>Cost:</label><br />
<input type="number" [(ngModel)]="menu.cost" name="cost" required minlength="3"
style="width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 5px;" />
</div>
<!-- Status -->
<div>
<label>Status:</label><br />
<select [(ngModel)]="menu.status" name="status" required
style="width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 5px;">
<option value="Available">Available</option>
<option value="Not Available">Not Available</option>
</select>
</div>
<!-- Buttons -->
<div style="display: flex; gap: 10px; align-items: center;">
<button type="submit"
style="padding: 10px 20px; background-color: #27ae60; border: none; color: white; border-radius: 5px; cursor: pointer;">Submit</button>
<button type="button" (click)="resetForm()"
style="padding: 10px 20px; background-color: #e67e22; border: none; color: white; border-radius: 5px; cursor: pointer;">Reset</button>
<a routerLink="/" style="margin-left: auto; color: #2980b9; text-decoration: none; font-weight: bold;">Back To Home</a>
</div>
</form>
</div>
<footer class="footer" style="text-align: center; margin-top: 30px; font-size: 13px; color: #888;">
<small>© 2025 EmpId 2797212 Om</small>
</footer>
</div>
------------------------------------------------
Update Menu
<div class="maain-container" style="max-width: 600px; margin: 40px auto; font-family: Arial, sans-serif; padding: 30px; border: 1px solid #ddd; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); background: #f9f9f9;">
<h2 class="form-title" style="text-align: center; color: #333; margin-bottom: 20px;">UPDATE MENU</h2>
<form (ngSubmit)="updateMenu()" #form="ngForm" style="display: flex; flex-direction: column; gap: 15px;">
<!-- Menu Name (Readonly) -->
<label>Menu Name:</label>
<input type="text" [(ngModel)]="menu.menuName" name="menuName" readonly
style="padding: 10px; border-radius: 6px; border: 1px solid #ccc; background-color: #eee;" />
<!-- Description (Readonly) -->
<label>Description:</label>
<textarea [(ngModel)]="menu.description" name="description" readonly
style="padding: 10px; border-radius: 6px; border: 1px solid #ccc; resize: none; height: 100px; background-color: #eee;"></textarea>
<!-- Category (Readonly) -->
<label>Category:</label>
<input type="text" [(ngModel)]="menu.category" name="category" readonly
style="padding: 10px; border-radius: 6px; border: 1px solid #ccc; background-color: #eee;" />
<!-- Type (Readonly) -->
<label>Type:</label>
<select [(ngModel)]="menu.type" name="type" disabled
style="padding: 10px; border-radius: 6px; border: 1px solid #ccc; background-color: #eee;">
<option value="Veg">Veg</option>
<option value="Non-Veg">Non-Veg</option>
</select>
<!-- Cost (Editable) -->
<label>Cost:</label>
<input type="number" [(ngModel)]="menu.cost" name="cost" required
style="padding: 10px; border-radius: 6px; border: 1px solid #ccc;" />
<!-- Status (Editable) -->
<label>Status:</label>
<select [(ngModel)]="menu.status" name="status" required
style="padding: 10px; border-radius: 6px; border: 1px solid #ccc;">
<option value="Available">Available</option>
<option value="Not Available">Not Available</option>
</select>
<!-- Buttons -->
<div style="display: flex; justify-content: space-between; align-items: center; margin-top: 20px;">
<button type="submit"
style="padding: 10px 20px; background-color: #007bff; color: white; border: none; border-radius: 6px; cursor: pointer;">Update</button>
<a routerLink="/view" style="text-decoration: none; color: #555; font-weight: bold;">Cancel</a>
</div>
</form>
<footer class="footer" style="text-align: center; margin-top: 30px;">
<small>© 2025 EmpId 2797212 Om</small>
</footer>
</div>
-------------------------------------------------------------------------------------
ADD Menu with validation
<div class="main-container" style="max-width: 800px; margin: 50px auto; padding: 30px; background-color: #f9fbfc; border-radius: 10px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); font-family: 'Segoe UI', sans-serif;">
<div class="top-row" style="text-align: center;">
<h1 style="margin-bottom: 10px; color: #2c3e50;">Online Restaurant Management System</h1>
</div>
<hr style="margin: 20px 0; border: none; border-top: 2px solid #ccc;" />
<div class="foorm-container">
<h2 style="text-align: center; color: #34495e; margin-bottom: 25px;">Add Menu</h2>
<form (ngSubmit)="submitMenu()" #form="ngForm" style="display: flex; flex-direction: column; gap: 18px;">
<!-- Menu Name -->
<div>
<label>Menu Name:</label><br />
<input type="text" [(ngModel)]="menu.menuName" name="menuName" required minlength="3" #menuName="ngModel"
style="width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 5px;" />
<div *ngIf="menuName.invalid && menuName.touched" style="color: red; font-size: 13px;">
Menu Name is required (min 3 characters).
</div>
</div>
<!-- Description -->
<div>
<label>Description:</label><br />
<textarea [(ngModel)]="menu.description" name="description" rows="3" #description="ngModel"
required minlength="10"
style="width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 5px;"></textarea>
<div *ngIf="description.invalid && description.touched" style="color: red; font-size: 13px;">
Description is required (min 10 characters).
</div>
</div>
<!-- Category -->
<div>
<label>Category:</label><br />
<input type="text" [(ngModel)]="menu.category" name="category" required minlength="5" #category="ngModel"
style="width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 5px;" />
<div *ngIf="category.invalid && category.touched" style="color: red; font-size: 13px;">
Category is required (min 5 characters).
</div>
</div>
<!-- Type -->
<div>
<label>Type:</label><br />
<select [(ngModel)]="menu.type" name="type" required #type="ngModel"
style="width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 5px;">
<option value="">Select</option>
<option value="Veg">Veg</option>
<option value="Non-Veg">Non-Veg</option>
</select>
<div *ngIf="type.invalid && type.touched" style="color: red; font-size: 13px;">
Type selection is required.
</div>
</div>
<!-- Cost -->
<div>
<label>Cost:</label><br />
<input type="number" [(ngModel)]="menu.cost" name="cost" required min="1" #cost="ngModel"
style="width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 5px;" />
<div *ngIf="cost.invalid && cost.touched" style="color: red; font-size: 13px;">
Cost must be a positive number.
</div>
</div>
<!-- Status -->
<div>
<label>Status:</label><br />
<select [(ngModel)]="menu.status" name="status" required #status="ngModel"
style="width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 5px;">
<option value="">Select</option>
<option value="Available">Available</option>
<option value="Not Available">Not Available</option>
</select>
<div *ngIf="status.invalid && status.touched" style="color: red; font-size: 13px;">
Please select a status.
</div>
</div>
<!-- Buttons -->
<div style="display: flex; gap: 10px; align-items: center;">
<button type="submit"
style="padding: 10px 20px; background-color: #27ae60; border: none; color: white; border-radius: 5px; cursor: pointer;">Submit</button>
<button type="button" (click)="resetForm()"
style="padding: 10px 20px; background-color: #e67e22; border: none; color: white; border-radius: 5px; cursor: pointer;">Reset</button>
<a routerLink="/" style="margin-left: auto; color: #2980b9; text-decoration: none; font-weight: bold;">Back To Home</a>
</div>
</form>
</div>
<footer class="footer" style="text-align: center; margin-top: 30px; font-size: 13px; color: #888;">
<small>© 2025 EmpId 2797212 Om</small>
</footer>
</div>
-----------------------------------------------
view Menu
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>View Menus</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- Paste your full <div class="main-container">...</div> here -->
</body>
</html>
<div class="main-container" style="max-width: 1000px; margin: 40px auto; padding: 30px; background: #f7f9fb; font-family: 'Segoe UI', sans-serif; border-radius: 12px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);">
<div class="top-row" style="text-align: center;">
<h1 class="main-title" style="color: #2c3e50; margin-bottom: 10px;">Online Restaurant Management System</h1>
</div>
<hr class="divider" style="margin: 20px 0; border: none; border-top: 2px solid #ccc;" />
<div class="form-container">
<h2 class="form-title" style="text-align: center; color: #34495e;">VIEW MENUS</h2>
<!-- VEG SECTION -->
<h3 class="sub-heading" style="margin-top: 30px; color: #27ae60;">Menus Tagged to Type: VEG</h3>
<table style="width: 100%; border-collapse: collapse; margin-top: 10px; background: white; border-radius: 8px; overflow: hidden;">
<thead style="background-color: #2ecc71; color: white;">
<tr>
<th style="padding: 12px;">MenuId</th>
<th style="padding: 12px;">Name</th>
<th style="padding: 12px;">Category</th>
<th style="padding: 12px;">Cost</th>
<th style="padding: 12px;">Status</th>
<th style="padding: 12px;">Action</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of vegItems" style="text-align: center; border-bottom: 1px solid #ddd;">
<td style="padding: 10px;">{{ item.menuId }}</td>
<td style="padding: 10px;">{{ item.menuName }}</td>
<td style="padding: 10px;">{{ item.category }}</td>
<td style="padding: 10px;">₹{{ item.cost }}</td>
<td style="padding: 10px;">{{ item.status }}</td>
<td style="padding: 10px;">
<button (click)="editMenu(item.menuId)" style="background: #2980b9; color: white; border: none; padding: 8px 12px; border-radius: 5px; cursor: pointer; margin-right: 5px;">Update</button>
<button (click)="confirmDelete(item.menuId)" style="background: #c0392b; color: white; border: none; padding: 8px 12px; border-radius: 5px; cursor: pointer;">Delete</button>
</td>
</tr>
</tbody>
</table>
<!-- NON VEG SECTION -->
<h3 class="sub-heading" style="margin-top: 40px; color: #e67e22;">Menus Tagged to Type: NON VEG</h3>
<table style="width: 100%; border-collapse: collapse; margin-top: 10px; background: white; border-radius: 8px; overflow: hidden;">
<thead style="background-color: #e67e22; color: white;">
<tr>
<th style="padding: 12px;">MenuId</th>
<th style="padding: 12px;">Name</th>
<th style="padding: 12px;">Category</th>
<th style="padding: 12px;">Cost</th>
<th style="padding: 12px;">Status</th>
<th style="padding: 12px;">Action</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of nonVegItems" style="text-align: center; border-bottom: 1px solid #ddd;">
<td style="padding: 10px;">{{ item.menuId }}</td>
<td style="padding: 10px;">{{ item.menuName }}</td>
<td style="padding: 10px;">{{ item.category }}</td>
<td style="padding: 10px;">₹{{ item.cost }}</td>
<td style="padding: 10px;">{{ item.status }}</td>
<td style="padding: 10px;">
<button (click)="editMenu(item.menuId)" style="background: #2980b9; color: white; border: none; padding: 8px 12px; border-radius: 5px; cursor: pointer; margin-right: 5px;">Update</button>
<button (click)="confirmDelete(item.menuId)" style="background: #c0392b; color: white; border: none; padding: 8px 12px; border-radius: 5px; cursor: pointer;">Delete</button>
</td>
</tr>
</tbody>
</table>
<div style="text-align: center; margin-top: 30px;">
<a routerLink="/" class="back-btn" style="text-decoration: none; background: #7f8c8d; color: white; padding: 10px 20px; border-radius: 6px; font-weight: bold;">Back To Home</a>
</div>
</div>
<footer class="footer" style="text-align: center; margin-top: 40px; color: #999;">
<small>© 2025 EmpId 2797212 Om</small>
</footer>
</div>
Comments
Post a Comment