Znote / ZnoteAAC

Developement repository for the Znote AAC project. A website portal to represent and manage your Open Tibia server.
MIT License
146 stars 127 forks source link

Fix admin_shop.php #348

Closed gregorecruzeiro closed 5 years ago

gregorecruzeiro commented 5 years ago

Notice: Undefined index: points in admin_shop.php on line 61

Znote commented 5 years ago

Isn't that a duplicate of line 7?

I think the actual problem is the foreach statement? Do you have an empty orders array?

Instead of

<?php foreach(($orders ? $orders : array()) as $order) { ?>

Try to do:

<?php foreach(($orders as $order) { ?>

But as an addition, wrap the entire <table> code with:

<?php if ($orders !== false): ?>
  <table>
    code ...  
  </table>
<?php endif; ?>

This should hide the table if there are no rows in it.

gregorecruzeiro commented 5 years ago

In fact, the column points </ th> is in the znote_shop_logs table and not in znote_shop_orders, it was not duplicate line 7, changed from znote_shop_orders to znote_shop_logs

Znote commented 5 years ago

Ahh wops. x) I'm tired. Thanks for the pull request. 👍

gregorecruzeiro commented 5 years ago

;p