View doc + Upload Link buttons open new window, always visible in both admin panels

This commit is contained in:
2026-05-25 19:58:43 +00:00
parent ab5ee95e20
commit b76da95cea
+28 -26
View File
@@ -857,19 +857,17 @@ textarea.notes-ta:focus{border-color:#f97316}
<span class="flow-meta" id="meta-<?= $bid ?>-insurance_verified">
<?= $stepInsurance?'Verified — on file':($cancelled?'N/A':($insFile?'Doc submitted — verify at pickup':'Pending — verify at pickup')) ?>
</span>
<?php if ($insFile && !$cancelled): ?>
<a class="flow-link" href="/view-doc.php?ref=<?= urlencode($b['booking_ref']) ?>&type=insurance&_t=<?= $token ?>" target="_blank" style="margin-right:8px">📄 View Submitted Doc ↗</a>
<?php endif; ?>
<?php if (!$cancelled): ?>
<div class="flow-action" style="margin-top:4px">
<div class="flow-action" style="margin-top:4px;display:flex;flex-wrap:wrap;gap:6px;align-items:center">
<?php if ($insFile): ?>
<a class="flow-toggle" href="/view-doc.php?ref=<?= urlencode($b['booking_ref']) ?>&type=insurance&_t=<?= $token ?>" target="_blank" style="text-decoration:none">📄 View Submitted Doc ↗</a>
<?php endif; ?>
<button class="flow-toggle <?= $stepInsurance?'active':'' ?>"
id="btn-<?= $bid ?>-insurance_verified"
onclick="toggleReq(<?= $bid ?>,'insurance_verified',this)">
<?= $stepInsurance?'✓ Verified at Pickup':'Mark Verified at Pickup' ?>
</button>
<?php if (!$insFile): ?>
<button class="flow-toggle" style="margin-left:6px" onclick="copyUploadLink('<?= htmlspecialchars($b['booking_ref']) ?>','insurance',this)">📎 Copy Upload Link</button>
<?php endif; ?>
<button class="flow-toggle" onclick="openUploadLink('<?= htmlspecialchars($b['booking_ref']) ?>','insurance')">📎 Upload Link</button>
</div>
<?php endif; ?>
</div>
@@ -885,19 +883,17 @@ textarea.notes-ta:focus{border-color:#f97316}
<span class="flow-meta" id="meta-<?= $bid ?>-license_verified">
<?= $stepLicense?'Verified at pickup':($cancelled?'N/A':($licFile?'Doc submitted — verify at pickup':'Verify at pickup')) ?>
</span>
<?php if ($licFile && !$cancelled): ?>
<a class="flow-link" href="/view-doc.php?ref=<?= urlencode($b['booking_ref']) ?>&type=license&_t=<?= $token ?>" target="_blank" style="margin-right:8px">📄 View Submitted Doc ↗</a>
<?php endif; ?>
<?php if (!$cancelled): ?>
<div class="flow-action" style="margin-top:4px">
<div class="flow-action" style="margin-top:4px;display:flex;flex-wrap:wrap;gap:6px;align-items:center">
<?php if ($licFile): ?>
<a class="flow-toggle" href="/view-doc.php?ref=<?= urlencode($b['booking_ref']) ?>&type=license&_t=<?= $token ?>" target="_blank" style="text-decoration:none">📄 View Submitted Doc ↗</a>
<?php endif; ?>
<button class="flow-toggle <?= $stepLicense?'active':'' ?>"
id="btn-<?= $bid ?>-license_verified"
onclick="toggleReq(<?= $bid ?>,'license_verified',this)">
<?= $stepLicense?'✓ Verified at Pickup':'Mark Verified at Pickup' ?>
</button>
<?php if (!$licFile): ?>
<button class="flow-toggle" style="margin-left:6px" onclick="copyUploadLink('<?= htmlspecialchars($b['booking_ref']) ?>','license',this)">📎 Copy Upload Link</button>
<?php endif; ?>
<button class="flow-toggle" onclick="openUploadLink('<?= htmlspecialchars($b['booking_ref']) ?>','license')">📎 Upload Link</button>
</div>
<?php endif; ?>
</div>
@@ -1287,8 +1283,10 @@ textarea.notes-ta:focus{border-color:#f97316}
$stepConfirmed = in_array($cb['status'], ['confirmed','completed']);
$stepWaiver = (bool)$cb['waiver_signed'];
$stepInsurance = (bool)$cb['insurance_verified'];
$insFile = $cb['insurance_file'] ?? '';
$stepDeposit = (bool)$cb['deposit_received'];
$stepLicense = (bool)$cb['license_verified'];
$licFile = $cb['license_file'] ?? '';
$stepHelmet = (bool)$cb['helmet_provided'];
$stepSafety = (bool)$cb['safety_course'];
$stepOps = (bool)$cb['operational_course'];
@@ -1363,14 +1361,18 @@ textarea.notes-ta:focus{border-color:#f97316}
<div class="flow-body">
<span class="flow-label">Insurance Received</span>
<span class="flow-meta" id="cv-meta-<?= $bid ?>-insurance_verified">
<?= $stepInsurance?'Verified — on file':($cancelled?'N/A':'Pending — verify at pickup') ?>
<?= $stepInsurance?'Verified — on file':($cancelled?'N/A':($insFile?'Doc submitted — verify at pickup':'Pending — verify at pickup')) ?>
</span>
<?php if (!$cancelled): ?>
<div class="flow-action">
<div class="flow-action" style="display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:4px">
<?php if ($insFile): ?>
<a class="flow-toggle" href="/view-doc.php?ref=<?= urlencode($cb['booking_ref']) ?>&type=insurance&_t=<?= $token ?>" target="_blank" style="text-decoration:none">📄 View Doc ↗</a>
<?php endif; ?>
<button class="flow-toggle <?= $stepInsurance?'active':'' ?>" id="cv-btn-<?= $bid ?>-insurance_verified"
onclick="cvToggleReq(<?= $bid ?>,'insurance_verified',this)">
<?= $stepInsurance?'✓ Marked Received':'Mark Received' ?>
<?= $stepInsurance?'✓ Verified at Pickup':'Mark Verified at Pickup' ?>
</button>
<button class="flow-toggle" onclick="openUploadLink('<?= htmlspecialchars($cb['booking_ref']) ?>','insurance')">📎 Upload Link</button>
</div>
<?php endif; ?>
</div>
@@ -1383,14 +1385,18 @@ textarea.notes-ta:focus{border-color:#f97316}
<div class="flow-body">
<span class="flow-label">Driver's License Verified</span>
<span class="flow-meta" id="cv-meta-<?= $bid ?>-license_verified">
<?= $stepLicense?'Verified — on file':($cancelled?'N/A':'Verify at pickup') ?>
<?= $stepLicense?'Verified at pickup':($cancelled?'N/A':($licFile?'Doc submitted — verify at pickup':'Verify at pickup')) ?>
</span>
<?php if (!$cancelled): ?>
<div class="flow-action">
<div class="flow-action" style="display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:4px">
<?php if ($licFile): ?>
<a class="flow-toggle" href="/view-doc.php?ref=<?= urlencode($cb['booking_ref']) ?>&type=license&_t=<?= $token ?>" target="_blank" style="text-decoration:none">📄 View Doc ↗</a>
<?php endif; ?>
<button class="flow-toggle <?= $stepLicense?'active':'' ?>" id="cv-btn-<?= $bid ?>-license_verified"
onclick="cvToggleReq(<?= $bid ?>,'license_verified',this)">
<?= $stepLicense?'✓ License Verified':'Mark License Verified' ?>
<?= $stepLicense?'✓ Verified at Pickup':'Mark Verified at Pickup' ?>
</button>
<button class="flow-toggle" onclick="openUploadLink('<?= htmlspecialchars($cb['booking_ref']) ?>','license')">📎 Upload Link</button>
</div>
<?php endif; ?>
</div>
@@ -1665,13 +1671,9 @@ function saveNotes(id) {
}
// ── Send reminder email ───────────────────────────────────────────────────────
function copyUploadLink(ref, type, btn) {
function openUploadLink(ref, type) {
const url = 'https://parkerslingshot.epictravelexpeditions.com/upload-docs.php?ref=' + encodeURIComponent(ref) + '&type=' + type;
navigator.clipboard.writeText(url).then(() => {
const orig = btn.textContent;
btn.textContent = '✓ Copied!';
setTimeout(() => btn.textContent = orig, 2000);
}).catch(() => prompt('Copy this link:', url));
window.open(url, '_blank');
}
function resendConfirmation(id, btn) {