trigger_error('GLM Usage: bandwidthDataConnect() - '.$this->connectError, E_USER_NOTICE);
} else {
+ // Get global send percentage - Notify if above this
+ $this->threshold = $config['send_percent'] - 0;
+
if (!$website) {
$website = $config['website'];
}
if ($this->bwdb == false) {
return false;
}
-//This one done
+
// Get stats for yesterday in Megabytes for traffic and Gigabytes for Storage
$yesterday = date('Y-m-d 0:0:0.0', strtotime(date('Y-m-d')." - 1day"));
$today = date('Y-m-d 0:0:0.0');
// For each website retrieved
foreach ($websites as $site) {
+
$mesg = '';
// If targets had exceeded target
';
// If customer contact provided
- if (trim($site['cust_contact']) != '' && $sendToCustContact) {
+ if ($sendAll || (trim($site['cust_contact']) != '' && $sendToCustContact)) {
$numbReportingWithContactEmail++;
public function sendHtmlEmail( $to, $from, $subject, $mesg, $forceDisplay = false )
{
+ if (trim($to) == '') {
+
+ if (!$forceDisplay) {
+ echo '<br><b>E-Mail Not Sent - No "To:" address!</b>';
+ return;
+ }
+ $to = "( *** E-Mail Address Not Supplied - This E-Mail would not have been sent. *** )";
+
+ }
+
// On development servers, force display
if (GLM_SERVERSTATS_PLUGIN_HOST == 'DEVELOPMENT') {
$forceDisplay = true;
font-size: 1.2rem;
}
.graphContainer {
- position: relative;
}
.graphContainer .graphTitle {
- position: absolute;
- top: -10px;
- width: 100%;
- margin-top: 10px;
- font-weight: bold;
font-size: 1.1rem;
+ font-weight: bold;
+ margin-bottom: 10px;
}
.graph {
- margin-top: 20px;
}
</style>
{if $selectedSite}
<div>
- <a href="{$ajaxUrl}?action=glm_server_stats&glm_action=ajaxSendUsageReport&selected_site={$selectedSite}" target="usageEmail" class="button button-secondary">Send usage E-mail for site selected above</a>
- <a href="{$ajaxUrl}?action=glm_server_stats&glm_action=ajaxSendUsageReport&selected_site={$selectedSite}&display_only=true" target="usageEmail" class="button button-secondary">Display usage E-mail for site selected above</a>
+ Send:
+ <a href="{$ajaxUrl}?action=glm_server_stats&glm_action=ajaxSendUsageReport&selected_site={$selectedSite}" target="usageEmail" class="button button-secondary button-small">Send usage E-mail for site selected above</a>
+
+ Review:
+ <a href="{$ajaxUrl}?action=glm_server_stats&glm_action=ajaxSendUsageReport&selected_site={$selectedSite}&display_only=true" target="usageEmail" class="button button-secondary button-small">Display usage E-mail for site selected above</a>
+
+ <a href="{$ajaxUrl}?action=glm_server_stats&glm_action=ajaxSendUsageReport&display_only=true" target="usageEmail" class="button button-secondary button-small">Display usage E-mail for all sites above threashold percentage</a>
</div>
{/if}
'field' => 'cust_contact',
'value' => {$settings.cust_contact},
'label' => 'Customer Contact E-Mail',
- 'required' => true
+ 'required' => false,
+ 'helpText' => 'Leave empty to prevent any E-mail from being sent for this site.'
]}
{include file="ui/f6/text.html"}
text-align: left;
vertical-align: top;
padding: 0px;
+ margin: 0px;
}
.glmbw-table tr {
+ margin-bottom: 0px;
+ padding-bottom: 0px;
}
.glmbw-image {
max-width: 90%;
font-size: 1em;
text-align: center;
}
+ #key-line {
+ margin: 0px;
+ padding: 0px;
+ }
+ #print-date {
+ font-size: 1em;
+ padding: 0px;
+ margin: 0px;
+ }
+ .graphContainer {
+ }
+ .graphContainer .graphTitle {
+ font-weight: bold;
+ margin-bottom: 5px;
+ }
+ .graph {
+ }
+
</style>
<div class="print-title" style="text-align: center;">
Usage statistics for site: {$selectedSite|upper} Date:
- <input style="width: 7rem;" data-id="graphDate" type="text" name="graph_date" value="{$thisDate}" class="glm-form-text-input-small glm-date-input" placeholder="Click to Select Date/Time" tabindex="2">
+ <input id="print-date" style="width: 7rem;" data-id="graphDate" type="text" name="graph_date" value="{$thisDate}" class="glm-form-text-input-small glm-date-input" placeholder="Click to Select Date/Time" tabindex="2">
</div>
<center>
<table class="glmbw-table unstriped">
<tr>
- <th> </th><th>Traffic</th><th>Target</th><th>% of Target</th><th>Storage</th><th>target</th><th>% of Target</th></tr>
+ <th> </th><th>Traffic</th><th>Target</th><th>% of Target</th><th>Storage</th><th>target</th><th>% of Target</th>
+ </tr>
<tr>
<th>Yesterday: </th>
<td>
<td{if $serverStats.trafficDiff.diskExceeded} style="color: red;"{/if}>{$serverStats.trafficDiff.diskPercent|string_format:"%.0f"}%</td>
</tr>
</table>
- <span class="datePrintInclude" style="margin-bottom: 0em;">
- <p>
+ <span class="datePrintInclude">
+ <p id="key-line">
Color Key: <span style="color: maroon;">Target</span>, <span style="color: gray;">Storage</span>, <span style="color: red;">Incoming</span>, <span style="color: green;">Outgoing</span>, <span style="color: blue;">Total</span><br>
</p>
</span>
<div class="graphContainer">
+ <div class="graph"><img id="twoYearImg" src="{$assetsUrl}/graph.png" class="glmbw-image"></div>
<div class="graphTitle">
Monthly traffic totals for the past year. The dotted line is our current/planned billing level.
</div>
- <div class="graph" style="padding-top: 0px;"><img id="twoYearImg" src="{$assetsUrl}/graph.png" class="glmbw-image"></div>
</div>
<div class="graphContainer">
+ <div class="graph"><img id="twoYearStorageImg" src="{$assetsUrl}/graph.png" class="glmbw-image"></div>
<div class="graphTitle">
Montlhy maximum disk space used for past year. The dotted line is our current/planned billing level.
</div>
- <div class="graph" style="padding-top: 0px;"><img id="twoYearStorageImg" src="{$assetsUrl}/graph.png" class="glmbw-image"></div>
</div>
<div class="graphContainer">
+ <div class="graph"><img id="twoDayImg" src="{$assetsUrl}/graph.png" class="glmbw-image"></div>
<div class="graphTitle">
Detail traffic for past 24 hours.
</div>
- <div class="graph" style="padding-top: 0px;"><img id="twoDayImg" src="{$assetsUrl}/graph.png" class="glmbw-image"></div>
</div>
<div class="graphContainer">
+ <div class="graph""><img id="twoMonthImg" src="{$assetsUrl}/graph.png" class="glmbw-image"></div>
<div class="graphTitle">
Daily traffic for past two months.
</div>
- <div class="graph" style="padding-top: 0px;"><img id="twoMonthImg" src="{$assetsUrl}/graph.png" class="glmbw-image"></div>
</div>
</center>
</div>