'.($discounts_h2 ?? 'discounts').' ('.$query_total.')

'.($discounts_p ?? '').'

'; if (isset($success_msg)){ $view .= '

'.$success_msg.'

'; } $view .= '
'.($button_create_discount ?? 'Create discount').'
'; if (empty($discounts)){ $view .= ''; } else { foreach ($discounts as $discount){ $current_date = strtotime((new DateTime())->format('Y-m-d H:i:s')); $view .= ' '; } } $view .= '
'.($discounts_id ?? '#').' '.($discounts_code ?? 'Code').' '.($discounts_active ?? 'Active').' '.($discounts_category ?? 'Categories').' '.($discounts_product ?? 'Products').' '.($discounts_type ?? 'Type').' '.($discounts_value ?? 'Value').' '.($discounts_start_date ?? 'Start Date').' '.($discounts_end_date ?? 'End Date').' '.$general_actions.'
'.($message_no_discounts ?? 'There are no discounts').'
'.$discount['id'].' '.$discount['discount_code'].' '.(($current_date >= strtotime($discount['start_date']) && $current_date <= strtotime($discount['end_date'])) ? $general_yes : $general_no).' '.($discount['category_names'] ? str_replace(',', ', ', $discount['category_names']) : $general_all ?? 'all').' '.($discount['product_names'] ? str_replace(',', ', ', $discount['product_names']) : $general_all ?? 'all').' '.$discount['discount_type'].' '.$discount['discount_value'].' '.date('Y-m-d h:ia', strtotime($discount['start_date'])).' '.date('Y-m-d h:ia', strtotime($discount['end_date'])).' '.$general_view.'
'; $view.=''; //OUTPUT echo $view; template_footer(); ?>