fork download
  1. <?php
  2. $stmt = $con->prepare("SELECT ca.id_cashier,
  3. cr.cash_register,
  4. ent.tradename,
  5. bo.tradename,
  6. u.first_name,
  7. u.last_name,
  8. ca.open_date,
  9. ca.open_amount,
  10. ca.close_date,
  11. SUM(i.amount_total) AS sales_day,
  12. ca.open_amount + COALESCE(SUM(i.amount_total), 0) AS total_amount,
  13. ca.status
  14. FROM tbl_cashier AS ca
  15. LEFT JOIN tbl_invoice AS i USING (id_seller)
  16. LEFT JOIN tbl_cash_register cr ON ca.id_cash_register=cr.id_cash_register
  17. LEFT JOIN tbl_users u ON ca.id_seller=u.id_user
  18. LEFT JOIN tbl_enterprise ent ON i.id_enterprise=ent.id_enterprise
  19. LEFT JOIN tbl_branch_office bo ON i.id_branch_office=bo.id_branch_office
  20. WHERE ca.id_seller = ?
  21. AND (
  22. i.id_invoice IS NULL
  23. OR (
  24. i.payer_date >= ca.open_date
  25. AND (
  26. ca.close_date IS NULL
  27. OR i.payer_date <= ca.close_date
  28. )
  29. )
  30. )
  31. GROUP BY 1 DESC LIMIT ?, ?");
Runtime error #stdin #stdout #stderr 0.02s 26000KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Notice:  Undefined variable: con in /home/AiY1gQ/prog.php on line 2
PHP Fatal error:  Uncaught Error: Call to a member function prepare() on null in /home/AiY1gQ/prog.php:2
Stack trace:
#0 {main}
  thrown in /home/AiY1gQ/prog.php on line 2