Search This Blog

Wednesday, November 27, 2019

SITEMODEL.PHP

<?php
defined('BASEPATH') OR exit ('no direct script');

class Sitemodel extends CI_Model {


public function mlistpelanggan() {
$data = $this->db->order_by('idpelanggan','DESC')
->get('tbpelanggan');
return $data;

}
public function mlistproduk() {

$data = $this->db->get('tbproduk');
return $data ;
//return $this->db->get('tbproduk');

}

public function mlistorders() {
$data = $this->db->query("select    b.idorders,
        a.namapelanggan,
a.kotapelanggan,
c.namaproduk,
c.harga,
b.jumlahorder,
(c.harga * b.jumlahorder) as total,
b.tglorder
from tbpelanggan a join tborders b
        on a.idpelanggan = b.idpelanggan
join tbproduk as c
on b.idproduk = c.idproduk
order by b.idorders desc");
return $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