On one particular page I have a button that toggles a certain field in the db. The function is
function source_toggle_paid($event_id = null, $attendee_id = null)
{
$this->authentication->checkLogin(); // Check if the user is logged in
// Check the parameters provided are null
if ($attendee_id == null || $event_id == null)
{
// If either attendee or event ids given are null, give an error message
$data = array(
'type' => 'error',
'message' => $this->message_list->get('DOES_NOT_EXIST', 'attendee') . ' ' . $this->message_list->get('BACK_TO_SOURCE_HOME')
);
// Output the error message
$this->load->view('template/main_header');
$this->load->view('template/message', $data);
$this->load->view('template/main_footer');
}
else // Otherwise, parameters are not null
{
//Load the attendee model, and toggle the paid status of the attendee
$this->load->model('Attendee');
$this->Attendee->toggle_field('paid',$attendee_id);
//Redirect the user back to the attendees page, with the used search term
redirect('admin/source_attendees/'.$event_id);
//redirect('admin/source_attendees/'.$event_id);
}
}
When I click the button I get redirected to the 404 page and the dp is unchanged, upon further playing I've found the function is never being reached. However if I type in the url manually it works, and if I right click and open in new tab, it works too