| 1 |
<?php |
| 2 |
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- View file, its variables are local to the include scope, not true globals. |
| 3 |
defined('ABSPATH') || die('Restricted Access'); |
| 4 |
?> |
| 5 |
<div class="acym__content acym__stats grid-x cell"> |
| 6 |
<input type="hidden" name="time_linechart" id="acym__time__linechart__input"> |
| 7 |
<div class="cell acym__stats__campaign-choose margin-bottom-1 large-3 medium-4 small-12"> |
| 8 |
<?php if ($data['page_title']) { ?> |
| 9 |
<h2 class="acym__title"><?php echo esc_html(acym_translation('ACYM_GLOBAL_STATISTICS')); ?></h2> |
| 10 |
<?php } ?> |
| 11 |
</div> |
| 12 |
<div class="large-9 medium-8 small-12 margin-bottom-1 cell acym__stats__export grid-x align-right grid-margin-x"> |
| 13 |
<?php if (!$data['page_title']) { ?> |
| 14 |
<div class="cell small-5 medium-4 large-3 xlarge-2"> |
| 15 |
<?php |
| 16 |
acym_select( |
| 17 |
[ |
| 18 |
'charts' => acym_translation('ACYM_CHARTS'), |
| 19 |
'formatted' => acym_translation('ACYM_FORMATTED_DATA'), |
| 20 |
'full' => acym_translation('ACYM_FULL_DATA'), |
| 21 |
], |
| 22 |
'export_type', |
| 23 |
'charts', |
| 24 |
['class' => 'acym__select'], |
| 25 |
'value', |
| 26 |
'text', |
| 27 |
null, |
| 28 |
false, |
| 29 |
true |
| 30 |
); |
| 31 |
?> |
| 32 |
</div> |
| 33 |
<?php |
| 34 |
acym_tooltip([ |
| 35 |
'hoveredText' => '<button type="button" class="cell shrink button primary acym__stats__export__button acym__stats__export__global__charts " data-task="exportGlobal">' |
| 36 |
.acym_translation('ACYM_EXPORT').'</button>', |
| 37 |
'textShownInTooltip' => acym_translation('ACYM_STATS_EXPORT_SETTINGS_TOOLTIP'), |
| 38 |
]); |
| 39 |
} ?> |
| 40 |
</div> |
| 41 |
<?php if (!empty($data['selectedMailid']) && !empty($data['lists'])) { ?> |
| 42 |
<div class="cell grid-x margin-bottom-1"> |
| 43 |
<h2 class="cell shrink acym__title acym__title__secondary"><?php echo esc_html(acym_translation('ACYM_RECEIVER_LISTS')); ?></h2> |
| 44 |
<div class="cell grid-x auto margin-left-1"> |
| 45 |
<?php |
| 46 |
foreach ($data['lists'] as $list) { |
| 47 |
acym_tooltip( |
| 48 |
[ |
| 49 |
'hoveredText' => '<i style="color: '.$list->color.'" class="acym_subscription acymicon-circle"></i>', |
| 50 |
'textShownInTooltip' => $list->name, |
| 51 |
] |
| 52 |
); |
| 53 |
} |
| 54 |
?> |
| 55 |
</div> |
| 56 |
<h2 class="cell acym__title acym__title__secondary"> |
| 57 |
<?php echo esc_html(acym_translationSprintf('ACYM_NUMBER_OF_RECEIVERS_X', $data['mail']->sent)); ?> |
| 58 |
</h2> |
| 59 |
</div> |
| 60 |
<?php } ?> |
| 61 |
<?php if (empty($data['sentMails'])) { ?> |
| 62 |
<h2 class="acym__listing__empty__title text-center cell margin-bottom-1"> |
| 63 |
<?php echo esc_html(acym_translation('ACYM_DONT_HAVE_STATS_CAMPAIGN')); ?> |
| 64 |
<a href="<?php echo esc_url(acym_completeLink('campaigns&task=edit&step=chooseTemplate')); ?>"><?php echo esc_html( |
| 65 |
acym_translation('ACYM_CREATE_ONE') |
| 66 |
); ?></a> |
| 67 |
</h2> |
| 68 |
<?php } ?> |
| 69 |
<div class="cell grid-x grid-margin-y" id="acym__stats__export__global__charts__scope"> |
| 70 |
<div class="cell grid-x acym__content acym__stats__donut__chart align-center"> |
| 71 |
<h2 class="cell acym__title acym__title__secondary"><?php echo esc_html(acym_translation('ACYM_EMAIL_STATISTICS')); ?></h2> |
| 72 |
<?php if (empty($data['sentMails'])) { ?> |
| 73 |
<h4 class="cell acym__subtitle__stats text-center"><b><?php echo esc_html(acym_translation('ACYM_LOOK_AT_THESE_AMAZING_DONUTS')); ?></b></h4> |
| 74 |
<?php } ?> |
| 75 |
<div class="acym__stats__donut__one-chart cell large-2 medium-4 small-12"> |
| 76 |
<?php |
| 77 |
ob_start(); |
| 78 |
acym_tooltip( |
| 79 |
[ |
| 80 |
'hoveredText' => acym_translation('ACYM_SUCCESSFULLY_SENT'), |
| 81 |
'textShownInTooltip' => $data['mail']->allSent, |
| 82 |
] |
| 83 |
); |
| 84 |
$tooltip = ob_get_clean(); |
| 85 |
acym_displayRoundChart( |
| 86 |
$data['mail']->percentageSent, |
| 87 |
'delivery', |
| 88 |
'', |
| 89 |
$tooltip |
| 90 |
); ?> |
| 91 |
</div> |
| 92 |
<div class="acym__stats__donut__one-chart cell large-2 medium-4 small-12"> |
| 93 |
<?php |
| 94 |
ob_start(); |
| 95 |
acym_tooltip( |
| 96 |
[ |
| 97 |
'hoveredText' => acym_translation(empty($data['anonymousStats']) ? 'ACYM_OPEN_RATE' : 'ACYM_OPENS'), |
| 98 |
'textShownInTooltip' => $data['mail']->allOpen, |
| 99 |
] |
| 100 |
); |
| 101 |
$tooltip = ob_get_clean(); |
| 102 |
acym_displayRoundChart( |
| 103 |
$data['mail']->percentageOpen, |
| 104 |
'open', |
| 105 |
'', |
| 106 |
$tooltip, |
| 107 |
empty($data['anonymousStats']) ? '' : (string)$data['mail']->openCount |
| 108 |
); ?> |
| 109 |
</div> |
| 110 |
<div class="acym__stats__donut__one-chart cell large-2 medium-4 small-12"> |
| 111 |
<?php |
| 112 |
ob_start(); |
| 113 |
acym_tooltip( |
| 114 |
[ |
| 115 |
'hoveredText' => acym_translation(empty($data['anonymousStats']) ? 'ACYM_CLICK_RATE' : 'ACYM_CLICKS'), |
| 116 |
'textShownInTooltip' => $data['mail']->allClick, |
| 117 |
] |
| 118 |
); |
| 119 |
$tooltip = ob_get_clean(); |
| 120 |
acym_displayRoundChart( |
| 121 |
$data['mail']->percentageClick, |
| 122 |
'click', |
| 123 |
'', |
| 124 |
$tooltip, |
| 125 |
empty($data['anonymousStats']) ? '' : (string)$data['mail']->clickCount |
| 126 |
); ?> |
| 127 |
</div> |
| 128 |
<div class="acym__stats__donut__one-chart cell large-2 medium-4 small-12"> |
| 129 |
<?php |
| 130 |
ob_start(); |
| 131 |
acym_tooltip( |
| 132 |
[ |
| 133 |
'hoveredText' => acym_translation('ACYM_BOUNCE_RATE'), |
| 134 |
'textShownInTooltip' => $data['mail']->allBounce, |
| 135 |
] |
| 136 |
); |
| 137 |
$tooltip = ob_get_clean(); |
| 138 |
acym_displayRoundChart( |
| 139 |
$data['mail']->percentageBounce, |
| 140 |
'bounce', |
| 141 |
'', |
| 142 |
$tooltip |
| 143 |
); ?> |
| 144 |
</div> |
| 145 |
<?php if (!empty($data['selectedMailid'])) { ?> |
| 146 |
<div class="acym__stats__donut__one-chart cell large-2 medium-4 small-12"> |
| 147 |
<?php |
| 148 |
ob_start(); |
| 149 |
acym_tooltip( |
| 150 |
[ |
| 151 |
'hoveredText' => acym_translation('ACYM_UNSUBSCRIBE_RATE'), |
| 152 |
'textShownInTooltip' => $data['mail']->allUnsub, |
| 153 |
] |
| 154 |
); |
| 155 |
$tooltip = ob_get_clean(); |
| 156 |
acym_displayRoundChart( |
| 157 |
$data['mail']->percentageUnsub, |
| 158 |
'unsubscribe', |
| 159 |
'', |
| 160 |
$tooltip |
| 161 |
); ?> |
| 162 |
</div> |
| 163 |
<?php } ?> |
| 164 |
</div> |
| 165 |
<div class="cell grid-x acym__content acym__stats__pie__chart"> |
| 166 |
<h2 class="cell acym__title acym__title__secondary"><?php echo esc_html(acym_translation('ACYM_OPENING_PLATFORMS')); ?></h2> |
| 167 |
<?php if (empty($data['devices'])) { ?> |
| 168 |
<h4 class="cell acym__subtitle__stats text-center"><b><?php echo esc_html(acym_translation('ACYM_EMAIL_NOT_OPEN_EXAMPLE_STATS')); ?></b></h4> |
| 169 |
<div class="cell large-3 hide-for-small-only hide-for-medium-only"></div> |
| 170 |
<div class="acym__stats__pie__one-chart cell large-3 medium-6"> |
| 171 |
<?php acym_pieChart($data['example_devices_chart'], '', acym_translation('ACYM_DEVICES')); ?> |
| 172 |
</div> |
| 173 |
<div class="acym__stats__pie__one-chart cell large-3 medium-6"> |
| 174 |
<?php acym_pieChart($data['example_source_chart'], '', acym_translation('ACYM_OPENED_WITH')); ?> |
| 175 |
</div> |
| 176 |
<div class="cell large-3 hide-for-small-only hide-for-medium-only"></div> |
| 177 |
<?php } else { ?> |
| 178 |
<div class="cell large-3 hide-for-small-only hide-for-medium-only"></div> |
| 179 |
<div class="acym__stats__pie__one-chart cell large-3 medium-6"> |
| 180 |
<?php acym_pieChart($data['devices'], 'devices', acym_translation('ACYM_DEVICES')); ?> |
| 181 |
</div> |
| 182 |
<div class="acym__stats__pie__one-chart cell large-3 medium-6"> |
| 183 |
<?php acym_pieChart($data['openedWith'], 'opened_with', acym_translation('ACYM_OPENED_WITH')); ?> |
| 184 |
</div> |
| 185 |
<div class="cell large-3 hide-for-small-only hide-for-medium-only"></div> |
| 186 |
<?php } ?> |
| 187 |
</div> |
| 188 |
<div class="cell acym__content grid-x"> |
| 189 |
<h2 class="cell shrink acym__title acym__title__secondary"> |
| 190 |
<?php echo esc_html(acym_translation('ACYM_OPEN_TIME_CHART')); |
| 191 |
acym_info(['textShownInTooltip' => 'ACYM_OPEN_TIME_CHART_DESC']); ?> |
| 192 |
</h2> |
| 193 |
<?php if ($data['empty_open']) { ?> |
| 194 |
<h4 class="cell acym__subtitle__stats text-center"><b><?php echo esc_html(acym_translation('ACYM_EMAIL_NOT_OPEN_EXAMPLE_STATS')); ?></b></h4> |
| 195 |
<?php } ?> |
| 196 |
<div class="cell grid-x" id="acym__stats__global__open-time"> |
| 197 |
<input type="hidden" id="acym__stats__global__open-time__data" value="<?php echo esc_attr(json_encode($data['openTime'])); ?>"> |
| 198 |
<canvas id="chartjs-0" height="400" width="400"></canvas> |
| 199 |
</div> |
| 200 |
</div> |
| 201 |
<div class="cell grid-x acym__content acym__stats__chart__line"> |
| 202 |
<h2 class="cell acym__title acym__title__secondary"><?php echo esc_html(acym_translation('ACYM_OPEN_CLICK_RATE')); ?></h2> |
| 203 |
<?php if (!$data['mail']->hasStats) { ?> |
| 204 |
<h4 class="acym__subtitle__stats cell text-center"> |
| 205 |
<b><?php echo esc_html(acym_translation('ACYM_NO_OPEN_CLICK_DATA_YET')); ?></b> |
| 206 |
<br> |
| 207 |
<?php echo esc_html(acym_translation('ACYM_HERE_AN_EXEMPLE_OF_WHAT_YOU_CAN_GET')); ?> |
| 208 |
</h4> |
| 209 |
<?php |
| 210 |
acym_lineChart( |
| 211 |
$data['example_line_chart']['month'], |
| 212 |
$data['example_line_chart']['day'], |
| 213 |
$data['example_line_chart']['hour'], |
| 214 |
); |
| 215 |
} else { |
| 216 |
if ($data['show_date_filters']) { |
| 217 |
?> |
| 218 |
<div class="cell grid-x margin-bottom-1"> |
| 219 |
<div class="cell large-auto "></div> |
| 220 |
<label class="cell grid-x large-3 medium-6 small-12 acym__stats__chart__date "> |
| 221 |
<p class="cell shrink"><?php echo esc_html(acym_translation('ACYM_START')); ?></p> |
| 222 |
<input |
| 223 |
class="acy_date_picker auto cell text-center acym__stats__chart__line__input__date" |
| 224 |
id="chart__line__start" |
| 225 |
type="datetime-local" |
| 226 |
data-start="<?php echo esc_attr($data['mail']->startEndDateHour['start']); ?>"> |
| 227 |
</label> |
| 228 |
<label class="cell grid-x large-3 medium-6 small-12 acym__stats__chart__date "> |
| 229 |
<p class="cell shrink"><?php echo esc_html(acym_translation('ACYM_END')); ?></p> |
| 230 |
<input |
| 231 |
class="acy_date_picker auto cell text-center acym__stats__chart__line__input__date" |
| 232 |
id="chart__line__end" |
| 233 |
type="datetime-local" |
| 234 |
data-end="<?php echo esc_attr($data['mail']->startEndDateHour['end']); ?>"> |
| 235 |
</label> |
| 236 |
</div> |
| 237 |
<?php } ?> |
| 238 |
<div id="acym__stats__chart__line__canvas" class="cell"> |
| 239 |
<?php acym_lineChart($data['mail']->month, $data['mail']->day, $data['mail']->hour); ?> |
| 240 |
</div> |
| 241 |
<?php } ?> |
| 242 |
</div> |
| 243 |
</div> |
| 244 |
</div> |
| 245 |
|