tripsdoc

Kasir_Model.php

Dec 12th, 2016
414
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. <?php
  2.  
  3. class Kasir_Model extends MY_model
  4. {
  5.     public function __construct()
  6.     {
  7.         parent::__construct();
  8.     }
  9.     public function getAllBarang()
  10.     {
  11.         $this->db->select('*');
  12.         $this->db->from('barang');
  13.        
  14.         return $this->db->get();
  15.     }
  16.     public function getBarang($kode)
  17.     {
  18.         $this->db->where('kode', $kode);
  19.         $this->db->select('*');
  20.         $this->db->from('barang');
  21.        
  22.         return $this->db->get();
  23.     }
  24.     public function addBarang($barang)
  25.     {
  26.         $this->db->insert('barang', $barang);
  27.     }
  28.     public function updateBarang($barang, $kondisi)
  29.     {
  30.         $this->db->where($kondisi);
  31.         $this->db->update('barang', $barang);
  32.     }
  33.     public function deleteBarang($kode)
  34.     {
  35.         $this->db->where('kode', $kode);
  36.         $this->db->delete('barang');
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment