Enhance approval email view logic and update HTML templates for better user feedback
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
This commit is contained in:
94
resources/views/approval/approve-form.blade.php
Normal file
94
resources/views/approval/approve-form.blade.php
Normal file
@@ -0,0 +1,94 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Request On Approve</title>
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
</head>
|
||||
<body style="font-family: Arial, sans-serif; background-color: #f4f4f4; margin:0; padding:0;">
|
||||
<table width="100%" cellpadding="0" cellspacing="0" style="padding: 20px 0;">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<!-- Card container -->
|
||||
<table width="600" cellpadding="0" cellspacing="0" style="background-color: #ffffff; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,0.1); border: 1px solid #e0e0e0;">
|
||||
<tr>
|
||||
<td style="padding: 30px; text-align: center;">
|
||||
<!-- Header -->
|
||||
<div style="font-size: 35px;"></div>
|
||||
<h2 style="color: Green; margin: 10px 0 20px; font-size: 24px;">✔ Request On Approve</h2>
|
||||
|
||||
<!-- Message -->
|
||||
{{-- <p style="font-size: 16px; color: #555555; line-height: 1.5;">
|
||||
Your request has been put on reject.
|
||||
</p> --}}
|
||||
|
||||
<!-- Remark Textbox -->
|
||||
<div style="margin-top: 20px; text-align: left;">
|
||||
<label for="remark" style="font-size: 14px; color: #333;">Remark</label>
|
||||
<textarea id="remark" style="width:100%; height:100px; padding:10px; margin-top:5px; border:1px solid #ddd; border-radius:5px;"></textarea>
|
||||
</div>
|
||||
|
||||
<!-- Buttons -->
|
||||
<div style="margin-top: 20px;">
|
||||
{{-- <button onclick="holdRequest()" style="padding: 10px 20px; margin-right: 10px; background-color:#FF8800; color:#fff; border:none; border-radius:5px; cursor:pointer;">
|
||||
Hold
|
||||
</button> --}}
|
||||
<input type="hidden" id="requestId" value="{{ request()->query('id') }}">
|
||||
<input type="hidden" id="level" value="{{ request()->query('level') }}">
|
||||
|
||||
<button onclick="saveRemark()" style="padding: 10px 20px; background-color:#4CAF50; color:#fff; border:none; border-radius:5px; cursor:pointer;">
|
||||
Save Remark
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- Footer -->
|
||||
<tr>
|
||||
<td style="padding: 15px; text-align: center; font-size: 12px; color: #999999;">
|
||||
CRI Digital Manufacturing Solutions<br>
|
||||
© 2026 All Rights Reserved
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
|
||||
function saveRemark() {
|
||||
const remark = document.getElementById("remark").value.trim();
|
||||
const id = document.getElementById("requestId").value;
|
||||
const level = document.getElementById("level").value;
|
||||
|
||||
fetch('/characteristic/approve-save', {
|
||||
method: 'POST',
|
||||
credentials: 'same-origin',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').content
|
||||
},
|
||||
body: JSON.stringify({
|
||||
id: id,
|
||||
level: level,
|
||||
remark: remark
|
||||
})
|
||||
})
|
||||
.then(res => {
|
||||
if (!res.ok) {
|
||||
throw new Error("HTTP error " + res.status);
|
||||
}
|
||||
return res.json();
|
||||
})
|
||||
.then(data => {
|
||||
alert('Approved saved successfully!');
|
||||
window.location.href = "/approval/approve-success";
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
alert('Error saving approve!');
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user