skillerpwns commited on
Commit
5f4271f
·
verified ·
1 Parent(s): 57e63c7

Nothing happens when i click on the links. no pop ups no new page nothing. I need these to be fully functioning. - Initial Deployment

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +1217 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Cmms
3
- emoji: 🏃
4
- colorFrom: yellow
5
- colorTo: yellow
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: cmms
3
+ emoji: 🐳
4
+ colorFrom: purple
5
+ colorTo: green
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,1217 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>MaintenancePro - CMM System</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
10
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf-autotable/3.5.28/jspdf.plugin.autotable.min.js"></script>
11
+ <style>
12
+ .sidebar {
13
+ transition: all 0.3s;
14
+ }
15
+ .sidebar.collapsed {
16
+ width: 70px;
17
+ }
18
+ .sidebar.collapsed .nav-text {
19
+ display: none;
20
+ }
21
+ .sidebar.collapsed .logo-text {
22
+ display: none;
23
+ }
24
+ .sidebar.collapsed .nav-item {
25
+ justify-content: center;
26
+ }
27
+ .main-content {
28
+ transition: all 0.3s;
29
+ }
30
+ .sidebar.collapsed + .main-content {
31
+ margin-left: 70px;
32
+ }
33
+ .page {
34
+ display: none;
35
+ }
36
+ .page.active {
37
+ display: block;
38
+ }
39
+ .machine-card:hover {
40
+ transform: translateY(-5px);
41
+ box-shadow: 0 10px 20px rgba(0,0,0,0.1);
42
+ }
43
+ .status-indicator {
44
+ width: 12px;
45
+ height: 12px;
46
+ border-radius: 50%;
47
+ display: inline-block;
48
+ margin-right: 5px;
49
+ }
50
+ .status-operational {
51
+ background-color: #10B981;
52
+ }
53
+ .status-warning {
54
+ background-color: #F59E0B;
55
+ }
56
+ .status-critical {
57
+ background-color: #EF4444;
58
+ }
59
+ .status-maintenance {
60
+ background-color: #3B82F6;
61
+ }
62
+ </style>
63
+ </head>
64
+ <body class="bg-gray-100">
65
+ <div class="flex h-screen overflow-hidden">
66
+ <!-- Sidebar -->
67
+ <div class="sidebar bg-gray-800 text-white w-64 flex flex-col">
68
+ <div class="p-4 flex items-center">
69
+ <div class="w-10 h-10 bg-blue-500 rounded-full flex items-center justify-center">
70
+ <i class="fas fa-tools text-white text-xl"></i>
71
+ </div>
72
+ <span class="logo-text ml-3 text-xl font-bold">MaintenancePro</span>
73
+ </div>
74
+ <div class="flex-1 overflow-y-auto">
75
+ <nav class="mt-6">
76
+ <div class="nav-item px-6 py-3 flex items-center text-gray-300 hover:bg-gray-700 cursor-pointer" onclick="return showPage('dashboard')">
77
+ <i class="fas fa-tachometer-alt"></i>
78
+ <span class="nav-text ml-3">Dashboard</span>
79
+ </div>
80
+ <div class="nav-item px-6 py-3 flex items-center text-gray-300 hover:bg-gray-700 cursor-pointer" onclick="return showPage('machines')">
81
+ <i class="fas fa-industry"></i>
82
+ <span class="nav-text ml-3">Machines</span>
83
+ </div>
84
+ <div class="nav-item px-6 py-3 flex items-center text-gray-300 hover:bg-gray-700 cursor-pointer" onclick="return showPage('work-orders')">
85
+ <i class="fas fa-clipboard-list"></i>
86
+ <span class="nav-text ml-3">Work Orders</span>
87
+ </div>
88
+ <div class="nav-item px-6 py-3 flex items-center text-gray-300 hover:bg-gray-700 cursor-pointer" onclick="return showPage('pm-schedules')">
89
+ <i class="fas fa-calendar-check"></i>
90
+ <span class="nav-text ml-3">PM Schedules</span>
91
+ </div>
92
+ <div class="nav-item px-6 py-3 flex items-center text-gray-300 hover:bg-gray-700 cursor-pointer" onclick="return showPage('inventory')">
93
+ <i class="fas fa-boxes"></i>
94
+ <span class="nav-text ml-3">Inventory</span>
95
+ </div>
96
+ <div class="nav-item px-6 py-3 flex items-center text-gray-300 hover:bg-gray-700 cursor-pointer" onclick="return showPage('reports')">
97
+ <i class="fas fa-chart-bar"></i>
98
+ <span class="nav-text ml-3">Reports</span>
99
+ </div>
100
+ </nav>
101
+ </div>
102
+ <div class="p-4 border-t border-gray-700">
103
+ <div class="flex items-center">
104
+ <img src="https://via.placeholder.com/40" alt="User" class="rounded-full">
105
+ <div class="ml-3">
106
+ <span class="nav-text block text-gray-300">Admin User</span>
107
+ <span class="nav-text block text-gray-500 text-sm">admin@example.com</span>
108
+ </div>
109
+ </div>
110
+ </div>
111
+ </div>
112
+
113
+ <!-- Main Content -->
114
+ <div class="main-content flex-1 overflow-auto ml-64">
115
+ <header class="bg-white shadow-sm p-4 flex justify-between items-center">
116
+ <h1 class="text-2xl font-semibold text-gray-800" id="page-title">Dashboard</h1>
117
+ <div class="flex items-center space-x-4">
118
+ <div class="relative">
119
+ <input type="text" placeholder="Search..." class="pl-10 pr-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
120
+ <i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
121
+ </div>
122
+ <button class="p-2 text-gray-500 hover:text-gray-700">
123
+ <i class="fas fa-bell"></i>
124
+ </button>
125
+ </div>
126
+ </header>
127
+
128
+ <!-- Dashboard Page -->
129
+ <div class="page active p-6" id="dashboard">
130
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-6">
131
+ <div class="bg-white p-6 rounded-lg shadow">
132
+ <div class="flex items-center justify-between">
133
+ <div>
134
+ <p class="text-gray-500">Total Machines</p>
135
+ <h3 class="text-2xl font-bold" id="total-machines">12</h3>
136
+ </div>
137
+ <div class="p-3 bg-blue-100 rounded-full">
138
+ <i class="fas fa-industry text-blue-500 text-xl"></i>
139
+ </div>
140
+ </div>
141
+ </div>
142
+ <div class="bg-white p-6 rounded-lg shadow">
143
+ <div class="flex items-center justify-between">
144
+ <div>
145
+ <p class="text-gray-500">Active Work Orders</p>
146
+ <h3 class="text-2xl font-bold" id="active-orders">5</h3>
147
+ </div>
148
+ <div class="p-3 bg-green-100 rounded-full">
149
+ <i class="fas fa-clipboard-list text-green-500 text-xl"></i>
150
+ </div>
151
+ </div>
152
+ </div>
153
+ <div class="bg-white p-6 rounded-lg shadow">
154
+ <div class="flex items-center justify-between">
155
+ <div>
156
+ <p class="text-gray-500">Due PMs</p>
157
+ <h3 class="text-2xl font-bold" id="due-pms">3</h3>
158
+ </div>
159
+ <div class="p-3 bg-yellow-100 rounded-full">
160
+ <i class="fas fa-calendar-check text-yellow-500 text-xl"></i>
161
+ </div>
162
+ </div>
163
+ </div>
164
+ <div class="bg-white p-6 rounded-lg shadow">
165
+ <div class="flex items-center justify-between">
166
+ <div>
167
+ <p class="text-gray-500">Critical Alerts</p>
168
+ <h3 class="text-2xl font-bold" id="critical-alerts">2</h3>
169
+ </div>
170
+ <div class="p-3 bg-red-100 rounded-full">
171
+ <i class="fas fa-exclamation-triangle text-red-500 text-xl"></i>
172
+ </div>
173
+ </div>
174
+ </div>
175
+ </div>
176
+
177
+ <div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6">
178
+ <div class="bg-white p-6 rounded-lg shadow lg:col-span-2">
179
+ <h2 class="text-lg font-semibold mb-4">Recent Work Orders</h2>
180
+ <div class="overflow-x-auto">
181
+ <table class="min-w-full divide-y divide-gray-200">
182
+ <thead class="bg-gray-50">
183
+ <tr>
184
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">WO #</th>
185
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Machine</th>
186
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Type</th>
187
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
188
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Due Date</th>
189
+ </tr>
190
+ </thead>
191
+ <tbody class="bg-white divide-y divide-gray-200" id="recent-orders-table">
192
+ <!-- Filled by JavaScript -->
193
+ </tbody>
194
+ </table>
195
+ </div>
196
+ </div>
197
+ <div class="bg-white p-6 rounded-lg shadow">
198
+ <h2 class="text-lg font-semibold mb-4">Machine Status</h2>
199
+ <div class="space-y-4">
200
+ <div>
201
+ <div class="flex justify-between mb-1">
202
+ <span class="text-sm font-medium">Operational</span>
203
+ <span class="text-sm" id="operational-count">8</span>
204
+ </div>
205
+ <div class="w-full bg-gray-200 rounded-full h-2.5">
206
+ <div class="bg-green-500 h-2.5 rounded-full" style="width: 67%"></div>
207
+ </div>
208
+ </div>
209
+ <div>
210
+ <div class="flex justify-between mb-1">
211
+ <span class="text-sm font-medium">Warning</span>
212
+ <span class="text-sm" id="warning-count">2</span>
213
+ </div>
214
+ <div class="w-full bg-gray-200 rounded-full h-2.5">
215
+ <div class="bg-yellow-500 h-2.5 rounded-full" style="width: 17%"></div>
216
+ </div>
217
+ </div>
218
+ <div>
219
+ <div class="flex justify-between mb-1">
220
+ <span class="text-sm font-medium">Critical</span>
221
+ <span class="text-sm" id="critical-count">1</span>
222
+ </div>
223
+ <div class="w-full bg-gray-200 rounded-full h-2.5">
224
+ <div class="bg-red-500 h-2.5 rounded-full" style="width: 8%"></div>
225
+ </div>
226
+ </div>
227
+ <div>
228
+ <div class="flex justify-between mb-1">
229
+ <span class="text-sm font-medium">Maintenance</span>
230
+ <span class="text-sm" id="maintenance-count">1</span>
231
+ </div>
232
+ <div class="w-full bg-gray-200 rounded-full h-2.5">
233
+ <div class="bg-blue-500 h-2.5 rounded-full" style="width: 8%"></div>
234
+ </div>
235
+ </div>
236
+ </div>
237
+ </div>
238
+ </div>
239
+
240
+ <div class="bg-white p-6 rounded-lg shadow mb-6">
241
+ <h2 class="text-lg font-semibold mb-4">Upcoming PMs</h2>
242
+ <div class="overflow-x-auto">
243
+ <table class="min-w-full divide-y divide-gray-200">
244
+ <thead class="bg-gray-50">
245
+ <tr>
246
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">PM #</th>
247
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Machine</th>
248
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Type</th>
249
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Frequency</th>
250
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Due Date</th>
251
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
252
+ </tr>
253
+ </thead>
254
+ <tbody class="bg-white divide-y divide-gray-200" id="upcoming-pms-table">
255
+ <!-- Filled by JavaScript -->
256
+ </tbody>
257
+ </table>
258
+ </div>
259
+ </div>
260
+ </div>
261
+
262
+ <!-- Machines Page -->
263
+ <div class="page p-6" id="machines">
264
+ <div class="flex justify-between items-center mb-6">
265
+ <h2 class="text-2xl font-semibold">Machines</h2>
266
+ <button onclick="showAddMachineModal()" class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg flex items-center">
267
+ <i class="fas fa-plus mr-2"></i> Add Machine
268
+ </button>
269
+ </div>
270
+
271
+ <div class="bg-white p-6 rounded-lg shadow mb-6">
272
+ <div class="flex justify-between items-center mb-4">
273
+ <div class="relative w-64">
274
+ <input type="text" id="machine-search" placeholder="Search machines..." class="pl-10 pr-4 py-2 border rounded-lg w-full focus:outline-none focus:ring-2 focus:ring-blue-500">
275
+ <i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
276
+ </div>
277
+ <div class="flex space-x-2">
278
+ <select id="machine-status-filter" class="border rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
279
+ <option value="all">All Statuses</option>
280
+ <option value="operational">Operational</option>
281
+ <option value="warning">Warning</option>
282
+ <option value="critical">Critical</option>
283
+ <option value="maintenance">Maintenance</option>
284
+ </select>
285
+ <select id="machine-type-filter" class="border rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
286
+ <option value="all">All Types</option>
287
+ <option value="cnc">CNC Machine</option>
288
+ <option value="lathe">Lathe</option>
289
+ <option value="milling">Milling Machine</option>
290
+ <option value="press">Press</option>
291
+ <option value="other">Other</option>
292
+ </select>
293
+ </div>
294
+ </div>
295
+
296
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6" id="machines-grid">
297
+ <!-- Filled by JavaScript -->
298
+ </div>
299
+ </div>
300
+ </div>
301
+
302
+ <!-- Work Orders Page -->
303
+ <div class="page p-6" id="work-orders">
304
+ <div class="flex justify-between items-center mb-6">
305
+ <h2 class="text-2xl font-semibold">Work Orders</h2>
306
+ <div class="flex space-x-2">
307
+ <button onclick="showAddWorkOrderModal()" class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg flex items-center">
308
+ <i class="fas fa-plus mr-2"></i> New Work Order
309
+ </button>
310
+ <button onclick="exportWorkOrdersToPDF()" class="bg-green-500 hover:bg-green-600 text-white px-4 py-2 rounded-lg flex items-center">
311
+ <i class="fas fa-file-pdf mr-2"></i> Export
312
+ </button>
313
+ </div>
314
+ </div>
315
+
316
+ <div class="bg-white p-6 rounded-lg shadow">
317
+ <div class="flex justify-between items-center mb-4">
318
+ <div class="relative w-64">
319
+ <input type="text" id="work-order-search" placeholder="Search work orders..." class="pl-10 pr-4 py-2 border rounded-lg w-full focus:outline-none focus:ring-2 focus:ring-blue-500">
320
+ <i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
321
+ </div>
322
+ <div class="flex space-x-2">
323
+ <select id="work-order-status-filter" class="border rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
324
+ <option value="all">All Statuses</option>
325
+ <option value="open">Open</option>
326
+ <option value="in-progress">In Progress</option>
327
+ <option value="completed">Completed</option>
328
+ <option value="closed">Closed</option>
329
+ </select>
330
+ <select id="work-order-type-filter" class="border rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
331
+ <option value="all">All Types</option>
332
+ <option value="corrective">Corrective</option>
333
+ <option value="preventive">Preventive</option>
334
+ <option value="predictive">Predictive</option>
335
+ <option value="inspection">Inspection</option>
336
+ </select>
337
+ </div>
338
+ </div>
339
+
340
+ <div class="overflow-x-auto">
341
+ <table class="min-w-full divide-y divide-gray-200">
342
+ <thead class="bg-gray-50">
343
+ <tr>
344
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">WO #</th>
345
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Title</th>
346
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Machine</th>
347
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Type</th>
348
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Priority</th>
349
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
350
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Created</th>
351
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Due Date</th>
352
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
353
+ </tr>
354
+ </thead>
355
+ <tbody class="bg-white divide-y divide-gray-200" id="work-orders-table">
356
+ <!-- Filled by JavaScript -->
357
+ </tbody>
358
+ </table>
359
+ </div>
360
+ </div>
361
+ </div>
362
+
363
+ <!-- PM Schedules Page -->
364
+ <div class="page p-6" id="pm-schedules">
365
+ <div class="flex justify-between items-center mb-6">
366
+ <h2 class="text-2xl font-semibold">Preventive Maintenance Schedules</h2>
367
+ <button onclick="showAddPMScheduleModal()" class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg flex items-center">
368
+ <i class="fas fa-plus mr-2"></i> New PM Schedule
369
+ </button>
370
+ </div>
371
+
372
+ <div class="bg-white p-6 rounded-lg shadow">
373
+ <div class="overflow-x-auto">
374
+ <table class="min-w-full divide-y divide-gray-200">
375
+ <thead class="bg-gray-50">
376
+ <tr>
377
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">PM #</th>
378
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Machine</th>
379
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Description</th>
380
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Frequency</th>
381
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Last Completed</th>
382
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Next Due</th>
383
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
384
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
385
+ </tr>
386
+ </thead>
387
+ <tbody class="bg-white divide-y divide-gray-200" id="pm-schedules-table">
388
+ <!-- Filled by JavaScript -->
389
+ </tbody>
390
+ </table>
391
+ </div>
392
+ </div>
393
+ </div>
394
+
395
+ <!-- Inventory Page -->
396
+ <div class="page p-6" id="inventory">
397
+ <div class="flex justify-between items-center mb-6">
398
+ <h2 class="text-2xl font-semibold">Inventory</h2>
399
+ <button onclick="showAddInventoryItemModal()" class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg flex items-center">
400
+ <i class="fas fa-plus mr-2"></i> Add Item
401
+ </button>
402
+ </div>
403
+
404
+ <div class="bg-white p-6 rounded-lg shadow">
405
+ <div class="flex justify-between items-center mb-4">
406
+ <div class="relative w-64">
407
+ <input type="text" id="inventory-search" placeholder="Search inventory..." class="pl-10 pr-4 py-2 border rounded-lg w-full focus:outline-none focus:ring-2 focus:ring-blue-500">
408
+ <i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
409
+ </div>
410
+ <div class="flex space-x-2">
411
+ <select id="inventory-category-filter" class="border rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
412
+ <option value="all">All Categories</option>
413
+ <option value="electrical">Electrical</option>
414
+ <option value="mechanical">Mechanical</option>
415
+ <option value="hydraulic">Hydraulic</option>
416
+ <option value="pneumatic">Pneumatic</option>
417
+ <option value="consumable">Consumable</option>
418
+ </select>
419
+ <select id="inventory-status-filter" class="border rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
420
+ <option value="all">All Statuses</option>
421
+ <option value="in-stock">In Stock</option>
422
+ <option value="low-stock">Low Stock</option>
423
+ <option value="out-of-stock">Out of Stock</option>
424
+ </select>
425
+ </div>
426
+ </div>
427
+
428
+ <div class="overflow-x-auto">
429
+ <table class="min-w-full divide-y divide-gray-200">
430
+ <thead class="bg-gray-50">
431
+ <tr>
432
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Item #</th>
433
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Name</th>
434
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Category</th>
435
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Quantity</th>
436
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Min Level</th>
437
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
438
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Location</th>
439
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
440
+ </tr>
441
+ </thead>
442
+ <tbody class="bg-white divide-y divide-gray-200" id="inventory-table">
443
+ <!-- Filled by JavaScript -->
444
+ </tbody>
445
+ </table>
446
+ </div>
447
+ </div>
448
+ </div>
449
+
450
+ <!-- Reports Page -->
451
+ <div class="page p-6" id="reports">
452
+ <h2 class="text-2xl font-semibold mb-6">Reports</h2>
453
+
454
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
455
+ <div class="bg-white p-6 rounded-lg shadow">
456
+ <h3 class="text-lg font-semibold mb-4">Work Order Summary</h3>
457
+ <div class="flex justify-between mb-2">
458
+ <span>Total Work Orders:</span>
459
+ <span class="font-medium" id="total-work-orders">42</span>
460
+ </div>
461
+ <div class="flex justify-between mb-2">
462
+ <span>Completed:</span>
463
+ <span class="font-medium" id="completed-work-orders">28</span>
464
+ </div>
465
+ <div class="flex justify-between mb-2">
466
+ <span>Open:</span>
467
+ <span class="font-medium" id="open-work-orders">8</span>
468
+ </div>
469
+ <div class="flex justify-between mb-2">
470
+ <span>In Progress:</span>
471
+ <span class="font-medium" id="in-progress-work-orders">6</span>
472
+ </div>
473
+ <div class="mt-4">
474
+ <button onclick="generateWorkOrderReport()" class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg flex items-center">
475
+ <i class="fas fa-file-pdf mr-2"></i> Generate Report
476
+ </button>
477
+ </div>
478
+ </div>
479
+
480
+ <div class="bg-white p-6 rounded-lg shadow">
481
+ <h3 class="text-lg font-semibold mb-4">PM Completion Rate</h3>
482
+ <div class="flex justify-between mb-2">
483
+ <span>Total PMs:</span>
484
+ <span class="font-medium" id="total-pms">24</span>
485
+ </div>
486
+ <div class="flex justify-between mb-2">
487
+ <span>Completed on Time:</span>
488
+ <span class="font-medium" id="completed-on-time-pms">18</span>
489
+ </div>
490
+ <div class="flex justify-between mb-2">
491
+ <span>Completed Late:</span>
492
+ <span class="font-medium" id="completed-late-pms">4</span>
493
+ </div>
494
+ <div class="flex justify-between mb-2">
495
+ <span>Overdue:</span>
496
+ <span class="font-medium" id="overdue-pms">2</span>
497
+ </div>
498
+ <div class="mt-4">
499
+ <button onclick="generatePMReport()" class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg flex items-center">
500
+ <i class="fas fa-file-pdf mr-2"></i> Generate Report
501
+ </button>
502
+ </div>
503
+ </div>
504
+ </div>
505
+
506
+ <div class="bg-white p-6 rounded-lg shadow mb-6">
507
+ <h3 class="text-lg font-semibold mb-4">Machine Downtime Analysis</h3>
508
+ <div class="flex justify-between items-center mb-4">
509
+ <div>
510
+ <select id="downtime-period" class="border rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
511
+ <option value="week">Last Week</option>
512
+ <option value="month">Last Month</option>
513
+ <option value="quarter">Last Quarter</option>
514
+ <option value="year">Last Year</option>
515
+ </select>
516
+ </div>
517
+ <button onclick="generateDowntimeReport()" class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg flex items-center">
518
+ <i class="fas fa-file-pdf mr-2"></i> Generate Report
519
+ </button>
520
+ </div>
521
+ <div class="h-64 bg-gray-100 rounded-lg flex items-center justify-center">
522
+ <p class="text-gray-500">Downtime chart will be displayed here</p>
523
+ </div>
524
+ </div>
525
+
526
+ <div class="bg-white p-6 rounded-lg shadow">
527
+ <h3 class="text-lg font-semibold mb-4">Custom Report</h3>
528
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-4">
529
+ <div>
530
+ <label class="block text-gray-700 mb-2">Report Type</label>
531
+ <select id="custom-report-type" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500">
532
+ <option value="work-orders">Work Orders</option>
533
+ <option value="pm">Preventive Maintenance</option>
534
+ <option value="downtime">Downtime</option>
535
+ <option value="inventory">Inventory Usage</option>
536
+ </select>
537
+ </div>
538
+ <div>
539
+ <label class="block text-gray-700 mb-2">Date Range</label>
540
+ <select id="custom-report-range" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500">
541
+ <option value="week">Last Week</option>
542
+ <option value="month">Last Month</option>
543
+ <option value="quarter">Last Quarter</option>
544
+ <option value="year">Last Year</option>
545
+ <option value="custom">Custom Range</option>
546
+ </select>
547
+ </div>
548
+ </div>
549
+ <div id="custom-date-range" class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-4 hidden">
550
+ <div>
551
+ <label class="block text-gray-700 mb-2">Start Date</label>
552
+ <input type="date" id="custom-start-date" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500">
553
+ </div>
554
+ <div>
555
+ <label class="block text-gray-700 mb-2">End Date</label>
556
+ <input type="date" id="custom-end-date" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500">
557
+ </div>
558
+ </div>
559
+ <div class="flex justify-end">
560
+ <button onclick="generateCustomReport()" class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg flex items-center">
561
+ <i class="fas fa-file-pdf mr-2"></i> Generate Custom Report
562
+ </button>
563
+ </div>
564
+ </div>
565
+ </div>
566
+ </div>
567
+ </div>
568
+
569
+ <!-- Add Machine Modal -->
570
+ <div id="add-machine-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden z-50">
571
+ <div class="bg-white rounded-lg shadow-xl w-full max-w-2xl">
572
+ <div class="flex justify-between items-center border-b px-6 py-4">
573
+ <h3 class="text-lg font-semibold">Add New Machine</h3>
574
+ <button onclick="hideModal('add-machine-modal')" class="text-gray-500 hover:text-gray-700">
575
+ <i class="fas fa-times"></i>
576
+ </button>
577
+ </div>
578
+ <div class="p-6">
579
+ <form id="add-machine-form">
580
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
581
+ <div>
582
+ <label class="block text-gray-700 mb-2">Machine Name*</label>
583
+ <input type="text" id="machine-name" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500" required>
584
+ </div>
585
+ <div>
586
+ <label class="block text-gray-700 mb-2">Machine ID*</label>
587
+ <input type="text" id="machine-id" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500" required>
588
+ </div>
589
+ <div>
590
+ <label class="block text-gray-700 mb-2">Machine Type*</label>
591
+ <select id="machine-type" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500" required>
592
+ <option value="">Select Type</option>
593
+ <option value="cnc">CNC Machine</option>
594
+ <option value="lathe">Lathe</option>
595
+ <option value="milling">Milling Machine</option>
596
+ <option value="press">Press</option>
597
+ <option value="other">Other</option>
598
+ </select>
599
+ </div>
600
+ <div>
601
+ <label class="block text-gray-700 mb-2">Status*</label>
602
+ <select id="machine-status" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500" required>
603
+ <option value="operational">Operational</option>
604
+ <option value="warning">Warning</option>
605
+ <option value="critical">Critical</option>
606
+ <option value="maintenance">Maintenance</option>
607
+ </select>
608
+ </div>
609
+ <div>
610
+ <label class="block text-gray-700 mb-2">Installation Date</label>
611
+ <input type="date" id="machine-install-date" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500">
612
+ </div>
613
+ <div>
614
+ <label class="block text-gray-700 mb-2">Manufacturer</label>
615
+ <input type="text" id="machine-manufacturer" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500">
616
+ </div>
617
+ <div class="md:col-span-2">
618
+ <label class="block text-gray-700 mb-2">Description</label>
619
+ <textarea id="machine-description" rows="3" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500"></textarea>
620
+ </div>
621
+ </div>
622
+ <div class="mt-6 flex justify-end space-x-3">
623
+ <button type="button" onclick="hideModal('add-machine-modal')" class="px-4 py-2 border rounded-lg text-gray-700 hover:bg-gray-100">Cancel</button>
624
+ <button type="submit" class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg">Save Machine</button>
625
+ </div>
626
+ </form>
627
+ </div>
628
+ </div>
629
+ </div>
630
+
631
+ <!-- Add Work Order Modal -->
632
+ <div id="add-work-order-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden z-50">
633
+ <div class="bg-white rounded-lg shadow-xl w-full max-w-2xl">
634
+ <div class="flex justify-between items-center border-b px-6 py-4">
635
+ <h3 class="text-lg font-semibold">Create New Work Order</h3>
636
+ <button onclick="hideModal('add-work-order-modal')" class="text-gray-500 hover:text-gray-700">
637
+ <i class="fas fa-times"></i>
638
+ </button>
639
+ </div>
640
+ <div class="p-6">
641
+ <form id="add-work-order-form">
642
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
643
+ <div class="md:col-span-2">
644
+ <label class="block text-gray-700 mb-2">Title*</label>
645
+ <input type="text" id="work-order-title" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500" required>
646
+ </div>
647
+ <div>
648
+ <label class="block text-gray-700 mb-2">Machine*</label>
649
+ <select id="work-order-machine" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500" required>
650
+ <option value="">Select Machine</option>
651
+ <!-- Filled by JavaScript -->
652
+ </select>
653
+ </div>
654
+ <div>
655
+ <label class="block text-gray-700 mb-2">Type*</label>
656
+ <select id="work-order-type" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500" required>
657
+ <option value="corrective">Corrective</option>
658
+ <option value="preventive">Preventive</option>
659
+ <option value="predictive">Predictive</option>
660
+ <option value="inspection">Inspection</option>
661
+ </select>
662
+ </div>
663
+ <div>
664
+ <label class="block text-gray-700 mb-2">Priority*</label>
665
+ <select id="work-order-priority" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500" required>
666
+ <option value="low">Low</option>
667
+ <option value="medium">Medium</option>
668
+ <option value="high">High</option>
669
+ <option value="critical">Critical</option>
670
+ </select>
671
+ </div>
672
+ <div>
673
+ <label class="block text-gray-700 mb-2">Due Date*</label>
674
+ <input type="date" id="work-order-due-date" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500" required>
675
+ </div>
676
+ <div>
677
+ <label class="block text-gray-700 mb-2">Assigned To</label>
678
+ <select id="work-order-assigned" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500">
679
+ <option value="">Unassigned</option>
680
+ <option value="john">John Smith</option>
681
+ <option value="jane">Jane Doe</option>
682
+ <option value="mike">Mike Johnson</option>
683
+ </select>
684
+ </div>
685
+ <div class="md:col-span-2">
686
+ <label class="block text-gray-700 mb-2">Description*</label>
687
+ <textarea id="work-order-description" rows="3" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500" required></textarea>
688
+ </div>
689
+ </div>
690
+ <div class="mt-6 flex justify-end space-x-3">
691
+ <button type="button" onclick="hideModal('add-work-order-modal')" class="px-4 py-2 border rounded-lg text-gray-700 hover:bg-gray-100">Cancel</button>
692
+ <button type="submit" class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg">Create Work Order</button>
693
+ </div>
694
+ </form>
695
+ </div>
696
+ </div>
697
+ </div>
698
+
699
+ <!-- Add PM Schedule Modal -->
700
+ <div id="add-pm-schedule-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden z-50">
701
+ <div class="bg-white rounded-lg shadow-xl w-full max-w-2xl">
702
+ <div class="flex justify-between items-center border-b px-6 py-4">
703
+ <h3 class="text-lg font-semibold">Add New PM Schedule</h3>
704
+ <button onclick="hideModal('add-pm-schedule-modal')" class="text-gray-500 hover:text-gray-700">
705
+ <i class="fas fa-times"></i>
706
+ </button>
707
+ </div>
708
+ <div class="p-6">
709
+ <form id="add-pm-schedule-form">
710
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
711
+ <div>
712
+ <label class="block text-gray-700 mb-2">Machine*</label>
713
+ <select id="pm-machine" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500" required>
714
+ <option value="">Select Machine</option>
715
+ <!-- Filled by JavaScript -->
716
+ </select>
717
+ </div>
718
+ <div>
719
+ <label class="block text-gray-700 mb-2">Frequency*</label>
720
+ <select id="pm-frequency" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500" required>
721
+ <option value="daily">Daily</option>
722
+ <option value="weekly">Weekly</option>
723
+ <option value="monthly">Monthly</option>
724
+ <option value="quarterly">Quarterly</option>
725
+ <option value="biannually">Biannually</option>
726
+ <option value="annually">Annually</option>
727
+ </select>
728
+ </div>
729
+ <div>
730
+ <label class="block text-gray-700 mb-2">Start Date*</label>
731
+ <input type="date" id="pm-start-date" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500" required>
732
+ </div>
733
+ <div>
734
+ <label class="block text-gray-700 mb-2">Estimated Duration (hours)*</label>
735
+ <input type="number" id="pm-duration" min="0.5" step="0.5" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500" required>
736
+ </div>
737
+ <div class="md:col-span-2">
738
+ <label class="block text-gray-700 mb-2">Description*</label>
739
+ <textarea id="pm-description" rows="3" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500" required></textarea>
740
+ </div>
741
+ <div class="md:col-span-2">
742
+ <label class="block text-gray-700 mb-2">Procedure*</label>
743
+ <textarea id="pm-procedure" rows="5" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500" required></textarea>
744
+ </div>
745
+ </div>
746
+ <div class="mt-6 flex justify-end space-x-3">
747
+ <button type="button" onclick="hideModal('add-pm-schedule-modal')" class="px-4 py-2 border rounded-lg text-gray-700 hover:bg-gray-100">Cancel</button>
748
+ <button type="submit" class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg">Save PM Schedule</button>
749
+ </div>
750
+ </form>
751
+ </div>
752
+ </div>
753
+ </div>
754
+
755
+ <!-- Add Inventory Item Modal -->
756
+ <div id="add-inventory-item-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden z-50">
757
+ <div class="bg-white rounded-lg shadow-xl w-full max-w-2xl">
758
+ <div class="flex justify-between items-center border-b px-6 py-4">
759
+ <h3 class="text-lg font-semibold">Add New Inventory Item</h3>
760
+ <button onclick="hideModal('add-inventory-item-modal')" class="text-gray-500 hover:text-gray-700">
761
+ <i class="fas fa-times"></i>
762
+ </button>
763
+ </div>
764
+ <div class="p-6">
765
+ <form id="add-inventory-item-form">
766
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
767
+ <div>
768
+ <label class="block text-gray-700 mb-2">Item Name*</label>
769
+ <input type="text" id="inventory-name" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500" required>
770
+ </div>
771
+ <div>
772
+ <label class="block text-gray-700 mb-2">Item Number*</label>
773
+ <input type="text" id="inventory-number" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500" required>
774
+ </div>
775
+ <div>
776
+ <label class="block text-gray-700 mb-2">Category*</label>
777
+ <select id="inventory-category" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500" required>
778
+ <option value="">Select Category</option>
779
+ <option value="electrical">Electrical</option>
780
+ <option value="mechanical">Mechanical</option>
781
+ <option value="hydraulic">Hydraulic</option>
782
+ <option value="pneumatic">Pneumatic</option>
783
+ <option value="consumable">Consumable</option>
784
+ </select>
785
+ </div>
786
+ <div>
787
+ <label class="block text-gray-700 mb-2">Quantity*</label>
788
+ <input type="number" id="inventory-quantity" min="0" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500" required>
789
+ </div>
790
+ <div>
791
+ <label class="block text-gray-700 mb-2">Minimum Level*</label>
792
+ <input type="number" id="inventory-min-level" min="0" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500" required>
793
+ </div>
794
+ <div>
795
+ <label class="block text-gray-700 mb-2">Unit of Measure*</label>
796
+ <input type="text" id="inventory-unit" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500" required>
797
+ </div>
798
+ <div>
799
+ <label class="block text-gray-700 mb-2">Location*</label>
800
+ <input type="text" id="inventory-location" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500" required>
801
+ </div>
802
+ <div>
803
+ <label class="block text-gray-700 mb-2">Supplier</label>
804
+ <input type="text" id="inventory-supplier" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500">
805
+ </div>
806
+ <div class="md:col-span-2">
807
+ <label class="block text-gray-700 mb-2">Description</label>
808
+ <textarea id="inventory-description" rows="3" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500"></textarea>
809
+ </div>
810
+ </div>
811
+ <div class="mt-6 flex justify-end space-x-3">
812
+ <button type="button" onclick="hideModal('add-inventory-item-modal')" class="px-4 py-2 border rounded-lg text-gray-700 hover:bg-gray-100">Cancel</button>
813
+ <button type="submit" class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg">Save Item</button>
814
+ </div>
815
+ </form>
816
+ </div>
817
+ </div>
818
+ </div>
819
+
820
+ <!-- Work Order Detail Modal -->
821
+ <div id="work-order-detail-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden z-50">
822
+ <div class="bg-white rounded-lg shadow-xl w-full max-w-4xl">
823
+ <div class="flex justify-between items-center border-b px-6 py-4">
824
+ <h3 class="text-lg font-semibold">Work Order Details - <span id="wo-detail-number"></span></h3>
825
+ <button onclick="hideModal('work-order-detail-modal')" class="text-gray-500 hover:text-gray-700">
826
+ <i class="fas fa-times"></i>
827
+ </button>
828
+ </div>
829
+ <div class="p-6">
830
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
831
+ <div>
832
+ <h4 class="font-medium text-gray-700 mb-2">Title</h4>
833
+ <p id="wo-detail-title" class="text-gray-900"></p>
834
+ </div>
835
+ <div>
836
+ <h4 class="font-medium text-gray-700 mb-2">Status</h4>
837
+ <p id="wo-detail-status" class="inline-flex items-center"></p>
838
+ </div>
839
+ <div>
840
+ <h4 class="font-medium text-gray-700 mb-2">Machine</h4>
841
+ <p id="wo-detail-machine" class="text-gray-900"></p>
842
+ </div>
843
+ <div>
844
+ <h4 class="font-medium text-gray-700 mb-2">Type</h4>
845
+ <p id="wo-detail-type" class="text-gray-900"></p>
846
+ </div>
847
+ <div>
848
+ <h4 class="font-medium text-gray-700 mb-2">Priority</h4>
849
+ <p id="wo-detail-priority" class="text-gray-900"></p>
850
+ </div>
851
+ <div>
852
+ <h4 class="font-medium text-gray-700 mb-2">Assigned To</h4>
853
+ <p id="wo-detail-assigned" class="text-gray-900"></p>
854
+ </div>
855
+ <div>
856
+ <h4 class="font-medium text-gray-700 mb-2">Created Date</h4>
857
+ <p id="wo-detail-created" class="text-gray-900"></p>
858
+ </div>
859
+ <div>
860
+ <h4 class="font-medium text-gray-700 mb-2">Due Date</h4>
861
+ <p id="wo-detail-due" class="text-gray-900"></p>
862
+ </div>
863
+ </div>
864
+
865
+ <div class="mb-6">
866
+ <h4 class="font-medium text-gray-700 mb-2">Description</h4>
867
+ <p id="wo-detail-description" class="text-gray-900"></p>
868
+ </div>
869
+
870
+ <div class="mb-6">
871
+ <h4 class="font-medium text-gray-700 mb-2">Completion Notes</h4>
872
+ <textarea id="wo-detail-notes" rows="3" class="border rounded-lg px-3 py-2 w-full focus:outline-none focus:ring-2 focus:ring-blue-500"></textarea>
873
+ </div>
874
+
875
+ <div class="flex justify-between items-center">
876
+ <div>
877
+ <button onclick="completeWorkOrder()" class="bg-green-500 hover:bg-green-600 text-white px-4 py-2 rounded-lg flex items-center">
878
+ <i class="fas fa-check mr-2"></i> Mark as Completed
879
+ </button>
880
+ </div>
881
+ <div class="flex space-x-2">
882
+ <button onclick="printWorkOrder()" class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg flex items-center">
883
+ <i class="fas fa-print mr-2"></i> Print
884
+ </button>
885
+ <button onclick="exportWorkOrderToPDF()" class="bg-purple-500 hover:bg-purple-600 text-white px-4 py-2 rounded-lg flex items-center">
886
+ <i class="fas fa-file-pdf mr-2"></i> Export PDF
887
+ </button>
888
+ </div>
889
+ </div>
890
+ </div>
891
+ </div>
892
+ </div>
893
+
894
+ <script>
895
+ // Sample data for the application
896
+ let machines = [
897
+ { id: 'M-1001', name: 'CNC Lathe #1', type: 'cnc', status: 'operational', manufacturer: 'Haas', installDate: '2020-05-15', description: 'Primary CNC lathe for precision parts' },
898
+ { id: 'M-1002', name: 'Vertical Mill', type: 'milling', status: 'operational', manufacturer: 'Bridgeport', installDate: '2019-11-20', description: 'General purpose milling machine' },
899
+ { id: 'M-1003', name: 'Hydraulic Press', type: 'press', status: 'warning', manufacturer: 'Dake', installDate: '2021-02-10', description: '50-ton hydraulic press' },
900
+ { id: 'M-1004', name: 'CNC Router', type: 'cnc', status: 'operational', manufacturer: 'ShopBot', installDate: '2022-01-05', description: 'For wood and plastic routing' },
901
+ { id: 'M-1005', name: 'Lathe #2', type: 'lathe', status: 'critical', manufacturer: 'Grizzly', installDate: '2018-07-30', description: 'Secondary lathe machine' },
902
+ { id: 'M-1006', name: 'Band Saw', type: 'other', status: 'operational', manufacturer: 'Jet', installDate: '2020-09-12', description: 'Metal cutting band saw' },
903
+ { id: 'M-1007', name: 'Surface Grinder', type: 'other', status: 'maintenance', manufacturer: 'Chevalier', installDate: '2021-05-22', description: 'Precision surface grinding' },
904
+ { id: 'M-1008', name: 'CNC Lathe #2', type: 'cnc', status: 'operational', manufacturer: 'Haas', installDate: '2021-08-15', description: 'Secondary CNC lathe' }
905
+ ];
906
+
907
+ let workOrders = [
908
+ { id: 'WO-2023-001', title: 'CNC Lathe Bearing Replacement', machineId: 'M-1001', type: 'corrective', priority: 'high', status: 'completed', assigned: 'john', created: '2023-01-05', due: '2023-01-10', completed: '2023-01-08', description: 'Replace worn out spindle bearings on CNC lathe', notes: 'Replaced with SKF bearings. Machine running smoothly now.' },
909
+ { id: 'WO-2023-002', title: 'Monthly PM - Vertical Mill', machineId: 'M-1002', type: 'preventive', priority: 'medium', status: 'completed', assigned: 'jane', created: '2023-01-10', due: '2023-01-15', completed: '2023-01-14', description: 'Monthly preventive maintenance for vertical mill', notes: 'Lubricated all moving parts. Checked alignment. All within specs.' },
910
+ { id: 'WO-2023-003', title: 'Hydraulic Press Leak', machineId: 'M-1003', type: 'corrective', priority: 'critical', status: 'in-progress', assigned: 'mike', created: '2023-01-12', due: '2023-01-14', description: 'Fix hydraulic fluid leak on press' },
911
+ { id: 'WO-2023-004', title: 'Lathe Motor Overheating', machineId: 'M-1005', type: 'corrective', priority: 'high', status: 'open', assigned: '', created: '2023-01-15', due: '2023-01-20', description: 'Diagnose and fix motor overheating issue' },
912
+ { id: 'WO-2023-005', title: 'Quarterly PM - CNC Router', machineId: 'M-1004', type: 'preventive', priority: 'medium', status: 'open', assigned: 'jane', created: '2023-01-18', due: '2023-01-25', description: 'Quarterly preventive maintenance for CNC router' }
913
+ ];
914
+
915
+ let pmSchedules = [
916
+ { id: 'PM-001', machineId: 'M-1001', description: 'Monthly spindle lubrication', frequency: 'monthly', startDate: '2022-01-01', lastCompleted: '2022-12-15', nextDue: '2023-01-15', duration: 2, procedure: '1. Power down machine\n2. Clean spindle area\n3. Apply specified lubricant\n4. Run test cycle\n5. Verify operation', status: 'due' },
917
+ { id: 'PM-002', machineId: 'M-1002', description: 'Weekly cleaning and inspection', frequency: 'weekly', startDate: '2022-01-01', lastCompleted: '2023-01-10', nextDue: '2023-01-17', duration: 1, procedure: '1. Clean machine surfaces\n2. Inspect for wear\n3. Check lubrication levels\n4. Verify safety features', status: 'scheduled' },
918
+ { id: 'PM-003', machineId: 'M-1004', description: 'Quarterly full maintenance', frequency: 'quarterly', startDate: '2022-01-01', lastCompleted: '2022-10-01', nextDue: '2023-01-01', duration: 4, procedure: '1. Complete all weekly tasks\n2. Check belt tension\n3. Inspect spindle bearings\n4. Verify axis alignment\n5. Test all functions', status: 'overdue' },
919
+ { id: 'PM-004', machineId: 'M-1006', description: 'Monthly blade inspection', frequency: 'monthly', startDate: '2022-03-15', lastCompleted: '2022-12-20', nextDue: '2023-01-20', duration: 0.5, procedure: '1. Inspect blade for wear\n2. Check tension\n3. Clean guides\n4. Test cut', status: 'scheduled' }
920
+ ];
921
+
922
+ let inventory = [
923
+ { id: 'INV-1001', name: 'Spindle Bearings', number: 'SKF-6205', category: 'mechanical', quantity: 12, minLevel: 5, unit: 'pcs', location: 'B2-S4', supplier: 'SKF', description: 'Precision spindle bearings for CNC machines' },
924
+ { id: 'INV-1002', name: 'Hydraulic Oil', number: 'MOBIL-46', category: 'hydraulic', quantity: 45, minLevel: 20, unit: 'gal', location: 'Fluid Storage', supplier: 'Mobil', description: 'ISO 46 hydraulic oil' },
925
+ { id: 'INV-1003', name: 'Cutting Fluid', number: 'TRIM-SOL', category: 'consumable', quantity: 8, minLevel: 10, unit: 'gal', location: 'Fluid Storage', supplier: 'Master Chemical', description: 'Soluble oil for metal cutting' },
926
+ { id: 'INV-1004', name: 'V-Belts', number: 'BANDO-3L260', category: 'mechanical', quantity: 3, minLevel: 5, unit: 'pcs', location: 'B1-S2', supplier: 'Bando', description: '3L260 V-belts for motors' },
927
+ { id: 'INV-1005', name: 'Proximity Sensor', number: 'OMRON-E2E', category: 'electrical', quantity: 2, minLevel: 5, unit: 'pcs', location: 'Electrical Cabinet', supplier: 'Omron', description: 'Inductive proximity sensor' },
928
+ { id: 'INV-1006', name: 'Fuses', number: 'BUSS-30A', category: 'electrical', quantity: 15, minLevel: 20, unit: 'pcs', location: 'Electrical Cabinet', supplier: 'Bussmann', description: '30A slow-blow fuses' }
929
+ ];
930
+
931
+ // Initialize the application
932
+ document.addEventListener('DOMContentLoaded', function() {
933
+ // Show dashboard by default
934
+ showPage('dashboard');
935
+
936
+ updateDashboard();
937
+ renderMachines();
938
+ renderWorkOrders();
939
+ renderPMSchedules();
940
+ renderInventory();
941
+
942
+ // Setup form submissions
943
+ document.getElementById('add-machine-form').addEventListener('submit', addMachine);
944
+ document.getElementById('add-work-order-form').addEventListener('submit', addWorkOrder);
945
+ document.getElementById('add-pm-schedule-form').addEventListener('submit', addPMSchedule);
946
+ document.getElementById('add-inventory-item-form').addEventListener('submit', addInventoryItem);
947
+
948
+ // Setup filter events
949
+ document.getElementById('machine-status-filter').addEventListener('change', filterMachines);
950
+ document.getElementById('machine-type-filter').addEventListener('change', filterMachines);
951
+ document.getElementById('machine-search').addEventListener('input', filterMachines);
952
+
953
+ document.getElementById('work-order-status-filter').addEventListener('change', filterWorkOrders);
954
+ document.getElementById('work-order-type-filter').addEventListener('change', filterWorkOrders);
955
+ document.getElementById('work-order-search').addEventListener('input', filterWorkOrders);
956
+
957
+ document.getElementById('inventory-category-filter').addEventListener('change', filterInventory);
958
+ document.getElementById('inventory-status-filter').addEventListener('change', filterInventory);
959
+ document.getElementById('inventory-search').addEventListener('input', filterInventory);
960
+
961
+ // Setup custom date range toggle
962
+ document.getElementById('custom-report-range').addEventListener('change', function() {
963
+ const customRangeDiv = document.getElementById('custom-date-range');
964
+ if (this.value === 'custom') {
965
+ customRangeDiv.classList.remove('hidden');
966
+ } else {
967
+ customRangeDiv.classList.add('hidden');
968
+ }
969
+ });
970
+ });
971
+
972
+ // Navigation functions
973
+ function showPage(pageId) {
974
+ // Hide all pages
975
+ document.querySelectorAll('.page').forEach(page => {
976
+ page.classList.remove('active');
977
+ });
978
+
979
+ // Show selected page
980
+ const page = document.getElementById(pageId);
981
+ if (page) {
982
+ page.classList.add('active');
983
+
984
+ // Update page title
985
+ const navItem = document.querySelector(`[onclick="showPage('${pageId}')"]`);
986
+ if (navItem) {
987
+ const navText = navItem.querySelector('.nav-text');
988
+ if (navText) {
989
+ document.getElementById('page-title').textContent = navText.textContent;
990
+ }
991
+ }
992
+ }
993
+
994
+ // Close any open modals
995
+ document.querySelectorAll('[id$="-modal"]').forEach(modal => {
996
+ modal.classList.add('hidden');
997
+ });
998
+
999
+ return false; // Prevent default link behavior
1000
+ }
1001
+
1002
+ // Modal functions
1003
+ function showAddMachineModal() {
1004
+ document.getElementById('add-machine-modal').classList.remove('hidden');
1005
+ }
1006
+
1007
+ function showAddWorkOrderModal() {
1008
+ const machineSelect = document.getElementById('work-order-machine');
1009
+ machineSelect.innerHTML = '<option value="">Select Machine</option>';
1010
+
1011
+ machines.forEach(machine => {
1012
+ const option = document.createElement('option');
1013
+ option.value = machine.id;
1014
+ option.textContent = `${machine.name} (${machine.id})`;
1015
+ machineSelect.appendChild(option);
1016
+ });
1017
+
1018
+ document.getElementById('add-work-order-modal').classList.remove('hidden');
1019
+ }
1020
+
1021
+ function showAddPMScheduleModal() {
1022
+ const machineSelect = document.getElementById('pm-machine');
1023
+ machineSelect.innerHTML = '<option value="">Select Machine</option>';
1024
+
1025
+ machines.forEach(machine => {
1026
+ const option = document.createElement('option');
1027
+ option.value = machine.id;
1028
+ option.textContent = `${machine.name} (${machine.id})`;
1029
+ machineSelect.appendChild(option);
1030
+ });
1031
+
1032
+ document.getElementById('add-pm-schedule-modal').classList.remove('hidden');
1033
+ }
1034
+
1035
+ function showAddInventoryItemModal() {
1036
+ document.getElementById('add-inventory-item-modal').classList.remove('hidden');
1037
+ }
1038
+
1039
+ function showWorkOrderDetail(woId) {
1040
+ const wo = workOrders.find(order => order.id === woId);
1041
+ if (!wo) return;
1042
+
1043
+ document.getElementById('wo-detail-number').textContent = wo.id;
1044
+ document.getElementById('wo-detail-title').textContent = wo.title;
1045
+
1046
+ let statusClass = '';
1047
+ let statusText = '';
1048
+ switch(wo.status) {
1049
+ case 'open':
1050
+ statusClass = 'bg-yellow-100 text-yellow-800 px-2 py-1 rounded';
1051
+ statusText = 'Open';
1052
+ break;
1053
+ case 'in-progress':
1054
+ statusClass = 'bg-blue-100 text-blue-800 px-2 py-1 rounded';
1055
+ statusText = 'In Progress';
1056
+ break;
1057
+ case 'completed':
1058
+ statusClass = 'bg-green-100 text-green-800 px-2 py-1 rounded';
1059
+ statusText = 'Completed';
1060
+ break;
1061
+ case 'closed':
1062
+ statusClass = 'bg-gray-100 text-gray-800 px-2 py-1 rounded';
1063
+ statusText = 'Closed';
1064
+ break;
1065
+ }
1066
+
1067
+ document.getElementById('wo-detail-status').innerHTML = `<span class="${statusClass}">${statusText}</span>`;
1068
+
1069
+ const machine = machines.find(m => m.id === wo.machineId);
1070
+ document.getElementById('wo-detail-machine').textContent = machine ? `${machine.name} (${machine.id})` : 'N/A';
1071
+
1072
+ let typeText = '';
1073
+ switch(wo.type) {
1074
+ case 'corrective':
1075
+ typeText = 'Corrective';
1076
+ break;
1077
+ case 'preventive':
1078
+ typeText = 'Preventive';
1079
+ break;
1080
+ case 'predictive':
1081
+ typeText = 'Predictive';
1082
+ break;
1083
+ case 'inspection':
1084
+ typeText = 'Inspection';
1085
+ break;
1086
+ }
1087
+ document.getElementById('wo-detail-type').textContent = typeText;
1088
+
1089
+ let priorityText = '';
1090
+ switch(wo.priority) {
1091
+ case 'low':
1092
+ priorityText = 'Low';
1093
+ break;
1094
+ case 'medium':
1095
+ priorityText = 'Medium';
1096
+ break;
1097
+ case 'high':
1098
+ priorityText = 'High';
1099
+ break;
1100
+ case 'critical':
1101
+ priorityText = 'Critical';
1102
+ break;
1103
+ }
1104
+ document.getElementById('wo-detail-priority').textContent = priorityText;
1105
+
1106
+ let assignedText = '';
1107
+ switch(wo.assigned) {
1108
+ case 'john':
1109
+ assignedText = 'John Smith';
1110
+ break;
1111
+ case 'jane':
1112
+ assignedText = 'Jane Doe';
1113
+ break;
1114
+ case 'mike':
1115
+ assignedText = 'Mike Johnson';
1116
+ break;
1117
+ default:
1118
+ assignedText = 'Unassigned';
1119
+ }
1120
+ document.getElementById('wo-detail-assigned').textContent = assignedText;
1121
+
1122
+ document.getElementById('wo-detail-created').textContent = formatDate(wo.created);
1123
+ document.getElementById('wo-detail-due').textContent = formatDate(wo.due);
1124
+ document.getElementById('wo-detail-description').textContent = wo.description;
1125
+ document.getElementById('wo-detail-notes').value = wo.notes || '';
1126
+
1127
+ document.getElementById('work-order-detail-modal').classList.remove('hidden');
1128
+ }
1129
+
1130
+ function hideModal(modalId) {
1131
+ document.getElementById(modalId).classList.add('hidden');
1132
+ }
1133
+
1134
+ // Data manipulation functions
1135
+ function addMachine(e) {
1136
+ e.preventDefault();
1137
+
1138
+ const newMachine = {
1139
+ id: document.getElementById('machine-id').value,
1140
+ name: document.getElementById('machine-name').value,
1141
+ type: document.getElementById('machine-type').value,
1142
+ status: document.getElementById('machine-status').value,
1143
+ manufacturer: document.getElementById('machine-manufacturer').value,
1144
+ installDate: document.getElementById('machine-install-date').value,
1145
+ description: document.getElementById('machine-description').value
1146
+ };
1147
+
1148
+ machines.push(newMachine);
1149
+ renderMachines();
1150
+ updateDashboard();
1151
+ hideModal('add-machine-modal');
1152
+ document.getElementById('add-machine-form').reset();
1153
+ }
1154
+
1155
+ function addWorkOrder(e) {
1156
+ e.preventDefault();
1157
+
1158
+ const newWorkOrder = {
1159
+ id: `WO-${new Date().getFullYear()}-${(workOrders.length + 1).toString().padStart(3, '0')}`,
1160
+ title: document.getElementById('work-order-title').value,
1161
+ machineId: document.getElementById('work-order-machine').value,
1162
+ type: document.getElementById('work-order-type').value,
1163
+ priority: document.getElementById('work-order-priority').value,
1164
+ status: 'open',
1165
+ assigned: document.getElementById('work-order-assigned').value,
1166
+ created: new Date().toISOString().split('T')[0],
1167
+ due: document.getElementById('work-order-due-date').value,
1168
+ description: document.getElementById('work-order-description').value
1169
+ };
1170
+
1171
+ workOrders.unshift(newWorkOrder);
1172
+ renderWorkOrders();
1173
+ updateDashboard();
1174
+ hideModal('add-work-order-modal');
1175
+ document.getElementById('add-work-order-form').reset();
1176
+ }
1177
+
1178
+ function addPMSchedule(e) {
1179
+ e.preventDefault();
1180
+
1181
+ const startDate = document.getElementById('pm-start-date').value;
1182
+ const frequency = document.getElementById('pm-frequency').value;
1183
+
1184
+ let nextDue = '';
1185
+ const start = new Date(startDate);
1186
+
1187
+ switch(frequency) {
1188
+ case 'daily':
1189
+ start.setDate(start.getDate() + 1);
1190
+ break;
1191
+ case 'weekly':
1192
+ start.setDate(start.getDate() + 7);
1193
+ break;
1194
+ case 'monthly':
1195
+ start.setMonth(start.getMonth() + 1);
1196
+ break;
1197
+ case 'quarterly':
1198
+ start.setMonth(start.getMonth() + 3);
1199
+ break;
1200
+ case 'biannually':
1201
+ start.setMonth(start.getMonth() + 6);
1202
+ break;
1203
+ case 'annually':
1204
+ start.setFullYear(start.getFullYear() + 1);
1205
+ break;
1206
+ }
1207
+
1208
+ nextDue = start.toISOString().split('T')[0];
1209
+
1210
+ const newPMSchedule = {
1211
+ id: `PM-${(pmSchedules.length + 1).toString().padStart(3, '0')}`,
1212
+ machineId: document.getElementById('pm-machine').value,
1213
+ description: document.getElementById('pm-description').value,
1214
+ frequency: frequency,
1215
+ startDate: start
1216
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=skillerpwns/cmms" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
1217
+ </html>