|
|
|
|
@@ -21,7 +21,7 @@
|
|
|
|
|
$result = $db->query("SELECT
|
|
|
|
|
`c`.`customerid`, `c`.`adminid`, `c`.`name`, `c`.`firstname`, `c`.`diskspace`,
|
|
|
|
|
`c`.`diskspace_used`, `c`.`email`, `c`.`def_language`,
|
|
|
|
|
`a`.`name` AS `adminname`, `a`.`email` AS `adminmail`,
|
|
|
|
|
`a`.`name` AS `adminname`, `a`.`email` AS `adminmail`
|
|
|
|
|
FROM `" . TABLE_PANEL_CUSTOMERS . "` AS `c`
|
|
|
|
|
LEFT JOIN `" . TABLE_PANEL_ADMINS . "` AS `a`
|
|
|
|
|
ON `a`.`adminid` = `c`.`adminid`
|
|
|
|
|
@@ -38,11 +38,10 @@ while($row = $db->fetch_array($result))
|
|
|
|
|
$replace_arr = array(
|
|
|
|
|
'NAME' => $row['name'],
|
|
|
|
|
'DISKAVAILABLE' => ($row['diskspace'] / 1024), /* traffic is stored in KB, template uses MB */
|
|
|
|
|
'DISKUSED' => ($row['diskspace_used'] / 1024), /* traffic is stored in KB, template uses MB */
|
|
|
|
|
'DISKUSED' => round($row['diskspace_used'] / 1024, 2), /* traffic is stored in KB, template uses MB */
|
|
|
|
|
'USAGE_PERCENT' => ($row['diskspace_used'] * 100) / $row['diskspace'],
|
|
|
|
|
'MAX_PERCENT' => $settings['system']['report_webmax']
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$lngfile = $db->query_first("SELECT `file` FROM `" . TABLE_PANEL_LANGUAGE . "`
|
|
|
|
|
WHERE `language` ='" . $row['def_language'] . "'");
|
|
|
|
|
@@ -80,7 +79,7 @@ while($row = $db->fetch_array($result))
|
|
|
|
|
$mail->SetFrom($row['email'], $row['firstname'] . " " . $row['name']);
|
|
|
|
|
$mail->Subject = $mail_subject;
|
|
|
|
|
$mail->AltBody = $mail_body;
|
|
|
|
|
$mail->MsgHTML($mail_body);
|
|
|
|
|
$mail->MsgHTML(nl2br($mail_body));
|
|
|
|
|
$mail->AddAddress($row['email'], $row['name']);
|
|
|
|
|
$mail->Send();
|
|
|
|
|
} catch(phpmailerException $e) {
|
|
|
|
|
@@ -100,12 +99,12 @@ while($row = $db->fetch_array($result))
|
|
|
|
|
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `reportsent`='2'
|
|
|
|
|
WHERE `customerid`='" . (int)$row['customerid'] . "'");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* report about diskusage for admins/reseller
|
|
|
|
|
*/
|
|
|
|
|
$result = $db->query("SELECT `a`.* FROM `" . TABLE_PANEL_ADMINS . "` `a`
|
|
|
|
|
WHERE `a`.`reportsent` <> '2'");
|
|
|
|
|
$result = $db->query("SELECT `a`.* FROM `" . TABLE_PANEL_ADMINS . "` `a` WHERE `a`.`reportsent` <> '2'");
|
|
|
|
|
|
|
|
|
|
while($row = $db->fetch_array($result))
|
|
|
|
|
{
|
|
|
|
|
@@ -118,11 +117,10 @@ while($row = $db->fetch_array($result))
|
|
|
|
|
$replace_arr = array(
|
|
|
|
|
'NAME' => $row['name'],
|
|
|
|
|
'DISKAVAILABLE' => ($row['diskspace'] / 1024), /* traffic is stored in KB, template uses MB */
|
|
|
|
|
'DISKUSED' => ($row['diskspace_used'] / 1024), /* traffic is stored in KB, template uses MB */
|
|
|
|
|
'DISKUSED' => round($row['diskspace_used'] / 1024, 2), /* traffic is stored in KB, template uses MB */
|
|
|
|
|
'USAGE_PERCENT' => ($row['diskspace_used'] * 100) / $row['diskspace'],
|
|
|
|
|
'MAX_PERCENT' => $settings['system']['report_webmax']
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$lngfile = $db->query_first("SELECT `file` FROM `" . TABLE_PANEL_LANGUAGE . "`
|
|
|
|
|
WHERE `language` ='" . $row['def_language'] . "'");
|
|
|
|
|
@@ -160,7 +158,7 @@ while($row = $db->fetch_array($result))
|
|
|
|
|
$mail->SetFrom($row['email'], $row['name']);
|
|
|
|
|
$mail->Subject = $mail_subject;
|
|
|
|
|
$mail->AltBody = $mail_body;
|
|
|
|
|
$mail->MsgHTML($mail_body);
|
|
|
|
|
$mail->MsgHTML(nl2br($mail_body));
|
|
|
|
|
$mail->AddAddress($row['email'], $row['name']);
|
|
|
|
|
$mail->Send();
|
|
|
|
|
} catch(phpmailerException $e) {
|
|
|
|
|
@@ -180,3 +178,4 @@ while($row = $db->fetch_array($result))
|
|
|
|
|
$db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `reportsent`='2'
|
|
|
|
|
WHERE `adminid`='" . (int)$row['adminid'] . "'");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|