GreenMoood commited on
Commit
c686580
·
verified ·
1 Parent(s): 06d7c67

remove the print

Browse files
Files changed (1) hide show
  1. suppliers.html +2 -71
suppliers.html CHANGED
@@ -451,12 +451,8 @@
451
  </div>
452
  </div>
453
  <div class="flex justify-between mt-6">
454
- <button type="button" id="printBtn" class="px-4 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg flex items-center">
455
- <i data-feather="printer" class="w-4 h-4 mr-2"></i>
456
- Print Form
457
- </button>
458
- <div class="space-x-3">
459
- <button type="button" id="cancelBtn" class="px-4 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg">
460
  Cancel
461
  </button>
462
  <button type="submit" class="px-4 py-2 bg-blue-600 hover:bg-blue-500 rounded-lg">
@@ -546,71 +542,6 @@ responsive: true,
546
  alert('Supplier saved successfully!');
547
  supplierModal.classList.add('hidden');
548
  });
549
- // Print functionality
550
- document.getElementById('printBtn').addEventListener('click', () => {
551
- const printContent = `
552
- <div style="font-family: Arial, sans-serif; padding: 20px;">
553
- <h1 style="text-align: center; margin-bottom: 30px;">Supplier Registration Form</h1>
554
- <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px;">
555
- <div><strong>Supplier ID:</strong> <span id="printSupplierId"></span></div>
556
- <div><strong>Supplier Name:</strong> <span id="printSupplierName"></span></div>
557
- <div><strong>ICE:</strong> <span id="printIce"></span></div>
558
- <div><strong>IF:</strong> <span id="printIf"></span></div>
559
- <div><strong>TP:</strong> <span id="printTp"></span></div>
560
- <div><strong>RC:</strong> <span id="printRc"></span></div>
561
- <div><strong>CNSS:</strong> <span id="printCnss"></span></div>
562
- <div><strong>RIB:</strong> <span id="printRib"></span></div>
563
- <div><strong>Contact Person:</strong> <span id="printContactPerson"></span></div>
564
- <div><strong>Email:</strong> <span id="printEmail"></span></div>
565
- <div><strong>Phone:</strong> <span id="printPhone"></span></div>
566
- <div><strong>Country:</strong> <span id="printCountry"></span></div>
567
- <div><strong>Address:</strong> <span id="printAddress"></span></div>
568
- <div><strong>Status:</strong> <span id="printStatus"></span></div>
569
- </div>
570
- <div style="margin-top: 30px; text-align: right;">
571
- <p>_________________________</p>
572
- <p>Signature</p>
573
- </div>
574
- </div>
575
- `;
576
-
577
- const printWindow = window.open('', '', 'width=800,height=600');
578
- printWindow.document.open();
579
- printWindow.document.write(`
580
- <html>
581
- <head>
582
- <title>Supplier Registration Form</title>
583
- <style>
584
- body { font-family: Arial, sans-serif; }
585
- @media print {
586
- @page { margin: 0; }
587
- body { margin: 1.6cm; }
588
- }
589
- </style>
590
- </head>
591
- <body onload="window.print();window.close();">
592
- ${printContent}
593
- <script>
594
- document.getElementById('printSupplierId').textContent = document.getElementById('supplierId').value;
595
- document.getElementById('printSupplierName').textContent = document.getElementById('supplierName').value;
596
- document.getElementById('printIce').textContent = document.getElementById('ice').value;
597
- document.getElementById('printIf').textContent = document.getElementById('if').value;
598
- document.getElementById('printTp').textContent = document.getElementById('tp').value;
599
- document.getElementById('printRc').textContent = document.getElementById('rc').value;
600
- document.getElementById('printCnss').textContent = document.getElementById('cnss').value;
601
- document.getElementById('printRib').textContent = document.getElementById('rib').value;
602
- document.getElementById('printContactPerson').textContent = document.getElementById('contactPerson').value;
603
- document.getElementById('printEmail').textContent = document.getElementById('email').value;
604
- document.getElementById('printPhone').textContent = document.getElementById('phone').value;
605
- document.getElementById('printCountry').textContent = document.getElementById('country').value;
606
- document.getElementById('printAddress').textContent = document.getElementById('address').value;
607
- document.getElementById('printStatus').textContent = document.getElementById('status').value;
608
- </script>
609
- </body>
610
- </html>
611
- `);
612
- printWindow.document.close();
613
- });
614
  // Edit functionality to populate form with row data
615
  document.querySelectorAll('.edit-btn').forEach(btn => {
616
  btn.addEventListener('click', (e) => {
 
451
  </div>
452
  </div>
453
  <div class="flex justify-between mt-6">
454
+ <div class="space-x-3 ml-auto">
455
+ <button type="button" id="cancelBtn" class="px-4 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg">
 
 
 
 
456
  Cancel
457
  </button>
458
  <button type="submit" class="px-4 py-2 bg-blue-600 hover:bg-blue-500 rounded-lg">
 
542
  alert('Supplier saved successfully!');
543
  supplierModal.classList.add('hidden');
544
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
545
  // Edit functionality to populate form with row data
546
  document.querySelectorAll('.edit-btn').forEach(btn => {
547
  btn.addEventListener('click', (e) => {