Hello,

I am unsure why the below code is not outputting my validation errors (the login page works fine)

PHP Code:
if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class 
Addsale extends CI_Controller 

    function 
__construct(){ 
    
parent::__construct(); 
    } 
    function 
index() { 
    if(!
$this->session->userdata('logged_in')) { 
        
redirect('admin/home'); 
    } 
    
// Main Page Data 
    
$data['cms_pages'] = $this->navigation_model->getCMSPages(); 
    
$data['title'] = 'Add Sale'
    
$data['content'] = $this->load->view('admin/addsale',NULL,TRUE); 
     
    
$this->load->view('admintemplate'$data); 

    
//Set Validation 
    
$this->form_validation->set_rules('name''Name''trim|required'); 
    
$this->form_validation->set_rules('location''Location''trim|required'); 
    
$this->form_validation->set_rules('bedrooms''Bedrooms''trim|is_natural|required'); 
    
$this->form_validation->set_rules('bathrooms''Bathrooms''trim|is_natural|required'); 
    
$this->form_validation->set_rules('condition''Condition''trim|required'); 
    
$this->form_validation->set_rules('description''Description''trim|required'); 
    
$this->form_validation->set_rules('price''Price''trim|required'); 

    if(
$this->form_validation->run() === TRUE) { 
    
    
//Set File Settings 
    
$config['upload_path'] = './includes/uploads/'
    
$config['allowed_types'] = 'jpg|png'
    
$config['max_size'] = '100'
    
$config['max_width'] = '1024'
    
$config['max_height'] = '768'

    
$this->load->library('upload'$config); 
    
    
$this->upload->do_upload();
    
$file_info $this->upload->data();
     
    
$data = array(   
        
'name' => $this->input->post('name'TRUE), 
        
'location' => $this->input->post('location'TRUE), 
        
'bedrooms' => $this->input->post('bedrooms'TRUE), 
        
'bathrooms' => $this->input->post('bathrooms'TRUE), 
        
'condition' => $this->input->post('condition'TRUE), 
        
'description' => $this->input->post('description'TRUE), 
        
'price' => $this->input->post('price'TRUE), 
        
'image' => $file_info['full_path'
        ); 
    
$this->sales_model->addSale($data); 
    } 
 } 


View:
Code HTML4Strict:
<section id = "validation"><?php echo validation_errors();?></section>