Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Dashboard extends CI_Controller{
- protected $data = array();
- function __construct()
- {
- parent::__construct();
- $this->data['pagetitle'] = 'Invoices Manager';
- }
- protected function render($the_view)
- {
- $this->data['the_view'] = (is_null($the_view)) ? '' : $this->load->view($the_view,$this->data, TRUE);
- $this->load->view('templates/master_page', $this->data);
- }
- public function home() {
- // $this->load->view('templates/master_page', $this->data);
- $this->render( 'templates/homepage_view');
- }
- public function dashboard() {
- // $this->load->view('templates/master_page', $this->data);
- $this->render( 'dashboard/home');
- }
- public function purchaselist(){
- $this->render('purchase/index');
- }
- }
- class Purchase extends CI_Controller{
- protected $data = array();
- protected $mydata = array();
- function __Construct()
- {
- parent::__Construct ();
- $this->load->database(); // load database
- $this->load->model('Purchase_model'); // load model
- $this->mydata['purchase']=null;
- }
- public function index()
- {
- $query = $this->Purchase_model->getPurchaselist();
- if($query)
- {
- $mydata['purchase'] = $query;
- }
- $this->load->view('purchase/index', $mydata);
- // $this->render( 'purchase/index');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement