0

Working on developing a commissions manager for my contractor's JS-based POS system, so making a new page to interact. Everything had been going fine, until suddenly now the webpage only loads a white screen (checked multiple browsers with multiple devices on multiple networks). No other pages are affected by this, but I do post to the page's controller .php for a couple functions on other pages, and those functions aren't running now. I've scaled back any edits to just the base index function to load the needed page, but still nothing. The code for the controller:

<?php 

require_once ("Secure_area.php");

class Commissions extends Secure_area
{
    function index() {
        $this->load->view('commissions/dashboard');
    }

    function add_deduction() {
        $date = $_POST['date'];
        $sale_id = $_POST['sale_id'];
        $type = $_POST['type'];
        $this->load->model("Commission");

        $new_date = $this->Commission->add_deduction($date, $sale_id, $type);
        echo $new_date;    
    }

}
?> 

This started after trying to make an edit to a database table using codeigniter, affecting less than 500 rows. Code for db edit:

$this->db->where("deleted", null);
$this->db->update("commission_log", ['deleted'=>0]);

The process didn't work, as the aforementioned cells are still null, not 0. I've tried loading the page with

$this->db->reset_query();
$this->db->stop_cache();
$this->db->flush_cache();

but no luck. I've tried restarting the db server, changing the name of the controller, using a fresh file for the controller, nothing. Still white. The db server says there's no active queries, or anything coming in when the web page is loaded. Any recommendations? I can provide more detail as needed.

Edit: No error messages, meaningful or otherwise, are populating either in PHP logs or browser console.

  • When I get a blank screen it means there is a PHP syntax error somewhere in your code. – CharlesEF May 23 '23 at 22:20
  • 1
    Check the php error log to begin with – ADyson May 23 '23 at 22:32
  • Are you able to set the environment to Development? From the little code you provided and your explanation, it sounds like index displays the page and uses an ajax request to add_deduction for the data? If that's the case, you'll likely need to check the browser console to see what errors are happening. – James May 23 '23 at 22:58
  • The code above is all that is in the file causing the issue. There's no syntax errors, as there's base code in the software that displays a specific message when there's syntax errors. Edited above to show that there's no errors populating in any error logs. – evie_and_eevees May 24 '23 at 01:09
  • The code above is not enough. You need to post enough of it so that we can reproduce the error. – Rohit Gupta Jun 20 '23 at 01:21
  • What have you tried to resolve the problem? Where are you stuck? Such code won't randomly stop working – Nico Haase Jun 20 '23 at 12:49

0 Answers0