TropangCNTC commited on
Commit
4ed75ea
·
verified ·
1 Parent(s): e72d1d0

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +16 -24
index.html CHANGED
@@ -507,7 +507,6 @@
507
  </head>
508
  <body>
509
 
510
- <!-- ACTION BAR WITH ALL BUTTONS -->
511
  <div class="action-bar">
512
  <button class="btn btn-clear" onclick="clearForm()">🗑️ Clear Form</button>
513
  <button class="btn btn-save" onclick="saveForm()">💾 Save Data</button>
@@ -515,7 +514,6 @@
515
  <button class="btn" onclick="window.print()">🖨️ Export to PDF / Print</button>
516
  </div>
517
 
518
- <!-- PAGE 1: CHECKLIST FORM -->
519
  <div class="a4-page">
520
  <div class="header-banner">
521
  <img src="picslogo.png" alt="DICT Header Logo">
@@ -771,7 +769,6 @@
771
  </table>
772
  </div>
773
 
774
- <!-- PAGE 2: ELECTRICAL TAPPING POINT (2 PHOTOS) + SITE PHOTOS (1/2) (2 PHOTOS) -->
775
  <div class="a4-page">
776
  <div style="background-color: var(--primary-color); color: #fff; font-weight: bold; padding: 5px 10px; font-size: 11px; border: 1px solid var(--border-color);">
777
  • Electrical Tapping point and Breaker Location:
@@ -824,7 +821,6 @@
824
  </div>
825
  </div>
826
 
827
- <!-- PAGE 3: SITE PHOTOS (2/2) -->
828
  <div class="a4-page">
829
  <div style="background-color: var(--primary-color); color: #fff; font-weight: bold; text-align: center; padding: 5px; font-size: 11px; text-transform: uppercase; border: 1px solid var(--border-color);">
830
  SITE PHOTOS (2/2)
@@ -895,7 +891,6 @@
895
  </div>
896
  </div>
897
 
898
- <!-- PAGE 4: FLOOR PLAN -->
899
  <div class="a4-page">
900
  <div style="background-color: var(--primary-color); color: #fff; font-weight: bold; text-align: center; padding: 5px; font-size: 11px; text-transform: uppercase; border: 1px solid var(--border-color);">
901
  Floor Plan
@@ -910,7 +905,6 @@
910
  </div>
911
  </div>
912
 
913
- <!-- PAGE 5: HEAT MAP -->
914
  <div class="a4-page heatmap-page">
915
  <div class="heatmap-header-title">
916
  HEAT MAP
@@ -960,7 +954,6 @@
960
  </div>
961
  </div>
962
 
963
- <!-- MODAL FOR SAVED FILES LIST -->
964
  <div class="modal-overlay" id="savedModal">
965
  <div class="modal-content">
966
  <div class="modal-header">
@@ -968,8 +961,7 @@
968
  <button class="close-modal" onclick="closeSavedModal()">&times;</button>
969
  </div>
970
  <div class="saved-list" id="savedListContainer">
971
- <!-- Dynamic list item here -->
972
- </div>
973
  </div>
974
  </div>
975
 
@@ -999,13 +991,13 @@
999
  }
1000
  }
1001
 
1002
- /* --- CLEAR FORM FUNCTION --- */
1003
  function clearForm() {
1004
- if (confirm("Sigurado ka bang gusto mong linisin/burahin ang lahat ng nakasulat at mga larawan sa form?")) {
1005
  // Clear inputs, select, textareas
1006
  const inputs = document.querySelectorAll('input[type="text"], textarea');
1007
  inputs.forEach(input => {
1008
- // preserve default disclaimer text if cleared
1009
  if (input.parentElement.classList.contains('disclaimer')) {
1010
  input.value = "The data reflected here have been initially discussed with the Site Coordinator and any proposed changes prior to date of implementation shall be coordinated with the Project Management Team and the project's service providers.";
1011
  } else {
@@ -1031,12 +1023,12 @@
1031
  }
1032
  }
1033
 
1034
- /* --- SAVE FORM FUNCTION --- */
1035
  function saveForm() {
1036
  const siteName = document.getElementById('site_name').value.trim() || 'Untitled Site';
1037
  const defaultName = siteName + ' - ' + new Date().toLocaleDateString();
1038
 
1039
- const recordName = prompt("Ilagay ang pangalan para sa na-save na record na ito:", defaultName);
1040
  if (!recordName) return;
1041
 
1042
  // Collect text inputs
@@ -1071,13 +1063,13 @@
1071
 
1072
  try {
1073
  localStorage.setItem('pics_survey_records', JSON.stringify(savedRecords));
1074
- alert("✅ Matagumpay na na-save ang survey record!");
1075
  } catch (e) {
1076
- alert("⚠️ Babala: Masyadong malaki ang laki ng mga na-upload na larawan kaya hindi kasya sa browser storage. Subukang liitan ang sukat ng mga larawan.");
1077
  }
1078
  }
1079
 
1080
- /* --- MODAL & LOAD SAVED FILES FUNCTION --- */
1081
  function openSavedModal() {
1082
  const container = document.getElementById('savedListContainer');
1083
  const records = JSON.parse(localStorage.getItem('pics_survey_records') || '[]');
@@ -1085,7 +1077,7 @@
1085
  container.innerHTML = '';
1086
 
1087
  if (records.length === 0) {
1088
- container.innerHTML = '<p style="text-align: center; color: #777; padding: 20px;">Walang nakitang na-save na record.</p>';
1089
  } else {
1090
  records.forEach((rec, index) => {
1091
  const item = document.createElement('div');
@@ -1093,7 +1085,7 @@
1093
  item.innerHTML = `
1094
  <div class="saved-item-info">
1095
  <span class="saved-item-title">${rec.title}</span>
1096
- <span class="saved-item-date">Na-save noong: ${rec.date}</span>
1097
  </div>
1098
  <div class="saved-item-actions">
1099
  <button class="btn-sm btn-load" onclick="loadRecord(${index})">Load</button>
@@ -1117,7 +1109,7 @@
1117
 
1118
  if (!record) return;
1119
 
1120
- if (confirm(`Gusto mo bang i-load ang record na "${record.title}"? Papalitan nito ang kasalukuyang nakasulat.`)) {
1121
  // Restore text inputs
1122
  const textElements = document.querySelectorAll('input[type="text"], textarea');
1123
  record.textData.forEach((item) => {
@@ -1155,20 +1147,20 @@
1155
  });
1156
 
1157
  closeSavedModal();
1158
- alert("✅ Na-load na ang napiling record!");
1159
  }
1160
  }
1161
 
1162
  function deleteRecord(index) {
1163
- if (confirm("Sigurado ka bang gusto mong burahin ang na-save na record na ito?")) {
1164
  let records = JSON.parse(localStorage.getItem('pics_survey_records') || '[]');
1165
  records.splice(index, 1);
1166
  localStorage.setItem('pics_survey_records', JSON.stringify(records));
1167
- openSavedModal(); // Refresh modal
1168
  }
1169
  }
1170
 
1171
- // Close Modal on outside click
1172
  window.onclick = function(event) {
1173
  const modal = document.getElementById('savedModal');
1174
  if (event.target === modal) {
 
507
  </head>
508
  <body>
509
 
 
510
  <div class="action-bar">
511
  <button class="btn btn-clear" onclick="clearForm()">🗑️ Clear Form</button>
512
  <button class="btn btn-save" onclick="saveForm()">💾 Save Data</button>
 
514
  <button class="btn" onclick="window.print()">🖨️ Export to PDF / Print</button>
515
  </div>
516
 
 
517
  <div class="a4-page">
518
  <div class="header-banner">
519
  <img src="picslogo.png" alt="DICT Header Logo">
 
769
  </table>
770
  </div>
771
 
 
772
  <div class="a4-page">
773
  <div style="background-color: var(--primary-color); color: #fff; font-weight: bold; padding: 5px 10px; font-size: 11px; border: 1px solid var(--border-color);">
774
  • Electrical Tapping point and Breaker Location:
 
821
  </div>
822
  </div>
823
 
 
824
  <div class="a4-page">
825
  <div style="background-color: var(--primary-color); color: #fff; font-weight: bold; text-align: center; padding: 5px; font-size: 11px; text-transform: uppercase; border: 1px solid var(--border-color);">
826
  SITE PHOTOS (2/2)
 
891
  </div>
892
  </div>
893
 
 
894
  <div class="a4-page">
895
  <div style="background-color: var(--primary-color); color: #fff; font-weight: bold; text-align: center; padding: 5px; font-size: 11px; text-transform: uppercase; border: 1px solid var(--border-color);">
896
  Floor Plan
 
905
  </div>
906
  </div>
907
 
 
908
  <div class="a4-page heatmap-page">
909
  <div class="heatmap-header-title">
910
  HEAT MAP
 
954
  </div>
955
  </div>
956
 
 
957
  <div class="modal-overlay" id="savedModal">
958
  <div class="modal-content">
959
  <div class="modal-header">
 
961
  <button class="close-modal" onclick="closeSavedModal()">&times;</button>
962
  </div>
963
  <div class="saved-list" id="savedListContainer">
964
+ </div>
 
965
  </div>
966
  </div>
967
 
 
991
  }
992
  }
993
 
994
+ /* --- CLEAR FORM FUNCTION (ENGLISH PROMPTS) --- */
995
  function clearForm() {
996
+ if (confirm("Are you sure you want to clear all inputs and uploaded images from the form?")) {
997
  // Clear inputs, select, textareas
998
  const inputs = document.querySelectorAll('input[type="text"], textarea');
999
  inputs.forEach(input => {
1000
+ // Preserve default disclaimer text if cleared
1001
  if (input.parentElement.classList.contains('disclaimer')) {
1002
  input.value = "The data reflected here have been initially discussed with the Site Coordinator and any proposed changes prior to date of implementation shall be coordinated with the Project Management Team and the project's service providers.";
1003
  } else {
 
1023
  }
1024
  }
1025
 
1026
+ /* --- SAVE FORM FUNCTION (ENGLISH PROMPTS) --- */
1027
  function saveForm() {
1028
  const siteName = document.getElementById('site_name').value.trim() || 'Untitled Site';
1029
  const defaultName = siteName + ' - ' + new Date().toLocaleDateString();
1030
 
1031
+ const recordName = prompt("Enter a name for this saved record:", defaultName);
1032
  if (!recordName) return;
1033
 
1034
  // Collect text inputs
 
1063
 
1064
  try {
1065
  localStorage.setItem('pics_survey_records', JSON.stringify(savedRecords));
1066
+ alert("✅ Survey record saved successfully!");
1067
  } catch (e) {
1068
+ alert("⚠️ Warning: Uploaded image files exceed local storage limits. Please try using smaller image files.");
1069
  }
1070
  }
1071
 
1072
+ /* --- MODAL & LOAD SAVED FILES FUNCTION (ENGLISH PROMPTS) --- */
1073
  function openSavedModal() {
1074
  const container = document.getElementById('savedListContainer');
1075
  const records = JSON.parse(localStorage.getItem('pics_survey_records') || '[]');
 
1077
  container.innerHTML = '';
1078
 
1079
  if (records.length === 0) {
1080
+ container.innerHTML = '<p style="text-align: center; color: #777; padding: 20px;">No saved records found.</p>';
1081
  } else {
1082
  records.forEach((rec, index) => {
1083
  const item = document.createElement('div');
 
1085
  item.innerHTML = `
1086
  <div class="saved-item-info">
1087
  <span class="saved-item-title">${rec.title}</span>
1088
+ <span class="saved-item-date">Saved on: ${rec.date}</span>
1089
  </div>
1090
  <div class="saved-item-actions">
1091
  <button class="btn-sm btn-load" onclick="loadRecord(${index})">Load</button>
 
1109
 
1110
  if (!record) return;
1111
 
1112
+ if (confirm(`Do you want to load the record "${record.title}"? This will overwrite current entries.`)) {
1113
  // Restore text inputs
1114
  const textElements = document.querySelectorAll('input[type="text"], textarea');
1115
  record.textData.forEach((item) => {
 
1147
  });
1148
 
1149
  closeSavedModal();
1150
+ alert("✅ Selected record loaded successfully!");
1151
  }
1152
  }
1153
 
1154
  function deleteRecord(index) {
1155
+ if (confirm("Are you sure you want to delete this saved record?")) {
1156
  let records = JSON.parse(localStorage.getItem('pics_survey_records') || '[]');
1157
  records.splice(index, 1);
1158
  localStorage.setItem('pics_survey_records', JSON.stringify(records));
1159
+ openSavedModal(); // Refresh list in modal
1160
  }
1161
  }
1162
 
1163
+ // Close Modal when clicking outside the box
1164
  window.onclick = function(event) {
1165
  const modal = document.getElementById('savedModal');
1166
  if (event.target === modal) {