Fix Bugs C,D,E from auditing report #2

Merged
pitmutt merged 1 commit from rev0919 into main 2023-10-26 18:57:49 +00:00
Showing only changes of commit ab08d12f2b - Show all commits

View file

@ -46,11 +46,13 @@ class zpmt_stats_page {
$this->_npages++; $this->_npages++;
} }
$sql = 'insert into zgo_pmtlst (pg_ix,pg_page,pg_npages,pg_offset,pg_limit) values (1,' . // $sql = 'insert into zgo_pmtlst (pg_ix,pg_page,pg_npages,pg_offset,pg_limit) values (1,' .
$this->_page . ',' . // $this->_page . ',' .
$this->_npages . ',' . // $this->_npages . ',' .
$this->_offset . ',' . // $this->_offset . ',' .
$this->_limit .')'; // $this->_limit .')';
$sql = $wpdb->prepare('insert into zgo_pmtlst (pg_ix,pg_page,pg_npages,pg_offset,pg_limit) values (1,%d,%d,%d,%d);',$this->_page,$this->_npages,$this->_offset,$this->_limit);
$wpdb->query($sql); $wpdb->query($sql);
} else { } else {
// Load last state // Load last state
@ -67,7 +69,10 @@ class zpmt_stats_page {
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';
$sql = $wpdb->prepare('update zgo_pmtlst set pg_npages=%d where pg_ix=1;',$this->_npages);
$wpdb->query($sql); $wpdb->query($sql);
} }
} }
@ -149,9 +154,13 @@ class zpmt_stats_page {
// //
// Save new list state // Save new list state
// //
$sql = 'update zgo_pmtlst set pg_page=' . $this->_page .
', pg_npages=' . $this->_npages . // $sql = 'update zgo_pmtlst set pg_page=' . $this->_page .
', pg_offset=' . $this->_offset . ' where pg_ix=1;'; // ', pg_npages=' . $this->_npages .
// ', pg_offset=' . $this->_offset . ' where pg_ix=1;';
$sql = $wpdb->prepare('update zgo_pmtlst set pg_page=%d, pg_npages=
%d, pg_offset=%d where pg_ix=1;',$this->_page,$this->_npages,$this->_offset);
$wpdb->query($sql); $wpdb->query($sql);
} }
@ -233,14 +242,14 @@ class zpmt_stats_page {
} }
$line++; $line++;
print '<td><a href="https://dev.zgo.cash/invoice/' . htmlentities($row->pmt_orderid, ENT_QUOTES) . '" target="_blank">' . htmlentities($row->pmt_orderid, ENT_QUOTES) . "</a></td>"; print '<td><a href="https://dev.zgo.cash/invoice/' . htmlentities($row->pmt_orderid, ENT_QUOTES) . '" target="_blank">' . htmlentities($row->pmt_orderid, ENT_QUOTES) . "</a></td>";
print "<td>" . $row->pmt_wc_order . "</td>"; print "<td>" . htmlwntities($row->pmt_wc_order,ENT_QUOTES) . "</td>";
print "<td>" . htmlentities($row->pmt_wc_custname, ENT_QUOTES) . "</td>"; print "<td>" . htmlentities($row->pmt_wc_custname, ENT_QUOTES) . "</td>";
print '<td style="text-align:center;">'. $row->pmt_accepted . "</td>"; print '<td style="text-align:center;">'. htmlentities($row->pmt_accepted,ENT_QUOTES) . "</td>";
print '<td style="text-align:center;">'.$row->pmt_confirmed ."</td>"; print '<td style="text-align:center;">'.htmlentities($row->pmt_confirmed,ENT_QUOTES) ."</td>";
print '<td style="text-align:right;">'. number_format($row->pmt_amount,2) . "</td>"; print '<td style="text-align:right;">'. number_format($row->pmt_amount,2) . "</td>";
print '<td style="text-align:right;">'. number_format($row->pmt_rate,2) . "</td>"; print '<td style="text-align:right;">'. number_format($row->pmt_rate,2) . "</td>";
print '<td style="text-align:right;">'. number_format($row->pmt_zec,8) . "</td>"; print '<td style="text-align:right;">'. number_format($row->pmt_zec,8) . "</td>";
print '<td style="text-align:center;">'.$row->pmt_wc_paid ."</td></tr>"; print '<td style="text-align:center;">'. htmlentities($row->pmt_wc_paid,ENT_QUOTES) ."</td></tr>";
} }
?> ?>
</table> </table>