Search This Blog

Wednesday, November 27, 2019

site.php

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Site extends CI_Controller {

        
        public function __construct(){
                parent::__construct();
                //kosongkan sementara
                //$this->load->model('sitemodel');
                
         }
        
        public function index()
        {
$this->load->view('vdisduk/home');
        }

        public function about()
        {
$this->load->view('vdisduk/home');
        }

        public function admin()
        {
$this->load->view('vdisduk/home');
        }

        public function login()
        {
$this->load->view('vdisduk/home');
        }

        public function logout()
        {
$this->load->view('vdisduk/home');
        }

        #---------best practive with db-----------------
        public function clistpelanggan()
        {
        
                //load model dahulu
                $this->load->model('sitemodel'); //sudah di wakilkan di construct
                $this->load->helper('url');
                // agar tidak perlu dipanggil berkali kali

                //load function berisi logic/ proses yang dibuat dalam model
                $data['varpelanggan'] = $this->sitemodel->mlistpelanggan()
                                                        ->result_array();
                $this->load->view('vdisduk/vpelanggan/vlistpelanggan.php',$data);
        }

        public function clistproduk()
        {
                //load model dahulu
                $this->load->model('sitemodel'); //sudah di wakilkan di construct
                // agar tidak perlu dipanggil berkali kali
                //load function berisi logic/ proses yang dibuat dalam model
                $data['varproduk'] = $this->sitemodel->mlistproduk();
                $this->load->view('vdisduk/vproduk/vlistproduk.php',$data);

        }

        public function clistorders()
        {
                                //load model dahulu
                $this->load->model('sitemodel'); //sudah di wakilkan di construct
                // agar tidak perlu dipanggil berkali kali
                //load function berisi logic/ proses yang dibuat dalam model
                $data['varorders'] = $this->sitemodel->mlistorders();
                $this->load->view('vdisduk/vorders/vlistorders.php',$data);

        }

}






Regards,


HERY PURNAMA

Certified IT Trainer
http://www.inhousetrainer.net

 Call/ SMS/WA :  081.223344.506 , BBM : 7DC633AA
 
 
 Social Net :

Hometown : Bandung - Jawa Barat

Please consider your environmental responsibility. Before printing this e-mail message, ask yourself whether you really need a hard copy.





No comments:

Post a Comment