Compare commits

...

No commits in common. "fc03aaabc8814e63e620d1d1734430fd17e7d6b2" and "main" have entirely different histories.

3 changed files with 7 additions and 6 deletions

View file

@ -6,7 +6,7 @@
## Description ## Description
This plugin implements an easy way to track payments processed using ZGo Payment Gateway for WooCommerce.
## Installation ## Installation

View file

@ -23,7 +23,6 @@ class Submenu_Page {
public $_path; public $_path;
function __construct( $path ) { function __construct( $path ) {
global $wpdb;
$this->_path = $path; $this->_path = $path;
$this->console_log('$_path -> '. $this->_path); $this->console_log('$_path -> '. $this->_path);
@ -40,7 +39,7 @@ class Submenu_Page {
'pg_limit integer not null default 0,' . 'pg_limit integer not null default 0,' .
'pg_dt datetime default current_timestamp, '. 'pg_dt datetime default current_timestamp, '.
'unique lstix (pg_ix) );'; 'unique lstix (pg_ix) );';
$wpdb->query($sql); $GLOBALS['wpdb']->query($sql);
if ( ! $this->pmtLstRdy() ) { if ( ! $this->pmtLstRdy() ) {
// //
@ -59,7 +58,7 @@ class Submenu_Page {
$this->_npages . ',' . $this->_npages . ',' .
$this->_offset . ',' . $this->_offset . ',' .
$this->_limit .')'; $this->_limit .')';
$wpdb->query($sql); $GLOBALS['wpdb']->query($sql);
} else { } else {
// Load last state // Load last state
$params = $this->pmtLstParams(); $params = $this->pmtLstParams();
@ -71,12 +70,12 @@ class Submenu_Page {
// //
// Calc new number of pages // Calc new number of pages
// //
$this->_npages = intdiv($this->_nrows,$this->_limit); $this->_npages = intdiv($this->_npages,$this->_limit);
if ( $this->_nrows > ($this->_npages*$this->_limit) ) { if ( $this->_nrows > ($this->_npages*$this->_limit) ) {
$this->_npages++; $this->_npages++;
} }
$sql = 'update zgo_pmtlst set pg_npages=' . $this->_npages . ' where pg_ix=1'; $sql = 'update zgo_pmtlst set pg_npages=' . $this->_npages . ' where pg_ix=1';
$wpdb->query($sql); $GLOBALS['wpdb']->query($sql);
} }
} }
} }
@ -117,6 +116,7 @@ class Submenu_Page {
} }
public function render() { public function render() {
global $wpdb; global $wpdb;
$currentDate = date('Y-m-d H:i:s'); $currentDate = date('Y-m-d H:i:s');

View file

@ -37,6 +37,7 @@ add_action( 'plugins_loaded', 'zgopmtlist_plugin' );
function zgopmtlist_plugin() { function zgopmtlist_plugin() {
$path = str_replace('zgopmtlist/','',plugin_dir_path( __FILE__ )); $path = str_replace('zgopmtlist/','',plugin_dir_path( __FILE__ ));
$plugin = new Submenu( new Submenu_Page($path) ); $plugin = new Submenu( new Submenu_Page($path) );
$plugin->init(); $plugin->init();