Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. class Dashboard extends CI_Controller{
  2. protected $data = array();
  3. function __construct()
  4. {
  5. parent::__construct();
  6. $this->data['pagetitle'] = 'Invoices Manager';
  7. }
  8. protected function render($the_view)
  9. {
  10. $this->data['the_view'] = (is_null($the_view)) ? '' : $this->load->view($the_view,$this->data, TRUE);
  11. $this->load->view('templates/master_page', $this->data);
  12. }
  13. public function home() {
  14. // $this->load->view('templates/master_page', $this->data);
  15. $this->render( 'templates/homepage_view');
  16. }
  17. public function dashboard() {
  18. // $this->load->view('templates/master_page', $this->data);
  19. $this->render( 'dashboard/home');
  20. }
  21. public function purchaselist(){
  22. $this->render('purchase/index');
  23. }
  24. }
  25.  
  26. class Purchase extends CI_Controller{
  27. protected $data = array();
  28. protected $mydata = array();
  29. function __Construct()
  30. {
  31. parent::__Construct ();
  32. $this->load->database(); // load database
  33. $this->load->model('Purchase_model'); // load model
  34. $this->mydata['purchase']=null;
  35. }
  36. public function index()
  37. {
  38. $query = $this->Purchase_model->getPurchaselist();
  39. if($query)
  40. {
  41. $mydata['purchase'] = $query;
  42. }
  43. $this->load->view('purchase/index', $mydata);
  44. // $this->render( 'purchase/index');
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement