Compare commits

...

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

3 changed files with 6 additions and 7 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,6 +23,7 @@ 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);
@ -39,7 +40,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) );';
$GLOBALS['wpdb']->query($sql); $wpdb->query($sql);
if ( ! $this->pmtLstRdy() ) { if ( ! $this->pmtLstRdy() ) {
// //
@ -58,7 +59,7 @@ class Submenu_Page {
$this->_npages . ',' . $this->_npages . ',' .
$this->_offset . ',' . $this->_offset . ',' .
$this->_limit .')'; $this->_limit .')';
$GLOBALS['wpdb']->query($sql); $wpdb->query($sql);
} else { } else {
// Load last state // Load last state
$params = $this->pmtLstParams(); $params = $this->pmtLstParams();
@ -70,12 +71,12 @@ class Submenu_Page {
// //
// Calc new number of pages // Calc new number of pages
// //
$this->_npages = intdiv($this->_npages,$this->_limit); $this->_npages = intdiv($this->_nrows,$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';
$GLOBALS['wpdb']->query($sql); $wpdb->query($sql);
} }
} }
} }
@ -116,7 +117,6 @@ 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,7 +37,6 @@ 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();