chart.php
6 days ago
count.php
6 days ago
index.html
6 days ago
items.php
6 days ago
table.php
6 days ago
items.php
172 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @package VikAppointments |
| 4 | * @subpackage core |
| 5 | * @author E4J s.r.l. |
| 6 | * @copyright Copyright (C) 2021 E4J s.r.l. All Rights Reserved. |
| 7 | * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL |
| 8 | * @link https://vikwp.com |
| 9 | */ |
| 10 | |
| 11 | // No direct access |
| 12 | defined('ABSPATH') or die('No script kiddies please!'); |
| 13 | |
| 14 | /** |
| 15 | * Layout variables |
| 16 | * ----------------- |
| 17 | * @var VAPStatisticsWidget $widget The instance of the widget to be displayed. |
| 18 | * @var mixed $data The table rows data. |
| 19 | * @var mixed $footer The table footer. |
| 20 | */ |
| 21 | extract($displayData); |
| 22 | |
| 23 | if (empty($data)) |
| 24 | { |
| 25 | // do nothing in case of empty data |
| 26 | return; |
| 27 | } |
| 28 | |
| 29 | $currency = VAPFactory::getCurrency(); |
| 30 | |
| 31 | // get ordering |
| 32 | $ordering = $widget->getOrdering(); |
| 33 | |
| 34 | ?> |
| 35 | |
| 36 | <div class="widget-revenue-table"> |
| 37 | <table data-widget-id="<?php echo $widget->getID(); ?>"> |
| 38 | |
| 39 | <thead> |
| 40 | <tr> |
| 41 | |
| 42 | <!-- OPTION --> |
| 43 | |
| 44 | <th style="text-align: left;" class="<?php echo $ordering['column'] == 'option' ? 'sorted' : ''; ?>"> |
| 45 | <?php echo JHtml::fetch('vaphtml.admin.customsort', 'VAPOPTIONFIELDSETTITLE1', 'option', $ordering['direction'], $ordering['column'], 'asc'); ?> |
| 46 | </th> |
| 47 | |
| 48 | <!-- COUNT --> |
| 49 | |
| 50 | <th style="text-align: right;" class="<?php echo $ordering['column'] == 'count' ? 'sorted' : ''; ?>"> |
| 51 | <?php echo JHtml::fetch('vaphtml.admin.customsort', 'VAPQUANTITY', 'count', $ordering['direction'], $ordering['column'], 'desc'); ?> |
| 52 | </th> |
| 53 | |
| 54 | <!-- TOTAL GROSS --> |
| 55 | |
| 56 | <th style="text-align: right;" class="<?php echo $ordering['column'] == 'total' ? 'sorted' : ''; ?>"> |
| 57 | <?php echo JHtml::fetch('vaphtml.admin.customsort', 'VAPTOTALGROSS', 'total', $ordering['direction'], $ordering['column'], 'desc'); ?> |
| 58 | </th> |
| 59 | |
| 60 | <!-- TOTAL TAX --> |
| 61 | |
| 62 | <th style="text-align: right;" class="<?php echo $ordering['column'] == 'tax' ? 'sorted' : ''; ?>"> |
| 63 | <?php echo JHtml::fetch('vaphtml.admin.customsort', 'VAPTOTALTAX', 'tax', $ordering['direction'], $ordering['column'], 'desc'); ?> |
| 64 | </th> |
| 65 | |
| 66 | <!-- TOTAL NET --> |
| 67 | |
| 68 | <th style="text-align: right;" class="<?php echo $ordering['column'] == 'net' ? 'sorted' : ''; ?>"> |
| 69 | <?php echo JHtml::fetch('vaphtml.admin.customsort', 'VAPTOTALNET', 'net', $ordering['direction'], $ordering['column'], 'desc'); ?> |
| 70 | </th> |
| 71 | |
| 72 | <!-- TOTAL DISCOUNT --> |
| 73 | |
| 74 | <th style="text-align: right;" class="<?php echo $ordering['column'] == 'discount' ? 'sorted' : ''; ?>"> |
| 75 | <?php echo JHtml::fetch('vaphtml.admin.customsort', 'VAPMANAGEPACKAGE13', 'discount', $ordering['direction'], $ordering['column'], 'desc'); ?> |
| 76 | </th> |
| 77 | |
| 78 | </tr> |
| 79 | </thead> |
| 80 | |
| 81 | <tbody> |
| 82 | <?php |
| 83 | foreach ($data as $totals) |
| 84 | { |
| 85 | ?> |
| 86 | <tr> |
| 87 | |
| 88 | <!-- OPTION --> |
| 89 | |
| 90 | <td style="text-align: left;" class="<?php echo $ordering['column'] == 'option' ? 'sorted' : ''; ?>"> |
| 91 | <?php echo $totals['name']; ?> |
| 92 | </td> |
| 93 | |
| 94 | <!-- COUNT --> |
| 95 | |
| 96 | <td style="text-align: right;" class="<?php echo $ordering['column'] == 'count' ? 'sorted' : ''; ?>"> |
| 97 | <?php echo isset($totals['count']) ? $totals['count'] : 0; ?> |
| 98 | </td> |
| 99 | |
| 100 | <!-- TOTAL GROSS --> |
| 101 | |
| 102 | <td style="text-align: right;" class="<?php echo $ordering['column'] == 'total' ? 'sorted' : ''; ?>"> |
| 103 | <?php echo $currency->format(isset($totals['total']) ? $totals['total'] : 0); ?> |
| 104 | </td> |
| 105 | |
| 106 | <!-- TOTAL TAX --> |
| 107 | |
| 108 | <td style="text-align: right;" class="<?php echo $ordering['column'] == 'tax' ? 'sorted' : ''; ?>"> |
| 109 | <?php echo $currency->format(isset($totals['tax']) ? $totals['tax'] : 0); ?> |
| 110 | </td> |
| 111 | |
| 112 | <!-- TOTAL NET --> |
| 113 | |
| 114 | <td style="text-align: right;" class="<?php echo $ordering['column'] == 'net' ? 'sorted' : ''; ?>"> |
| 115 | <?php echo $currency->format(isset($totals['net']) ? $totals['net'] : 0); ?> |
| 116 | </td> |
| 117 | |
| 118 | <!-- TOTAL DISCOUNT --> |
| 119 | |
| 120 | <td style="text-align: right;" class="<?php echo $ordering['column'] == 'discount' ? 'sorted' : ''; ?>"> |
| 121 | <?php echo $currency->format(isset($totals['discount']) ? $totals['discount'] : 0); ?> |
| 122 | </td> |
| 123 | |
| 124 | </tr> |
| 125 | <?php |
| 126 | } |
| 127 | ?> |
| 128 | </tbody> |
| 129 | |
| 130 | <tfoot> |
| 131 | <tr> |
| 132 | |
| 133 | <!-- OPTION --> |
| 134 | |
| 135 | <td style="text-align: left;" class="<?php echo $ordering['column'] == 'option' ? 'sorted' : ''; ?>"> </td> |
| 136 | |
| 137 | <!-- COUNT --> |
| 138 | |
| 139 | <td style="text-align: right;" class="<?php echo $ordering['column'] == 'count' ? 'sorted' : ''; ?>"> |
| 140 | <?php echo $footer['count'] ?? 0; ?> |
| 141 | </td> |
| 142 | |
| 143 | <!-- TOTAL GROSS --> |
| 144 | |
| 145 | <td style="text-align: right;" class="<?php echo $ordering['column'] == 'total' ? 'sorted' : ''; ?>"> |
| 146 | <?php echo $currency->format($footer['total'] ?? 0); ?> |
| 147 | </td> |
| 148 | |
| 149 | <!-- TOTAL TAX --> |
| 150 | |
| 151 | <td style="text-align: right;" class="<?php echo $ordering['column'] == 'tax' ? 'sorted' : ''; ?>"> |
| 152 | <?php echo $currency->format($footer['tax'] ?? 0); ?> |
| 153 | </td> |
| 154 | |
| 155 | <!-- TOTAL NET --> |
| 156 | |
| 157 | <td style="text-align: right;" class="<?php echo $ordering['column'] == 'net' ? 'sorted' : ''; ?>"> |
| 158 | <?php echo $currency->format($footer['net'] ?? 0); ?> |
| 159 | </td> |
| 160 | |
| 161 | <!-- TOTAL DISCOUNT --> |
| 162 | |
| 163 | <td style="text-align: right;" class="<?php echo $ordering['column'] == 'discount' ? 'sorted' : ''; ?>"> |
| 164 | <?php echo $currency->format($footer['discount'] ?? 0); ?> |
| 165 | </td> |
| 166 | |
| 167 | </tr> |
| 168 | </tfoot> |
| 169 | |
| 170 | </table> |
| 171 | </div> |
| 172 |