23 lines
1.1 KiB
PHP
23 lines
1.1 KiB
PHP
<?php
|
|
$content = file_get_contents('admin/products.php');
|
|
|
|
$search = <<<HTML
|
|
<?php if ($product['is_loyalty']): ?>
|
|
<span class="badge bg-info bg-opacity-10 text-info border border-info rounded-pill ms-1" style="font-size: 0.7rem;">
|
|
<i class="bi bi-star-fill"></i> Loyalty
|
|
</span>
|
|
<?php endif; ?>
|
|
HTML;
|
|
|
|
$replace = $search . <<<HTML
|
|
|
|
<?php if ($product['show_in_qorder']): ?>
|
|
<span class="badge bg-primary bg-opacity-10 text-primary border border-primary rounded-pill ms-1" style="font-size: 0.7rem;">
|
|
<i class="bi bi-qr-code"></i> QR Menu
|
|
</span>
|
|
<?php endif; ?>
|
|
HTML;
|
|
|
|
$content = str_replace($search, $replace, $content);
|
|
file_put_contents('admin/products.php', $content);
|
|
echo "Badge added.\n"; |