Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Kasir_Model extends MY_model
- {
- public function __construct()
- {
- parent::__construct();
- }
- public function getAllBarang()
- {
- $this->db->select('*');
- $this->db->from('barang');
- return $this->db->get();
- }
- public function getBarang($kode)
- {
- $this->db->where('kode', $kode);
- $this->db->select('*');
- $this->db->from('barang');
- return $this->db->get();
- }
- public function addBarang($barang)
- {
- $this->db->insert('barang', $barang);
- }
- public function updateBarang($barang, $kondisi)
- {
- $this->db->where($kondisi);
- $this->db->update('barang', $barang);
- }
- public function deleteBarang($kode)
- {
- $this->db->where('kode', $kode);
- $this->db->delete('barang');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment