PluginProbe
Easy Invoice – Invoice Generator, PDF Quotes & Payments / 2.4.1
Easy Invoice – Invoice Generator, PDF Quotes & Payments v2.4.1
2.4.0 2.4.1 2.3.8 2.3.7 2.3.6 2.3.5 2.3.4 2.3.3 2.3.2 2.3.1 2.2.0 2.1.21 2.1.20 2.1.19 2.1.18 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.16 2.1.2 All 57 releases
easy-invoice / includes / Helpers / NotificationHelper.php

NotificationHelper.php in Easy Invoice – Invoice Generator, PDF Quotes & Payments 2.4.1, at includes/Helpers/NotificationHelper.php

50 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Notification Helper for Easy Invoice
4 *
5 * @package Easy_Invoice
6 */
7
8 if (!defined('ABSPATH')) {
9 exit;
10 }
11
12 /**
13 * Display notification messages
14 *
15 * @param string $type The type of notification (success, error, warning, info)
16 * @param string $message The message to display
17 */
18 function easy_invoice_display_notification($type, $message) {
19 $bg_class = '';
20 $icon_class = '';
21
22 switch ($type) {
23 case 'success':
24 $bg_class = 'bg-green-100 border-green-400 text-green-700';
25 $icon_class = 'fas fa-check-circle';
26 break;
27 case 'error':
28 $bg_class = 'bg-red-100 border-red-400 text-red-700';
29 $icon_class = 'fas fa-exclamation-circle';
30 break;
31 case 'warning':
32 $bg_class = 'bg-yellow-100 border-yellow-400 text-yellow-700';
33 $icon_class = 'fas fa-exclamation-triangle';
34 break;
35 default:
36 $bg_class = 'bg-blue-100 border-blue-400 text-blue-700';
37 $icon_class = 'fas fa-info-circle';
38 }
39
40 echo '<div class="border-l-4 p-4 mb-4 ' . esc_attr($bg_class) . '">';
41 echo '<div class="flex">';
42 echo '<div class="flex-shrink-0">';
43 echo '<i class="' . esc_attr($icon_class) . '"></i>';
44 echo '</div>';
45 echo '<div class="ml-3">';
46 echo '<p class="text-sm">' . esc_html($message) . '</p>';
47 echo '</div>';
48 echo '</div>';
49 echo '</div>';
50 }