Added panel box report mail pages
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 32s

This commit is contained in:
dhanabalan
2026-09-04 17:16:40 +05:30
parent 5088e30ffa
commit 3f6bda4144
2 changed files with 394 additions and 0 deletions

View File

@@ -0,0 +1,71 @@
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
class PanelBoxReportMail extends Mailable
{
use Queueable, SerializesModels;
/**
* Create a new message instance.
*/
public $records;
public $plantId;
public $machineId;
public $plantName;
public $machineName;
public function __construct($records,$plantId,$machineId, $plantName, $machineName)
{
$this->records = $records;
$this->plantId = $plantId;
$this->machineId = $machineId;
$this->plantName = $plantName;
$this->machineName = $machineName;
}
/**
* Get the message envelope.
*/
public function envelope(): Envelope
{
return new Envelope(
subject: 'Panel Box Inspection Report Mail',
);
}
/**
* Get the message content definition.
*/
public function content(): Content
{
$greeting = '<b>Dear Sir</b>';
return new Content(
view: 'mail.panel-box-report',
with: [
'company' => 'CRI Digital Manufacturing Solutions',
'greeting' => $greeting,
'wishes' => 'Thanks & Regards,<br>CRI Digital Manufacturing Solutions',
],
);
}
/**
* Get the attachments for the message.
*
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
*/
public function attachments(): array
{
return [];
}
}

View File

@@ -0,0 +1,323 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
body {
margin: 0;
padding: 0;
background: #f4f6f8;
font-family: Arial, Helvetica, sans-serif;
color: #1f2937;
}
.wrapper {
width: 100%;
padding: 30px 0;
}
.container {
width: 680px;
max-width: 94%;
margin: 0 auto;
background: #ffffff;
border-radius: 14px;
overflow: hidden;
box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}
/* Header */
.header {
background: #111827;
padding: 28px 32px;
color: #ffffff;
}
.header-title {
font-size: 24px;
font-weight: bold;
margin: 0;
}
.header-subtitle {
margin-top: 7px;
font-size: 13px;
color: #d1d5db;
}
/* Info */
.info {
padding: 22px 32px 10px;
}
.info-table {
width: 100%;
border-collapse: collapse;
}
.info-label {
font-size: 11px;
color: #6b7280;
text-transform: uppercase;
font-weight: bold;
letter-spacing: 0.5px;
}
.info-value {
font-size: 14px;
font-weight: bold;
color: #111827;
padding-top: 4px;
}
/* Summary */
.summary {
margin: 18px 32px;
padding: 22px;
background: #fff1f2;
border: 1px solid #fecdd3;
border-radius: 12px;
}
.summary-label {
font-size: 12px;
color: #9f1239;
font-weight: bold;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.summary-count {
font-size: 34px;
font-weight: bold;
color: #e11d48;
margin-top: 5px;
}
.summary-text {
font-size: 12px;
color: #881337;
margin-top: 3px;
}
/* Table */
.content {
padding: 5px 32px 30px;
}
.section-title {
font-size: 16px;
font-weight: bold;
color: #111827;
margin: 15px 0;
}
.serial-table {
width: 100%;
border-collapse: separate;
border-spacing: 0;
border: 1px solid #e5e7eb;
border-radius: 10px;
overflow: hidden;
}
.serial-table th {
background: #f9fafb;
color: #6b7280;
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.4px;
padding: 12px 14px;
text-align: left;
border-bottom: 1px solid #e5e7eb;
}
.serial-table td {
padding: 13px 14px;
font-size: 13px;
border-bottom: 1px solid #f0f1f3;
}
.serial-table tr:last-child td {
border-bottom: none;
}
.serial-number {
font-weight: bold;
color: #111827;
font-family: monospace;
font-size: 13px;
}
.not-ok {
display: inline-block;
padding: 5px 10px;
background: #ffe4e6;
color: #be123c;
border-radius: 20px;
font-size: 10px;
font-weight: bold;
}
/* Footer */
.footer {
background: #f9fafb;
padding: 18px 32px;
text-align: center;
border-top: 1px solid #e5e7eb;
}
.footer-text {
margin: 0;
font-size: 11px;
color: #9ca3af;
}
.footer-warning {
margin-top: 5px;
font-size: 11px;
color: #6b7280;
}
</style>
</head>
<body>
<div class="wrapper">
<div class="container">
{{-- HEADER --}}
<div class="header">
<div class="header-title">
Panel Box Inspection Report
</div>
<div class="header-subtitle">
NOT OK Serial Number Report
</div>
</div>
{{-- PLANT / MACHINE INFORMATION --}}
<div class="info">
<table class="info-table">
<tr>
<td width="33%">
<div class="info-label">Plant</div>
<div class="info-value">
{{ $plantName }}
</div>
</td>
<td width="33%">
<div class="info-label">Machine</div>
<div class="info-value">
{{ $machineName }}
</div>
</td>
<td width="34%">
<div class="info-label">Report Date</div>
<div class="info-value">
{{ now()->format('d M Y') }}
</div>
</td>
</tr>
</table>
</div>
{{-- SUMMARY --}}
<div class="summary">
<div class="summary-label">
NOT OK Inspections
</div>
<div class="summary-count">
{{ $records->count() }}
</div>
<div class="summary-text">
Panel box serial numbers requiring attention
</div>
</div>
{{-- SERIAL NUMBER LIST --}}
<div class="content">
<div class="section-title">
NOT OK Serial Numbers
</div>
<table class="serial-table">
<thead>
<tr>
<th width="12%">S.No</th>
<th>Serial Number</th>
<th width="20%">Status</th>
</tr>
</thead>
<tbody>
@foreach($records as $index => $record)
<tr>
<td>
{{ $index + 1 }}
</td>
<td>
<span class="serial-number">
{{ $record->serial_number }}
</span>
</td>
<td>
<span class="not-ok">
NOT OK
</span>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
{{-- FOOTER --}}
<div class="footer">
<p class="footer-text">
This is an automated Panel Box Inspection Report.
</p>
<p class="footer-warning">
Please review the above serial numbers for necessary action.
</p>
</div>
</div>
</div>
</body>
</html>