/** * ambil data dari database berdasarkan where * @param $ndbase,$tdbase,$wheres * @return array */ public function ambilDetail($tdbase, $ndbase, $wheres) { $dbConn = new DBConnection(); $i = new dbHandler($dbConn, $ndbase); $sql = "SELECT " . $tdbase . " FROM " . $ndbase . " WHERE " . $wheres . " "; $details = $i->getBySQL($sql); return $details; }
public function perusahaan() { $dbConn = new DBConnection(); $i = new dbHandler($dbConn, 'perusahaan'); $sql = "select id, Nama, Alamat, Kota, Telp, Email, Note from perusahaan "; $perusahaan = $i->getBySQL($sql); return $perusahaan; }
/** * Get invoice items from database based on invoice Id passed * @param $id * @param $rawData - Should we use the html markup or just pass back the raw data * @return string */ public function getInvItems($id) { $dbConn = new DBConnection(); $i = new dbHandler($dbConn, 'inv_items'); $sql = "select ii.itemId, ii.qty, ii.poNumber, ii.itemDisc, ii.itemUkuran, inv.itemCode, inv.itemName, inv.itemDesc, inv.itemPrice, inv.satuan, inv.itemSize, round(sum((inv.itemPrice * ii.qty ) - (inv.itemPrice * ii.qty * ii.itemDisc * 0.01) ), 2) as lineTotal from inv_items as ii join items as inv on inv.id = ii.itemId where ii.invId = " . $id . " group by ii.id"; $items = $i->getBySQL($sql); return $items; }