403 lines
15 KiB
PHP
403 lines
15 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;
|
|
}
|
|
|
|
.footer {
|
|
margin-top: 40px;
|
|
text-align: center;
|
|
font-size: 11px;
|
|
color: #D1D5DB;
|
|
}
|
|
|
|
/* Quill WYSIWYG Compatibility */
|
|
.ql-align-center {
|
|
text-align: center !important;
|
|
}
|
|
|
|
.ql-align-right {
|
|
text-align: right !important;
|
|
}
|
|
|
|
.ql-align-justify {
|
|
text-align: justify !important;
|
|
}
|
|
|
|
.ql-size-small {
|
|
font-size: 0.75em !important;
|
|
}
|
|
|
|
.ql-size-large {
|
|
font-size: 1.5em !important;
|
|
}
|
|
|
|
.ql-size-huge {
|
|
font-size: 2.5em !important;
|
|
}
|
|
|
|
.contact-person-page,
|
|
.terms-and-conditions-page {
|
|
width: 100%;
|
|
}
|
|
|
|
.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->ig_handle)<span>· {{ '@' . ltrim($profile->ig_handle, '@') }}</span>@endif
|
|
@if($profile->tiktok_handle)<span>· {{ '@' . ltrim($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>
|
|
</div>
|
|
@endforeach
|
|
|
|
@if(!empty($profile->past_brands))
|
|
@php
|
|
$logoSizesPdf = [
|
|
'small' => 'max-height:30px; max-width:60px;',
|
|
'medium' => 'max-height:45px; max-width:90px;',
|
|
'large' => 'max-height:65px; max-width:130px;',
|
|
];
|
|
$sizeStylePdf = $logoSizesPdf[$profile->brand_logo_size ?? 'medium'] ?? $logoSizesPdf['medium'];
|
|
@endphp
|
|
<div style="page-break-before: always;"></div>
|
|
<div class="platform-section" style="margin-top:20px; page-break-inside:avoid;">
|
|
<div class="platform-title" style="text-align:center;">Brand Collaborations</div>
|
|
<div style="text-align:center; padding-top:10px;">
|
|
@foreach($profile->past_brands as $brandPath)
|
|
@if(file_exists(storage_path('app/public/' . $brandPath)))
|
|
<img src="{{ storage_path('app/public/' . $brandPath) }}"
|
|
style="{{ $sizeStylePdf }} object-fit:contain; margin:0 10px; display:inline-block; vertical-align:middle;">
|
|
@endif
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
@php
|
|
$pdfShowcase = array_filter($profile->content_showcase ?? [], function($item) {
|
|
return !isset($item['show_on_pdf']) || $item['show_on_pdf'];
|
|
});
|
|
@endphp
|
|
@if(!empty($pdfShowcase))
|
|
<div style="page-break-before: always;"></div>
|
|
<div class="platform-section" style="margin-top:20px; page-break-inside:avoid;">
|
|
<div class="platform-title" style="text-align:center;">Content Showcase</div>
|
|
<div style="text-align:center; padding-top:10px;">
|
|
@foreach($pdfShowcase as $item)
|
|
@php
|
|
$isUrl = ($item['file_id'] === 'url');
|
|
$file = !$isUrl ? \App\Models\MediaFile::find($item['file_id']) : null;
|
|
@endphp
|
|
@if($file || $isUrl)
|
|
<div style="display:inline-block; width:180px; margin:10px; border:1px solid rgba(0,0,0,0.1); border-radius:8px; overflow:hidden; vertical-align:top; background:#ffffff;">
|
|
<div style="height:120px; background:#F9FAFB; border-bottom:1px solid rgba(0,0,0,0.05); position:relative; text-align:center;">
|
|
@if(!empty($item['thumbnail_path']) && file_exists(storage_path('app/public/' . $item['thumbnail_path'])))
|
|
<a href="{{ $isUrl ? $item['url'] : $file->url }}" target="_blank" style="display:block; text-decoration:none; position:relative;">
|
|
<img src="{{ storage_path('app/public/' . $item['thumbnail_path']) }}" style="width:100%; height:120px; object-fit:cover;">
|
|
@if(!$isUrl && $file->is_video)
|
|
<div style="position:absolute; inset:0; display:flex; align-items:center; justify-content:center; background:rgba(0,0,0,0.2);">
|
|
<div style="width:30px; height:30px; background:rgba(255,255,255,0.8); border-radius:50%; display:flex; align-items:center; justify-content:center; color:{{ $accentHex }}; font-size:16px;">▶</div>
|
|
</div>
|
|
@endif
|
|
</a>
|
|
@elseif(!$isUrl && $file->is_image && file_exists(storage_path('app/private/' . $file->path)))
|
|
<a href="{{ $file->url }}" target="_blank" style="display:block; text-decoration:none;">
|
|
<img src="{{ storage_path('app/private/' . $file->path) }}" style="width:100%; height:120px; object-fit:cover;">
|
|
</a>
|
|
@else
|
|
<a href="{{ $isUrl ? $item['url'] : $file->url }}" target="_blank" style="display:block; text-decoration:none; color:{{ $accentHex }}; padding-top:40px; font-weight:bold;">
|
|
<span style="font-size:30px; display:block;">{{ $isUrl ? '🌐' : ($file->is_video ? '🎬' : '📁') }}</span>
|
|
{{ $isUrl ? 'Open Link' : 'View File' }}
|
|
</a>
|
|
@endif
|
|
</div>
|
|
<div style="padding:10px; text-align:center;">
|
|
<div style="font-weight:700; font-size:11px;">{{ $item['name'] }}</div>
|
|
<div style="font-size:9px; color:#9CA3AF; margin-top:4px;">
|
|
{{ $isUrl ? 'External Link' : ($file->is_video ? 'Video' : ($file->is_image ? 'Image' : 'Document')) }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
@if($profile->terms_and_conditions)
|
|
<div style="page-break-before: always;"></div>
|
|
<div class="platform-section" style="margin-top:20px; page-break-inside:avoid;">
|
|
<div class="platform-title">Terms & Conditions</div>
|
|
<div style="font-size:10px; color:#6B7280; line-height:1.5; padding:0 10px;">
|
|
{!! $profile->terms_and_conditions !!}</div>
|
|
</div>
|
|
@endif
|
|
|
|
<div style="page-break-before: always;"></div>
|
|
@if($profile->contact_person_html)
|
|
<div class="contact-person-page">
|
|
{!! $profile->contact_person_html !!}
|
|
</div>
|
|
@else
|
|
<div style="text-align: center; margin-top: 40px;">
|
|
<h1
|
|
style="font-family: 'Comic Sans MS', sans-serif; font-size: 32px; font-weight: 900; letter-spacing: 4px; color: #111827; margin-bottom: 30px; text-transform: uppercase;">
|
|
CONTACT PERSON</h1>
|
|
@if($profile->whatsapp)
|
|
<div
|
|
style="font-family: 'Comic Sans MS', sans-serif; font-size: 36px; font-weight: 900; color: #14b8a6; margin-bottom: 5px;">
|
|
{{ $profile->whatsapp }}</div>
|
|
<div
|
|
style="font-family: 'Comic Sans MS', sans-serif; font-size: 20px; font-weight: 800; color: #14b8a6; margin-bottom: 30px; letter-spacing: 2px;">
|
|
(WHATS APP)</div>
|
|
@endif
|
|
|
|
@if($profile->email)
|
|
<div
|
|
style="font-family: 'Comic Sans MS', sans-serif; font-size: 14px; font-weight: 800; color: #f97316; margin-bottom: 10px; letter-spacing: 2px;">
|
|
EMAIL</div>
|
|
<div
|
|
style="font-family: 'Comic Sans MS', sans-serif; font-size: 32px; font-weight: 900; color: #ef4444; margin-bottom: 40px; letter-spacing: 2px;">
|
|
{{ strtoupper($profile->email) }}</div>
|
|
@endif
|
|
<div
|
|
style="font-size: 11px; font-weight: 900; color: #111827; line-height: 1.5; max-width: 80%; margin: 0 auto; text-transform: uppercase;">
|
|
Kami tidak bertanggung jawab atas segala bentuk kerjasama yg timbul dengan pihak selain dari kontak diatas
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
<div class="footer">
|
|
{{ $profile->custom_footer ?: 'Prices may vary. Contact for custom packages.' }}
|
|
· Generated {{ now()->format('d M Y') }}
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html> |