Files
Kol-Manager/resources/views/rate-cards/pdf.blade.php
I-Fun 22f03ccca7 Add contract management and invoice settings pages
- Created a new Blade view for managing brand contracts with forms for adding and editing contracts, including client and category selection.
- Implemented success message notifications for contract actions.
- Added a new Blade view for invoice settings, allowing customization of invoice number format, header branding, and default values for new invoices.
- Introduced a new PDF view for generating rate cards with customizable styles based on user profile settings.
- Developed a profile management page for rate cards, enabling users to update their identity, appearance, and visibility settings.
2026-04-01 21:47:34 +07:00

143 lines
5.6 KiB
PHP

@php
// Convert hex accent color to rgb for rgba() usage in dompdf
$accent = ltrim($profile->accent_color ?? '#FFB7C5', '#');
$ar = hexdec(substr($accent, 0, 2));
$ag = hexdec(substr($accent, 2, 2));
$ab = hexdec(substr($accent, 4, 2));
$accentRgb = "{$ar},{$ag},{$ab}";
$bg = $profile->bg_color ?? '#FFFBFE';
$text = $profile->text_color ?? '#374151';
$accentHex = '#' . $accent;
@endphp
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Rate Card — {{ $profile->owner_name }}</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: 'DejaVu Sans', sans-serif;
background: {{ $bg }};
color: {{ $text }};
padding: 36px 32px;
font-size: 12px;
}
.header {
text-align: center;
margin-bottom: 32px;
padding-bottom: 20px;
border-bottom: 2px solid {{ $accentHex }};
}
.logo-img { max-height: 72px; max-width: 140px; margin: 0 auto 10px; display: block; }
.name { font-size: 24px; font-weight: 700; color: {{ $accentHex }}; }
.tagline { color: #9CA3AF; margin-top: 4px; font-size: 11px; }
.contacts { margin-top: 10px; font-size: 10px; color: #6B7280; }
.contacts span { margin: 0 6px; }
.platform-section { margin-bottom: 22px; }
.platform-title {
font-size: 13px; font-weight: 700;
color: {{ $text }};
margin-bottom: 8px;
padding: 5px 10px;
background-color: rgba({{ $accentRgb }}, 0.1);
border-left: 4px solid {{ $accentHex }};
}
table { width: 100%; border-collapse: collapse; }
th {
text-align: left; padding: 7px 10px;
background-color: rgba({{ $accentRgb }}, 0.08);
color: #6B7280; font-size: 9px;
text-transform: uppercase; letter-spacing: 0.05em;
border-bottom: 1px solid rgba({{ $accentRgb }}, 0.25);
}
td { padding: 8px 10px; border-bottom: 1px solid #F3F4F6; vertical-align: top; }
tr:last-child td { border-bottom: none; }
.service-name { font-weight: 600; color: {{ $text }}; }
.content-type {
display: inline-block; font-size: 9px;
background-color: rgba({{ $accentRgb }}, 0.1);
color: {{ $accentHex }};
padding: 1px 7px; border-radius: 10px; margin-top: 2px;
}
.desc { color: #9CA3AF; font-size: 10px; margin-top: 3px; }
.price { font-weight: 700; color: {{ $accentHex }}; font-size: 13px; }
.price-unit { color: #9CA3AF; font-size: 9px; }
.negotiable { color: #F59E0B; font-size: 9px; font-weight: 600; }
.footer { text-align: center; margin-top: 36px; color: #D1D5DB; font-size: 9px; border-top: 1px solid #F3F4F6; padding-top: 14px; }
</style>
</head>
<body>
<div class="header">
@if($profile->logo_path && file_exists(storage_path('app/private/' . $profile->logo_path)))
<img src="{{ storage_path('app/private/' . $profile->logo_path) }}" class="logo-img" alt="{{ $profile->owner_name }}">
@endif
<div class="name">{{ $profile->owner_name }}</div>
@if($profile->tagline)
<div class="tagline">{{ $profile->tagline }}</div>
@endif
<div class="contacts">
@if($profile->email)<span>✉ {{ $profile->email }}</span>@endif
@if($profile->whatsapp)<span>· {{ $profile->whatsapp }}</span>@endif
@if($profile->ig_handle)<span>· @{{ $profile->ig_handle }}</span>@endif
@if($profile->tiktok_handle)<span>· @{{ $profile->tiktok_handle }}</span>@endif
@if($profile->youtube_handle)<span>· {{ $profile->youtube_handle }}</span>@endif
</div>
</div>
@foreach($rateCards as $platform => $cards)
<div class="platform-section">
<div class="platform-title">
@php $icons = ['instagram' => 'Instagram', 'tiktok' => 'TikTok', 'youtube' => 'YouTube', 'general' => 'General']; @endphp
{{ $icons[$platform] ?? ucfirst($platform) }}
</div>
<table>
<thead>
<tr>
<th style="width:38%">Service</th>
<th style="width:37%">Description</th>
<th style="width:25%; text-align:right">Price</th>
</tr>
</thead>
<tbody>
@foreach($cards as $card)
<tr>
<td>
<div class="service-name">{{ $card->service_name }}</div>
@if($card->content_type)
<span class="content-type">{{ $card->content_type }}</span>
@endif
</td>
<td>
@if($card->description)
<div class="desc">{{ $card->description }}</div>
@endif
</td>
<td style="text-align:right">
@if($profile->show_prices)
<div class="price">{{ $card->formatted_price }}</div>
<div class="price-unit">{{ str_replace('_', ' ', $card->price_unit) }}</div>
@else
<div class="price" style="font-size:11px">On Request</div>
@endif
@if($card->is_negotiable)
<div class="negotiable">Negotiable</div>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endforeach
<div class="footer">
{{ $profile->custom_footer ?: 'Prices may vary. Contact for custom packages.' }}
· Generated {{ now()->format('d M Y') }}
</div>
</body>
</html>