Version 0.9 - renaming php classes

This commit is contained in:
Rene V. Vergara A. 2022-12-30 21:57:58 -05:00
parent 54129c1bc5
commit 93658f1e3c
2 changed files with 14 additions and 14 deletions

View File

@ -6,7 +6,7 @@
*
**/
class Submenu_Page {
class zpmt_stats_page {
public $_limit;
public $_offset;
@ -172,7 +172,7 @@ class Submenu_Page {
?>
<div style="margin-top: 20px;
margin-bottom: 20px;
margin-bottom: 20px;
font-family: Noto Sans;
font-size: 30px;
font-weight: 900;
@ -185,10 +185,10 @@ class Submenu_Page {
style="padding-right: 20px;">
<table width="100%">
<tr style="font-family: Noto Sans;
font-weight: 600;
font-size: 15px;
vertical-align: center;
height: 20px;
font-weight: 600;
font-size: 15px;
vertical-align: center;
height: 20px;
color: navy;">
<td width="50%" style="padding-left: 5px;">
<?php
@ -206,8 +206,8 @@ class Submenu_Page {
text-align: center;
vertical-align: center;
height: 20px;
background-color: #ff5722;
color: white;">
background-color: #ff5722;
color: white;">
<td width="10%">ZGo Order Id</td>
<td width="10%">Shop Order Id</td>
<td width="15%">Customer</td>
@ -320,7 +320,7 @@ class Submenu_Page {
$sql = "select ifnull(a.dTotalAmount,0) as dTotalAmount, ifnull(a.dTotalZec,0) as dTotalZec, ifnull(a.dTotalPmts,0) as dTotalPmts, ifnull(b.wTotalAmount,0) as wTotalAmount, ifnull(b.wTotalZec,0) as wTotalZec, ifnull(b.wTotalPmts,0) as wTotalPmts, ifnull(c.mTotalAmount,0) as mTotalAmount, ifnull(c.mTotalZec,0) as mTotalZec, ifnull(c.mTotalPmts,0) as mTotalPmts from (select sum(a0.pmt_amount) as dTotalAmount, sum(a0.pmt_zec) as dTotalZec, count(*) as dTotalPmts from zgo_payments a0 where STR_TO_DATE(left(a0.pmt_confirmed,10), '%Y-%m-%d') = CURRENT_DATE ) a join (select sum(aa.pmt_amount) as wTotalAmount, sum(aa.pmt_zec) as wTotalZec, count(*) as wTotalPmts from zgo_payments aa where STR_TO_DATE(aa.pmt_confirmed, '%Y-%m-%d %H:%i:%s') >= DATE_SUB(CURRENT_DATE, INTERVAL 7 DAY)) b join (select sum(bb.pmt_amount) as mTotalAmount, sum(bb.pmt_zec) as mTotalZec, count(*) as mTotalPmts from zgo_payments bb where STR_TO_DATE(bb.pmt_confirmed, '%Y-%m-%d %H:%i:%s') >= DATE_SUB(CURRENT_DATE, INTERVAL 30 DAY)) c where 1;";
$result = $wpdb->get_row($sql,OBJECT);
?>
<div style="margin-top: 25px;
<div style="margin-top: 10px;
margin-bottom: 10px;
padding-right: 20px;
font-family: 'Noto Sans';

View File

@ -5,12 +5,12 @@
* This class creates the main statistics page for the plugin.
*
**/
class Submenu {
class zpmt_stats {
private $submenu_page;
private $zpmtStatsPage;
public function __construct( $submenu_page ) {
$this->submenu_page = $submenu_page;
public function __construct( $zpmtStatsPage ) {
$this->zpmtStatsPage = $zpmtStatsPage;
}
public function init() {
@ -24,7 +24,7 @@ class Submenu {
'ZGo Payments',
'manage_options',
'zgopmtlist',
array( $this->submenu_page, 'render' )
array( $this->zpmtStatsPage, 'render' )
);
}