title: An uncaught Exception was encountered Type: RuntimeException Message: Unable to locate the model you have specified: Events
body: <p><strong>error</strong></p>
  
  <blockquote>
    <p>An uncaught Exception was encountered Type: RuntimeException Message:
    Unable to locate the model you have specified: Events Filename:
    /home/dailysurvive/public_html/citymallgulberglahore.com/mall/system/core/Loader.php
    Line Number: 344 Backtrace: File:
    /home/dailysurvive/public_html/citymallgulberglahore.com/mall/application/controllers/Welcome.php
    Line: 29 Function: model File:
    /home/dailysurvive/public_html/citymallgulberglahore.com/mall/index.php
    Line: 315 Function: require_once</p>
  </blockquote>
  
  <p>the images for the error files are as following</p>
  
  <p>Model.php</p>
  
  <pre><code>defined('BASEPATH') OR exit('No direct script access allowed');
  
  /**
   * Model Class
   *
   * @package     CodeIgniter
   * @subpackage  Libraries
   * @category    Libraries
   * @author      EllisLab Dev Team
   * @link        https://codeigniter.com/user_guide/libraries/config.html
   */
  class CI_Model {
  
  /**
   * Class constructor
   *
   * @return  void
   */
  public function __construct()
  {
      log_message('info', 'Model Class Initialized');
  }
  
  // --------------------------------------------------------------------
  
  /**
   * __get magic
   *
   * Allows models to access CI's loaded classes using the same
   * syntax as controllers.
   *
   * @param   string  $key
   */
  public function __get($key)
  {
      // Debugging note:
      //  If you're here because you're getting an error message
      //  saying 'Undefined Property: system/core/Model.php', it's
      //  most likely a typo in your model code.
      return get_instance()-&gt;$key;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Loader.php</p>
  
  <pre><code>    $model = ucfirst($model);
      if ( ! class_exists($model, FALSE))
      {
          foreach ($this-&gt;_ci_model_paths as $mod_path)
          {
              if ( ! file_exists($mod_path.'models/'.$path.$model.'.php'))
              {
                  continue;
              }
  
              require_once($mod_path.'models/'.$path.$model.'.php');
              if ( ! class_exists($model, FALSE))
              {
                  throw new RuntimeException($mod_path."models/".$path.$model.".php exists, but doesn't declare class ".$model);
              }
  
              break;
          }
  
          if ( ! class_exists($model, FALSE))
          {
              throw new RuntimeException('Unable to locate the model you have specified: '.$model);
          }
      }
      elseif ( ! is_subclass_of($model, 'CI_Model'))
      {
          throw new RuntimeException("Class ".$model." already exists and doesn't extend CI_Model");
      }
  
      $this-&gt;_ci_models[] = $name;
      $CI-&gt;$name = new $model();
      return $this;
  }
  </code></pre>
  
  <p>Welcome.php</p>
  
  <pre><code>public function index($data=null)
  {
      //$this-&gt;load-&gt;view('welcome_message');
     $this-&gt;load-&gt;model("events");
     $data['records'] = $this-&gt;events-&gt;getAllRecords();
  
  
      $this-&gt;load-&gt;view('header',$data);
      $this-&gt;load-&gt;view('home',$data);
      $this-&gt;load-&gt;view('footer',$data);
  
  }
  
  function home()
  {
      $data = array(
          'back_step' =&gt; '../',
      );
  
  
      $dat = array(
  
          'email'     =&gt; $this-&gt;input-&gt;post('email')
      );
  
  
  
      $this-&gt;load-&gt;model("events");
      $this-&gt;load-&gt;database();
  
     $res = $this-&gt;db-&gt;insert('subscribe',$dat);
  
      $data['records'] = $this-&gt;events-&gt;getAllRecords();
  
      $this-&gt;index($data);
  </code></pre>
  
  <p>index.php</p>
  
  <pre><code>/*
   * --------------------------------------------------------------------
   * LOAD THE BOOTSTRAP FILE
   * --------------------------------------------------------------------
   *
   * And away we go...
   */
  require_once BASEPATH.'core/CodeIgniter.php';
  </code></pre>