| @@ -31,9 +31,9 @@ | ||
| 31 | 31 | <div class="bg-white p-6 rounded-xl border border-gray-200 shadow-sm mb-8"> |
| 32 | 32 | <div class="flex items-center justify-between pb-4 border-b border-gray-200 mb-4"> |
| 33 | 33 | <h4 class="text-lg font-semibold text-gray-800 flex items-center"> |
| 34 | 34 | <i class="fas fa-user-check text-indigo-500 mr-3"></i> |
| 35 | - <span><?php _e('Client Details', 'easy-invoice'); ?></span> | |
| 35 | + <span><?php esc_html_e('Client Details', 'easy-invoice'); ?></span> | |
| 36 | 36 | </h4> |
| 37 | 37 | </div> |
| 38 | 38 | |
| 39 | 39 | <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-6 pt-2"> |
| @@ -39,9 +39,9 @@ | ||
| 39 | 39 | <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-6 pt-2"> |
| 40 | 40 | <div class="flex items-start group"> |
| 41 | 41 | <div class="flex-shrink-0 w-8 text-center pt-1"><i class="fas fa-user-tie text-gray-400 group-hover:text-indigo-500 transition-colors"></i></div> |
| 42 | 42 | <div class="ml-3"> |
| 43 | - <label class="block text-xs font-medium text-gray-500 uppercase tracking-wider"><?php _e('Full Name', 'easy-invoice'); ?></label> | |
| 43 | + <label class="block text-xs font-medium text-gray-500 uppercase tracking-wider"><?php esc_html_e('Full Name', 'easy-invoice'); ?></label> | |
| 44 | 44 | <p class="text-sm font-semibold text-gray-800 mt-1"><?php echo esc_html($client->getFirstName() . ' ' . $client->getLastName()); ?></p> |
| 45 | 45 | </div> |
| 46 | 46 | </div> |
| 47 | 47 | |
| @@ -47,9 +47,9 @@ | ||
| 47 | 47 | |
| 48 | 48 | <div class="flex items-start group"> |
| 49 | 49 | <div class="flex-shrink-0 w-8 text-center pt-1"><i class="fas fa-building text-gray-400 group-hover:text-indigo-500 transition-colors"></i></div> |
| 50 | 50 | <div class="ml-3"> |
| 51 | - <label class="block text-xs font-medium text-gray-500 uppercase tracking-wider"><?php _e('Company', 'easy-invoice'); ?></label> | |
| 51 | + <label class="block text-xs font-medium text-gray-500 uppercase tracking-wider"><?php esc_html_e('Company', 'easy-invoice'); ?></label> | |
| 52 | 52 | <p class="text-sm font-semibold text-gray-800 mt-1"><?php echo esc_html($client->getBusinessClientName() ?: 'N/A'); ?></p> |
| 53 | 53 | </div> |
| 54 | 54 | </div> |
| 55 | 55 | |
| @@ -55,9 +55,9 @@ | ||
| 55 | 55 | |
| 56 | 56 | <div class="flex items-start group"> |
| 57 | 57 | <div class="flex-shrink-0 w-8 text-center pt-1"><i class="fas fa-envelope text-gray-400 group-hover:text-indigo-500 transition-colors"></i></div> |
| 58 | 58 | <div class="ml-3"> |
| 59 | - <label class="block text-xs font-medium text-gray-500 uppercase tracking-wider"><?php _e('Email', 'easy-invoice'); ?></label> | |
| 59 | + <label class="block text-xs font-medium text-gray-500 uppercase tracking-wider"><?php esc_html_e('Email', 'easy-invoice'); ?></label> | |
| 60 | 60 | <p class="text-sm text-gray-800 mt-1 break-all"><?php echo esc_html($client->getEmail()); ?></p> |
| 61 | 61 | </div> |
| 62 | 62 | </div> |
| 63 | 63 | |
| @@ -63,9 +63,9 @@ | ||
| 63 | 63 | |
| 64 | 64 | <div class="flex items-start group"> |
| 65 | 65 | <div class="flex-shrink-0 w-8 text-center pt-1"><i class="fas fa-phone-alt text-gray-400 group-hover:text-indigo-500 transition-colors"></i></div> |
| 66 | 66 | <div class="ml-3"> |
| 67 | - <label class="block text-xs font-medium text-gray-500 uppercase tracking-wider"><?php _e('Phone', 'easy-invoice'); ?></label> | |
| 67 | + <label class="block text-xs font-medium text-gray-500 uppercase tracking-wider"><?php esc_html_e('Phone', 'easy-invoice'); ?></label> | |
| 68 | 68 | <p class="text-sm text-gray-800 mt-1"><?php echo esc_html($client->getPhone() ?: 'N/A'); ?></p> |
| 69 | 69 | </div> |
| 70 | 70 | </div> |
| 71 | 71 | |
| @@ -71,9 +71,9 @@ | ||
| 71 | 71 | |
| 72 | 72 | <div class="flex items-start group"> |
| 73 | 73 | <div class="flex-shrink-0 w-8 text-center pt-1"><i class="fas fa-at text-gray-400 group-hover:text-indigo-500 transition-colors"></i></div> |
| 74 | 74 | <div class="ml-3"> |
| 75 | - <label class="block text-xs font-medium text-gray-500 uppercase tracking-wider"><?php _e('Username', 'easy-invoice'); ?></label> | |
| 75 | + <label class="block text-xs font-medium text-gray-500 uppercase tracking-wider"><?php esc_html_e('Username', 'easy-invoice'); ?></label> | |
| 76 | 76 | <p class="text-sm text-gray-800 mt-1"><?php echo esc_html($client->getUsername()); ?></p> |
| 77 | 77 | </div> |
| 78 | 78 | </div> |
| 79 | 79 | |
| @@ -79,9 +79,9 @@ | ||
| 79 | 79 | |
| 80 | 80 | <div class="flex items-start group"> |
| 81 | 81 | <div class="flex-shrink-0 w-8 text-center pt-1"><i class="fas fa-id-card text-gray-400 group-hover:text-indigo-500 transition-colors"></i></div> |
| 82 | 82 | <div class="ml-3"> |
| 83 | - <label class="block text-xs font-medium text-gray-500 uppercase tracking-wider"><?php _e('Client ID', 'easy-invoice'); ?></label> | |
| 83 | + <label class="block text-xs font-medium text-gray-500 uppercase tracking-wider"><?php esc_html_e('Client ID', 'easy-invoice'); ?></label> | |
| 84 | 84 | <p class="text-sm text-gray-800 mt-1"><?php echo esc_html($client->getId()); ?></p> |
| 85 | 85 | </div> |
| 86 | 86 | </div> |
| 87 | 87 | |
| @@ -87,9 +87,9 @@ | ||
| 87 | 87 | |
| 88 | 88 | <div class="flex items-start group"> |
| 89 | 89 | <div class="flex-shrink-0 w-8 text-center pt-1"><i class="fas fa-user-shield text-gray-400 group-hover:text-indigo-500 transition-colors"></i></div> |
| 90 | 90 | <div class="ml-3"> |
| 91 | - <label class="block text-xs font-medium text-gray-500 uppercase tracking-wider"><?php _e('Role', 'easy-invoice'); ?></label> | |
| 91 | + <label class="block text-xs font-medium text-gray-500 uppercase tracking-wider"><?php esc_html_e('Role', 'easy-invoice'); ?></label> | |
| 92 | 92 | <div class="mt-1"> |
| 93 | 93 | <?php |
| 94 | 94 | $role_class = 'bg-blue-100 text-blue-800'; |
| 95 | 95 | $role_icon = 'fas fa-user'; |
| @@ -121,10 +121,10 @@ | ||
| 121 | 121 | $role_icon = 'fas fa-user'; |
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 | ?> |
| 125 | - <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium <?php echo $role_class; ?>"> | |
| 126 | - <i class="<?php echo $role_icon; ?> mr-1"></i> | |
| 125 | + <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium <?php echo esc_attr($role_class); ?>"> | |
| 126 | + <i class="<?php echo esc_attr($role_icon); ?> mr-1"></i> | |
| 127 | 127 | <?php echo esc_html(ucfirst($client_role ?? 'client')); ?> |
| 128 | 128 | </span> |
| 129 | 129 | </div> |
| 130 | 130 | </div> |
| @@ -132,9 +132,9 @@ | ||
| 132 | 132 | |
| 133 | 133 | <div class="flex items-start group"> |
| 134 | 134 | <div class="flex-shrink-0 w-8 text-center pt-1"><i class="fas fa-globe-americas text-gray-400 group-hover:text-indigo-500 transition-colors"></i></div> |
| 135 | 135 | <div class="ml-3"> |
| 136 | - <label class="block text-xs font-medium text-gray-500 uppercase tracking-wider"><?php _e('Website', 'easy-invoice'); ?></label> | |
| 136 | + <label class="block text-xs font-medium text-gray-500 uppercase tracking-wider"><?php esc_html_e('Website', 'easy-invoice'); ?></label> | |
| 137 | 137 | <p class="text-sm text-gray-800 mt-1"> |
| 138 | 138 | <?php if ($client->getWebsite()): ?> |
| 139 | 139 | <a href="<?php echo esc_url($client->getWebsite()); ?>" target="_blank" class="text-indigo-600 hover:text-indigo-800 hover:underline"> |
| 140 | 140 | <?php echo esc_html($client->getWebsite()); ?> |
| @@ -148,9 +148,9 @@ | ||
| 148 | 148 | |
| 149 | 149 | <div class="flex items-start group md:col-span-2 lg:col-span-3"> |
| 150 | 150 | <div class="flex-shrink-0 w-8 text-center pt-1"><i class="fas fa-map-marker-alt text-gray-400 group-hover:text-indigo-500 transition-colors"></i></div> |
| 151 | 151 | <div class="ml-3"> |
| 152 | - <label class="block text-xs font-medium text-gray-500 uppercase tracking-wider"><?php _e('Address', 'easy-invoice'); ?></label> | |
| 152 | + <label class="block text-xs font-medium text-gray-500 uppercase tracking-wider"><?php esc_html_e('Address', 'easy-invoice'); ?></label> | |
| 153 | 153 | <p class="text-sm text-gray-800 mt-1 whitespace-pre-wrap"><?php echo esc_html($client->getAddress() ?: 'N/A'); ?></p> |
| 154 | 154 | </div> |
| 155 | 155 | </div> |
| 156 | 156 | </div> |
| @@ -158,9 +158,9 @@ | ||
| 158 | 158 | <?php if ($client->getExtraInfo()): ?> |
| 159 | 159 | <div class="mt-6 pt-6 border-t border-gray-200"> |
| 160 | 160 | <h3 class="text-sm font-semibold text-gray-800 mb-2 flex items-center"> |
| 161 | 161 | <i class="fas fa-info-circle text-gray-400 mr-2"></i> |
| 162 | - <span><?php _e('Extra Info', 'easy-invoice'); ?></span> | |
| 162 | + <span><?php esc_html_e('Extra Info', 'easy-invoice'); ?></span> | |
| 163 | 163 | </h3> |
| 164 | 164 | <div class="bg-gray-50 p-4 rounded-md text-sm text-gray-700 prose max-w-none"> |
| 165 | 165 | <?php echo nl2br(esc_html($client->getExtraInfo())); ?> |
| 166 | 166 | </div> |
| @@ -167,13 +167,26 @@ | ||
| 167 | 167 | </div> |
| 168 | 168 | <?php endif; ?> |
| 169 | 169 | </div> |
| 170 | 170 | |
| 171 | + <?php | |
| 172 | + /** | |
| 173 | + * Fires after the client's details, before their invoices. | |
| 174 | + * | |
| 175 | + * Where an addon adds something that belongs to the client rather than to | |
| 176 | + * any one document -- Pro shows the card on file here, with the control | |
| 177 | + * to remove it. | |
| 178 | + * | |
| 179 | + * @param int $client_id Client (WordPress user) id. | |
| 180 | + */ | |
| 181 | + do_action('easy_invoice_client_view_after_details', (int) $client->getId()); | |
| 182 | + ?> | |
| 183 | + | |
| 171 | 184 | <div class="bg-white shadow-sm rounded-xl border border-gray-200"> |
| 172 | 185 | <div class="p-6 border-b border-gray-200"> |
| 173 | 186 | <h2 class="text-lg font-semibold text-gray-800 flex items-center"> |
| 174 | 187 | <i class="fas fa-file-invoice-dollar text-indigo-500 mr-3"></i> |
| 175 | - <span>Invoices</span> | |
| 188 | + <span><?php esc_html_e('Invoices', 'easy-invoice'); ?></span> | |
| 176 | 189 | </h2> |
| 177 | 190 | </div> |
| 178 | 191 | |
| 179 | 192 | <?php if (empty($invoices)): ?> |
| @@ -178,9 +191,9 @@ | ||
| 178 | 191 | |
| 179 | 192 | <?php if (empty($invoices)): ?> |
| 180 | 193 | <div class="text-center py-12"> |
| 181 | 194 | <div class="text-gray-400 mb-4"><i class="fas fa-file-invoice fa-4x"></i></div> |
| 182 | - <p class="text-gray-500 font-medium mb-4">No invoices found for this client.</p> | |
| 195 | + <p class="text-gray-500 font-medium mb-4"><?php esc_html_e('No invoices found for this client.', 'easy-invoice'); ?></p> | |
| 183 | 196 | </div> |
| 184 | 197 | <?php else: ?> |
| 185 | 198 | <div class="overflow-x-auto"> |
| 186 | 199 | <table class="min-w-full divide-y divide-gray-200"> |
| @@ -185,45 +198,29 @@ | ||
| 185 | 198 | <div class="overflow-x-auto"> |
| 186 | 199 | <table class="min-w-full divide-y divide-gray-200"> |
| 187 | 200 | <thead class="bg-gray-50"> |
| 188 | 201 | <tr> |
| 189 | - <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Invoice</th> | |
| 190 | - <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date</th> | |
| 191 | - <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Due Date</th> | |
| 192 | - <th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">Amount</th> | |
| 193 | - <th scope="col" class="px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th> | |
| 202 | + <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"><?php esc_html_e('Invoice', 'easy-invoice'); ?></th> | |
| 203 | + <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"><?php esc_html_e('Date', 'easy-invoice'); ?></th> | |
| 204 | + <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"><?php esc_html_e('Due Date', 'easy-invoice'); ?></th> | |
| 205 | + <th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider"><?php esc_html_e('Amount', 'easy-invoice'); ?></th> | |
| 206 | + <th scope="col" class="px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"><?php esc_html_e('Status', 'easy-invoice'); ?></th> | |
| 194 | 207 | <th scope="col" class="relative px-6 py-3"> |
| 195 | - <span class="sr-only">Actions</span> | |
| 208 | + <span class="sr-only"><?php esc_html_e('Actions', 'easy-invoice'); ?></span> | |
| 196 | 209 | </th> |
| 197 | 210 | </tr> |
| 198 | 211 | </thead> |
| 199 | 212 | <tbody class="bg-white divide-y divide-gray-200"> |
| 200 | 213 | <?php foreach ($invoices as $invoice): |
| 201 | - $status_class = ''; | |
| 202 | - $status_icon = ''; | |
| 203 | - switch ($invoice['status']) { | |
| 204 | - case 'paid': | |
| 205 | - $status_class = 'bg-green-100 text-green-800'; | |
| 206 | - $status_icon = 'fas fa-check-circle'; | |
| 207 | - break; | |
| 208 | - case 'pending': | |
| 209 | - $status_class = 'bg-yellow-100 text-yellow-800'; | |
| 210 | - $status_icon = 'fas fa-hourglass-half'; | |
| 211 | - break; | |
| 212 | - case 'overdue': | |
| 213 | - $status_class = 'bg-red-100 text-red-800'; | |
| 214 | - $status_icon = 'fas fa-exclamation-triangle'; | |
| 215 | - break; | |
| 216 | - default: | |
| 217 | - $status_class = 'bg-gray-100 text-gray-800'; | |
| 218 | - $status_icon = 'fas fa-question-circle'; | |
| 219 | - } | |
| 214 | + $status_key = \EasyInvoice\Helpers\InvoiceStatus::displayKey( (string) $invoice['status'], $invoice['due_date'] ?? null ); | |
| 215 | + $status_class = \EasyInvoice\Helpers\InvoiceStatus::badgeClass( $status_key ); | |
| 216 | + $status_icon = [ 'paid' => 'fas fa-check-circle', 'partial' => 'fas fa-adjust', 'overdue' => 'fas fa-exclamation-triangle', 'draft' => 'fas fa-pencil-alt', 'cancelled' => 'fas fa-ban' ][ $status_key ] ?? 'fas fa-file-invoice'; | |
| 220 | 217 | ?> |
| 221 | 218 | <tr> |
| 222 | 219 | <td class="px-6 py-4 whitespace-nowrap"> |
| 223 | 220 | <div class="flex flex-col"> |
| 224 | 221 | <div class="text-sm font-semibold text-indigo-600 hover:text-indigo-800"> |
| 225 | - <a href="<?php echo get_permalink($invoice['id']); ?>"><?php echo esc_html($invoice['title']); ?></a> | |
| 222 | + <a href="<?php echo esc_url(get_permalink($invoice['id'])); ?>"><?php echo esc_html($invoice['title']); ?></a> | |
| 226 | 223 | </div> |
| 227 | 224 | <div class="text-xs text-gray-500 font-mono"> |
| 228 | 225 | <?php echo esc_html($invoice['invoice_number']); ?> |
| 229 | 226 | </div> |
| @@ -229,12 +226,12 @@ | ||
| 229 | 226 | </div> |
| 230 | 227 | </div> |
| 231 | 228 | </td> |
| 232 | 229 | <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> |
| 233 | - <?php echo esc_html(date("M d, Y", strtotime($invoice['date']))); ?> | |
| 230 | + <?php echo esc_html(gmdate("M d, Y", strtotime($invoice['date']))); ?> | |
| 234 | 231 | </td> |
| 235 | 232 | <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> |
| 236 | - <?php echo esc_html(date("M d, Y", strtotime($invoice['due_date']))); ?> | |
| 233 | + <?php echo esc_html(gmdate("M d, Y", strtotime($invoice['due_date']))); ?> | |
| 237 | 234 | </td> |
| 238 | 235 | <td class="px-6 py-4 whitespace-nowrap text-right text-sm text-gray-800 font-medium"> |
| 239 | 236 | <?php |
| 240 | 237 | // Use InvoiceFormatter for proper currency formatting |
| @@ -242,15 +239,15 @@ | ||
| 242 | 239 | echo esc_html($formatter->format($invoice['amount'] ?? 0)); |
| 243 | 240 | ?> |
| 244 | 241 | </td> |
| 245 | 242 | <td class="px-6 py-4 whitespace-nowrap text-center"> |
| 246 | - <span class="px-3 py-1 inline-flex text-xs leading-5 font-semibold rounded-full <?php echo $status_class; ?>"> | |
| 247 | - <i class="<?php echo $status_icon; ?> mr-1.5"></i> | |
| 248 | - <?php echo ucfirst(esc_html($invoice['status'])); ?> | |
| 243 | + <span class="px-3 py-1 inline-flex text-xs leading-5 font-semibold rounded-full <?php echo esc_attr($status_class); ?>"> | |
| 244 | + <i class="<?php echo esc_attr($status_icon); ?> mr-1.5"></i> | |
| 245 | + <?php echo esc_html( \EasyInvoice\Helpers\InvoiceStatus::label( $status_key ) ); ?> | |
| 249 | 246 | </span> |
| 250 | 247 | </td> |
| 251 | 248 | <td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium space-x-3"> |
| 252 | - <a href="<?php echo get_permalink($invoice['id']); ?>" class="text-indigo-600 hover:text-indigo-900" data-tooltip="View Invoice"> | |
| 249 | + <a href="<?php echo esc_url(get_permalink($invoice['id'])); ?>" class="text-indigo-600 hover:text-indigo-900" data-tooltip="View Invoice"> | |
| 253 | 250 | <i class="fas fa-eye"></i> |
| 254 | 251 | </a> |
| 255 | 252 | <a href="?page=easy-invoice-builder&invoice_id=<?php echo esc_attr($invoice['id']); ?>" class="text-gray-500 hover:text-indigo-900" data-tooltip="Edit Invoice"> |
| 256 | 253 | <i class="fas fa-pen"></i> |
| @@ -267,9 +264,9 @@ | ||
| 267 | 264 | <div class="bg-white shadow-sm rounded-xl border border-gray-200 mt-6"> |
| 268 | 265 | <div class="p-6 border-b border-gray-200"> |
| 269 | 266 | <h2 class="text-lg font-semibold text-gray-800 flex items-center"> |
| 270 | 267 | <i class="fas fa-file-contract text-green-500 mr-3"></i> |
| 271 | - <span>Quotes</span> | |
| 268 | + <span><?php esc_html_e('Quotes', 'easy-invoice'); ?></span> | |
| 272 | 269 | </h2> |
| 273 | 270 | </div> |
| 274 | 271 | |
| 275 | 272 | <?php if (empty($quotes)): ?> |
| @@ -274,9 +271,9 @@ | ||
| 274 | 271 | |
| 275 | 272 | <?php if (empty($quotes)): ?> |
| 276 | 273 | <div class="text-center py-12"> |
| 277 | 274 | <div class="text-gray-400 mb-4"><i class="fas fa-file-contract fa-4x"></i></div> |
| 278 | - <p class="text-gray-500 font-medium mb-4">No quotes found for this client.</p> | |
| 275 | + <p class="text-gray-500 font-medium mb-4"><?php esc_html_e('No quotes found for this client.', 'easy-invoice'); ?></p> | |
| 279 | 276 | </div> |
| 280 | 277 | <?php else: ?> |
| 281 | 278 | <div class="overflow-x-auto"> |
| 282 | 279 | <table class="min-w-full divide-y divide-gray-200"> |
| @@ -281,15 +278,15 @@ | ||
| 281 | 278 | <div class="overflow-x-auto"> |
| 282 | 279 | <table class="min-w-full divide-y divide-gray-200"> |
| 283 | 280 | <thead class="bg-gray-50"> |
| 284 | 281 | <tr> |
| 285 | - <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Quote</th> | |
| 286 | - <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date</th> | |
| 287 | - <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Expiry Date</th> | |
| 288 | - <th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">Amount</th> | |
| 289 | - <th scope="col" class="px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th> | |
| 282 | + <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"><?php esc_html_e('Quote', 'easy-invoice'); ?></th> | |
| 283 | + <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"><?php esc_html_e('Date', 'easy-invoice'); ?></th> | |
| 284 | + <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"><?php esc_html_e('Expiry Date', 'easy-invoice'); ?></th> | |
| 285 | + <th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider"><?php esc_html_e('Amount', 'easy-invoice'); ?></th> | |
| 286 | + <th scope="col" class="px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"><?php esc_html_e('Status', 'easy-invoice'); ?></th> | |
| 290 | 287 | <th scope="col" class="relative px-6 py-3"> |
| 291 | - <span class="sr-only">Actions</span> | |
| 288 | + <span class="sr-only"><?php esc_html_e('Actions', 'easy-invoice'); ?></span> | |
| 292 | 289 | </th> |
| 293 | 290 | </tr> |
| 294 | 291 | </thead> |
| 295 | 292 | <tbody class="bg-white divide-y divide-gray-200"> |
| @@ -321,9 +318,9 @@ | ||
| 321 | 318 | <tr> |
| 322 | 319 | <td class="px-6 py-4 whitespace-nowrap"> |
| 323 | 320 | <div class="flex flex-col"> |
| 324 | 321 | <div class="text-sm font-semibold text-green-600 hover:text-green-800"> |
| 325 | - <a href="<?php echo get_permalink($quote['id']); ?>"><?php echo esc_html($quote['title']); ?></a> | |
| 322 | + <a href="<?php echo esc_url(get_permalink($quote['id'])); ?>"><?php echo esc_html($quote['title']); ?></a> | |
| 326 | 323 | </div> |
| 327 | 324 | <div class="text-xs text-gray-500 font-mono"> |
| 328 | 325 | <?php echo esc_html($quote['quote_number']); ?> |
| 329 | 326 | </div> |
| @@ -329,12 +326,12 @@ | ||
| 329 | 326 | </div> |
| 330 | 327 | </div> |
| 331 | 328 | </td> |
| 332 | 329 | <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> |
| 333 | - <?php echo esc_html(date("M d, Y", strtotime($quote['date']))); ?> | |
| 330 | + <?php echo esc_html(gmdate("M d, Y", strtotime($quote['date']))); ?> | |
| 334 | 331 | </td> |
| 335 | 332 | <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> |
| 336 | - <?php echo esc_html(date("M d, Y", strtotime($quote['expiry_date']))); ?> | |
| 333 | + <?php echo esc_html(gmdate("M d, Y", strtotime($quote['expiry_date']))); ?> | |
| 337 | 334 | </td> |
| 338 | 335 | <td class="px-6 py-4 whitespace-nowrap text-right text-sm text-gray-800 font-medium"> |
| 339 | 336 | <?php |
| 340 | 337 | // Use QuoteFormatter for proper currency formatting |
| @@ -342,15 +339,15 @@ | ||
| 342 | 339 | echo esc_html($formatter->format($quote['amount'] ?? 0)); |
| 343 | 340 | ?> |
| 344 | 341 | </td> |
| 345 | 342 | <td class="px-6 py-4 whitespace-nowrap text-center"> |
| 346 | - <span class="px-3 py-1 inline-flex text-xs leading-5 font-semibold rounded-full <?php echo $status_class; ?>"> | |
| 347 | - <i class="<?php echo $status_icon; ?> mr-1.5"></i> | |
| 348 | - <?php echo ucfirst(esc_html($quote['status'])); ?> | |
| 343 | + <span class="px-3 py-1 inline-flex text-xs leading-5 font-semibold rounded-full <?php echo esc_attr($status_class); ?>"> | |
| 344 | + <i class="<?php echo esc_attr($status_icon); ?> mr-1.5"></i> | |
| 345 | + <?php echo esc_html(ucfirst($quote['status'])); ?> | |
| 349 | 346 | </span> |
| 350 | 347 | </td> |
| 351 | 348 | <td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium space-x-3"> |
| 352 | - <a href="<?php echo get_permalink($quote['id']); ?>" class="text-green-600 hover:text-green-900" data-tooltip="View Quote"> | |
| 349 | + <a href="<?php echo esc_url(get_permalink($quote['id'])); ?>" class="text-green-600 hover:text-green-900" data-tooltip="View Quote"> | |
| 353 | 350 | <i class="fas fa-eye"></i> |
| 354 | 351 | </a> |
| 355 | 352 | <a href="?page=easy-invoice-quote-builder"e_id=<?php echo esc_attr($quote['id']); ?>" class="text-gray-500 hover:text-green-900" data-tooltip="Edit Quote"> |
| 356 | 353 | <i class="fas fa-pen"></i> |