Asadleo9 commited on
Commit
7c22bc3
·
verified ·
1 Parent(s): cf34f1b

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +243 -1
index.html CHANGED
@@ -1028,6 +1028,36 @@
1028
  </div>
1029
  </div>
1030
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1031
  </div>
1032
 
1033
  <!-- Charts Row -->
@@ -1209,4 +1239,216 @@
1209
  </div>
1210
  <div class="form-group">
1211
  <label for="category">Category</label>
1212
- <select id="
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1028
  </div>
1029
  </div>
1030
  </div>
1031
+
1032
+ <div class="stat-card">
1033
+ <div class="stat-header">
1034
+ <div>
1035
+ <div class="stat-value" id="accountBalance">$45,230</div>
1036
+ <div class="stat-label">Account Balance</div>
1037
+ <span class="stat-change positive">
1038
+ <i class="fas fa-arrow-up"></i> 5.7%
1039
+ </span>
1040
+ </div>
1041
+ <div class="stat-icon info">
1042
+ <i class="fas fa-wallet"></i>
1043
+ </div>
1044
+ </div>
1045
+ </div>
1046
+
1047
+ <div class="stat-card">
1048
+ <div class="stat-header">
1049
+ <div>
1050
+ <div class="stat-value" id="profitMargin">23.5%</div>
1051
+ <div class="stat-label">Profit Margin</div>
1052
+ <span class="stat-change positive">
1053
+ <i class="fas fa-arrow-up"></i> 2.1%
1054
+ </span>
1055
+ </div>
1056
+ <div class="stat-icon success">
1057
+ <i class="fas fa-chart-pie"></i>
1058
+ </div>
1059
+ </div>
1060
+ </div>
1061
  </div>
1062
 
1063
  <!-- Charts Row -->
 
1239
  </div>
1240
  <div class="form-group">
1241
  <label for="category">Category</label>
1242
+ <select id="category" name="category" required>
1243
+ <option value="">Select Category</option>
1244
+ <option value="Antibiotics">Antibiotics</option>
1245
+ <option value="Pain Relief">Pain Relief</option>
1246
+ <option value="GI Medications">GI Medications</option>
1247
+ <option value="Diabetes">Diabetes</option>
1248
+ <option value="Cardiovascular">Cardiovascular</option>
1249
+ <option value="Vitamins">Vitamins</option>
1250
+ </select>
1251
+ </div>
1252
+ <div class="form-group">
1253
+ <label for="stock">Stock Quantity</label>
1254
+ <input type="number" id="stock" name="stock" min="0" required>
1255
+ </div>
1256
+ <div class="form-group">
1257
+ <label for="price">Price ($)</label>
1258
+ <input type="number" id="price" name="price" min="0" step="0.01" required>
1259
+ </div>
1260
+ <div class="form-group">
1261
+ <label for="expiryDate">Expiry Date</label>
1262
+ <input type="date" id="expiryDate" name="expiryDate" required>
1263
+ </div>
1264
+ <div class="modal-footer">
1265
+ <button type="button" class="btn btn-secondary" onclick="closeMedicineModal()">Cancel</button>
1266
+ <button type="submit" class="btn btn-primary">Save Medicine</button>
1267
+ </div>
1268
+ </form>
1269
+ </div>
1270
+ </div>
1271
+
1272
+ <script>
1273
+ // Sidebar toggle
1274
+ function toggleSidebar() {
1275
+ const sidebar = document.getElementById('sidebar');
1276
+ const mainContent = document.getElementById('mainContent');
1277
+ sidebar.classList.toggle('collapsed');
1278
+ mainContent.classList.toggle('expanded');
1279
+ }
1280
+
1281
+ // Set active navigation
1282
+ function setActiveNav(element) {
1283
+ const navItems = document.querySelectorAll('.nav-item');
1284
+ navItems.forEach(item => item.classList.remove('active'));
1285
+ element.classList.add('active');
1286
+ }
1287
+
1288
+ // Search functionality
1289
+ function handleSearch(event) {
1290
+ const searchTerm = event.target.value.toLowerCase();
1291
+ console.log('Searching for:', searchTerm);
1292
+ // Implement search logic here
1293
+ }
1294
+
1295
+ // Show notifications
1296
+ function showNotifications() {
1297
+ console.log('Showing notifications');
1298
+ // Implement notification logic here
1299
+ }
1300
+
1301
+ // Close alert banner
1302
+ function closeAlert() {
1303
+ const alertBanner = document.getElementById('alertBanner');
1304
+ alertBanner.style.display = 'none';
1305
+ }
1306
+
1307
+ // Change chart view
1308
+ function changeChartView(element, view) {
1309
+ const buttons = document.querySelectorAll('.chart-option-btn');
1310
+ buttons.forEach(btn => btn.classList.remove('active'));
1311
+ element.classList.add('active');
1312
+ console.log('Chart view changed to:', view);
1313
+ // Implement chart view change logic here
1314
+ }
1315
+
1316
+ // Filter inventory
1317
+ function filterInventory() {
1318
+ console.log('Filtering inventory');
1319
+ // Implement filter logic here
1320
+ }
1321
+
1322
+ // Open add medicine modal
1323
+ function openAddMedicineModal() {
1324
+ const modal = document.getElementById('medicineModal');
1325
+ const modalTitle = document.getElementById('modalTitle');
1326
+ modalTitle.textContent = 'Add New Medicine';
1327
+ modal.classList.add('active');
1328
+ }
1329
+
1330
+ // Edit medicine
1331
+ function editMedicine(button) {
1332
+ const modal = document.getElementById('medicineModal');
1333
+ const modalTitle = document.getElementById('modalTitle');
1334
+ modalTitle.textContent = 'Edit Medicine';
1335
+ modal.classList.add('active');
1336
+ // Populate form with existing data
1337
+ console.log('Editing medicine');
1338
+ }
1339
+
1340
+ // Close medicine modal
1341
+ function closeMedicineModal() {
1342
+ const modal = document.getElementById('medicineModal');
1343
+ modal.classList.remove('active');
1344
+ }
1345
+
1346
+ // Save medicine
1347
+ function saveMedicine(event) {
1348
+ event.preventDefault();
1349
+ const formData = new FormData(event.target);
1350
+ const medicineData = Object.fromEntries(formData);
1351
+ console.log('Saving medicine:', medicineData);
1352
+ // Implement save logic here
1353
+ closeMedicineModal();
1354
+ }
1355
+
1356
+ // Initialize chart
1357
+ document.addEventListener('DOMContentLoaded', function () {
1358
+ const ctx = document.getElementById('salesChart').getContext('2d');
1359
+ const salesChart = new Chart(ctx, {
1360
+ type: 'line',
1361
+ data: {
1362
+ labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
1363
+ datasets: [{
1364
+ label: 'Sales ($)',
1365
+ data: [1200, 1900, 1500, 2500, 2200, 3000, 2800],
1366
+ backgroundColor: 'rgba(44, 122, 123, 0.2)',
1367
+ borderColor: '#2c7a7b',
1368
+ borderWidth: 2,
1369
+ tension: 0.4,
1370
+ fill: true
1371
+ }]
1372
+ },
1373
+ options: {
1374
+ responsive: true,
1375
+ maintainAspectRatio: false,
1376
+ plugins: {
1377
+ legend: {
1378
+ display: false
1379
+ }
1380
+ },
1381
+ scales: {
1382
+ y: {
1383
+ beginAtZero: true,
1384
+ grid: {
1385
+ color: 'rgba(0, 0, 0, 0.05)'
1386
+ }
1387
+ },
1388
+ x: {
1389
+ grid: {
1390
+ display: false
1391
+ }
1392
+ }
1393
+ }
1394
+ }
1395
+ });
1396
+ });
1397
+
1398
+ // Chart.js
1399
+ class Chart {
1400
+ constructor(ctx, config) {
1401
+ this.ctx = ctx;
1402
+ this.config = config;
1403
+ this.draw();
1404
+ }
1405
+
1406
+ draw() {
1407
+ const canvas = this.ctx.canvas;
1408
+ const width = canvas.width = canvas.offsetWidth;
1409
+ const height = canvas.height = canvas.offsetHeight;
1410
+
1411
+ // Clear canvas
1412
+ this.ctx.clearRect(0, 0, width, height);
1413
+
1414
+ // Draw chart based on config
1415
+ if (this.config.type === 'line') {
1416
+ this.drawLineChart();
1417
+ }
1418
+ }
1419
+
1420
+ drawLineChart() {
1421
+ const { data, options } = this.config;
1422
+ const { labels, datasets } = data;
1423
+ const { y: yAxis, x: xAxis } = options.scales;
1424
+
1425
+ const padding = 40;
1426
+ const chartWidth = this.ctx.canvas.width - padding * 2;
1427
+ const chartHeight = this.ctx.canvas.height - padding * 2;
1428
+
1429
+ // Draw axes
1430
+ this.ctx.strokeStyle = '#e2e8f0';
1431
+ this.ctx.lineWidth = 1;
1432
+ this.ctx.beginPath();
1433
+ this.ctx.moveTo(padding, padding);
1434
+ this.ctx.lineTo(padding, this.ctx.canvas.height - padding);
1435
+ this.ctx.lineTo(this.ctx.canvas.width - padding, this.ctx.canvas.height - padding);
1436
+ this.ctx.stroke();
1437
+
1438
+ // Draw data points and lines
1439
+ const dataset = datasets[0];
1440
+ const maxValue = Math.max(...dataset.data);
1441
+ const minValue = 0;
1442
+ const valueRange = maxValue - minValue;
1443
+
1444
+ const xStep = chartWidth / (labels.length - 1);
1445
+ const yStep = chartHeight / valueRange;
1446
+
1447
+ // Draw line
1448
+ this.ctx.strokeStyle = dataset.borderColor;
1449
+ this.ctx.lineWidth = dataset.borderWidth;
1450
+ this.ctx.beginPath();
1451
+
1452
+ dataset.data.forEach((value, index) => {
1453
+ const x = padding + index * xStep;
1454
+ const y = this.ctx.canvas.height - padding - ((value - minValue) /