-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaudit-report.html
More file actions
214 lines (190 loc) · 12.1 KB
/
Copy pathaudit-report.html
File metadata and controls
214 lines (190 loc) · 12.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HSE Audit Report | Aramco Standard</title>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
<style>
:root { --aramco-green: #00843D; --aramco-dark: #1e1e1e; }
body { font-family: 'Roboto', sans-serif; background: #555; margin: 0; padding: 10px; padding-bottom: 100px; }
.document-page { background: #fff; width: 210mm; min-height: 297mm; margin: 0 auto; padding: 10mm; border: 2px solid var(--aramco-dark); box-shadow: 0 0 20px rgba(0,0,0,0.5); position: relative; box-sizing: border-box; }
/* 🏛️ Official Editable Header */
.header-table { width: 100%; border-collapse: collapse; border: 2px solid #000; }
.header-table td { border: 1px solid #000; padding: 10px; vertical-align: middle; }
.audit-title-box { text-align: center; background: #f2f2f2; }
.audit-title-box input { width: 100%; border: none; background: transparent; text-align: center; font-weight: bold; font-size: 16px; color: var(--aramco-green); outline: none; }
.audit-title-box small input { font-size: 11px; color: #333; font-weight: normal; }
.rev-box input { border: none; font-size: 10px; width: 100%; text-align: right; outline: none; font-weight: bold; background: transparent; }
/* 📋 Info Grid */
.info-section { display: grid; grid-template-columns: repeat(2, 1fr); border: 2px solid #000; border-top: none; }
.field { border-right: 1px solid #000; border-bottom: 1px solid #000; padding: 8px; }
.field:last-child { border-right: none; }
.field label { display: block; font-size: 10px; font-weight: bold; color: #555; text-transform: uppercase; }
.field input, .field select { width: 100%; border: none; font-size: 13px; outline: none; background: transparent; font-weight: bold; }
/* ✍️ Sections */
.section-header { background: var(--aramco-green); color: white; padding: 8px; font-weight: bold; text-transform: uppercase; font-size: 13px; margin-top: -1px; border: 2px solid #000; }
.text-box { border: 2px solid #000; border-top: none; padding: 10px; }
textarea { width: 100%; min-height: 60px; border: none; font-family: inherit; font-size: 13px; resize: none; outline: none; background: transparent; }
/* 📸 Finding & Photo Grid */
.finding-row { border: 2px solid #000; border-top: none; display: grid; grid-template-columns: 1fr 200px; }
.finding-text { padding: 10px; border-right: 1px solid #000; }
.photo-area { padding: 10px; text-align: center; background: #fafafa; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.img-preview { width: 100%; max-width: 150px; height: 100px; border: 1px dashed #ccc; object-fit: cover; margin-bottom: 5px; background: #eee; }
/* 🕹️ Floating Bottom Controls */
.controls { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(30,30,30,0.9); padding: 10px; display: flex; justify-content: center; gap: 8px; z-index: 2000; flex-wrap: wrap; }
.btn { padding: 10px 15px; border: none; border-radius: 4px; color: white; font-weight: bold; cursor: pointer; font-size: 12px; display: flex; align-items: center; gap: 5px; }
.btn-green { background: var(--aramco-green); }
.btn-blue { background: #1976d2; }
.btn-orange { background: #f57c00; }
.btn-red { background: #d32f2f; }
.btn-cam { font-size: 10px; padding: 5px; background: #444; border: none; color: white; cursor: pointer; }
@media print {
body { background: white; padding: 0; }
.document-page { border: 2px solid #000; box-shadow: none; width: 100%; margin: 0; padding: 10mm; }
.controls, .btn-cam { display: none !important; }
.section-header { -webkit-print-color-adjust: exact; background-color: var(--aramco-green) !important; color: white !important; }
}
@media (max-width: 800px) {
body { padding: 5px; padding-bottom: 130px; }
.document-page { width: 100%; padding: 5mm; min-height: auto; }
.info-section { grid-template-columns: 1fr; }
.finding-row { grid-template-columns: 1fr; }
.finding-text { border-right: none; border-bottom: 1px solid #000; }
.photo-area { border-top: 1px solid #000; }
.btn { flex: 1 1 45%; font-size: 11px; justify-content: center; }
}
</style>
</head>
<body>
<div class="controls no-print">
<button class="btn btn-green" onclick="window.print()">📄 PRINT REPORT</button>
<button class="btn btn-blue" onclick="saveAudit()">💾 SAVE DATA</button>
<button class="btn btn-orange" onclick="loadAudit()">🔄 LOAD SAVED</button>
<button class="btn btn-red" onclick="addFinding()">➕ ADD FINDING</button>
<a href="index.html" class="btn btn-blue" style="text-decoration:none;">⬅️ MENU</a>
</div>
<div class="document-page" id="audit-doc">
<table class="header-table">
<tr>
<td width="20%" style="text-align:center;">
<img src="https://upload.wikimedia.org/wikipedia/en/thumb/4/44/Saudi_Aramco_Logo.svg/1200px-Saudi_Aramco_Logo.svg.png" style="width:60px;">
</td>
<td class="audit-title-box">
<input type="text" value="HSE COMPLIANCE AUDIT REPORT">
<br>
<small><input type="text" value="Saudi Aramco Suppliers Safety Management System (SSMS)"></small>
</td>
<td width="25%" class="rev-box">
<input type="text" value="APPENDIX 12" style="font-size: 12px;"><br>
<input type="text" value="Rev: April 2026"><br>
<label style="font-size:9px; font-weight:bold;">Ref:</label>
<input type="text" id="ref_no" value="____" style="width:60px; text-align:left;">
</td>
</tr>
</table>
<div class="info-section">
<div class="field"><label>Audit Type:</label>
<select id="audit_type">
<option>INTERNAL AUDIT (1st Party)</option>
<option>EXTERNAL AUDIT (2nd Party)</option>
</select>
</div>
<div class="field"><label>Date of Audit:</label><input type="date" id="audit_date"></div>
<div class="field"><label>Facility / Location:</label><input type="text" id="facility"></div>
<div class="field"><label>Contract Number:</label><input type="text" id="contract"></div>
<div class="field"><label>Lead Auditor:</label><input type="text" id="auditor"></div>
<div class="field"><label>Auditee Manager:</label><input type="text" id="manager"></div>
</div>
<div class="section-header">1. Executive Summary & Scope</div>
<div class="text-box"><textarea id="scope" placeholder="Describe scope..."></textarea></div>
<div class="section-header">2. Positive Observations (Strengths)</div>
<div class="text-box"><textarea id="strengths" placeholder="List strengths..."></textarea></div>
<div class="section-header">3. Detailed Findings & Photo Evidence</div>
<div id="findings-container">
<div class="finding-row">
<div class="finding-text">
<label style="font-size:10px; font-weight:bold;">FINDING #1:</label>
<textarea class="f-desc" placeholder="Describe the deficiency..."></textarea>
</div>
<div class="photo-area">
<img id="prev_1" class="img-preview" src="" alt="Pending Image">
<input type="file" id="file_1" accept="image/*" style="display:none" onchange="previewImage(this, 'prev_1')">
<button class="btn-cam" onclick="document.getElementById('file_1').click()">📷 TAKE PHOTO</button>
</div>
</div>
</div>
<div class="section-header">4. Audit Result & Sign-off</div>
<div class="info-section">
<div class="field"><label>Audit Score / Result:</label><select><option>EXCELLENT</option><option>GOOD</option><option>PASS</option><option>FAIL</option></select></div>
<div class="field"><label>Next Audit Due:</label><input type="date"></div>
</div>
<div style="display:flex; border:2px solid #000; border-top:none; min-height: 80px;">
<div style="flex:1; padding:15px; border-right:1px solid #000; text-align:center;">
<p style="font-size:10px; font-weight:bold;">LEAD AUDITOR SIGNATURE</p><br>____________________
</div>
<div style="flex:1; padding:15px; text-align:center;">
<p style="font-size:10px; font-weight:bold;">AUDITEE MANAGER SIGNATURE</p><br>____________________
</div>
</div>
</div>
<script>
let findingCount = 1;
function addFinding() {
findingCount++;
const html = `
<div class="finding-row">
<div class="finding-text">
<label style="font-size:10px; font-weight:bold;">FINDING #${findingCount}:</label>
<textarea class="f-desc" placeholder="Describe deficiency..."></textarea>
</div>
<div class="photo-area">
<img id="prev_${findingCount}" class="img-preview" src="" alt="Pending">
<input type="file" id="file_${findingCount}" accept="image/*" style="display:none" onchange="previewImage(this, 'prev_${findingCount}')">
<button class="btn-cam" onclick="document.getElementById('file_${findingCount}').click()">📷 PHOTO</button>
</div>
</div>`;
document.getElementById('findings-container').insertAdjacentHTML('beforeend', html);
}
function previewImage(input, previewId) {
if (input.files && input.files[0]) {
const reader = new FileReader();
reader.onload = (e) => document.getElementById(previewId).src = e.target.result;
reader.readAsDataURL(input.files[0]);
}
}
function saveAudit() {
const auditData = {
ref: document.getElementById('ref_no').value,
findings: []
};
document.querySelectorAll('.finding-row').forEach((row) => {
auditData.findings.push({
text: row.querySelector('.f-desc').value,
img: row.querySelector('.img-preview').src
});
});
localStorage.setItem('aramco_audit_v4', JSON.stringify(auditData));
alert("✅ Audit Data & Photos Saved!");
}
function loadAudit() {
const data = JSON.parse(localStorage.getItem('aramco_audit_v4'));
if(!data) return alert("No Data Found!");
document.getElementById('ref_no').value = data.ref;
alert("🔄 Header Data Loaded!");
}
// 🔄 Settings se Data Auto-Fill karne ka Magic Code
window.addEventListener('load', () => {
const gComp = localStorage.getItem('g_comp');
const gCont = localStorage.getItem('g_cont');
const gName = localStorage.getItem('g_name');
const gSite = localStorage.getItem('g_site');
if(gComp && document.getElementById('comp_name')) document.getElementById('comp_name').value = gComp;
if(gCont && document.getElementById('cont_no')) document.getElementById('cont_no').value = gCont;
if(gName && document.getElementById('auditor')) document.getElementById('auditor').value = gName;
if(gSite && document.getElementById('facility')) document.getElementById('facility').value = gSite;
if(gSite && document.getElementById('fac_area')) document.getElementById('fac_area').value = gSite;
});
</script>
</body>
</html>