copy dari repo om Irfan
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class GudangHarddiskModel extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataGHarddisk($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('hdd');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('hdd');
|
||||
$this->db->where(['ID_HDD' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class JabatanModel extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataJabatan($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('jabatan');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('jabatan');
|
||||
$this->db->where(['id_jabatan' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class JenisModel extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataJenis($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('processor');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('processor');
|
||||
$this->db->where(['ID_PROCESSOR' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
class KaryawanModel extends CI_Model
|
||||
{
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if ($batch === false) {
|
||||
$insert = $this->db->insert($table, $data);
|
||||
} else {
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if ($batch === false) {
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
} else {
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataKaryawan($id = null)
|
||||
{
|
||||
if ($id === null) {
|
||||
$this->db->select('*, b.NAMA_JABATAN');
|
||||
$this->db->from('karyawan a');
|
||||
$this->db->join('jabatan b', 'b.ID_JABATAN=a.JABATAN_ID');
|
||||
} else {
|
||||
$this->db->select('*, b.NAMA_JABATAN');
|
||||
$this->db->from('karyawan a');
|
||||
$this->db->join('jabatan b', 'b.ID_JABATAN=a.JABATAN_ID');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,265 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelAccounting extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataAccounting($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('accounting');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('accounting');
|
||||
$this->db->where(['ID_ACCOUNTING' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDAccountingMax(){
|
||||
$this->db->select_max('ID_ACCOUNTING');
|
||||
$this->db->from('accounting');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPembelianHarga($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_SJBELI,"%d %M %Y")) AS WAKTU');
|
||||
$this->db->from('pembelian a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID','left');
|
||||
$this->db->join('kota c','c.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->where('a.STATUS_PEMBELIAN="SJ SUDAH PROSES"');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_SJBELI,"%d %M %Y")) AS WAKTU');
|
||||
$this->db->from('pembelian a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID','left');
|
||||
$this->db->join('kota c','c.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->where(['a.ID_PEMBELIAN' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPembelianStock($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_SJBELI,"%d %M %Y")) AS WAKTU');
|
||||
$this->db->from('pembelian a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID','left');
|
||||
$this->db->join('kota c','c.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->join('stock d','d.PEMBELIAN_ID=a.ID_PEMBELIAN','left');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_SJBELI,"%d %M %Y")) AS WAKTU');
|
||||
$this->db->from('pembelian a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID','left');
|
||||
$this->db->join('kota c','c.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->join('stock d','d.PEMBELIAN_ID=a.ID_PEMBELIAN','left');
|
||||
$this->db->where(['a.ID_PEMBELIAN' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getStock($id = null) {
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('stock a');
|
||||
$this->db->join('barang b', 'b.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->where(['a.ID_STOCK' => $id]);
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('stock a');
|
||||
$this->db->join('barang b', 'b.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->where(['a.ID_STOCK' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataTambahStock($id)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('pembelian a');
|
||||
$this->db->join('stock b', 'b.PEMBELIAN_ID=a.ID_PEMBELIAN');
|
||||
$this->db->join('barang c', 'c.ID_BARANG=b.BARANG_ID');
|
||||
$this->db->join('jenis d', 'd.ID_JENIS=c.JENIS_ID');
|
||||
$this->db->join('gudang e', 'e.ID_GUDANG=b.GUDANG_ID');
|
||||
$this->db->join('sn f', 'f.STOCK_ID=b.ID_STOCK','left');
|
||||
$this->db->where(['a.ID_PEMBELIAN' => $id]);
|
||||
$this->db->group_by('b.ID_STOCK');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getPembelianHarga($id)
|
||||
{
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(f.DPP_BELI_SATUAN,0)) as SATUAN,CONCAT("Rp ",FORMAT(f.DPP_BELI_TOTAL,0)) as JUMLAH');
|
||||
$this->db->from('pembelian a');
|
||||
$this->db->join('stock b', 'b.PEMBELIAN_ID=a.ID_PEMBELIAN');
|
||||
$this->db->join('barang c', 'c.ID_BARANG=b.BARANG_ID');
|
||||
$this->db->join('jenis d', 'd.ID_JENIS=c.JENIS_ID');
|
||||
$this->db->join('gudang e', 'e.ID_GUDANG=b.GUDANG_ID');
|
||||
$this->db->join('harga f', 'f.STOCK_ID=b.ID_STOCK','left');
|
||||
$this->db->where(['a.ID_PEMBELIAN' => $id]);
|
||||
$this->db->group_by('b.ID_STOCK');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getStockID($id)
|
||||
{
|
||||
$this->db->select('a.*, b.KODE_BARANG, b.NAMA_BARANG,b.QTY_REAL,c.TYPE_JENIS');
|
||||
$this->db->from('stock a');
|
||||
$this->db->join('barang b', 'b.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('jenis c', 'c.ID_JENIS=b.JENIS_ID');
|
||||
$this->db->where(['a.ID_STOCK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getStockTitle($id)
|
||||
{
|
||||
$this->db->select('b.NAMA_BARANG');
|
||||
$this->db->from('stock a');
|
||||
$this->db->join('barang b', 'b.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->where(['a.ID_STOCK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getStockHarga($id)
|
||||
{
|
||||
$this->db->select('a.*, b.KODE_BARANG, b.NAMA_BARANG');
|
||||
$this->db->from('stock a');
|
||||
$this->db->join('barang b', 'b.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('harga c', 'c.STOCK_ID=a.ID_STOCK');
|
||||
$this->db->where(['a.ID_STOCK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getQtyPembelian($id)
|
||||
{
|
||||
$this->db->select('QTY,BLOCKADDSN');
|
||||
$this->db->from('stock');
|
||||
$this->db->where(['ID_STOCK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getQtyPembelianSn($id)
|
||||
{
|
||||
$this->db->select('b.ID_SN');
|
||||
$this->db->from('stock a');
|
||||
$this->db->join('sn b','b.STOCK_ID=a.ID_STOCK');
|
||||
$this->db->where(['ID_STOCK' => $id]);
|
||||
return $this->db->count_all_results();
|
||||
}
|
||||
|
||||
public function getStockSn($id)
|
||||
{
|
||||
$this->db->select('b.ID_STOCK');
|
||||
$this->db->from('pembelian a');
|
||||
$this->db->join('stock b','b.PEMBELIAN_ID=a.ID_PEMBELIAN');
|
||||
$this->db->join('sn c','c.STOCK_ID=b.ID_STOCK');
|
||||
$this->db->where(['a.ID_PEMBELIAN' => $id]);
|
||||
$this->db->group_by('b.ID_STOCK');
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockAddSn($id)
|
||||
{
|
||||
$this->db->select('a.ID_SN');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('stock b','b.ID_STOCK=a.STOCK_ID');
|
||||
$this->db->where(['b.ID_STOCK' => $id]);
|
||||
|
||||
return $this->db->count_all_results();
|
||||
}
|
||||
|
||||
public function getQtyStockSn($id)
|
||||
{
|
||||
$this->db->select('a.ID_SN');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('stock b','b.ID_STOCK=a.STOCK_ID');
|
||||
$this->db->join('pembelian c','c.ID_PEMBELIAN=b.PEMBELIAN_ID');
|
||||
$this->db->where(['b.ID_STOCK' => $id]);
|
||||
|
||||
return $this->db->count_all_results();
|
||||
}
|
||||
|
||||
public function getDataSn($id)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('sn');
|
||||
$this->db->where(['STOCK_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDetailPembelianID($id)
|
||||
{
|
||||
$this->db->select('STOCK_ID');
|
||||
$this->db->from('sn');
|
||||
$this->db->where(['ID_SN' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getSJPembelian($id)
|
||||
{
|
||||
$this->db->select('SJ_PEMBELIAN');
|
||||
$this->db->from('pembelian');
|
||||
$this->db->where(['ID_PEMBELIAN' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getGudangSN()
|
||||
{
|
||||
$this->db->select_max('ID_SN');
|
||||
$this->db->from('sn');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getStockHargaID()
|
||||
{
|
||||
$this->db->select_max('ID_HARGA');
|
||||
$this->db->from('harga');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getGudangStock($id)
|
||||
{
|
||||
$this->db->select('b.GUDANG_ID');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('stock b','b.ID_STOCK=a.STOCK_ID');
|
||||
$this->db->where(['a.ID_SN' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBarangStock($id)
|
||||
{
|
||||
$this->db->select('b.BARANG_ID,b.BLOCKADDSN,c.QTY_REAL');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('stock b','b.ID_STOCK=a.STOCK_ID');
|
||||
$this->db->join('barang c','c.ID_BARANG=b.BARANG_ID');
|
||||
$this->db->where(['b.ID_STOCK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelAdminGudang extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataAdminGudang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('admingudang');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('admingudang');
|
||||
$this->db->where(['ID_ADMINGUDANG' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelAkun extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getData_Akun($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('akun');
|
||||
$this->db->order_by('NAMA_AKUN ASC');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('akun');
|
||||
$this->db->where(['ID_AKUN' => $id]);
|
||||
$this->db->order_by('NAMA_AKUN ASC');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Kontak_byAKUN($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('kontak a');
|
||||
$this->db->join('akun b','b.ID_AKUN=a.AKUN_ID');
|
||||
$this->db->where(['a.AKUN_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,150 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelBank extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getData_Bank($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('bank');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('bank');
|
||||
$this->db->where(['ID_BANK' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_SaldoBank_byBANK_byTGL($id1,$id2){
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT((SUM(a.DEBET_SB)),2)) as DEBET,CONCAT("Rp ",FORMAT((SUM(a.KREDIT_SB)),2)) as KREDIT,CONCAT("Rp ",FORMAT((SUM(a.DEBET_SB-a.KREDIT_SB)),2)) as TOTAL');
|
||||
$this->db->from('saldo_bank a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID');
|
||||
$this->db->where(['a.BANK_ID' => $id1]);
|
||||
$this->db->where('a.TGL_SB="'.$id2.'"');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Bank_forDkb($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('bank');
|
||||
$this->db->where('ID_BANK !=', $id);
|
||||
$this->db->order_by('KODE_BANK ASC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_SaldoBank_byBANK($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('saldo_bank');
|
||||
$this->db->where(['BANK_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Kasbank_byBANK($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('kasbank');
|
||||
$this->db->where(['BANK_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBankDbank(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('bank a');
|
||||
$this->db->join('detail_bank b','b.BANK_ID=a.ID_BANK','left');
|
||||
$this->db->where('b.BANK_ID is NULL');
|
||||
$this->db->order_by('a.NAMA_BANK','ASC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBankDetail($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(SALDO_BANK,2)) as SALDO,CONCAT("Rp ",FORMAT(HUTANG_BANK,2)) as HUTANG');
|
||||
$this->db->from('bank');
|
||||
$this->db->order_by('NAMA_BANK','ASC');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(SALDO_BANK,2)) as SALDO,CONCAT("Rp ",FORMAT(HUTANG_BANK,2)) as HUTANG');
|
||||
$this->db->from('bank');
|
||||
$this->db->where(['ID_BANK' => $id]);
|
||||
$this->db->order_by('NAMA_BANK','ASC');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDBANK() {
|
||||
$this->db->select('MAX(KODE_DBANK) AS KODE');
|
||||
$this->db->from('detail_bank');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDetailBank($id=null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(b.SALDO_BANK,2)) as SALDO,CONCAT("Rp ",FORMAT(a.DEBIT_DBANK,2)) as DEBIT');
|
||||
$this->db->from('detail_bank a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->group_by('a.ID_DBANK');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(b.SALDO_BANK,2)) as SALDO,CONCAT("Rp ",FORMAT(a.DEBIT_DBANK,2)) as DEBIT');
|
||||
$this->db->from('detail_bank a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->group_by('a.ID_DBANK');
|
||||
$this->db->where(['a.BANK_ID' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDetailDbank($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('detail_bank');
|
||||
$this->db->where(['ID_DBANK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Hutang Bank
|
||||
public function getDataHutangBank($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HBA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(b.HUTANG_BANK,2)) as HUTANG,CONCAT("Rp ",FORMAT(a.NOMINAL_HBA,2)) as HBA');
|
||||
$this->db->from('hutang_bank a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->group_by('a.ID_HBA');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HBA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(b.HUTANG_BANK,2)) as HUTANG,CONCAT("Rp ",FORMAT(a.NOMINAL_HBA,2)) as HBA');
|
||||
$this->db->from('hutang_bank a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->group_by('a.ID_HBA');
|
||||
$this->db->where(['a.ID_HBA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeHBA() {
|
||||
$this->db->select('MAX(KODE_HBA) AS KODE');
|
||||
$this->db->from('hutang_bank');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,643 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelBankKeluar extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
//Step One, Input Bank Keluar
|
||||
public function getDataBankKeluar($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_BANKKELUAR,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.KREDIT_BANKKELUAR,2)) as KREDIT');
|
||||
$this->db->from('bankkeluar a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('kasbank_bk c','c.BANKKELUAR_ID=a.ID_BANKKELUAR','left');
|
||||
$this->db->group_by('a.ID_BANKKELUAR');
|
||||
$this->db->where('a.STATUS_BANKKELUAR is NULL');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_BANKKELUAR,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.KREDIT_BANKKELUAR,2)) as KREDIT');
|
||||
$this->db->from('bankkeluar a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('kasbank_bk c','c.BANKKELUAR_ID=a.ID_BANKKELUAR','left');
|
||||
$this->db->group_by('a.ID_BANKKELUAR');
|
||||
$this->db->where('a.STATUS_BANKKELUAR is NULL');
|
||||
$this->db->where(['a.ID_BANKKELUAR' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBankKeluarRev($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_BANKKELUAR,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_BANKKELUAR,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.KREDIT_BANKKELUAR,2)) as KREDIT');
|
||||
$this->db->from('bankkeluar a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('kasbank_bk c','c.BANKKELUAR_ID=a.ID_BANKKELUAR','left');
|
||||
$this->db->group_by('a.ID_BANKKELUAR');
|
||||
$this->db->where('a.STATUS_BANKKELUAR="0"');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_BANKKELUAR,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_BANKKELUAR,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.KREDIT_BANKKELUAR,2)) as KREDIT');
|
||||
$this->db->from('bankkeluar a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('kasbank_bk c','c.BANKKELUAR_ID=a.ID_BANKKELUAR','left');
|
||||
$this->db->group_by('a.ID_BANKKELUAR');
|
||||
$this->db->where('a.STATUS_BANKKELUAR="0"');
|
||||
$this->db->where(['a.ID_BANKKELUAR' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeBankKeluar() {
|
||||
$this->db->select('MAX(KODE_BANKKELUAR) AS KODE');
|
||||
$this->db->from('bankkeluar');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function hapusKasbankBK($id){
|
||||
$this->db->where(['BANKKELUAR_ID' => $id]);
|
||||
$this->db->delete('kasbank_bk');
|
||||
}
|
||||
|
||||
//Step Two, Input Transaksi
|
||||
public function getDataKasbankBK($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_BANKKELUAR,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_BANKKELUAR,2)) as DEBITALL,CONCAT("Rp ",FORMAT(c.NOMINAL_KBBK,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.KREDIT_BANKKELUAR,2)) as KREDIT');
|
||||
$this->db->from('bankkeluar a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('kasbank_bk c','c.BANKKELUAR_ID=a.ID_BANKKELUAR');
|
||||
$this->db->join('perkiraan d','d.ID_PERKIRAAN=c.PERKIRAAN_ID','left');
|
||||
$this->db->group_by('c.ID_KBBK');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_BANKKELUAR,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_BANKKELUAR,2)) as DEBITALL,CONCAT("Rp ",FORMAT(c.NOMINAL_KBBK,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.KREDIT_BANKKELUAR,2)) as KREDIT');
|
||||
$this->db->from('bankkeluar a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('kasbank_bk c','c.BANKKELUAR_ID=a.ID_BANKKELUAR');
|
||||
$this->db->join('perkiraan d','d.ID_PERKIRAAN=c.PERKIRAAN_ID','left');
|
||||
$this->db->where(['a.ID_BANKKELUAR' => $id]);
|
||||
$this->db->group_by('c.ID_KBBK');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTitleBK($id) {
|
||||
$this->db->select('KODE_BANKKELUAR,CONCAT("Rp ",FORMAT(DEBIT_BANKKELUAR,2)) as DEBIT,CONCAT("Rp ",FORMAT(KREDIT_BANKKELUAR,2)) as KREDIT');
|
||||
$this->db->from('bankkeluar');
|
||||
$this->db->where(['ID_BANKKELUAR' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeKasbankBK() {
|
||||
$this->db->select('MAX(KODE_KBBK) AS KODE');
|
||||
$this->db->from('kasbank_bk');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getID_KBBK() {
|
||||
$this->db->select('MAX(ID_KBBK) AS KODE');
|
||||
$this->db->from('kasbank_bk');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDebitData($id) {
|
||||
$this->db->select('a.DEBIT_BANKKELUAR,a.ID_BANKKELUAR,b.NOMINAL_KBBK');
|
||||
$this->db->from('bankkeluar a');
|
||||
$this->db->join('kasbank_bk b','b.BANKKELUAR_ID=a.ID_BANKKELUAR');
|
||||
$this->db->where(['b.ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Step Three, Input Detail
|
||||
public function getTitleKBBK($id) {
|
||||
$this->db->select('KODE_KBBK,BANKKELUAR_ID,CONCAT("Rp ",FORMAT(NOMINAL_KBBK,2)) as DEBIT');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataKBBK($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, KAS
|
||||
public function getSaldoKAS($id) {
|
||||
$this->db->select('SALDO_KAS');
|
||||
$this->db->from('kas');
|
||||
$this->db->where(['ID_KAS' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataKAS($id) {
|
||||
$this->db->select('b.SALDO_KAS,b.ID_KAS');
|
||||
$this->db->from('detail_kas a');
|
||||
$this->db->join('kas b','b.ID_KAS=a.KAS_ID','left');
|
||||
$this->db->where(['ID_DKAS' => $id]);
|
||||
$this->db->group_by('ID_DKAS');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDetailKAS() {
|
||||
$this->db->select('MAX(KODE_DKAS) AS KODE');
|
||||
$this->db->from('detail_kas');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDKAS() {
|
||||
$this->db->select_max('ID_DKAS');
|
||||
$this->db->from('detail_kas');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDKASID($id) {
|
||||
$this->db->select('DKAS_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, BANK
|
||||
public function getSaldoBANK($id) {
|
||||
$this->db->select('SALDO_BANK');
|
||||
$this->db->from('bank');
|
||||
$this->db->where(['ID_BANK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBANK($id) {
|
||||
$this->db->select('b.SALDO_BANK,b.ID_BANK');
|
||||
$this->db->from('detail_bank a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->where(['ID_DBANK' => $id]);
|
||||
$this->db->group_by('ID_DBANK');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDetailBANK() {
|
||||
$this->db->select('MAX(KODE_DBANK) AS KODE');
|
||||
$this->db->from('detail_bank');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDBANK() {
|
||||
$this->db->select_max('ID_DBANK');
|
||||
$this->db->from('detail_bank');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDBANKID($id) {
|
||||
$this->db->select('DBANK_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, DP Pembelian
|
||||
public function getSaldoDPB($id) {
|
||||
$this->db->select('SALDO_SUPPLIER');
|
||||
$this->db->from('supplier');
|
||||
$this->db->where(['ID_SUPPLIER' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataSUP($id) {
|
||||
$this->db->select('b.SALDO_SUPPLIER,b.ID_SUPPLIER');
|
||||
$this->db->from('dp_pembelian a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID','left');
|
||||
$this->db->where(['ID_DPB' => $id]);
|
||||
$this->db->group_by('ID_DPB');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDPB() {
|
||||
$this->db->select('MAX(KODE_DPB) AS KODE');
|
||||
$this->db->from('dp_pembelian');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDPB() {
|
||||
$this->db->select_max('ID_DPB');
|
||||
$this->db->from('dp_pembelian');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDPBID($id) {
|
||||
$this->db->select('DPB_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, DP Pajak
|
||||
public function getSaldoDPP($id) {
|
||||
$this->db->select('SALDO_PAJAK');
|
||||
$this->db->from('pajak');
|
||||
$this->db->where(['ID_PAJAK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPAJ($id) {
|
||||
$this->db->select('b.SALDO_PAJAK,b.ID_PAJAK');
|
||||
$this->db->from('dp_pajak a');
|
||||
$this->db->join('pajak b','b.ID_PAJAK=a.PAJAK_ID','left');
|
||||
$this->db->where(['ID_DPP' => $id]);
|
||||
$this->db->group_by('ID_DPP');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDPP() {
|
||||
$this->db->select('MAX(KODE_DPP) AS KODE');
|
||||
$this->db->from('dp_pajak');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDPP() {
|
||||
$this->db->select_max('ID_DPP');
|
||||
$this->db->from('dp_pajak');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDPPID($id) {
|
||||
$this->db->select('DPP_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Piutang Karyawan
|
||||
public function getKodePiutangKARYAWAN() {
|
||||
$this->db->select('MAX(KODE_PKAR) AS KODE');
|
||||
$this->db->from('piutang_karyawan');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getPiutangKARYAWAN($id) {
|
||||
$this->db->select('HUTANG_KARYAWAN');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDPKAR() {
|
||||
$this->db->select_max('ID_PKAR');
|
||||
$this->db->from('piutang_karyawan');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPKAR($id) {
|
||||
$this->db->select('b.HUTANG_KARYAWAN,b.ID_KARYAWAN');
|
||||
$this->db->from('piutang_karyawan a');
|
||||
$this->db->join('karyawan b','b.ID_KARYAWAN=a.KARYAWAN_ID','left');
|
||||
$this->db->where(['ID_PKAR' => $id]);
|
||||
$this->db->group_by('ID_PKAR');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getPKARID($id) {
|
||||
$this->db->select('PKAR_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Piutang Pihak Ke3
|
||||
public function getKodePiutangPIHAKKE3() {
|
||||
$this->db->select('MAX(KODE_PPI) AS KODE');
|
||||
$this->db->from('piutang_pihakke3');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getPiutangPIHAKKE3($id) {
|
||||
$this->db->select('HUTANG_PIHAKKE3');
|
||||
$this->db->from('pihakke3');
|
||||
$this->db->where(['ID_PIHAKKE3' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDPPI() {
|
||||
$this->db->select_max('ID_PPI');
|
||||
$this->db->from('piutang_pihakke3');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPPI($id) {
|
||||
$this->db->select('b.HUTANG_PIHAKKE3,b.ID_PIHAKKE3');
|
||||
$this->db->from('piutang_pihakke3 a');
|
||||
$this->db->join('pihakke3 b','b.ID_PIHAKKE3=a.PIHAKKE3_ID','left');
|
||||
$this->db->where(['ID_PPI' => $id]);
|
||||
$this->db->group_by('ID_PPI');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getPPIID($id) {
|
||||
$this->db->select('PPI_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Detail Hutang Dagang
|
||||
public function getKodeDetailHDA() {
|
||||
$this->db->select('MAX(KODE_DHDA) AS KODE');
|
||||
$this->db->from('detail_hda');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDHDA() {
|
||||
$this->db->select_max('ID_DHDA');
|
||||
$this->db->from('detail_hda');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockconHDA($id) {
|
||||
$this->db->select('BLOCKCON');
|
||||
$this->db->from('hutang_dagang');
|
||||
$this->db->where(['ID_HDA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDHDAID($id) {
|
||||
$this->db->select('DHDA_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHDA($id) {
|
||||
$this->db->select('b.BLOCKCON,b.ID_HDA,a.KREDIT_DHDA,d.PIUTANG_SUPPLIER,d.ID_SUPPLIER');
|
||||
$this->db->from('detail_hda a');
|
||||
$this->db->join('hutang_dagang b','b.ID_HDA=a.HDA_ID','left');
|
||||
$this->db->join('pembelian c','c.ID_PEMBELIAN=b.PEMBELIAN_ID','left');
|
||||
$this->db->join('supplier d','d.ID_SUPPLIER=c.SUPPLIER_ID','left');
|
||||
$this->db->where(['a.ID_DHDA' => $id]);
|
||||
$this->db->group_by('a.ID_DHDA');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Detail Hutang Pajak
|
||||
public function getKodeDetailHPA() {
|
||||
$this->db->select('MAX(KODE_DHPA) AS KODE');
|
||||
$this->db->from('detail_hpa');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDHPA() {
|
||||
$this->db->select_max('ID_DHPA');
|
||||
$this->db->from('detail_hpa');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockconHPA($id) {
|
||||
$this->db->select('BLOCKCON');
|
||||
$this->db->from('hutang_pajak');
|
||||
$this->db->where(['ID_HPA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDHPAID($id) {
|
||||
$this->db->select('DHPA_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHPA($id) {
|
||||
$this->db->select('b.BLOCKCON,b.ID_HPA,a.KREDIT_DHPA,c.HUTANG_PAJAK,c.ID_PAJAK');
|
||||
$this->db->from('detail_hpa a');
|
||||
$this->db->join('hutang_pajak b','b.ID_HPA=a.HPA_ID','left');
|
||||
$this->db->join('pajak c','c.ID_PAJAK=b.PAJAK_ID','left');
|
||||
$this->db->where(['a.ID_DHPA' => $id]);
|
||||
$this->db->group_by('a.ID_DHPA');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Detail Hutang Bank
|
||||
public function getKodeDetailHBA() {
|
||||
$this->db->select('MAX(KODE_DHBA) AS KODE');
|
||||
$this->db->from('detail_hba');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDHBA() {
|
||||
$this->db->select_max('ID_DHBA');
|
||||
$this->db->from('detail_hba');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockconHBA($id) {
|
||||
$this->db->select('BLOCKCON');
|
||||
$this->db->from('hutang_bank');
|
||||
$this->db->where(['ID_HBA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDHBAID($id) {
|
||||
$this->db->select('DHBA_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHBA($id) {
|
||||
$this->db->select('b.BLOCKCON,b.ID_HBA,a.KREDIT_DHBA,c.HUTANG_BANK,c.SALDO_BANK,c.ID_BANK');
|
||||
$this->db->from('detail_hba a');
|
||||
$this->db->join('hutang_bank b','b.ID_HBA=a.HBA_ID','left');
|
||||
$this->db->join('bank c','c.ID_BANK=b.BANK_ID','left');
|
||||
$this->db->where(['a.ID_DHBA' => $id]);
|
||||
$this->db->group_by('a.ID_DHBA');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Detail Hutang Lain
|
||||
public function getKodeDetailHLA() {
|
||||
$this->db->select('MAX(KODE_DHLA) AS KODE');
|
||||
$this->db->from('detail_hla');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDHLA() {
|
||||
$this->db->select_max('ID_DHLA');
|
||||
$this->db->from('detail_hla');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockconHLA($id) {
|
||||
$this->db->select('BLOCKCON');
|
||||
$this->db->from('hutang_lain');
|
||||
$this->db->where(['ID_HLA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDHLAID($id) {
|
||||
$this->db->select('DHLA_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHLA($id) {
|
||||
$this->db->select('b.BLOCKCON,b.ID_HLA,a.KREDIT_DHLA');
|
||||
$this->db->from('detail_hla a');
|
||||
$this->db->join('hutang_lain b','b.ID_HLA=a.HLA_ID','left');
|
||||
$this->db->where(['a.ID_DHLA' => $id]);
|
||||
$this->db->group_by('a.ID_DHLA');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Detail Biaya Fee
|
||||
public function getKodeDetailBF() {
|
||||
$this->db->select('MAX(KODE_DBF) AS KODE');
|
||||
$this->db->from('detail_bf');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDBF() {
|
||||
$this->db->select_max('ID_DBF');
|
||||
$this->db->from('detail_bf');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockconBF($id) {
|
||||
$this->db->select('BLOCKCON');
|
||||
$this->db->from('biaya_fee');
|
||||
$this->db->where(['ID_BF' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDBFID($id) {
|
||||
$this->db->select('DBF_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBF($id) {
|
||||
$this->db->select('b.BLOCKCON,b.ID_BF,a.KREDIT_DBF');
|
||||
$this->db->from('detail_bf a');
|
||||
$this->db->join('biaya_fee b','b.ID_BF=a.BF_ID','left');
|
||||
$this->db->where(['a.ID_DBF' => $id]);
|
||||
$this->db->group_by('a.ID_DBF');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Biaya Pengiriman
|
||||
public function getKodeDetailBP() {
|
||||
$this->db->select('MAX(KODE_DBP) AS KODE');
|
||||
$this->db->from('detail_bp');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDBP() {
|
||||
$this->db->select_max('ID_DBP');
|
||||
$this->db->from('detail_bp');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockkreBP($id) {
|
||||
$this->db->select('BLOCKKRE_BP');
|
||||
$this->db->from('biaya_pengiriman');
|
||||
$this->db->where(['ID_BP' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDBPID($id) {
|
||||
$this->db->select('DBP_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBP($id) {
|
||||
$this->db->select('a.KODE_BP,a.ID_BP,b.ID_PENJUALAN,a.NOMINAL_BP,a.BLOCKDEB_BP,a.BLOCKKRE_BP,c.KREDIT_DBP');
|
||||
$this->db->from('biaya_pengiriman a');
|
||||
$this->db->join('penjualan b','b.ID_PENJUALAN=a.PENJUALAN_ID','left');
|
||||
$this->db->join('detail_bp c','c.BP_ID=a.ID_BP','left');
|
||||
$this->db->where(['c.ID_DBP' => $id]);
|
||||
$this->db->group_by('a.ID_BP');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Biaya Service Kendaraan
|
||||
public function getKodeDetailBSK() {
|
||||
$this->db->select('MAX(KODE_DBSK) AS KODE');
|
||||
$this->db->from('detail_bsk');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDBSK() {
|
||||
$this->db->select_max('ID_DBSK');
|
||||
$this->db->from('detail_bsk');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDBSKID($id) {
|
||||
$this->db->select('DBSK_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBSK($id) {
|
||||
$this->db->select('a.KODE_BSK,a.ID_BSK,b.ID_KENDARAAN,a.NOMINAL_BSK');
|
||||
$this->db->from('biaya_sk a');
|
||||
$this->db->join('kendaraan b','b.ID_KENDARAAN=a.KENDARAAN_ID','left');
|
||||
$this->db->where(['a.ID_BSK' => $id]);
|
||||
$this->db->group_by('a.ID_BSK');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Biaya Bensin
|
||||
public function getKodeDetailBB() {
|
||||
$this->db->select('MAX(KODE_DBB) AS KODE');
|
||||
$this->db->from('detail_bb');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDBB() {
|
||||
$this->db->select_max('ID_DBB');
|
||||
$this->db->from('detail_bb');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDBBID($id) {
|
||||
$this->db->select('DBB_ID');
|
||||
$this->db->from('kasbank_bk');
|
||||
$this->db->where(['ID_KBBK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBB($id) {
|
||||
$this->db->select('a.KODE_BB,a.ID_BB,b.ID_KENDARAAN,c.ID_KARYAWAN,a.NOMINAL_BB');
|
||||
$this->db->from('biaya_bensin a');
|
||||
$this->db->join('kendaraan b','b.ID_KENDARAAN=a.KENDARAAN_ID','left');
|
||||
$this->db->join('karyawan c','c.ID_KARYAWAN=a.KARYAWAN_ID','left');
|
||||
$this->db->where(['a.ID_BB' => $id]);
|
||||
$this->db->group_by('a.ID_BB');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,460 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelBankMasuk extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
//Step One, Input Bank Masuk
|
||||
public function getDataBankMasuk($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_BANKMASUK,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_BANKMASUK,2)) as DEBIT');
|
||||
$this->db->from('bankmasuk a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('kasbank_bm c','c.BANKMASUK_ID=a.ID_BANKMASUK','left');
|
||||
$this->db->group_by('a.ID_BANKMASUK');
|
||||
$this->db->where('a.STATUS_BANKMASUK is NULL');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_BANKMASUK,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_BANKMASUK,2)) as DEBIT');
|
||||
$this->db->from('bankmasuk a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('kasbank_bm c','c.BANKMASUK_ID=a.ID_BANKMASUK','left');
|
||||
$this->db->group_by('a.ID_BANKMASUK');
|
||||
$this->db->where('a.STATUS_BANKMASUK is NULL');
|
||||
$this->db->where(['a.ID_BANKMASUK' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBankMasukRev($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_BANKMASUK,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_BANKMASUK,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.KREDIT_BANKMASUK,2)) as KREDIT');
|
||||
$this->db->from('bankmasuk a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('kasbank_bm c','c.BANKMASUK_ID=a.ID_BANKMASUK','left');
|
||||
$this->db->group_by('a.ID_BANKMASUK');
|
||||
$this->db->where('a.STATUS_BANKMASUK="0"');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_BANKMASUK,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_BANKMASUK,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.KREDIT_BANKMASUK,2)) as KREDIT');
|
||||
$this->db->from('bankmasuk a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('kasbank_bm c','c.BANKMASUK_ID=a.ID_BANKMASUK','left');
|
||||
$this->db->group_by('a.ID_BANKMASUK');
|
||||
$this->db->where('a.STATUS_BANKMASUK="0"');
|
||||
$this->db->where(['a.ID_BANKMASUK' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeBankMasuk() {
|
||||
$this->db->select('MAX(KODE_BANKMASUK) AS KODE');
|
||||
$this->db->from('bankmasuk');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function hapusKasbankBM($id){
|
||||
$this->db->where(['BANKMASUK_ID' => $id]);
|
||||
$this->db->delete('kasbank_bm');
|
||||
}
|
||||
|
||||
//Step Two, Input Transaksi
|
||||
public function getDataKasbankBM($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_BANKMASUK,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_BANKMASUK,2)) as DEBIT,CONCAT("Rp ",FORMAT(c.NOMINAL_KBBM,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.KREDIT_BANKMASUK,2)) as KREDITALL');
|
||||
$this->db->from('bankmasuk a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('kasbank_bm c','c.BANKMASUK_ID=a.ID_BANKMASUK');
|
||||
$this->db->join('perkiraan d','d.ID_PERKIRAAN=c.PERKIRAAN_ID','left');
|
||||
$this->db->group_by('c.ID_KBBM');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_BANKMASUK,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_BANKMASUK,2)) as DEBIT,CONCAT("Rp ",FORMAT(c.NOMINAL_KBBM,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.KREDIT_BANKMASUK,2)) as KREDITALL');
|
||||
$this->db->from('bankmasuk a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('kasbank_bm c','c.BANKMASUK_ID=a.ID_BANKMASUK');
|
||||
$this->db->join('perkiraan d','d.ID_PERKIRAAN=c.PERKIRAAN_ID','left');
|
||||
$this->db->where(['a.ID_BANKMASUK' => $id]);
|
||||
$this->db->group_by('c.ID_KBBM');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTitleBM($id) {
|
||||
$this->db->select('KODE_BANKMASUK,CONCAT("Rp ",FORMAT(DEBIT_BANKMASUK,2)) as DEBIT,CONCAT("Rp ",FORMAT(KREDIT_BANKMASUK,2)) as KREDIT');
|
||||
$this->db->from('bankmasuk');
|
||||
$this->db->where(['ID_BANKMASUK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeKasbankBM() {
|
||||
$this->db->select('MAX(KODE_KBBM) AS KODE');
|
||||
$this->db->from('kasbank_bm');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getID_KBBM() {
|
||||
$this->db->select('MAX(ID_KBBM) AS KODE');
|
||||
$this->db->from('kasbank_bm');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKreditData($id) {
|
||||
$this->db->select('a.KREDIT_BANKMASUK,a.ID_BANKMASUK,b.NOMINAL_KBBM');
|
||||
$this->db->from('bankmasuk a');
|
||||
$this->db->join('kasbank_bm b','b.BANKMASUK_ID=a.ID_BANKMASUK');
|
||||
$this->db->where(['b.ID_KBBM' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Step Three, Input Detail
|
||||
public function getTitleKBBM($id) {
|
||||
$this->db->select('KODE_KBBM,BANKMASUK_ID,CONCAT("Rp ",FORMAT(NOMINAL_KBBM,2)) as KREDIT');
|
||||
$this->db->from('kasbank_bm');
|
||||
$this->db->where(['ID_KBBM' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataKBBM($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('kasbank_bm');
|
||||
$this->db->where(['ID_KBBM' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, KAS
|
||||
public function getSaldoKAS($id) {
|
||||
$this->db->select('SALDO_KAS');
|
||||
$this->db->from('kas');
|
||||
$this->db->where(['ID_KAS' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataKAS($id) {
|
||||
$this->db->select('b.SALDO_KAS,b.ID_KAS');
|
||||
$this->db->from('detail_kas a');
|
||||
$this->db->join('kas b','b.ID_KAS=a.KAS_ID','left');
|
||||
$this->db->where(['ID_DKAS' => $id]);
|
||||
$this->db->group_by('ID_DKAS');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDetailKAS() {
|
||||
$this->db->select('MAX(KODE_DKAS) AS KODE');
|
||||
$this->db->from('detail_kas');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDKAS() {
|
||||
$this->db->select_max('ID_DKAS');
|
||||
$this->db->from('detail_kas');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDKASID($id) {
|
||||
$this->db->select('DKAS_ID');
|
||||
$this->db->from('kasbank_bm');
|
||||
$this->db->where(['ID_KBBM' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, BANK
|
||||
public function getSaldoBANK($id) {
|
||||
$this->db->select('SALDO_BANK');
|
||||
$this->db->from('bank');
|
||||
$this->db->where(['ID_BANK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBANK($id) {
|
||||
$this->db->select('b.SALDO_BANK,b.ID_BANK');
|
||||
$this->db->from('detail_bank a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->where(['ID_DBANK' => $id]);
|
||||
$this->db->group_by('ID_DBANK');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDetailBANK() {
|
||||
$this->db->select('MAX(KODE_DBANK) AS KODE');
|
||||
$this->db->from('detail_bank');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDBANK() {
|
||||
$this->db->select_max('ID_DBANK');
|
||||
$this->db->from('detail_bank');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDBANKID($id) {
|
||||
$this->db->select('DBANK_ID');
|
||||
$this->db->from('kasbank_bm');
|
||||
$this->db->where(['ID_KBBM' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, DP Penjualan
|
||||
public function getSaldoDPJ($id) {
|
||||
$this->db->select('SALDO_PELANGGAN');
|
||||
$this->db->from('pelanggan');
|
||||
$this->db->where(['ID_PELANGGAN' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPEL($id) {
|
||||
$this->db->select('b.SALDO_PELANGGAN,b.ID_PELANGGAN');
|
||||
$this->db->from('dp_penjualan a');
|
||||
$this->db->join('pelanggan b','b.ID_PELANGGAN=a.PELANGGAN_ID','left');
|
||||
$this->db->where(['ID_DPJ' => $id]);
|
||||
$this->db->group_by('ID_DPJ');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDPJ() {
|
||||
$this->db->select('MAX(KODE_DPJ) AS KODE');
|
||||
$this->db->from('dp_penjualan');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDPJ() {
|
||||
$this->db->select_max('ID_DPJ');
|
||||
$this->db->from('dp_penjualan');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDPJID($id) {
|
||||
$this->db->select('DPJ_ID');
|
||||
$this->db->from('kasbank_bm');
|
||||
$this->db->where(['ID_KBBM' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Hutang BANK
|
||||
public function getKodeHutangBANK() {
|
||||
$this->db->select('MAX(KODE_HBA) AS KODE');
|
||||
$this->db->from('hutang_bank');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getHutangSaldoBANK($id) {
|
||||
$this->db->select('HUTANG_BANK,SALDO_BANK');
|
||||
$this->db->from('bank');
|
||||
$this->db->where(['ID_BANK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDHBA() {
|
||||
$this->db->select_max('ID_HBA');
|
||||
$this->db->from('hutang_bank');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHBA($id) {
|
||||
$this->db->select('b.HUTANG_BANK,b.SALDO_BANK,b.ID_BANK');
|
||||
$this->db->from('hutang_bank a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->where(['ID_HBA' => $id]);
|
||||
$this->db->group_by('ID_HBA');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getHBAID($id) {
|
||||
$this->db->select('HBA_ID');
|
||||
$this->db->from('kasbank_bm');
|
||||
$this->db->where(['ID_KBBM' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Hutang LAIN
|
||||
public function getKodeHutangLAIN() {
|
||||
$this->db->select('MAX(KODE_HLA) AS KODE');
|
||||
$this->db->from('hutang_lain');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDHLA() {
|
||||
$this->db->select_max('ID_HLA');
|
||||
$this->db->from('hutang_lain');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getHLAID($id) {
|
||||
$this->db->select('HLA_ID');
|
||||
$this->db->from('kasbank_bm');
|
||||
$this->db->where(['ID_KBBM' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Detail Piutang Karyawan
|
||||
public function getKodeDetailPKAR() {
|
||||
$this->db->select('MAX(KODE_DPKAR) AS KODE');
|
||||
$this->db->from('detail_pkar');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDPKAR() {
|
||||
$this->db->select_max('ID_DPKAR');
|
||||
$this->db->from('detail_pkar');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockconPKAR($id) {
|
||||
$this->db->select('BLOCKCON');
|
||||
$this->db->from('piutang_karyawan');
|
||||
$this->db->where(['ID_PKAR' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDPKARID($id) {
|
||||
$this->db->select('DPKAR_ID');
|
||||
$this->db->from('kasbank_bm');
|
||||
$this->db->where(['ID_KBBM' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPKAR($id) {
|
||||
$this->db->select('b.BLOCKCON,b.ID_PKAR,a.DEBIT_DPKAR,c.HUTANG_KARYAWAN,c.ID_KARYAWAN');
|
||||
$this->db->from('detail_pkar a');
|
||||
$this->db->join('piutang_karyawan b','b.ID_PKAR=a.PKAR_ID','left');
|
||||
$this->db->join('karyawan c','c.ID_KARYAWAN=b.KARYAWAN_ID','left');
|
||||
$this->db->where(['a.ID_DPKAR' => $id]);
|
||||
$this->db->group_by('a.ID_DPKAR');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Detail Piutang Pihak Ke3
|
||||
public function getKodeDetailPPI() {
|
||||
$this->db->select('MAX(KODE_DPPI) AS KODE');
|
||||
$this->db->from('detail_ppi');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDPPI() {
|
||||
$this->db->select_max('ID_DPPI');
|
||||
$this->db->from('detail_ppi');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockconPPI($id) {
|
||||
$this->db->select('BLOCKCON');
|
||||
$this->db->from('piutang_pihakke3');
|
||||
$this->db->where(['ID_PPI' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDPPIID($id) {
|
||||
$this->db->select('DPPI_ID');
|
||||
$this->db->from('kasbank_bm');
|
||||
$this->db->where(['ID_KBBM' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPPI($id) {
|
||||
$this->db->select('b.BLOCKCON,b.ID_PPI,a.DEBIT_DPPI,c.ID_PIHAKKE3,c.HUTANG_PIHAKKE3');
|
||||
$this->db->from('detail_ppi a');
|
||||
$this->db->join('piutang_pihakke3 b','b.ID_PPI=a.PPI_ID','left');
|
||||
$this->db->join('pihakke3 c','c.ID_PIHAKKE3=b.PIHAKKE3_ID','left');
|
||||
$this->db->where(['a.ID_DPPI' => $id]);
|
||||
$this->db->group_by('a.ID_DPPI');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Detail Piutang Dagang
|
||||
public function getKodeDetailPDA() {
|
||||
$this->db->select('MAX(KODE_DPDA) AS KODE');
|
||||
$this->db->from('detail_pda');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDPDA() {
|
||||
$this->db->select_max('ID_DPDA');
|
||||
$this->db->from('detail_pda');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockconPDA($id) {
|
||||
$this->db->select('BLOCKCON');
|
||||
$this->db->from('piutang_dagang');
|
||||
$this->db->where(['ID_PDA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDPDAID($id) {
|
||||
$this->db->select('DPDA_ID');
|
||||
$this->db->from('kasbank_bm');
|
||||
$this->db->where(['ID_KBBM' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPDA($id) {
|
||||
$this->db->select('b.BLOCKCON,b.ID_PDA,a.DEBIT_DPDA,c.ID_PENJUALAN,d.ID_PELANGGAN,d.HUTANG_PELANGGAN');
|
||||
$this->db->from('detail_pda a');
|
||||
$this->db->join('piutang_dagang b','b.ID_PDA=a.PDA_ID','left');
|
||||
$this->db->join('penjualan c','c.ID_PENJUALAN=b.PENJUALAN_ID','left');
|
||||
$this->db->join('pelanggan d','d.ID_PELANGGAN=c.PELANGGAN_ID','left');
|
||||
$this->db->where(['a.ID_DPDA' => $id]);
|
||||
$this->db->group_by('a.ID_DPDA');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Biaya Pengiriman
|
||||
public function getKodeDetailBP() {
|
||||
$this->db->select('MAX(KODE_DBP) AS KODE');
|
||||
$this->db->from('detail_bp');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDBP() {
|
||||
$this->db->select_max('ID_DBP');
|
||||
$this->db->from('detail_bp');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockdebBP($id) {
|
||||
$this->db->select('BLOCKDEB_BP');
|
||||
$this->db->from('biaya_pengiriman');
|
||||
$this->db->where(['ID_BP' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDBPID($id) {
|
||||
$this->db->select('DBP_ID');
|
||||
$this->db->from('kasbank_bm');
|
||||
$this->db->where(['ID_KBBM' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBP($id) {
|
||||
$this->db->select('a.KODE_BP,a.ID_BP,b.ID_PENJUALAN,a.NOMINAL_BP,a.BLOCKDEB_BP,a.BLOCKKRE_BP,c.DEBIT_DBP');
|
||||
$this->db->from('biaya_pengiriman a');
|
||||
$this->db->join('penjualan b','b.ID_PENJUALAN=a.PENJUALAN_ID','left');
|
||||
$this->db->join('detail_bp c','c.BP_ID=a.ID_BP','left');
|
||||
$this->db->where(['c.ID_DBP' => $id]);
|
||||
$this->db->group_by('a.ID_BP');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,358 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelBankMasuk extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataBankMasuk($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_BANKMASUK,"%d %M %Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_BANKMASUK,2)) as DEBIT');
|
||||
$this->db->from('bankmasuk a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('debit c','c.DEBIT_ID=a.ID_BANKMASUK','left');
|
||||
$this->db->group_by('a.ID_BANKMASUK');
|
||||
$this->db->where('a.STATUS_BANKMASUK is NULL');
|
||||
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_BANKMASUK,"%d %M %Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_BANKMASUK,2)) as DEBIT');
|
||||
$this->db->from('bankmasuk a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('debit c','c.DEBIT_ID=a.ID_BANKMASUK','left');
|
||||
$this->db->where(['a.ID_BANKMASUK' => $id]);
|
||||
$this->db->group_by('a.ID_BANKMASUK');
|
||||
$this->db->where('a.STATUS_BANKMASUK is NULL');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBankMasukRelasi($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_BANKMASUK,"%d %M %Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_BANKMASUK,2)) as DEBIT,CONCAT("Rp ",FORMAT(c.KREDIT_RELASI,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDITALL');
|
||||
$this->db->from('bankmasuk a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('debit c','c.DEBIT_ID=a.ID_BANKMASUK');
|
||||
$this->db->join('neraca d','d.ID_NERACA=c.NERACA_ID','left');
|
||||
$this->db->join('link e','e.DEBIT_ID=c.ID_DEBIT','left');
|
||||
$this->db->group_by('c.ID_DEBIT');
|
||||
$this->db->where('c.TYPE_DEBIT="Bank"');
|
||||
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_BANKMASUK,"%d %M %Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_BANKMASUK,2)) as DEBIT,CONCAT("Rp ",FORMAT(c.KREDIT_RELASI,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDITALL');
|
||||
$this->db->from('bankmasuk a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('debit c','c.DEBIT_ID=a.ID_BANKMASUK');
|
||||
$this->db->join('neraca d','d.ID_NERACA=c.NERACA_ID','left');
|
||||
$this->db->join('link e','e.DEBIT_ID=c.ID_DEBIT','left');
|
||||
$this->db->where(['a.ID_BANKMASUK' => $id]);
|
||||
$this->db->where('c.TYPE_DEBIT="Bank"');
|
||||
$this->db->group_by('c.ID_DEBIT');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getRelasiLink($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,d.NAMA_KARYAWAN as KARKAR,g.NAMA_KARYAWAN as KARKEN,l.NAMA_KOTA as KOTA_PEL,m.NAMA_KOTA as KOTA_TP,n.NAMA_KOTA as KOTA_SUP');
|
||||
$this->db->from('link a');
|
||||
$this->db->join('debit b','b.ID_DEBIT=a.DEBIT_ID');
|
||||
$this->db->join('bank c','c.ID_BANK=a.TARGET1_ID');
|
||||
$this->db->join('karyawan d','d.ID_KARYAWAN=a.TARGET1_ID');
|
||||
$this->db->join('kas e','e.ID_KAS=a.TARGET1_ID');
|
||||
$this->db->join('kendaraan f','f.ID_KENDARAAN=a.TARGET1_ID');
|
||||
$this->db->join('karyawan g','g.ID_KARYAWAN=a.TARGET2_ID');
|
||||
$this->db->join('pajak h','h.ID_PAJAK=a.TARGET1_ID');
|
||||
$this->db->join('pelanggan i','i.ID_PELANGGAN=a.TARGET1_ID');
|
||||
$this->db->join('tp j','j.ID_TP=a.TARGET1_ID');
|
||||
$this->db->join('supplier k','k.ID_SUPPLIER=a.TARGET1_ID');
|
||||
$this->db->join('kota l','l.ID_KOTA=i.KOTA_ID');
|
||||
$this->db->join('kota m','m.ID_KOTA=j.KOTA_ID');
|
||||
$this->db->join('kota n','n.ID_KOTA=k.KOTA_ID');
|
||||
$this->db->group_by('a.ID_LINK');
|
||||
|
||||
}else{
|
||||
$this->db->select('*,d.NAMA_KARYAWAN as KARKAR,g.NAMA_KARYAWAN as KARKEN,l.NAMA_KOTA as KOTA_PEL,m.NAMA_KOTA as KOTA_TP,n.NAMA_KOTA as KOTA_SUP');
|
||||
$this->db->from('link a');
|
||||
$this->db->join('debit b','b.ID_DEBIT=a.DEBIT_ID');
|
||||
$this->db->join('bank c','c.ID_BANK=a.TARGET1_ID','left');
|
||||
$this->db->join('karyawan d','d.ID_KARYAWAN=a.TARGET1_ID','left');
|
||||
$this->db->join('kas e','e.ID_KAS=a.TARGET1_ID','left');
|
||||
$this->db->join('kendaraan f','f.ID_KENDARAAN=a.TARGET1_ID','left');
|
||||
$this->db->join('karyawan g','g.ID_KARYAWAN=a.TARGET2_ID','left');
|
||||
$this->db->join('pajak h','h.ID_PAJAK=a.TARGET1_ID','left');
|
||||
$this->db->join('pelanggan i','i.ID_PELANGGAN=a.TARGET1_ID','left');
|
||||
$this->db->join('tp j','j.ID_TP=a.TARGET1_ID','left');
|
||||
$this->db->join('supplier k','k.ID_SUPPLIER=a.TARGET1_ID','left');
|
||||
$this->db->join('kota l','l.ID_KOTA=i.KOTA_ID','left');
|
||||
$this->db->join('kota m','m.ID_KOTA=j.KOTA_ID','left');
|
||||
$this->db->join('kota n','n.ID_KOTA=k.KOTA_ID','left');
|
||||
$this->db->where(['b.ID_DEBIT' => $id]);
|
||||
$this->db->group_by('a.ID_LINK');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getRelasiLinkBank($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('link a');
|
||||
$this->db->join('debit b','b.ID_DEBIT=a.DEBIT_ID');
|
||||
$this->db->join('bank c','c.ID_BANK=a.TARGET1_ID');
|
||||
$this->db->group_by('a.ID_LINK');
|
||||
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('link a');
|
||||
$this->db->join('debit b','b.ID_DEBIT=a.DEBIT_ID');
|
||||
$this->db->join('bank c','c.ID_BANK=a.TARGET1_ID');
|
||||
$this->db->where(['b.ID_DEBIT' => $id]);
|
||||
$this->db->group_by('a.ID_LINK');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getRelasiLinkKaryawan($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('link a');
|
||||
$this->db->join('debit b','b.ID_DEBIT=a.DEBIT_ID');
|
||||
$this->db->join('karyawan c','c.ID_KARYAWAN=a.TARGET1_ID');
|
||||
$this->db->group_by('a.ID_LINK');
|
||||
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('link a');
|
||||
$this->db->join('debit b','b.ID_DEBIT=a.DEBIT_ID');
|
||||
$this->db->join('karyawan c','c.ID_KARYAWAN=a.TARGET1_ID');
|
||||
$this->db->where(['b.ID_DEBIT' => $id]);
|
||||
$this->db->group_by('a.ID_LINK');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getRelasiLinkKas($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('link a');
|
||||
$this->db->join('debit b','b.ID_DEBIT=a.DEBIT_ID');
|
||||
$this->db->join('kas c','c.ID_KAS=a.TARGET1_ID');
|
||||
$this->db->group_by('a.ID_LINK');
|
||||
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('link a');
|
||||
$this->db->join('debit b','b.ID_DEBIT=a.DEBIT_ID');
|
||||
$this->db->join('kas c','c.ID_KAS=a.TARGET1_ID');
|
||||
$this->db->where(['b.ID_DEBIT' => $id]);
|
||||
$this->db->group_by('a.ID_LINK');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getRelasiLinkKendaraan($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('link a');
|
||||
$this->db->join('debit b','b.ID_DEBIT=a.DEBIT_ID');
|
||||
$this->db->join('kendaraan c','c.ID_KENDARAAN=a.TARGET1_ID');
|
||||
$this->db->join('karyawan d','d.ID_KARYAWAN=a.TARGET2_ID');
|
||||
$this->db->group_by('a.ID_LINK');
|
||||
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('link a');
|
||||
$this->db->join('debit b','b.ID_DEBIT=a.DEBIT_ID');
|
||||
$this->db->join('kendaraan c','c.ID_KENDARAAN=a.TARGET1_ID');
|
||||
$this->db->join('karyawan d','d.ID_KARYAWAN=a.TARGET2_ID');
|
||||
$this->db->where(['b.ID_DEBIT' => $id]);
|
||||
$this->db->group_by('a.ID_LINK');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getRelasiLinkPajak($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('link a');
|
||||
$this->db->join('debit b','b.ID_DEBIT=a.DEBIT_ID');
|
||||
$this->db->join('pajak c','c.ID_PAJAK=a.TARGET1_ID');
|
||||
$this->db->group_by('a.ID_LINK');
|
||||
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('link a');
|
||||
$this->db->join('debit b','b.ID_DEBIT=a.DEBIT_ID');
|
||||
$this->db->join('pajak c','c.ID_PAJAK=a.TARGET1_ID');
|
||||
$this->db->where(['b.ID_DEBIT' => $id]);
|
||||
$this->db->group_by('a.ID_LINK');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getRelasiLinkPelanggan($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('link a');
|
||||
$this->db->join('debit b','b.ID_DEBIT=a.DEBIT_ID');
|
||||
$this->db->join('pelanggan c','c.ID_PELANGGAN=a.TARGET1_ID');
|
||||
$this->db->join('kota d','d.ID_KOTA=c.KOTA_ID');
|
||||
$this->db->group_by('a.ID_LINK');
|
||||
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('link a');
|
||||
$this->db->join('debit b','b.ID_DEBIT=a.DEBIT_ID');
|
||||
$this->db->join('pelanggan c','c.ID_PELANGGAN=a.TARGET1_ID');
|
||||
$this->db->join('kota d','d.ID_KOTA=c.KOTA_ID');
|
||||
$this->db->where(['b.ID_DEBIT' => $id]);
|
||||
$this->db->group_by('a.ID_LINK');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getRelasiLinkPihakKe3($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('link a');
|
||||
$this->db->join('debit b','b.ID_DEBIT=a.DEBIT_ID');
|
||||
$this->db->join('tp c','c.ID_TP=a.TARGET1_ID');
|
||||
$this->db->join('kota d','d.ID_KOTA=c.KOTA_ID');
|
||||
$this->db->group_by('a.ID_LINK');
|
||||
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('link a');
|
||||
$this->db->join('debit b','b.ID_DEBIT=a.DEBIT_ID');
|
||||
$this->db->join('tp c','c.ID_TP=a.TARGET1_ID');
|
||||
$this->db->join('kota d','d.ID_KOTA=c.KOTA_ID');
|
||||
$this->db->where(['b.ID_DEBIT' => $id]);
|
||||
$this->db->group_by('a.ID_LINK');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getRelasiLinkSupplier($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('link a');
|
||||
$this->db->join('debit b','b.ID_DEBIT=a.DEBIT_ID');
|
||||
$this->db->join('supplier c','c.ID_SUPPLIER=a.TARGET1_ID');
|
||||
$this->db->join('kota d','d.ID_KOTA=c.KOTA_ID');
|
||||
$this->db->group_by('a.ID_LINK');
|
||||
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('link a');
|
||||
$this->db->join('debit b','b.ID_DEBIT=a.DEBIT_ID');
|
||||
$this->db->join('supplier c','c.ID_SUPPLIER=a.TARGET1_ID');
|
||||
$this->db->join('kota d','d.ID_KOTA=c.KOTA_ID');
|
||||
$this->db->where(['b.ID_DEBIT' => $id]);
|
||||
$this->db->group_by('a.ID_LINK');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDebitBankMasuk($id)
|
||||
{
|
||||
$this->db->select('KODE_BANKMASUK,CONCAT("Rp ",FORMAT(DEBIT_BANKMASUK,2)) as DEBIT,CONCAT("Rp ",FORMAT(BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('bankmasuk');
|
||||
$this->db->where(['ID_BANKMASUK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeKreditRelasi($id)
|
||||
{
|
||||
$this->db->select('a.KODE_DEBIT,CONCAT("Rp ",FORMAT(a.KREDIT_RELASI,2)) as KREDIT,b.TARGET1_ID');
|
||||
$this->db->from('debit a');
|
||||
$this->db->join('link b','b.DEBIT_ID=a.ID_DEBIT','left');
|
||||
$this->db->where(['a.ID_DEBIT' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKreditTotal($id){
|
||||
$this->db->select('CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('bankmasuk a');
|
||||
$this->db->join('debit b','b.DEBIT_ID=a.ID_BANKMASUK','left');
|
||||
$this->db->where(['a.ID_BANKMASUK' => $id]);
|
||||
$this->db->group_by('a.ID_BANKMASUK');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockconBankMasuk($id)
|
||||
{
|
||||
$this->db->select('a.BLOCKCON,a.ID_BANKMASUK,b.KREDIT_RELASI');
|
||||
$this->db->from('bankmasuk a');
|
||||
$this->db->join('debit b','b.DEBIT_ID=a.ID_BANKMASUK');
|
||||
$this->db->where(['b.ID_DEBIT' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeBankMasuk()
|
||||
{
|
||||
$this->db->select('MAX(KODE_BANKMASUK) AS KODE');
|
||||
$this->db->from('bankmasuk');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDebit()
|
||||
{
|
||||
$this->db->select('MAX(KODE_DEBIT) AS KODE');
|
||||
$this->db->from('debit');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeLink()
|
||||
{
|
||||
$this->db->select('MAX(KODE_LINK) AS KODE');
|
||||
$this->db->from('link');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function delRelasi($id)
|
||||
{
|
||||
$this->db->where(['KASBANK_ID' => $id]);
|
||||
$this->db->where('TYPE_DEBIT="Bank"');
|
||||
$this->db->delete('debit');
|
||||
}
|
||||
|
||||
public function delLink($id)
|
||||
{
|
||||
$this->db->where(['DEBIT_ID' => $id]);
|
||||
$this->db->where('TYPE_KASBANK="Bank"');
|
||||
$this->db->delete('link');
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,593 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelBarang extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
//Model getCount
|
||||
public function getCount_Barang(){
|
||||
$this->db->select('ID_BARANG');
|
||||
$this->db->from('barang');
|
||||
return $this->db->count_all_results();
|
||||
}
|
||||
|
||||
//Model yang dipakai
|
||||
public function getData_Barang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('a.ID_BARANG,a.KODE_BARANG,a.NAMA_BARANG,a.JENIS_ID,b.NAMA_JENIS');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('jenis b','b.ID_JENIS=a.JENIS_ID');
|
||||
$this->db->order_by('a.KODE_BARANG ASC');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('jenis b','b.ID_JENIS=a.JENIS_ID');
|
||||
$this->db->where(['a.ID_BARANG' => $id]);
|
||||
$this->db->group_by('a.ID_BARANG');
|
||||
$this->db->order_by('b.NAMA_JENIS ASC,a.KODE_BARANG ASC');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Barang_byKODE($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang');
|
||||
$this->db->where(['KODE_BARANG' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Barang_byNAMA($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang');
|
||||
$this->db->where(['NAMA_BARANG' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Barang_forAdmin($jenis_id = null, $merk_id = null, $model_id = null){
|
||||
if ($jenis_id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('jenis b','b.ID_JENIS=a.JENIS_ID');
|
||||
$this->db->join('merk c','c.ID_MERK=a.MERK_ID','left');
|
||||
$this->db->join('model d','d.ID_MODEL=a.MODEL_ID','left');
|
||||
$this->db->order_by('a.ID_BARANG DESC');
|
||||
$this->db->where('a.ID_BARANG is NULL');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('jenis b','b.ID_JENIS=a.JENIS_ID');
|
||||
$this->db->join('merk c','c.ID_MERK=a.MERK_ID','left');
|
||||
$this->db->join('model d','d.ID_MODEL=a.MODEL_ID','left');
|
||||
$this->db->where(['a.JENIS_ID' => $jenis_id]);
|
||||
if ($merk_id!=NULL) {
|
||||
$this->db->where(['a.MERK_ID' => $merk_id]);
|
||||
}
|
||||
if ($model_id!=NULL) {
|
||||
$this->db->where(['a.MODEL_ID' => $model_id]);
|
||||
}
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Barang_forView($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('a.ID_BARANG,a.KODE_BARANG,a.NAMA_BARANG,a.JENIS_ID,b.NAMA_JENIS');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('jenis b','b.ID_JENIS=a.JENIS_ID');
|
||||
$this->db->order_by('a.ID_BARANG DESC');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('jenis b','b.ID_JENIS=a.JENIS_ID');
|
||||
$this->db->where(['a.ID_BARANG' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Jenis_byID($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('jenis');
|
||||
$this->db->where(['ID_JENIS' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_DaftarBeli_byBARANG($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('daftar_beli');
|
||||
$this->db->where(['BARANG_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_DaftarOrder_byBARANG($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('daftar_order');
|
||||
$this->db->where(['BARANG_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_SnStock_byBARANG($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('sn_stock');
|
||||
$this->db->where(['BARANG_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_TransaksiStock_byBARANG($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('transaksi_stock');
|
||||
$this->db->where(['BARANG_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Model yang belum dipakai
|
||||
public function getID_BarangMax() {
|
||||
$this->db->select_max('ID_BARANG');
|
||||
$this->db->from('barang');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getDataBarangSetStock(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('daftar_beli b','b.BARANG_ID=a.ID_BARANG','left');
|
||||
$this->db->where('b.BARANG_ID is NULL');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBarangKonsinyasi(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('kuantiti b','b.BARANG_ID=a.ID_BARANG','left');
|
||||
$this->db->join('jenis c','c.ID_JENIS=a.JENIS_ID','left');
|
||||
$this->db->where('b.GLOBAL_KUANTITI!=0');
|
||||
$this->db->where('c.TYPE_JENIS=1');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBarangBekasSewa(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('daftar_snsewa a');
|
||||
$this->db->join('daftar_sewa b','b.ID_DS=a.DS_ID','left');
|
||||
$this->db->join('barang c','c.ID_BARANG=b.BARANG_ID','left');
|
||||
$this->db->join('sn d','d.ID_SN=a.SN_ID','left');
|
||||
$this->db->group_by('a.ID_SNSEWA');
|
||||
$this->db->where('a.STATUS_SNSEWA=1');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getSnKonsinyasi($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('daftar_konsinyasi b','b.ID_DK=a.DK_ID','left');
|
||||
$this->db->join('konsinyasi c','c.ID_KONSINYASI=b.KONSINYASI_ID','left');
|
||||
$this->db->join('barang d','d.ID_BARANG=a.BARANG_ID','left');
|
||||
$this->db->where(['c.PELANGGAN_ID' => $id]);
|
||||
$this->db->group_by('a.ID_SN');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getSnBekasSewa(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('daftar_sewa b','b.ID_DS=a.DS_ID','left');
|
||||
$this->db->join('sewa c','c.ID_SEWA=b.SEWA_ID','left');
|
||||
$this->db->join('barang d','d.ID_BARANG=a.BARANG_ID','left');
|
||||
$this->db->join('daftar_snsewa e','e.SN_ID=a.ID_SN','left');
|
||||
$this->db->group_by('a.ID_SN');
|
||||
$this->db->where('e.STATUS_SNSEWA=1');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBarangKeluarMasuk(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('kuantiti b','b.BARANG_ID=a.ID_BARANG','left');
|
||||
$this->db->where('b.GLOBAL_KUANTITI!=0');
|
||||
$this->db->where('a.JENIS_ID>=7');
|
||||
$this->db->group_by('a.ID_BARANG');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBarang_Pending(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('kuantiti b','b.ID_KUANTITI=a.ID_BARANG');
|
||||
$this->db->join('jenis c','c.ID_JENIS=a.JENIS_ID');
|
||||
$this->db->where('b.PCM_KUANTITI!=0');
|
||||
$this->db->order_by('b.PCM_KUANTITI DESC,c.NAMA_JENIS ASC,a.KODE_BARANG ASC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBarang_Peminjaman(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('kuantiti b','b.ID_KUANTITI=a.ID_BARANG');
|
||||
$this->db->join('jenis c','c.ID_JENIS=a.JENIS_ID');
|
||||
$this->db->where('b.PCM_KUANTITI!=0');
|
||||
$this->db->order_by('b.PCM_KUANTITI DESC,c.NAMA_JENIS ASC,a.KODE_BARANG ASC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBarang_Service(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('kuantiti b','b.ID_KUANTITI=a.ID_BARANG');
|
||||
$this->db->join('jenis c','c.ID_JENIS=a.JENIS_ID');
|
||||
$this->db->where('b.PCM_KUANTITI!=0');
|
||||
$this->db->order_by('b.PCM_KUANTITI DESC,c.NAMA_JENIS ASC,a.KODE_BARANG ASC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBarang_Konsinyasi(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('kuantiti b','b.ID_KUANTITI=a.ID_BARANG');
|
||||
$this->db->join('jenis c','c.ID_JENIS=a.JENIS_ID');
|
||||
$this->db->where('b.PCM_KUANTITI!=0');
|
||||
$this->db->order_by('b.PCM_KUANTITI DESC,c.NAMA_JENIS ASC,a.KODE_BARANG ASC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBarang_TransaksiStock0(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('jenis b','b.ID_JENIS=a.JENIS_ID','left');
|
||||
$this->db->join('kuantiti c','c.ID_KUANTITI=a.ID_BARANG','left');
|
||||
$this->db->where('b.TYPE_JENIS!=2');
|
||||
$this->db->where('c.PCM_KUANTITI!=0');
|
||||
$this->db->order_by('c.PCM_KUANTITI DESC,b.NAMA_JENIS ASC,a.KODE_BARANG ASC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBarang_TransaksiStock1(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('jenis b','b.ID_JENIS=a.JENIS_ID','left');
|
||||
$this->db->order_by('b.NAMA_JENIS ASC,a.KODE_BARANG ASC');
|
||||
$this->db->where('b.TYPE_JENIS!=2');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBarangNonSN(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('kuantiti b','b.BARANG_ID=a.ID_BARANG','left');
|
||||
$this->db->join('jenis c','c.ID_JENIS=a.JENIS_ID','left');
|
||||
$this->db->where('b.PCM_KUANTITI!=0');
|
||||
$this->db->where('c.TYPE_JENIS=0');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBarangSn(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('barang b','b.ID_BARANG=a.BARANG_ID','left');
|
||||
$this->db->where('a.STATUS_SN is NULL');
|
||||
$this->db->group_by('a.ID_SN');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getID_BARANG() {
|
||||
$this->db->select_max('ID_BARANG');
|
||||
$this->db->from('barang');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function delKuantiti($id){
|
||||
$this->db->where(['BARANG_ID' => $id]);
|
||||
$this->db->delete('kuantiti');
|
||||
}
|
||||
|
||||
public function delDaftarHarga($id){
|
||||
$this->db->where(['BARANG_ID' => $id]);
|
||||
$this->db->delete('daftar_harga');
|
||||
}
|
||||
|
||||
public function delStock($id){
|
||||
$this->db->where(['BARANG_ID' => $id]);
|
||||
$this->db->delete('stock');
|
||||
}
|
||||
|
||||
public function getDataBarangPembelian($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('jenis b','b.ID_JENIS=a.JENIS_ID','left');
|
||||
$this->db->order_by('KODE_BARANG','ASC');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('jenis b','b.ID_JENIS=a.JENIS_ID','left');
|
||||
$this->db->where('a.TYPE_BARANG="SKU"');
|
||||
$this->db->or_where('a.TYPE_BARANG="RETAIL"');
|
||||
$this->db->where(['a.ID_BARANG' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBarangQtyReal($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('a.QTY_REAL');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('stock b','b.BARANG_ID=a.ID_BARANG');
|
||||
}else{
|
||||
$this->db->select('a.QTY_REAL');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('stock b','b.BARANG_ID=a.ID_BARANG');
|
||||
$this->db->where(['a.ID_BARANG' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBarangQtyRealIDStock($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('a.QTY_REAL,a.ID_BARANG,b.BLOCKADDSN');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('stock b','b.BARANG_ID=a.ID_BARANG');
|
||||
}else{
|
||||
$this->db->select('a.QTY_REAL,a.ID_BARANG');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('stock b','b.BARANG_ID=a.ID_BARANG');
|
||||
$this->db->where(['b.ID_STOCK' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataStockQty($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('b.QTY');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('stock b','b.BARANG_ID=a.ID_BARANG');
|
||||
}else{
|
||||
$this->db->select('b.QTY');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('stock b','b.BARANG_ID=a.ID_BARANG');
|
||||
$this->db->where(['b.ID_STOCK' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Model Get Barang
|
||||
public function getBarang_Sewa(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('kuantiti b','b.ID_KUANTITI=a.ID_BARANG','left');
|
||||
$this->db->join('jenis c','c.ID_JENIS=a.JENIS_ID','left');
|
||||
$this->db->where('b.SEWA_KUANTITI!=0');
|
||||
$this->db->where('c.TYPE_JENIS=1');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBarang_Operasional(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('kuantiti b','b.ID_KUANTITI=a.ID_BARANG','left');
|
||||
$this->db->join('jenis c','c.ID_JENIS=a.JENIS_ID','left');
|
||||
$this->db->where('b.PCM_KUANTITI!=0');
|
||||
$this->db->order_by('b.PCM_KUANTITI DESC,c.NAMA_JENIS ASC,a.KODE_BARANG ASC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBarang_Proyek_PCM(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('kuantiti b','b.ID_KUANTITI=a.ID_BARANG');
|
||||
$this->db->join('jenis c','c.ID_JENIS=a.JENIS_ID');
|
||||
$this->db->where('b.PCM_KUANTITI!=0');
|
||||
$this->db->order_by('b.PCM_KUANTITI DESC,c.NAMA_JENIS ASC,a.KODE_BARANG ASC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBarang_Proyek_SP(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('kuantiti b','b.ID_KUANTITI=a.ID_BARANG');
|
||||
$this->db->join('jenis c','c.ID_JENIS=a.JENIS_ID');
|
||||
$this->db->where('b.PROYEK_KUANTITI!=0');
|
||||
$this->db->order_by('b.PROYEK_KUANTITI DESC,c.NAMA_JENIS ASC,a.KODE_BARANG ASC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBarang_Proyek_Plot(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('kuantiti b','b.ID_KUANTITI=a.ID_BARANG');
|
||||
$this->db->join('jenis c','c.ID_JENIS=a.JENIS_ID');
|
||||
$this->db->where('b.PLOT_KUANTITI!=0');
|
||||
$this->db->order_by('b.PLOT_KUANTITI DESC,c.NAMA_JENIS ASC,a.KODE_BARANG ASC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Semua Barang Non-Jasa
|
||||
public function getBarang_TypeAll_NonJasa(){
|
||||
$this->db->select('a.ID_BARANG,c.PCM_KUANTITI,a.KODE_BARANG,a.NAMA_BARANG,b.NAMA_JENIS');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('jenis b','b.ID_JENIS=a.JENIS_ID');
|
||||
$this->db->join('kuantiti c','c.ID_KUANTITI=a.ID_BARANG');
|
||||
$this->db->where('b.TYPE_JENIS!=2');
|
||||
$this->db->order_by('c.PCM_KUANTITI DESC,b.NAMA_JENIS ASC,a.KODE_BARANG ASC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBarang_TypeAll_NonJasaITP(){
|
||||
$this->db->select('a.ID_BARANG,c.ITP_KUANTITI,a.KODE_BARANG,a.NAMA_BARANG,b.NAMA_JENIS');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('jenis b','b.ID_JENIS=a.JENIS_ID');
|
||||
$this->db->join('kuantiti c','c.ID_KUANTITI=a.ID_BARANG');
|
||||
$this->db->where('b.TYPE_JENIS!=2');
|
||||
$this->db->order_by('b.NAMA_JENIS ASC,a.KODE_BARANG ASC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBarang_Type0_NonJasaITP(){
|
||||
$this->db->select('a.ID_BARANG,c.ITP_KUANTITI,a.KODE_BARANG,a.NAMA_BARANG,b.NAMA_JENIS');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('jenis b','b.ID_JENIS=a.JENIS_ID');
|
||||
$this->db->join('kuantiti c','c.ID_KUANTITI=a.ID_BARANG');
|
||||
$this->db->where('b.TYPE_JENIS=0');
|
||||
$this->db->order_by('b.NAMA_JENIS ASC,a.KODE_BARANG ASC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Semua Barang Non-QTY
|
||||
public function getBarang_TypeAll_NonQty(){
|
||||
$this->db->select('a.ID_BARANG,a.KODE_BARANG,a.NAMA_BARANG,b.NAMA_JENIS');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('jenis b','b.ID_JENIS=a.JENIS_ID');
|
||||
$this->db->where('b.TYPE_JENIS=2');
|
||||
$this->db->order_by('b.TYPE_JENIS ASC,a.KODE_BARANG ASC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Semua Barang yang bisa Dimodif
|
||||
public function getBarang_Type01(){
|
||||
$this->db->select('a.ID_BARANG,c.PCM_KUANTITI,a.KODE_BARANG,a.NAMA_BARANG,b.NAMA_JENIS');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('jenis b','b.ID_JENIS=a.JENIS_ID');
|
||||
$this->db->join('kuantiti c','c.ID_KUANTITI=a.ID_BARANG');
|
||||
$this->db->where('a.JENIS_ID<=5');
|
||||
$this->db->order_by('c.PCM_KUANTITI DESC,b.NAMA_JENIS ASC,a.KODE_BARANG ASC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Semua Barang Non-QTY
|
||||
public function getBarang_Type02(){
|
||||
$this->db->select('a.ID_BARANG,a.KODE_BARANG,a.NAMA_BARANG,b.NAMA_JENIS');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('jenis b','b.ID_JENIS=a.JENIS_ID');
|
||||
$this->db->where('b.TYPE_JENIS=2');
|
||||
$this->db->order_by('b.TYPE_JENIS ASC,a.KODE_BARANG ASC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Semua Barang Material, Kabel, dll
|
||||
public function getBarang_Type03(){
|
||||
$this->db->select('a.ID_BARANG,c.PCM_KUANTITI,a.KODE_BARANG,a.NAMA_BARANG,b.NAMA_JENIS');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('jenis b','b.ID_JENIS=a.JENIS_ID');
|
||||
$this->db->join('kuantiti c','c.ID_KUANTITI=a.ID_BARANG');
|
||||
$this->db->where('a.JENIS_ID=14 OR a.JENIS_ID=11 OR a.JENIS_ID=9 OR a.JENIS_ID=10');
|
||||
$this->db->order_by('c.PCM_KUANTITI DESC,b.NAMA_JENIS ASC,a.KODE_BARANG ASC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Semua Barang Retail, Sn ataupun Non-SN, Cabutan
|
||||
public function getBarang_Type04(){
|
||||
$this->db->select('a.ID_BARANG,c.PCM_KUANTITI,a.KODE_BARANG,a.NAMA_BARANG,b.NAMA_JENIS');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('jenis b','b.ID_JENIS=a.JENIS_ID');
|
||||
$this->db->join('kuantiti c','c.ID_KUANTITI=a.ID_BARANG');
|
||||
$this->db->where('a.JENIS_ID=6 OR a.JENIS_ID=7 OR a.JENIS_ID=8 OR a.JENIS_ID=9 OR a.JENIS_ID=10 OR a.JENIS_ID=13 OR a.JENIS_ID=16 OR a.JENIS_ID=17 OR a.JENIS_ID=25');
|
||||
$this->db->order_by('c.PCM_KUANTITI DESC,b.NAMA_JENIS ASC,a.KODE_BARANG ASC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Semua Barang Software, License
|
||||
public function getBarang_Type05(){
|
||||
$this->db->select('a.ID_BARANG,c.PCM_KUANTITI,a.KODE_BARANG,a.NAMA_BARANG,b.NAMA_JENIS');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('jenis b','b.ID_JENIS=a.JENIS_ID');
|
||||
$this->db->join('kuantiti c','c.ID_KUANTITI=a.ID_BARANG');
|
||||
$this->db->where('a.JENIS_ID=12 OR a.JENIS_ID=21');
|
||||
$this->db->order_by('c.PCM_KUANTITI DESC,b.NAMA_JENIS ASC,a.KODE_BARANG ASC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Semua Barang Sparepart, Service
|
||||
public function getBarang_Type06(){
|
||||
$this->db->select('a.ID_BARANG,c.PCM_KUANTITI,a.KODE_BARANG,a.NAMA_BARANG,b.NAMA_JENIS');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('jenis b','b.ID_JENIS=a.JENIS_ID');
|
||||
$this->db->join('kuantiti c','c.ID_KUANTITI=a.ID_BARANG');
|
||||
$this->db->where('a.JENIS_ID=15');
|
||||
$this->db->order_by('c.PCM_KUANTITI DESC,b.NAMA_JENIS ASC,a.KODE_BARANG ASC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Semua Barang Sparepart tanpa Cabutan
|
||||
public function getBarang_Type07(){
|
||||
$this->db->select('a.ID_BARANG,c.PCM_KUANTITI,a.KODE_BARANG,a.NAMA_BARANG,b.NAMA_JENIS');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('jenis b','b.ID_JENIS=a.JENIS_ID');
|
||||
$this->db->join('kuantiti c','c.ID_KUANTITI=a.ID_BARANG');
|
||||
$this->db->where('a.JENIS_ID=15');
|
||||
$this->db->order_by('c.PCM_KUANTITI DESC,b.NAMA_JENIS ASC,a.KODE_BARANG ASC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBarang_DaftarBeli(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('daftar_beli b','b.BARANG_ID=a.ID_BARANG','left');
|
||||
$this->db->join('jenis c','c.ID_JENIS=a.JENIS_ID','left');
|
||||
$this->db->order_by('c.NAMA_JENIS ASC,a.KODE_BARANG ASC');
|
||||
$this->db->group_by('a.KODE_BARANG');
|
||||
$this->db->where('a.JENIS_ID!=6');
|
||||
$this->db->where('c.TYPE_JENIS!=2');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBarang_DaftarReturBeli($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('kuantiti b','b.ID_KUANTITI=a.ID_BARANG','left');
|
||||
$this->db->join('daftar_beli c','c.BARANG_ID=b.ID_KUANTITI','left');
|
||||
$this->db->join('pembelian d','d.ID_PEMBELIAN=c.PEMBELIAN_ID','left');
|
||||
$this->db->join('retur_pembelian e','e.SUPPLIER_ID=d.SUPPLIER_ID','left');
|
||||
$this->db->order_by('a.KODE_BARANG','ASC');
|
||||
$this->db->group_by('a.KODE_BARANG');
|
||||
$this->db->where(['e.SUPPLIER_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Model Get Sn
|
||||
public function getSn_Sewa($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('daftar_sewa b','b.ID_DS=a.DS_ID','left');
|
||||
$this->db->join('sewa c','c.ID_SEWA=b.SEWA_ID','left');
|
||||
$this->db->join('barang d','d.ID_BARANG=a.BARANG_ID','left');
|
||||
$this->db->where(['c.PELANGGAN_ID' => $id]);
|
||||
$this->db->group_by('a.ID_SN');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,132 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelBarang extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataBarang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*','b.NAMA_TYPE','c.NAMA_PROCESSOR','d.NAMA_RAM','e.NAMA_HDD','f.NAMA_SSD','g.NAMA_OS','h.NAMA_VGA','i.NAMA_MONITOR','j.NAMA_WARNA');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.ID_TYPE');
|
||||
$this->db->join('processor c','c.ID_PROCESSOR=a.ID_PROCESSOR');
|
||||
$this->db->join('ram d','d.ID_RAM=a.ID_RAM');
|
||||
$this->db->join('hdd e','e.ID_HDD=a.ID_HDD');
|
||||
$this->db->join('ssd f','f.ID_SSD=a.ID_SSD');
|
||||
$this->db->join('os g','g.ID_OS=a.ID_OS');
|
||||
$this->db->join('vga h','h.ID_VGA=a.ID_VGA');
|
||||
$this->db->join('monitor i','i.ID_MONITOR=a.ID_MONITOR');
|
||||
$this->db->join('warna j','j.ID_WARNA=a.ID_WARNA');
|
||||
}else{
|
||||
$this->db->select('*','b.NAMA_TYPE','c.NAMA_PROCESSOR','d.NAMA_RAM','e.NAMA_HDD','f.NAMA_SSD','g.NAMA_OS','h.NAMA_VGA','i.NAMA_MONITOR','j.NAMA_WARNA');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.ID_TYPE');
|
||||
$this->db->join('processor c','c.ID_PROCESSOR=a.ID_PROCESSOR');
|
||||
$this->db->join('ram d','d.ID_RAM=a.ID_RAM');
|
||||
$this->db->join('hdd e','e.ID_HDD=a.ID_HDD');
|
||||
$this->db->join('ssd f','f.ID_SSD=a.ID_SSD');
|
||||
$this->db->join('os g','g.ID_OS=a.ID_OS');
|
||||
$this->db->join('vga h','h.ID_VGA=a.ID_VGA');
|
||||
$this->db->join('monitor i','i.ID_MONITOR=a.ID_MONITOR');
|
||||
$this->db->join('warna j','j.ID_WARNA=a.ID_WARNA');
|
||||
$this->db->where(['ID_BARANG' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNamaBarang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(NAMA_TYPE,"|",NAMA_PROCESSOR,"|",NAMA_RAM,"|",NAMA_SSD,"|",NAMA_HDD,"|",NAMA_OS,"|",NAMA_VGA,"|",NAMA_MONITOR,"|",NAMA_WARNA) AS NAMA_SKU');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.ID_TYPE');
|
||||
$this->db->join('processor c','c.ID_PROCESSOR=a.ID_PROCESSOR');
|
||||
$this->db->join('ram d','d.ID_RAM=a.ID_RAM');
|
||||
$this->db->join('hdd e','e.ID_HDD=a.ID_HDD');
|
||||
$this->db->join('ssd f','f.ID_SSD=a.ID_SSD');
|
||||
$this->db->join('os g','g.ID_OS=a.ID_OS');
|
||||
$this->db->join('vga h','h.ID_VGA=a.ID_VGA');
|
||||
$this->db->join('monitor i','i.ID_MONITOR=a.ID_MONITOR');
|
||||
$this->db->join('warna j','j.ID_WARNA=a.ID_WARNA');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(NAMA_TYPE,"|",NAMA_PROCESSOR,"|",NAMA_RAM,"|",NAMA_SSD,"|",NAMA_HDD,"|",NAMA_OS,"|",NAMA_VGA,"|",NAMA_MONITOR,"|",NAMA_WARNA) AS NAMA_SKU');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.ID_TYPE');
|
||||
$this->db->join('processor c','c.ID_PROCESSOR=a.ID_PROCESSOR');
|
||||
$this->db->join('ram d','d.ID_RAM=a.ID_RAM');
|
||||
$this->db->join('hdd e','e.ID_HDD=a.ID_HDD');
|
||||
$this->db->join('ssd f','f.ID_SSD=a.ID_SSD');
|
||||
$this->db->join('os g','g.ID_OS=a.ID_OS');
|
||||
$this->db->join('vga h','h.ID_VGA=a.ID_VGA');
|
||||
$this->db->join('monitor i','i.ID_MONITOR=a.ID_MONITOR');
|
||||
$this->db->join('warna j','j.ID_WARNA=a.ID_WARNA');
|
||||
$this->db->where(['ID_BARANG' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNamaBarangSku($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(NAMA_TYPE,"|",NAMA_PROCESSOR,"|",SUBSTR(NAMA_RAM,1,4),"|",NAMA_SSD,"|",NAMA_HDD,"|",NAMA_OS,"|",NAMA_VGA,"|",NAMA_MONITOR,"|",NAMA_WARNA) AS SKU');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.ID_TYPE');
|
||||
$this->db->join('processor c','c.ID_PROCESSOR=a.ID_PROCESSOR');
|
||||
$this->db->join('ram d','d.ID_RAM=a.ID_RAM');
|
||||
$this->db->join('hdd e','e.ID_HDD=a.ID_HDD');
|
||||
$this->db->join('ssd f','f.ID_SSD=a.ID_SSD');
|
||||
$this->db->join('os g','g.ID_OS=a.ID_OS');
|
||||
$this->db->join('vga h','h.ID_VGA=a.ID_VGA');
|
||||
$this->db->join('monitor i','i.ID_MONITOR=a.ID_MONITOR');
|
||||
$this->db->join('warna j','j.ID_WARNA=a.ID_WARNA');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(NAMA_TYPE,"|",NAMA_PROCESSOR,"|",SUBSTR(NAMA_RAM,1,4),"|",NAMA_SSD,"|",NAMA_HDD,"|",NAMA_OS,"|",NAMA_VGA,"|",NAMA_MONITOR,"|",NAMA_WARNA) AS SKU');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.ID_TYPE');
|
||||
$this->db->join('processor c','c.ID_PROCESSOR=a.ID_PROCESSOR');
|
||||
$this->db->join('ram d','d.ID_RAM=a.ID_RAM');
|
||||
$this->db->join('hdd e','e.ID_HDD=a.ID_HDD');
|
||||
$this->db->join('ssd f','f.ID_SSD=a.ID_SSD');
|
||||
$this->db->join('os g','g.ID_OS=a.ID_OS');
|
||||
$this->db->join('vga h','h.ID_VGA=a.ID_VGA');
|
||||
$this->db->join('monitor i','i.ID_MONITOR=a.ID_MONITOR');
|
||||
$this->db->join('warna j','j.ID_WARNA=a.ID_WARNA');
|
||||
$this->db->where(['ID_BARANG' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,177 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelBeli extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataBeli($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,b.NAMA_SUPPLIER,c.KODE_BARANG');
|
||||
$this->db->from('beli a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID');
|
||||
$this->db->join('barang c','c.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('jenis d','d.ID_JENIS=c.JENIS_ID');
|
||||
}else{
|
||||
$this->db->select('*,b.NAMA_SUPPLIER,c.KODE_BARANG');
|
||||
$this->db->from('beli a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID');
|
||||
$this->db->join('barang c','c.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('jenis d','d.ID_JENIS=c.JENIS_ID');
|
||||
$this->db->where(['ID_BELI' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBeliSn($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,b.NAMA_SUPPLIER,c.KODE_BARANG');
|
||||
$this->db->from('beli a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID');
|
||||
$this->db->join('barang c','c.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('jenis d','d.ID_JENIS=c.JENIS_ID');
|
||||
}else{
|
||||
$this->db->select('*,b.NAMA_SUPPLIER,c.KODE_BARANG');
|
||||
$this->db->from('beli a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID');
|
||||
$this->db->join('barang c','c.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('jenis d','d.ID_JENIS=c.JENIS_ID');
|
||||
$this->db->where(['ID_BELI' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBeliID($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,a.ID_BELI');
|
||||
$this->db->from('beli a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID');
|
||||
$this->db->join('barang c','c.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('jenis d','d.ID_JENIS=c.JENIS_ID');
|
||||
$this->db->where('HARGA_BELI is NULL',NULL,FALSE);
|
||||
}else{
|
||||
$this->db->select('*,a.ID_BELI');
|
||||
$this->db->from('beli a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID');
|
||||
$this->db->join('barang c','c.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('jenis d','d.ID_JENIS=c.JENIS_ID');
|
||||
$this->db->where('HARGA_BELI is NULL',NULL,FALSE);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBeliSKU($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('ID_BELI');
|
||||
$this->db->from('beli');
|
||||
$this->db->where('SKU_ID is NULL',NULL,FALSE);
|
||||
}else{
|
||||
$this->db->select('ID_BELI');
|
||||
$this->db->from('beli');
|
||||
$this->db->where('SKU_ID is NULL',NULL,FALSE);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBeliPWA($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,b.NAMA_SUPPLIER,c.KODE_BARANG');
|
||||
$this->db->from('beli a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID');
|
||||
$this->db->join('barang c','c.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('jenis d','d.ID_JENIS=c.JENIS_ID');
|
||||
$this->db->where('c.JENIS_ID<=3');
|
||||
$this->db->where('a.SKU_ID is NULL',NULL,FALSE);
|
||||
}else{
|
||||
$this->db->select('*,b.NAMA_SUPPLIER,c.KODE_BARANG');
|
||||
$this->db->from('beli a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID');
|
||||
$this->db->join('barang c','c.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('jenis d','d.ID_JENIS=c.JENIS_ID');
|
||||
$this->db->where('c.JENIS_ID<=3');
|
||||
$this->db->where('a.SKU_ID is NULL',NULL,FALSE);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBeliNB($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,b.NAMA_SUPPLIER,c.KODE_BARANG');
|
||||
$this->db->from('beli a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID');
|
||||
$this->db->join('barang c','c.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('jenis d','d.ID_JENIS=c.JENIS_ID');
|
||||
$this->db->where('c.JENIS_ID=4');
|
||||
$this->db->where('a.SKU_ID is NULL',NULL,FALSE);
|
||||
}else{
|
||||
$this->db->select('*,b.NAMA_SUPPLIER,c.KODE_BARANG');
|
||||
$this->db->from('beli a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID');
|
||||
$this->db->join('barang c','c.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('jenis d','d.ID_JENIS=c.JENIS_ID');
|
||||
$this->db->where('c.JENIS_ID=4');
|
||||
$this->db->where('a.SKU_ID is NULL',NULL,FALSE);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBeliServer($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,b.NAMA_SUPPLIER,c.KODE_BARANG');
|
||||
$this->db->from('beli a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID');
|
||||
$this->db->join('barang c','c.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('jenis d','d.ID_JENIS=c.JENIS_ID');
|
||||
$this->db->where('c.JENIS_ID=5');
|
||||
$this->db->where('a.SKU_ID is NULL',NULL,FALSE);
|
||||
}else{
|
||||
$this->db->select('*,b.NAMA_SUPPLIER,c.KODE_BARANG');
|
||||
$this->db->from('beli a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID');
|
||||
$this->db->join('barang c','c.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('jenis d','d.ID_JENIS=c.JENIS_ID');
|
||||
$this->db->where('c.JENIS_ID=5');
|
||||
$this->db->where('a.SKU_ID is NULL',NULL,FALSE);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,133 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelBiayaFee extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
//Step One, View Biaya Fee
|
||||
public function getDataPiutangDagang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PDA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PDA,2)) as DEBIT');
|
||||
$this->db->from('piutang_dagang a');
|
||||
$this->db->join('penjualan b','b.ID_PENJUALAN=a.PENJUALAN_ID','left');
|
||||
$this->db->join('pelanggan c','c.ID_PELANGGAN=b.PELANGGAN_ID','left');
|
||||
$this->db->join('kota d','d.ID_KOTA=c.KOTA_ID','left');
|
||||
$this->db->join('detail_pda e','e.PDA_ID=a.ID_PDA','left');
|
||||
$this->db->group_by('a.ID_PDA');
|
||||
$this->db->where('a.STATUS_PDA is NULL');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PDA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PDA,2)) as DEBIT');
|
||||
$this->db->from('piutang_dagang a');
|
||||
$this->db->join('penjualan b','b.ID_PENJUALAN=a.PENJUALAN_ID','left');
|
||||
$this->db->join('pelanggan c','c.ID_PELANGGAN=b.PELANGGAN_ID','left');
|
||||
$this->db->join('kota d','d.ID_KOTA=c.KOTA_ID','left');
|
||||
$this->db->join('detail_pda e','e.PDA_ID=a.ID_PDA','left');
|
||||
$this->db->group_by('a.ID_PDA');
|
||||
$this->db->where('a.STATUS_PDA is NULL');
|
||||
$this->db->where(['a.ID_PDA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBiayaFeeDetail($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_BF,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.NOMINAL_BF,2)) as BIAYA');
|
||||
$this->db->from('biaya_fee a');
|
||||
$this->db->join('detail_bf b','b.BF_ID=a.ID_BF','left');
|
||||
$this->db->join('penjualan c','c.ID_PENJUALAN=a.PENJUALAN_ID','left');
|
||||
$this->db->join('pelanggan d','d.ID_PELANGGAN=c.PELANGGAN_ID','left');
|
||||
$this->db->group_by('a.ID_BF');
|
||||
$this->db->where('a.NOMINAL_BF!=a.BLOCKCON');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_BF,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.NOMINAL_BF,2)) as BIAYA');
|
||||
$this->db->from('biaya_fee a');
|
||||
$this->db->join('detail_bf b','b.BF_ID=a.ID_BF','left');
|
||||
$this->db->join('penjualan c','c.ID_PENJUALAN=a.PENJUALAN_ID','left');
|
||||
$this->db->join('pelanggan d','d.ID_PELANGGAN=c.PELANGGAN_ID','left');
|
||||
$this->db->group_by('a.ID_BF');
|
||||
$this->db->where('a.NOMINAL_BF!=a.BLOCKCON');
|
||||
$this->db->where(['a.ID_BF' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodePiutangDagang()
|
||||
{
|
||||
$this->db->select('MAX(KODE_PDA) AS KODE');
|
||||
$this->db->from('piutang_dagang');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Step Two, View Deskripsi
|
||||
public function getDataDeskripsiPDA($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PDA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PDA,2)) as DEBIT,CONCAT("Rp ",FORMAT(b.KREDIT_DPDA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDITALL');
|
||||
$this->db->from('piutang_dagang a');
|
||||
$this->db->join('detail_pda b','b.PDA_ID=a.ID_PDA');
|
||||
$this->db->group_by('b.ID_DPDA');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PDA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PDA,2)) as DEBIT,CONCAT("Rp ",FORMAT(b.KREDIT_DPDA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDITALL');
|
||||
$this->db->from('piutang_dagang a');
|
||||
$this->db->join('detail_pda b','b.PDA_ID=a.ID_PDA');
|
||||
$this->db->group_by('b.ID_DPDA');
|
||||
$this->db->where(['a.ID_PDA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTitlePDA($id)
|
||||
{
|
||||
$this->db->select('KODE_PDA,CONCAT("Rp ",FORMAT(NOMINAL_PDA,2)) as DEBIT,CONCAT("Rp ",FORMAT(BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('piutang_dagang');
|
||||
$this->db->where(['ID_PDA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDetailPDA()
|
||||
{
|
||||
$this->db->select('MAX(KODE_DPDA) AS KODE');
|
||||
$this->db->from('detail_pda');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getID_DPDA()
|
||||
{
|
||||
$this->db->select('MAX(ID_DPDA) AS KODE');
|
||||
$this->db->from('detail_pda');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockcon($id)
|
||||
{
|
||||
$this->db->select('a.BLOCKCON,a.ID_PDA,b.KREDIT_DPDA');
|
||||
$this->db->from('piutang_dagang a');
|
||||
$this->db->join('detail_pda b','b.PDA_ID=a.ID_PDA');
|
||||
$this->db->where(['b.ID_DPDA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,133 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelBiayaPengiriman extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
//Step One, View Biaya Pengiriman
|
||||
public function getDataPiutangDagang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PDA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PDA,2)) as DEBIT');
|
||||
$this->db->from('piutang_dagang a');
|
||||
$this->db->join('penjualan b','b.ID_PENJUALAN=a.PENJUALAN_ID','left');
|
||||
$this->db->join('pelanggan c','c.ID_PELANGGAN=b.PELANGGAN_ID','left');
|
||||
$this->db->join('kota d','d.ID_KOTA=c.KOTA_ID','left');
|
||||
$this->db->join('detail_pda e','e.PDA_ID=a.ID_PDA','left');
|
||||
$this->db->group_by('a.ID_PDA');
|
||||
$this->db->where('a.STATUS_PDA is NULL');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PDA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PDA,2)) as DEBIT');
|
||||
$this->db->from('piutang_dagang a');
|
||||
$this->db->join('penjualan b','b.ID_PENJUALAN=a.PENJUALAN_ID','left');
|
||||
$this->db->join('pelanggan c','c.ID_PELANGGAN=b.PELANGGAN_ID','left');
|
||||
$this->db->join('kota d','d.ID_KOTA=c.KOTA_ID','left');
|
||||
$this->db->join('detail_pda e','e.PDA_ID=a.ID_PDA','left');
|
||||
$this->db->group_by('a.ID_PDA');
|
||||
$this->db->where('a.STATUS_PDA is NULL');
|
||||
$this->db->where(['a.ID_PDA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBiayaPengirimanDetail($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_BP,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.BLOCKKRE_BP,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKDEB_BP,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.NOMINAL_BP,2)) as BIAYA');
|
||||
$this->db->from('biaya_pengiriman a');
|
||||
$this->db->join('detail_bp b','b.BP_ID=a.ID_BP','left');
|
||||
$this->db->join('penjualan c','c.ID_PENJUALAN=a.PENJUALAN_ID','left');
|
||||
$this->db->group_by('a.ID_BP');
|
||||
$this->db->where('a.NOMINAL_BP!=a.BLOCKDEB_BP');
|
||||
$this->db->or_where('a.NOMINAL_BP!=a.BLOCKKRE_BP');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_BP,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.BLOCKKRE_BP,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKDEB_BP,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.NOMINAL_BP,2)) as BIAYA');
|
||||
$this->db->from('biaya_pengiriman a');
|
||||
$this->db->join('detail_bp b','b.BP_ID=a.ID_BP','left');
|
||||
$this->db->join('penjualan c','c.ID_PENJUALAN=a.PENJUALAN_ID','left');
|
||||
$this->db->group_by('a.ID_BP');
|
||||
$this->db->where('a.NOMINAL_BP!=a.BLOCKDEB_BP');
|
||||
$this->db->or_where('a.NOMINAL_BP!=a.BLOCKKRE_BP');
|
||||
$this->db->where(['a.ID_BP' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodePiutangDagang()
|
||||
{
|
||||
$this->db->select('MAX(KODE_PDA) AS KODE');
|
||||
$this->db->from('piutang_dagang');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Step Two, View Deskripsi
|
||||
public function getDataDeskripsiPDA($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PDA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PDA,2)) as DEBIT,CONCAT("Rp ",FORMAT(b.KREDIT_DPDA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDITALL');
|
||||
$this->db->from('piutang_dagang a');
|
||||
$this->db->join('detail_pda b','b.PDA_ID=a.ID_PDA');
|
||||
$this->db->group_by('b.ID_DPDA');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PDA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PDA,2)) as DEBIT,CONCAT("Rp ",FORMAT(b.KREDIT_DPDA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDITALL');
|
||||
$this->db->from('piutang_dagang a');
|
||||
$this->db->join('detail_pda b','b.PDA_ID=a.ID_PDA');
|
||||
$this->db->group_by('b.ID_DPDA');
|
||||
$this->db->where(['a.ID_PDA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTitlePDA($id)
|
||||
{
|
||||
$this->db->select('KODE_PDA,CONCAT("Rp ",FORMAT(NOMINAL_PDA,2)) as DEBIT,CONCAT("Rp ",FORMAT(BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('piutang_dagang');
|
||||
$this->db->where(['ID_PDA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDetailPDA()
|
||||
{
|
||||
$this->db->select('MAX(KODE_DPDA) AS KODE');
|
||||
$this->db->from('detail_pda');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getID_DPDA()
|
||||
{
|
||||
$this->db->select('MAX(ID_DPDA) AS KODE');
|
||||
$this->db->from('detail_pda');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockcon($id)
|
||||
{
|
||||
$this->db->select('a.BLOCKCON,a.ID_PDA,b.KREDIT_DPDA');
|
||||
$this->db->from('piutang_dagang a');
|
||||
$this->db->join('detail_pda b','b.PDA_ID=a.ID_PDA');
|
||||
$this->db->where(['b.ID_DPDA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,180 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelClaim extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataClaim($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('garansi a');
|
||||
$this->db->join('progress b','b.GARANSI_ID=a.ID_GARANSI');
|
||||
$this->db->join('service c','c.PROGRESS_ID=b.ID_PROGRESS');
|
||||
$this->db->join('agen d','d.ID_AGEN=a.AGEN_ID');
|
||||
$this->db->order_by('ID_GARANSI','ASC');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('garansi a');
|
||||
$this->db->join('progress b','b.GARANSI_ID=a.ID_GARANSI');
|
||||
$this->db->join('service c','c.PROGRESS_ID=b.ID_PROGRESS');
|
||||
$this->db->join('agen d','d.ID_AGEN=a.AGEN_ID');
|
||||
$this->db->order_by('ID_GARANSI','ASC');
|
||||
$this->db->where(['ID_GARANSI' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getViewClaim($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(g.TANGGAL_GARANSI,"%d %M %Y %H:%i")) AS WAKTU_CLAIM');
|
||||
$this->db->from('service a');
|
||||
$this->db->join('barang b','b.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('operator c','c.ID_OPERATOR=a.OPERATOR_ID');
|
||||
$this->db->join('pelanggan d','d.ID_PELANGGAN=a.PELANGGAN_ID');
|
||||
$this->db->join('progress e','a.PROGRESS_ID=e.ID_PROGRESS','left');
|
||||
$this->db->join('teknisi f','f.ID_TEKNISI=e.TEKNISI_ID','left');
|
||||
$this->db->join('garansi g','g.ID_GARANSI=e.GARANSI_ID','left');
|
||||
$this->db->join('agen h','h.ID_AGEN=g.AGEN_ID','left');
|
||||
$this->db->where('g.STATUS_GARANSI="Belum Proses"');
|
||||
$this->db->order_by('TANGGAL_GARANSI','ASC');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getViewUpClaim($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(g.TANGGAL_GARANSI,"%d %M %Y %H:%i")) AS WAKTU_CLAIM');
|
||||
$this->db->from('service a');
|
||||
$this->db->join('barang b','b.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('operator c','c.ID_OPERATOR=a.OPERATOR_ID');
|
||||
$this->db->join('pelanggan d','d.ID_PELANGGAN=a.PELANGGAN_ID');
|
||||
$this->db->join('progress e','a.PROGRESS_ID=e.ID_PROGRESS','left');
|
||||
$this->db->join('teknisi f','f.ID_TEKNISI=e.TEKNISI_ID','left');
|
||||
$this->db->join('garansi g','g.ID_GARANSI=e.GARANSI_ID','left');
|
||||
$this->db->join('agen h','h.ID_AGEN=g.AGEN_ID','left');
|
||||
$this->db->where('g.STATUS_GARANSI="Proses Claim"');
|
||||
$this->db->order_by('TANGGAL_GARANSI','ASC');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataClaimID($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select_max('ID_CLAIMDELL');
|
||||
$this->db->from('claimdell');
|
||||
}else{
|
||||
$this->db->select_max('ID_CLAIMDELL');
|
||||
$this->db->from('claimdell');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataIDService($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('a.ID_SERVICE');
|
||||
$this->db->from('service a');
|
||||
$this->db->join('claimdell b','b.ID_CLAIMDELL=a.CLAIMDELL_ID');
|
||||
}else{
|
||||
$this->db->select('a.ID_SERVICE');
|
||||
$this->db->from('service a');
|
||||
$this->db->join('claimdell b','b.ID_CLAIMDELL=a.CLAIMDELL_ID');
|
||||
$this->db->where(['ID_CLAIMDELL' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataIDProgress($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('b.ID_PROGRESS');
|
||||
$this->db->from('service a');
|
||||
$this->db->join('progress b','b.ID_PROGRESS=a.PROGRESS_ID');
|
||||
}else{
|
||||
$this->db->select('b.ID_PROGRESS');
|
||||
$this->db->from('service a');
|
||||
$this->db->join('progress b','b.ID_PROGRESS=a.PROGRESS_ID');
|
||||
$this->db->where(['ID_SERVICE' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getGaransiIDProgress($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('a.ID_PROGRESS');
|
||||
$this->db->from('progress a');
|
||||
$this->db->join('garansi b','b.ID_GARANSI=a.GARANSI_ID');
|
||||
}else{
|
||||
$this->db->select('a.ID_PROGRESS');
|
||||
$this->db->from('progress a');
|
||||
$this->db->join('garansi b','b.ID_GARANSI=a.GARANSI_ID');
|
||||
$this->db->where(['b.ID_GARANSI' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getProgressIDService($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('a.ID_SERVICE');
|
||||
$this->db->from('service a');
|
||||
$this->db->join('progress b','b.ID_PROGRESS=a.PROGRESS_ID');
|
||||
}else{
|
||||
$this->db->select('a.ID_SERVICE');
|
||||
$this->db->from('service a');
|
||||
$this->db->join('progress b','b.ID_PROGRESS=a.PROGRESS_ID');
|
||||
$this->db->where(['b.ID_PROGRESS' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataTeknisiID($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('ID_PROGRESS,STATUS_PROGRESS,TEKNISI_ID');
|
||||
$this->db->from('progress');
|
||||
}else{
|
||||
$this->db->select('ID_PROGRESS,STATUS_PROGRESS,TEKNISI_ID');
|
||||
$this->db->from('progress');
|
||||
$this->db->where(['ID_PROGRESS' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
class ModelConfig extends CI_Model
|
||||
{
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if ($batch === false) {
|
||||
$insert = $this->db->insert($table, $data);
|
||||
} else {
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if ($batch === false) {
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
} else {
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataConfig($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,b.NO_INVOICE,c.NAMA_DISTRIBUTOR,FORMAT(b.HPP-SUM(g.POTONGAN),0) as HPP_REAL,d.NAMA_STATUSGUDANG,e.NAMA_STATUSPENJUALAN');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('invoice b','b.ID_INVOICE=a.ID_INVOICE');
|
||||
$this->db->join('distributor c','c.ID_DISTRIBUTOR=b.ID_DISTRIBUTOR');
|
||||
$this->db->join('statusgudang d','d.ID_STATUSGUDANG=a.ID_STATUSGUDANG');
|
||||
$this->db->join('statuspenjualan e','e.ID_STATUSPENJUALAN=a.ID_STATUSPENJUALAN');
|
||||
$this->db->join('promo g','g.ID_INVOICE=a.ID_INVOICE');
|
||||
$this->db->group_by('a.ID_SN');
|
||||
}else{
|
||||
$this->db->select('*,b.NO_INVOICE,c.NAMA_DISTRIBUTOR,FORMAT(b.HPP-SUM(g.POTONGAN),0) as HPP_REAL,d.NAMA_STATUSGUDANG,e.NAMA_STATUSPENJUALAN');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('invoice b','b.ID_INVOICE=a.ID_INVOICE');
|
||||
$this->db->join('distributor c','c.ID_DISTRIBUTOR=b.ID_DISTRIBUTOR');
|
||||
$this->db->join('statusgudang d','d.ID_STATUSGUDANG=a.ID_STATUSGUDANG');
|
||||
$this->db->join('statuspenjualan e','e.ID_STATUSPENJUALAN=a.ID_STATUSPENJUALAN');
|
||||
$this->db->join('promo g','g.ID_INVOICE=a.ID_INVOICE');
|
||||
$this->db->group_by('a.ID_SN');
|
||||
$this->db->where(['ID_SN' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataSnBelumLaku($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('statuspenjualan b','b.ID_STATUSPENJUALAN=a.ID_STATUSPENJUALAN');
|
||||
$this->db->where('a.ID_STATUSPENJUALAN=1');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('statuspenjualan b','b.ID_STATUSPENJUALAN=a.ID_STATUSPENJUALAN');
|
||||
$this->db->where('a.ID_STATUSPENJUALAN=1');
|
||||
$this->db->where(['ID_SN' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelCorp extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getData_Corp($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('corp');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('corp');
|
||||
$this->db->where(['ID_CORP' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Corp_forPembelianPCM(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('corp');
|
||||
$this->db->where('ID_CORP<=4');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Corp_forPembelianITP(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('corp');
|
||||
$this->db->where('ID_CORP=5');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Corp_forPenjualanITP(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('corp');
|
||||
$this->db->where('ID_CORP=4 OR ID_CORP=5');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Corp_So($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('corp');
|
||||
$this->db->where('ID_CORP<4');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('corp');
|
||||
$this->db->where(['ID_CORP' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDpPajak($id=null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(b.SALDO_PAJAK,2)) as SALDO,CONCAT("Rp ",FORMAT(a.NOMINAL_DPP,2)) as DP');
|
||||
$this->db->from('dp_pajak a');
|
||||
$this->db->join('corp b','b.ID_CORP=a.CORP_ID','left');
|
||||
$this->db->group_by('a.ID_DPP');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(b.SALDO_PAJAK,2)) as SALDO,CONCAT("Rp ",FORMAT(a.NOMINAL_DPP,2)) as DP');
|
||||
$this->db->from('dp_pajak a');
|
||||
$this->db->join('corp b','b.ID_CORP=a.CORP_ID','left');
|
||||
$this->db->group_by('a.ID_DPP');
|
||||
$this->db->where(['a.CORP_ID' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataCorpDpp(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('corp a');
|
||||
$this->db->join('dp_pajak b','b.CORP_ID=a.ID_CORP','left');
|
||||
$this->db->where('b.CORP_ID is NULL');
|
||||
$this->db->order_by('a.NAMA_CORP','ASC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataCorpHpa(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('corp a');
|
||||
$this->db->join('hutang_pajak b','b.CORP_ID=a.ID_CORP','left');
|
||||
$this->db->where('b.CORP_ID is NULL');
|
||||
$this->db->order_by('a.NAMA_CORP','ASC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDpp($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('dp_pajak');
|
||||
$this->db->where(['ID_DPP' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDPP() {
|
||||
$this->db->select('MAX(KODE_DPP) AS KODE');
|
||||
$this->db->from('dp_pajak');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHutangPajak($id=null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HPA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(b.HUTANG_PAJAK,2)) as HUTANG,CONCAT("Rp ",FORMAT(a.NOMINAL_HPA,2)) as HPA');
|
||||
$this->db->from('hutang_pajak a');
|
||||
$this->db->join('corp b','b.ID_CORP=a.CORP_ID','left');
|
||||
$this->db->group_by('a.ID_HPA');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HPA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(b.HUTANG_PAJAK,2)) as HUTANG,CONCAT("Rp ",FORMAT(a.NOMINAL_HPA,2)) as HPA');
|
||||
$this->db->from('hutang_pajak a');
|
||||
$this->db->join('corp b','b.ID_CORP=a.CORP_ID','left');
|
||||
$this->db->group_by('a.ID_HPA');
|
||||
$this->db->where(['a.CORP_ID' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHpa($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('hutang_pajak');
|
||||
$this->db->where(['ID_HPA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeHPA() {
|
||||
$this->db->select('MAX(KODE_HPA) AS KODE');
|
||||
$this->db->from('hutang_pajak');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelCustomer extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getData_Customer($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('customer');
|
||||
$this->db->order_by('NAMA_CUSTOMER ASC');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('customer');
|
||||
$this->db->where(['ID_CUSTOMER' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Customer_byALAMAT($alamat, $id=null){
|
||||
$this->db->select('*');
|
||||
$this->db->from('customer');
|
||||
$this->db->where(['ALAMAT_CUSTOMER' => $alamat]);
|
||||
if ($id!=null) {
|
||||
$this->db->where('ID_CUSTOMER!=', $id);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_RekapPajak_byCUSTOMER($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('rekap_pajak');
|
||||
$this->db->where(['CUSTOMER_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelDetailKas extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataDetailKas($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HPA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HPA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('hutang_pajak a');
|
||||
$this->db->join('pajak b','b.ID_PAJAK=a.PAJAK_ID','left');
|
||||
$this->db->join('detail_hpa c','c.HPA_ID=a.ID_HPA','left');
|
||||
$this->db->group_by('a.ID_HPA');
|
||||
$this->db->where('a.STATUS_HPA is NULL');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HPA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HPA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('hutang_pajak a');
|
||||
$this->db->join('pajak b','b.ID_PAJAK=a.PAJAK_ID','left');
|
||||
$this->db->join('detail_hpa c','c.HPA_ID=a.ID_HPA','left');
|
||||
$this->db->group_by('a.ID_HPA');
|
||||
$this->db->where('a.STATUS_HPA is NULL');
|
||||
$this->db->where(['a.ID_HPA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDetailKasDetail($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HPA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HPA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('hutang_pajak a');
|
||||
$this->db->join('pajak b','b.ID_PAJAK=a.PAJAK_ID','left');
|
||||
$this->db->join('detail_hpa c','c.HPA_ID=a.ID_HPA','left');
|
||||
$this->db->group_by('a.ID_HPA');
|
||||
$this->db->where('a.NOMINAL_HPA!=a.BLOCKCON');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HPA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HPA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('hutang_pajak a');
|
||||
$this->db->join('pajak b','b.ID_PAJAK=a.PAJAK_ID','left');
|
||||
$this->db->join('detail_hpa c','c.HPA_ID=a.ID_HPA','left');
|
||||
$this->db->group_by('a.ID_HPA');
|
||||
$this->db->where('a.NOMINAL_HPA!=a.BLOCKCON');
|
||||
$this->db->where(['a.ID_HPA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDetailKas()
|
||||
{
|
||||
$this->db->select('MAX(KODE_HPA) AS KODE');
|
||||
$this->db->from('hutang_pajak');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDeskripsiHPA($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HPA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HPA,2)) as DEBIT,CONCAT("Rp ",FORMAT(c.KREDIT_DHPA,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDITALL');
|
||||
$this->db->from('hutang_pajak a');
|
||||
$this->db->join('pajak b','b.ID_PAJAK=a.PAJAK_ID','left');
|
||||
$this->db->join('detail_hpa c','c.HPA_ID=a.ID_HPA');
|
||||
$this->db->group_by('c.ID_DHPA');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HPA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HPA,2)) as DEBIT,CONCAT("Rp ",FORMAT(c.KREDIT_DHPA,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDITALL');
|
||||
$this->db->from('hutang_pajak a');
|
||||
$this->db->join('pajak b','b.ID_PAJAK=a.PAJAK_ID','left');
|
||||
$this->db->join('detail_hpa c','c.HPA_ID=a.ID_HPA');
|
||||
$this->db->group_by('c.ID_DHPA');
|
||||
$this->db->where(['a.ID_HPA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTitleHPA($id)
|
||||
{
|
||||
$this->db->select('KODE_HPA,CONCAT("Rp ",FORMAT(NOMINAL_HPA,2)) as KREDIT,CONCAT("Rp ",FORMAT(BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('hutang_pajak');
|
||||
$this->db->where(['ID_HPA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelDistributor extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataDistributor($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('distributor');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('distributor');
|
||||
$this->db->where(['ID_DISTRIBUTOR' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,179 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelDpPajak extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataDpPajak($id=null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,a.KODE_BUKTI AS KB,CONCAT(DATE_FORMAT(a.TGL_DPP,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_DPP,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBIT,CONCAT("Rp ",FORMAT(b.SALDO_PAJAK,2)) as SALDO,CONCAT("Rp ",FORMAT(b.HUTANG_PAJAK,2)) as HUTANG');
|
||||
$this->db->from('dp_pajak a');
|
||||
$this->db->join('pajak b','b.ID_PAJAK=a.PAJAK_ID','left');
|
||||
$this->db->join('detail_dpp c','c.DPP_ID=a.ID_DPP','left');
|
||||
$this->db->where('a.STATUS_DPP is NULL');
|
||||
$this->db->group_by('a.ID_DPP');
|
||||
}else{
|
||||
$this->db->select('*,a.KODE_BUKTI AS KB,CONCAT(DATE_FORMAT(a.TGL_DPP,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_DPP,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBIT,CONCAT("Rp ",FORMAT(b.SALDO_PAJAK,2)) as SALDO,CONCAT("Rp ",FORMAT(b.HUTANG_PAJAK,2)) as HUTANG');
|
||||
$this->db->from('dp_pajak a');
|
||||
$this->db->join('pajak b','b.ID_PAJAK=a.PAJAK_ID','left');
|
||||
$this->db->join('detail_dpp c','c.DPP_ID=a.ID_DPP','left');
|
||||
$this->db->where('a.STATUS_DPP is NULL');
|
||||
$this->db->group_by('a.ID_DPP');
|
||||
$this->db->where(['a.ID_DPP' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDpPajakDetail($id=null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(a.NOMINAL_DPP,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('dp_pajak a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID','left');
|
||||
$this->db->join('kota c','c.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->join('detail_dpb d','d.DPP_ID=a.ID_DPP','left');
|
||||
$this->db->where('a.NOMINAL_DPP!=a.BLOCKCON');
|
||||
$this->db->group_by('a.ID_DPP');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(a.NOMINAL_DPP,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('dp_pajak a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID','left');
|
||||
$this->db->join('kota c','c.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->join('detail_dpb d','d.DPP_ID=a.ID_DPP','left');
|
||||
$this->db->where('a.NOMINAL_DPP!=a.BLOCKCON');
|
||||
$this->db->where(['a.ID_DPP' => $id]);
|
||||
$this->db->group_by('a.ID_DPP');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Step Two, Input Transaksi
|
||||
public function getDataDetailDpPajak($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_DPP,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_DPP,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('dp_pajak a');
|
||||
$this->db->join('detail_dpb b','b.DPP_ID=a.ID_DPP');
|
||||
$this->db->join('hutang_dagang c','c.ID_HDA=b.HDA_ID','left');
|
||||
$this->db->join('pajak d','d.ID_PEMBELIAN=c.PEMBELIAN_ID','left');
|
||||
$this->db->join('supplier e','e.ID_SUPPLIER=d.SUPPLIER_ID','left');
|
||||
$this->db->join('kota f','f.ID_KOTA=e.KOTA_ID','left');
|
||||
$this->db->group_by('b.ID_DDPP');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_DPP,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_DPP,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('dp_pajak a');
|
||||
$this->db->join('detail_dpb b','b.DPP_ID=a.ID_DPP');
|
||||
$this->db->join('hutang_dagang c','c.ID_HDA=b.HDA_ID','left');
|
||||
$this->db->join('pajak d','d.ID_PEMBELIAN=c.PEMBELIAN_ID','left');
|
||||
$this->db->join('supplier e','e.ID_SUPPLIER=d.SUPPLIER_ID','left');
|
||||
$this->db->join('kota f','f.ID_KOTA=e.KOTA_ID','left');
|
||||
$this->db->where(['a.ID_DPP' => $id]);
|
||||
$this->db->group_by('b.ID_DDPP');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTitleDPP($id) {
|
||||
$this->db->select('KODE_DPP,CONCAT("Rp ",FORMAT(NOMINAL_DPP,2)) as KREDIT,CONCAT("Rp ",FORMAT(BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('dp_pajak');
|
||||
$this->db->where(['ID_DPP' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHutangDagang($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('hutang_dagang');
|
||||
$this->db->where(['ID_HDA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDpPajak($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('dp_pajak');
|
||||
$this->db->where(['ID_DPP' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDDPP($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('detail_dpb');
|
||||
$this->db->where(['ID_DDPP' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDDPP() {
|
||||
$this->db->select_max('ID_DDPP');
|
||||
$this->db->from('detail_dpb');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDHDA() {
|
||||
$this->db->select_max('ID_DHDA');
|
||||
$this->db->from('detail_hda');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDPP($id) {
|
||||
$this->db->select('b.NOMINAL_DPP,b.BLOCKCON');
|
||||
$this->db->from('detail_dpb a');
|
||||
$this->db->join('dp_pajak b','b.ID_DPP=a.DPP_ID','left');
|
||||
$this->db->where(['ID_DDPP' => $id]);
|
||||
$this->db->group_by('ID_DDPP');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHDA($id) {
|
||||
$this->db->select('b.NOMINAL_HDA,b.BLOCKCON');
|
||||
$this->db->from('detail_hda a');
|
||||
$this->db->join('hutang_dagang b','b.ID_HDA=a.HDA_ID','left');
|
||||
$this->db->where(['ID_DHDA' => $id]);
|
||||
$this->db->group_by('ID_DHDA');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataSupplier($id) {
|
||||
$this->db->select('PIUTANG_SUPPLIER,SALDO_SUPPLIER');
|
||||
$this->db->from('supplier');
|
||||
$this->db->where(['ID_SUPPLIER' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDetailDPP() {
|
||||
$this->db->select('MAX(KODE_DDPP) AS KODE');
|
||||
$this->db->from('detail_dpb');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDetailHDA() {
|
||||
$this->db->select('MAX(KODE_DHDA) AS KODE');
|
||||
$this->db->from('detail_hda');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function hapusDetailHda($id){
|
||||
$this->db->where(['KODE_BUKTI' => $id]);
|
||||
$this->db->delete('detail_hda');
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,181 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelDpPembelian extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataDpPembelian($id=null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,a.KODE_BUKTI AS KB,CONCAT(DATE_FORMAT(a.TGL_DPB,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_DPB,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBIT,CONCAT("Rp ",FORMAT(b.SALDO_SUPPLIER,2)) as SALDO,CONCAT("Rp ",FORMAT(b.PIUTANG_SUPPLIER,2)) as PIUTANG');
|
||||
$this->db->from('dp_pembelian a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID','left');
|
||||
$this->db->join('kota c','c.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->join('detail_dpb d','d.DPB_ID=a.ID_DPB','left');
|
||||
$this->db->where('a.STATUS_DPB is NULL');
|
||||
$this->db->group_by('a.ID_DPB');
|
||||
}else{
|
||||
$this->db->select('*,a.KODE_BUKTI AS KB,CONCAT(DATE_FORMAT(a.TGL_DPB,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_DPB,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBIT,CONCAT("Rp ",FORMAT(b.SALDO_SUPPLIER,2)) as SALDO,CONCAT("Rp ",FORMAT(b.PIUTANG_SUPPLIER,2)) as PIUTANG');
|
||||
$this->db->from('dp_pembelian a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID','left');
|
||||
$this->db->join('kota c','c.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->join('detail_dpb d','d.DPB_ID=a.ID_DPB','left');
|
||||
$this->db->where('a.STATUS_DPB is NULL');
|
||||
$this->db->where(['a.ID_DPB' => $id]);
|
||||
$this->db->group_by('a.ID_DPB');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDpPembelianDetail($id=null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(a.NOMINAL_DPB,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('dp_pembelian a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID','left');
|
||||
$this->db->join('kota c','c.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->join('detail_dpb d','d.DPB_ID=a.ID_DPB','left');
|
||||
$this->db->where('a.NOMINAL_DPB!=a.BLOCKCON');
|
||||
$this->db->group_by('a.ID_DPB');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(a.NOMINAL_DPB,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('dp_pembelian a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID','left');
|
||||
$this->db->join('kota c','c.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->join('detail_dpb d','d.DPB_ID=a.ID_DPB','left');
|
||||
$this->db->where('a.NOMINAL_DPB!=a.BLOCKCON');
|
||||
$this->db->where(['a.ID_DPB' => $id]);
|
||||
$this->db->group_by('a.ID_DPB');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Step Two, Input Transaksi
|
||||
public function getDataDetailDpPembelian($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_DPB,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_DPB,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('dp_pembelian a');
|
||||
$this->db->join('detail_dpb b','b.DPB_ID=a.ID_DPB');
|
||||
$this->db->join('hutang_dagang c','c.ID_HDA=b.HDA_ID','left');
|
||||
$this->db->join('pembelian d','d.ID_PEMBELIAN=c.PEMBELIAN_ID','left');
|
||||
$this->db->join('supplier e','e.ID_SUPPLIER=d.SUPPLIER_ID','left');
|
||||
$this->db->join('kota f','f.ID_KOTA=e.KOTA_ID','left');
|
||||
$this->db->group_by('b.ID_DDPB');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_DPB,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_DPB,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('dp_pembelian a');
|
||||
$this->db->join('detail_dpb b','b.DPB_ID=a.ID_DPB');
|
||||
$this->db->join('hutang_dagang c','c.ID_HDA=b.HDA_ID','left');
|
||||
$this->db->join('pembelian d','d.ID_PEMBELIAN=c.PEMBELIAN_ID','left');
|
||||
$this->db->join('supplier e','e.ID_SUPPLIER=d.SUPPLIER_ID','left');
|
||||
$this->db->join('kota f','f.ID_KOTA=e.KOTA_ID','left');
|
||||
$this->db->where(['a.ID_DPB' => $id]);
|
||||
$this->db->group_by('b.ID_DDPB');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTitleDPB($id) {
|
||||
$this->db->select('KODE_DPB,CONCAT("Rp ",FORMAT(NOMINAL_DPB,2)) as KREDIT,CONCAT("Rp ",FORMAT(BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('dp_pembelian');
|
||||
$this->db->where(['ID_DPB' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHutangDagang($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('hutang_dagang');
|
||||
$this->db->where(['ID_HDA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDpPembelian($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('dp_pembelian');
|
||||
$this->db->where(['ID_DPB' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDDPB($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('detail_dpb');
|
||||
$this->db->where(['ID_DDPB' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDDPB() {
|
||||
$this->db->select_max('ID_DDPB');
|
||||
$this->db->from('detail_dpb');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDHDA() {
|
||||
$this->db->select_max('ID_DHDA');
|
||||
$this->db->from('detail_hda');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDPB($id) {
|
||||
$this->db->select('b.NOMINAL_DPB,b.BLOCKCON');
|
||||
$this->db->from('detail_dpb a');
|
||||
$this->db->join('dp_pembelian b','b.ID_DPB=a.DPB_ID','left');
|
||||
$this->db->where(['ID_DDPB' => $id]);
|
||||
$this->db->group_by('ID_DDPB');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHDA($id) {
|
||||
$this->db->select('b.NOMINAL_HDA,b.BLOCKCON');
|
||||
$this->db->from('detail_hda a');
|
||||
$this->db->join('hutang_dagang b','b.ID_HDA=a.HDA_ID','left');
|
||||
$this->db->where(['ID_DHDA' => $id]);
|
||||
$this->db->group_by('ID_DHDA');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataSupplier($id) {
|
||||
$this->db->select('PIUTANG_SUPPLIER,SALDO_SUPPLIER');
|
||||
$this->db->from('supplier');
|
||||
$this->db->where(['ID_SUPPLIER' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDetailDPB() {
|
||||
$this->db->select('MAX(KODE_DDPB) AS KODE');
|
||||
$this->db->from('detail_dpb');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDetailHDA() {
|
||||
$this->db->select('MAX(KODE_DHDA) AS KODE');
|
||||
$this->db->from('detail_hda');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function hapusDetailHda($id){
|
||||
$this->db->where(['KODE_BUKTI' => $id]);
|
||||
$this->db->delete('detail_hda');
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,181 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelDpPenjualan extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataDpPenjualan($id=null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,a.KODE_BUKTI AS KB,CONCAT(DATE_FORMAT(a.TGL_DPJ,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_DPJ,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT,CONCAT("Rp ",FORMAT(b.SALDO_PELANGGAN,2)) as SALDO,CONCAT("Rp ",FORMAT(b.HUTANG_PELANGGAN,2)) as HUTANG');
|
||||
$this->db->from('dp_penjualan a');
|
||||
$this->db->join('pelanggan b','b.ID_PELANGGAN=a.PELANGGAN_ID','left');
|
||||
$this->db->join('kota c','c.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->join('detail_dpj d','d.DPJ_ID=a.ID_DPJ','left');
|
||||
$this->db->where('a.STATUS_DPJ is NULL');
|
||||
$this->db->group_by('a.ID_DPJ');
|
||||
}else{
|
||||
$this->db->select('*,a.KODE_BUKTI AS KB,CONCAT(DATE_FORMAT(a.TGL_DPJ,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_DPJ,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT,CONCAT("Rp ",FORMAT(b.SALDO_PELANGGAN,2)) as SALDO,CONCAT("Rp ",FORMAT(b.HUTANG_PELANGGAN,2)) as HUTANG');
|
||||
$this->db->from('dp_penjualan a');
|
||||
$this->db->join('pelanggan b','b.ID_PELANGGAN=a.PELANGGAN_ID','left');
|
||||
$this->db->join('kota c','c.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->join('detail_dpj d','d.DPJ_ID=a.ID_DPJ','left');
|
||||
$this->db->where('a.STATUS_DPJ is NULL');
|
||||
$this->db->where(['a.ID_DPJ' => $id]);
|
||||
$this->db->group_by('a.ID_DPJ');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDpPenjualanDetail($id=null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(a.NOMINAL_DPJ,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('dp_penjualan a');
|
||||
$this->db->join('pelanggan b','b.ID_PELANGGAN=a.PELANGGAN_ID','left');
|
||||
$this->db->join('kota c','c.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->join('detail_dpj d','d.DPJ_ID=a.ID_DPJ','left');
|
||||
$this->db->where('a.NOMINAL_DPJ!=a.BLOCKCON');
|
||||
$this->db->group_by('a.ID_DPJ');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(a.NOMINAL_DPJ,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('dp_penjualan a');
|
||||
$this->db->join('pelanggan b','b.ID_PELANGGAN=a.PELANGGAN_ID','left');
|
||||
$this->db->join('kota c','c.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->join('detail_dpj d','d.DPJ_ID=a.ID_DPJ','left');
|
||||
$this->db->where('a.NOMINAL_DPJ!=a.BLOCKCON');
|
||||
$this->db->where(['a.ID_DPJ' => $id]);
|
||||
$this->db->group_by('a.ID_DPJ');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Step Two, Input Transaksi
|
||||
public function getDataDetailDpPenjualan($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_DPJ,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_DPJ,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('dp_penjualan a');
|
||||
$this->db->join('detail_dpj b','b.DPJ_ID=a.ID_DPJ');
|
||||
$this->db->join('piutang_dagang c','c.ID_PDA=b.PDA_ID','left');
|
||||
$this->db->join('penjualan d','d.ID_PENJUALAN=c.PENJUALAN_ID','left');
|
||||
$this->db->join('pelanggan e','e.ID_PELANGGAN=d.PELANGGAN_ID','left');
|
||||
$this->db->join('kota f','f.ID_KOTA=e.KOTA_ID','left');
|
||||
$this->db->group_by('b.ID_DDPJ');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_DPJ,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_DPJ,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('dp_penjualan a');
|
||||
$this->db->join('detail_dpj b','b.DPJ_ID=a.ID_DPJ');
|
||||
$this->db->join('piutang_dagang c','c.ID_PDA=b.PDA_ID','left');
|
||||
$this->db->join('penjualan d','d.ID_PENJUALAN=c.PENJUALAN_ID','left');
|
||||
$this->db->join('pelanggan e','e.ID_PELANGGAN=d.PELANGGAN_ID','left');
|
||||
$this->db->join('kota f','f.ID_KOTA=e.KOTA_ID','left');
|
||||
$this->db->where(['a.ID_DPJ' => $id]);
|
||||
$this->db->group_by('b.ID_DDPJ');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTitleDPJ($id) {
|
||||
$this->db->select('KODE_DPJ,CONCAT("Rp ",FORMAT(NOMINAL_DPJ,2)) as DEBIT,CONCAT("Rp ",FORMAT(BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('dp_penjualan');
|
||||
$this->db->where(['ID_DPJ' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPiutangDagang($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('piutang_dagang');
|
||||
$this->db->where(['ID_PDA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDpPenjualan($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('dp_penjualan');
|
||||
$this->db->where(['ID_DPJ' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDDPJ($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('detail_dpj');
|
||||
$this->db->where(['ID_DDPJ' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDDPJ() {
|
||||
$this->db->select_max('ID_DDPJ');
|
||||
$this->db->from('detail_dpj');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDPDA() {
|
||||
$this->db->select_max('ID_DPDA');
|
||||
$this->db->from('detail_pda');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDPJ($id) {
|
||||
$this->db->select('b.NOMINAL_DPJ,b.BLOCKCON');
|
||||
$this->db->from('detail_dpj a');
|
||||
$this->db->join('dp_penjualan b','b.ID_DPJ=a.DPJ_ID','left');
|
||||
$this->db->where(['ID_DDPJ' => $id]);
|
||||
$this->db->group_by('ID_DDPJ');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPDA($id) {
|
||||
$this->db->select('b.NOMINAL_PDA,b.BLOCKCON');
|
||||
$this->db->from('detail_pda a');
|
||||
$this->db->join('piutang_dagang b','b.ID_PDA=a.PDA_ID','left');
|
||||
$this->db->where(['ID_DPDA' => $id]);
|
||||
$this->db->group_by('ID_DPDA');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPelanggan($id) {
|
||||
$this->db->select('HUTANG_PELANGGAN,SALDO_PELANGGAN');
|
||||
$this->db->from('pelanggan');
|
||||
$this->db->where(['ID_PELANGGAN' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDetailDPJ() {
|
||||
$this->db->select('MAX(KODE_DDPJ) AS KODE');
|
||||
$this->db->from('detail_dpj');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDetailPDA() {
|
||||
$this->db->select('MAX(KODE_DPDA) AS KODE');
|
||||
$this->db->from('detail_pda');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function hapusDetailPda($id){
|
||||
$this->db->where(['KODE_BUKTI' => $id]);
|
||||
$this->db->delete('detail_pda');
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelDvd extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataDvd($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('dvd a');
|
||||
$this->db->join('spek b','b.DVD_ID=a.ID_DVD','left');
|
||||
$this->db->group_by('a.ID_DVD');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('dvd a');
|
||||
$this->db->join('spek b','b.DVD_ID=a.ID_DVD','left');
|
||||
$this->db->group_by('a.ID_DVD');
|
||||
$this->db->where(['ID_DVD' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelGudang extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataGudang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('gudang');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('gudang');
|
||||
$this->db->where(['ID_GUDANG' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataGudangPembelian($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('gudang');
|
||||
$this->db->where('ID_GUDANG<=2');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('gudang');
|
||||
$this->db->where(['ID_GUDANG' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelHarddisk extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataHarddisk($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('hdd');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('hdd');
|
||||
$this->db->where(['ID_HDD' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
class ModelHarga extends CI_Model
|
||||
{
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if ($batch === false) {
|
||||
$insert = $this->db->insert($table, $data);
|
||||
} else {
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if ($batch === false) {
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
} else {
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataHarga($id = null)
|
||||
{
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(FORMAT(a.HPP,0)) as RUPIAH,b.NO_PO,a.TIMESTAMP as WAKTU');
|
||||
$this->db->from('harga a');
|
||||
$this->db->join('sku b', 'b.ID_SKU=a.ID_SKU');
|
||||
} else {
|
||||
$this->db->select('*,CONCAT(FORMAT(a.HPP,0)) as RUPIAH,b.NO_PO,a.TIMESTAMP as WAKTU');
|
||||
$this->db->from('harga a');
|
||||
$this->db->join('sku b', 'b.ID_SKU=a.ID_SKU');
|
||||
$this->db->where(['ID_HARGA' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelHargaBeli extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataHargaBeli($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(FORMAT(a.HARGA_BELI,0)) as RUPIAH');
|
||||
$this->db->from('beli a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID');
|
||||
$this->db->join('barang c','c.ID_BARANG=a.BARANG_ID');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(FORMAT(a.HARGA_BELI,0)) as RUPIAH');
|
||||
$this->db->from('beli a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID');
|
||||
$this->db->join('barang c','c.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->where(['ID_BELI' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelHdd extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataHdd($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('hdd');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('hdd');
|
||||
$this->db->where(['ID_HDD' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHddPC($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('hdd');
|
||||
$this->db->where('TYPE_HDD="SATA"');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHddNB($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('hdd');
|
||||
$this->db->where('TYPE_HDD="SATA" AND DIMENSI_HDD="2,5 Inch"');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHddAIO($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('hdd');
|
||||
$this->db->where('TYPE_HDD="SATA" AND DIMENSI_HDD="2,5 Inch"');
|
||||
$this->db->or_where('TYPE_HDD="SATA" AND DIMENSI_HDD="3,5 Inch"');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHddWS($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('hdd');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHddSRV($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('hdd');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelHutang extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataHutang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HUTANG,"%d %M %Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NILAI_HUTANG,2)) as JUMLAH');
|
||||
$this->db->from('hutang a');
|
||||
$this->db->join('pembelian b','b.ID_PEMBELIAN=a.PEMBELIAN_ID','left');
|
||||
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HUTANG,"%d %M %Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NILAI_HUTANG,2)) as JUMLAH');
|
||||
$this->db->from('hutang a');
|
||||
$this->db->join('pembelian b','b.ID_PEMBELIAN=a.PEMBELIAN_ID','left');
|
||||
$this->db->where(['a.ID_HUTANG' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelHutangBank extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataHutangBank($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HBA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HBA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('hutang_bank a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('detail_hba c','c.HBA_ID=a.ID_HBA','left');
|
||||
$this->db->group_by('a.ID_HBA');
|
||||
$this->db->where('a.STATUS_HBA is NULL');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HBA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HBA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('hutang_bank a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('detail_hba c','c.HBA_ID=a.ID_HBA','left');
|
||||
$this->db->group_by('a.ID_HBA');
|
||||
$this->db->where('a.STATUS_HBA is NULL');
|
||||
$this->db->where(['a.ID_HBA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHutangBankDetail($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HBA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HBA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('hutang_bank a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('detail_hba c','c.HBA_ID=a.ID_HBA','left');
|
||||
$this->db->group_by('a.ID_HBA');
|
||||
$this->db->where('a.NOMINAL_HBA!=a.BLOCKCON');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HBA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HBA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('hutang_bank a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('detail_hba c','c.HBA_ID=a.ID_HBA','left');
|
||||
$this->db->group_by('a.ID_HBA');
|
||||
$this->db->where('a.NOMINAL_HBA!=a.BLOCKCON');
|
||||
$this->db->where(['a.ID_HBA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDeskripsiHBA($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(c.TGL_DHBA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HBA,2)) as DEBIT,CONCAT("Rp ",FORMAT(c.KREDIT_DHBA,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDITALL');
|
||||
$this->db->from('hutang_bank a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('detail_hba c','c.HBA_ID=a.ID_HBA');
|
||||
$this->db->group_by('c.ID_DHBA');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(c.TGL_DHBA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HBA,2)) as DEBIT,CONCAT("Rp ",FORMAT(c.KREDIT_DHBA,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDITALL');
|
||||
$this->db->from('hutang_bank a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('detail_hba c','c.HBA_ID=a.ID_HBA');
|
||||
$this->db->group_by('c.ID_DHBA');
|
||||
$this->db->where(['a.ID_HBA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTitleHBA($id)
|
||||
{
|
||||
$this->db->select('KODE_HBA,CONCAT("Rp ",FORMAT(NOMINAL_HBA,2)) as KREDIT,CONCAT("Rp ",FORMAT(BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('hutang_bank');
|
||||
$this->db->where(['ID_HBA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelHutangDagang extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataHutangDagang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HDA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HDA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('hutang_dagang a');
|
||||
$this->db->join('pembelian b','b.ID_PEMBELIAN=a.PEMBELIAN_ID','left');
|
||||
$this->db->join('supplier c','c.ID_SUPPLIER=b.SUPPLIER_ID','left');
|
||||
$this->db->join('kota d','d.ID_KOTA=c.KOTA_ID','left');
|
||||
$this->db->join('detail_hda e','e.HDA_ID=a.ID_HDA','left');
|
||||
$this->db->group_by('a.ID_HDA');
|
||||
$this->db->where('a.STATUS_HDA is NULL');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HDA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HDA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('hutang_dagang a');
|
||||
$this->db->join('pembelian b','b.ID_PEMBELIAN=a.PEMBELIAN_ID','left');
|
||||
$this->db->join('supplier c','c.ID_SUPPLIER=b.SUPPLIER_ID','left');
|
||||
$this->db->join('kota d','d.ID_KOTA=c.KOTA_ID','left');
|
||||
$this->db->join('detail_hda e','e.HDA_ID=a.ID_HDA','left');
|
||||
$this->db->group_by('a.ID_HDA');
|
||||
$this->db->where('a.STATUS_HDA is NULL');
|
||||
$this->db->where(['a.ID_HDA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHutangDagangDetail($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HDA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HDA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('hutang_dagang a');
|
||||
$this->db->join('pembelian b','b.ID_PEMBELIAN=a.PEMBELIAN_ID','left');
|
||||
$this->db->join('supplier c','c.ID_SUPPLIER=b.SUPPLIER_ID','left');
|
||||
$this->db->join('kota d','d.ID_KOTA=c.KOTA_ID','left');
|
||||
$this->db->join('detail_hda e','e.HDA_ID=a.ID_HDA','left');
|
||||
$this->db->group_by('a.ID_HDA');
|
||||
$this->db->where('a.NOMINAL_HDA!=a.BLOCKCON');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HDA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HDA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('hutang_dagang a');
|
||||
$this->db->join('pembelian b','b.ID_PEMBELIAN=a.PEMBELIAN_ID','left');
|
||||
$this->db->join('supplier c','c.ID_SUPPLIER=b.SUPPLIER_ID','left');
|
||||
$this->db->join('kota d','d.ID_KOTA=c.KOTA_ID','left');
|
||||
$this->db->join('detail_hda e','e.HDA_ID=a.ID_HDA','left');
|
||||
$this->db->group_by('a.ID_HDA');
|
||||
$this->db->where('a.NOMINAL_HDA!=a.BLOCKCON');
|
||||
$this->db->where(['a.ID_HDA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHutangDagangDPB($id){
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HDA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HDA,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('hutang_dagang a');
|
||||
$this->db->join('pembelian b','b.ID_PEMBELIAN=a.PEMBELIAN_ID');
|
||||
$this->db->join('supplier c','c.ID_SUPPLIER=b.SUPPLIER_ID');
|
||||
$this->db->join('dp_pembelian d','d.SUPPLIER_ID=c.ID_SUPPLIER');
|
||||
$this->db->join('kota e','e.ID_KOTA=c.KOTA_ID','left');
|
||||
$this->db->where('a.NOMINAL_HDA!=a.BLOCKCON');
|
||||
$this->db->group_by('a.ID_HDA');
|
||||
$this->db->where(['d.SUPPLIER_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDeskripsiHDA($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HDA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HDA,2)) as KREDIT,CONCAT("Rp ",FORMAT(b.DEBIT_DHDA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDITALL');
|
||||
$this->db->from('hutang_dagang a');
|
||||
$this->db->join('detail_hda b','b.HDA_ID=a.ID_HDA');
|
||||
$this->db->group_by('b.ID_DHDA');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HDA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HDA,2)) as KREDIT,CONCAT("Rp ",FORMAT(b.DEBIT_DHDA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDITALL');
|
||||
$this->db->from('hutang_dagang a');
|
||||
$this->db->join('detail_hda b','b.HDA_ID=a.ID_HDA');
|
||||
$this->db->group_by('b.ID_DHDA');
|
||||
$this->db->where(['a.ID_HDA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTitleHDA($id)
|
||||
{
|
||||
$this->db->select('KODE_HDA,CONCAT("Rp ",FORMAT(NOMINAL_HDA,2)) as KREDIT,CONCAT("Rp ",FORMAT(BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('hutang_dagang');
|
||||
$this->db->where(['ID_HDA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDPB($id)
|
||||
{
|
||||
$this->db->select('SUPPLIER_ID');
|
||||
$this->db->from('dp_pembelian');
|
||||
$this->db->where(['ID_DPB' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelHutangLain extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
//Step One, Input Hutang Lain
|
||||
public function getDataHutangLain($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HLA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HLA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('hutang_lain a');
|
||||
$this->db->join('detail_hla b','b.HLA_ID=a.ID_HLA','left');
|
||||
$this->db->group_by('a.ID_HLA');
|
||||
$this->db->where('a.STATUS_HLA is NULL');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HLA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HLA,2)) as DEBIT,,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('hutang_lain a');
|
||||
$this->db->join('detail_hla b','b.HLA_ID=a.ID_HLA','left');
|
||||
$this->db->group_by('a.ID_HLA');
|
||||
$this->db->where('a.STATUS_HLA is NULL');
|
||||
$this->db->where(['a.ID_HLA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHutangLainDetail($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HLA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HLA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('hutang_lain a');
|
||||
$this->db->join('detail_hla b','b.HLA_ID=a.ID_HLA','left');
|
||||
$this->db->group_by('a.ID_HLA');
|
||||
$this->db->where('a.NOMINAL_HLA!=a.BLOCKCON');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HLA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HLA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('hutang_lain a');
|
||||
$this->db->join('detail_hla b','b.HLA_ID=a.ID_HLA','left');
|
||||
$this->db->group_by('a.ID_HLA');
|
||||
$this->db->where('a.NOMINAL_HLA!=a.BLOCKCON');
|
||||
$this->db->where(['a.ID_HLA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDeskripsiHLA($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HLA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HLA,2)) as DEBIT,CONCAT("Rp ",FORMAT(b.KREDIT_DHLA,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDITALL');
|
||||
$this->db->from('hutang_lain a');
|
||||
$this->db->join('detail_hla b','b.HLA_ID=a.ID_HLA');
|
||||
$this->db->group_by('b.ID_DHLA');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HLA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HLA,2)) as DEBIT,CONCAT("Rp ",FORMAT(b.KREDIT_DHLA,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDITALL');
|
||||
$this->db->from('hutang_lain a');
|
||||
$this->db->join('detail_hla b','b.HLA_ID=a.ID_HLA');
|
||||
$this->db->group_by('b.ID_DHLA');
|
||||
$this->db->where(['a.ID_HLA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTitleHLA($id)
|
||||
{
|
||||
$this->db->select('KODE_HLA,CONCAT("Rp ",FORMAT(NOMINAL_HLA,2)) as KREDIT,CONCAT("Rp ",FORMAT(BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('hutang_lain');
|
||||
$this->db->where(['ID_HLA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelHutangPajak extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataHutangPajak($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HPA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HPA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('hutang_pajak a');
|
||||
$this->db->join('pajak b','b.ID_PAJAK=a.PAJAK_ID','left');
|
||||
$this->db->join('detail_hpa c','c.HPA_ID=a.ID_HPA','left');
|
||||
$this->db->group_by('a.ID_HPA');
|
||||
$this->db->where('a.STATUS_HPA is NULL');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HPA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HPA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('hutang_pajak a');
|
||||
$this->db->join('pajak b','b.ID_PAJAK=a.PAJAK_ID','left');
|
||||
$this->db->join('detail_hpa c','c.HPA_ID=a.ID_HPA','left');
|
||||
$this->db->group_by('a.ID_HPA');
|
||||
$this->db->where('a.STATUS_HPA is NULL');
|
||||
$this->db->where(['a.ID_HPA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHutangPajakDetail($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HPA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HPA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('hutang_pajak a');
|
||||
$this->db->join('pajak b','b.ID_PAJAK=a.PAJAK_ID','left');
|
||||
$this->db->join('detail_hpa c','c.HPA_ID=a.ID_HPA','left');
|
||||
$this->db->group_by('a.ID_HPA');
|
||||
$this->db->where('a.NOMINAL_HPA!=a.BLOCKCON');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HPA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HPA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('hutang_pajak a');
|
||||
$this->db->join('pajak b','b.ID_PAJAK=a.PAJAK_ID','left');
|
||||
$this->db->join('detail_hpa c','c.HPA_ID=a.ID_HPA','left');
|
||||
$this->db->group_by('a.ID_HPA');
|
||||
$this->db->where('a.NOMINAL_HPA!=a.BLOCKCON');
|
||||
$this->db->where(['a.ID_HPA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeHutangPajak()
|
||||
{
|
||||
$this->db->select('MAX(KODE_HPA) AS KODE');
|
||||
$this->db->from('hutang_pajak');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDeskripsiHPA($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HPA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HPA,2)) as DEBIT,CONCAT("Rp ",FORMAT(c.KREDIT_DHPA,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDITALL');
|
||||
$this->db->from('hutang_pajak a');
|
||||
$this->db->join('pajak b','b.ID_PAJAK=a.PAJAK_ID','left');
|
||||
$this->db->join('detail_hpa c','c.HPA_ID=a.ID_HPA');
|
||||
$this->db->group_by('c.ID_DHPA');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HPA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_HPA,2)) as DEBIT,CONCAT("Rp ",FORMAT(c.KREDIT_DHPA,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDITALL');
|
||||
$this->db->from('hutang_pajak a');
|
||||
$this->db->join('pajak b','b.ID_PAJAK=a.PAJAK_ID','left');
|
||||
$this->db->join('detail_hpa c','c.HPA_ID=a.ID_HPA');
|
||||
$this->db->group_by('c.ID_DHPA');
|
||||
$this->db->where(['a.ID_HPA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTitleHPA($id)
|
||||
{
|
||||
$this->db->select('KODE_HPA,CONCAT("Rp ",FORMAT(NOMINAL_HPA,2)) as KREDIT,CONCAT("Rp ",FORMAT(BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('hutang_pajak');
|
||||
$this->db->where(['ID_HPA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelInputSn extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataOs($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('os');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('os');
|
||||
$this->db->where(['ID_OS' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function view()
|
||||
{
|
||||
return $this->db->get('sn')->result();
|
||||
}
|
||||
|
||||
public function save_batch($data)
|
||||
{
|
||||
return $this->db->insert_batch('sn', $data);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelInventory1 extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataInventory1($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,c.NAMA_TYPE,d.NAMA_PROCESSOR,e.NAMA_RAM,f.NAMA_HDD,g.NAMA_SSD,h.NAMA_VGA,i.NAMA_OS,j.NAMA_DVD,k.NAMA_WARNA,l.NAMA_KEYMOU,m.NAMA_SP,n.NAMA_RAID');
|
||||
$this->db->from('inventory a');
|
||||
$this->db->join('sku b','b.ID_SKU=a.ID_SKU');
|
||||
$this->db->join('type c','c.ID_TYPE=b.ID_TYPE');
|
||||
$this->db->join('processor d','d.ID_PROCESSOR=b.ID_PROCESSOR');
|
||||
$this->db->join('ram e','e.ID_RAM=b.ID_RAM');
|
||||
$this->db->join('hdd f','f.ID_HDD=b.ID_HDD');
|
||||
$this->db->join('ssd g','g.ID_SSD=b.ID_SSD');
|
||||
$this->db->join('vga h','h.ID_VGA=b.ID_VGA');
|
||||
$this->db->join('os i','i.ID_OS=b.ID_OS');
|
||||
$this->db->join('dvd j','j.ID_DVD=b.ID_DVD');
|
||||
$this->db->join('warna k','k.ID_WARNA=b.ID_WARNA');
|
||||
$this->db->join('keymou l','l.ID_KEYMOU=b.ID_KEYMOU');
|
||||
$this->db->join('sp m','m.ID_SP=b.ID_SP');
|
||||
$this->db->join('raid n','n.ID_RAID=b.ID_RAID');
|
||||
}else{
|
||||
$this->db->select('*,c.NAMA_TYPE,d.NAMA_PROCESSOR,e.NAMA_RAM,f.NAMA_HDD,g.NAMA_SSD,h.NAMA_VGA,i.NAMA_OS,j.NAMA_DVD,k.NAMA_WARNA,l.NAMA_KEYMOU,m.NAMA_SP,n.NAMA_RAID');
|
||||
$this->db->from('inventory a');
|
||||
$this->db->join('sku b','b.ID_SKU=a.ID_SKU');
|
||||
$this->db->join('type c','c.ID_TYPE=b.ID_TYPE');
|
||||
$this->db->join('processor d','d.ID_PROCESSOR=b.ID_PROCESSOR');
|
||||
$this->db->join('ram e','e.ID_RAM=b.ID_RAM');
|
||||
$this->db->join('hdd f','f.ID_HDD=b.ID_HDD');
|
||||
$this->db->join('ssd g','g.ID_SSD=b.ID_SSD');
|
||||
$this->db->join('vga h','h.ID_VGA=b.ID_VGA');
|
||||
$this->db->join('os i','i.ID_OS=b.ID_OS');
|
||||
$this->db->join('dvd j','j.ID_DVD=b.ID_DVD');
|
||||
$this->db->join('warna k','k.ID_WARNA=b.ID_WARNA');
|
||||
$this->db->join('keymou l','l.ID_KEYMOU=b.ID_KEYMOU');
|
||||
$this->db->join('sp m','m.ID_SP=b.ID_SP');
|
||||
$this->db->join('raid n','n.ID_RAID=b.ID_RAID');
|
||||
$this->db->where(['ID_INVENTORY' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,132 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelInventoryNB extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataInventoryNB($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*','b.NAMA_TYPE','c.NAMA_PROCESSOR','d.NAMA_RAM','e.NAMA_HDD','f.NAMA_SSD','g.NAMA_VGA','h.NAMA_OS','i.NAMA_WARNA','j.NAMA_DVD');
|
||||
$this->db->from('nb a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.ID_TYPE');
|
||||
$this->db->join('processor c','c.ID_PROCESSOR=a.ID_PROCESSOR');
|
||||
$this->db->join('ram d','d.ID_RAM=a.ID_RAM');
|
||||
$this->db->join('hdd e','e.ID_HDD=a.ID_HDD');
|
||||
$this->db->join('ssd f','f.ID_SSD=a.ID_SSD');
|
||||
$this->db->join('vga g','g.ID_VGA=a.ID_VGA');
|
||||
$this->db->join('os h','h.ID_OS=a.ID_OS');
|
||||
$this->db->join('warna i','i.ID_WARNA=a.ID_WARNA');
|
||||
$this->db->join('dvd j','j.ID_DVD=a.ID_DVD');
|
||||
}else{
|
||||
$this->db->select('*','b.NAMA_TYPE','c.NAMA_PROCESSOR','d.NAMA_RAM','e.NAMA_HDD','f.NAMA_SSD','g.NAMA_VGA','h.NAMA_OS','i.NAMA_WARNA','j.NAMA_DVD');
|
||||
$this->db->from('nb a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.ID_TYPE');
|
||||
$this->db->join('processor c','c.ID_PROCESSOR=a.ID_PROCESSOR');
|
||||
$this->db->join('ram d','d.ID_RAM=a.ID_RAM');
|
||||
$this->db->join('hdd e','e.ID_HDD=a.ID_HDD');
|
||||
$this->db->join('ssd f','f.ID_SSD=a.ID_SSD');
|
||||
$this->db->join('vga g','g.ID_VGA=a.ID_VGA');
|
||||
$this->db->join('os h','h.ID_OS=a.ID_OS');
|
||||
$this->db->join('warna i','i.ID_WARNA=a.ID_WARNA');
|
||||
$this->db->join('dvd j','j.ID_DVD=a.ID_DVD');
|
||||
$this->db->where(['ID_NB' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNamaBarang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(NAMA_TYPE,"|",NAMA_PROCESSOR,"|",NAMA_RAM,"|",NAMA_SSD,"|",NAMA_HDD,"|",NAMA_OS,"|",NAMA_VGA,"|",NAMA_MONITOR,"|",NAMA_WARNA) AS NAMA_SKU');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.ID_TYPE');
|
||||
$this->db->join('processor c','c.ID_PROCESSOR=a.ID_PROCESSOR');
|
||||
$this->db->join('ram d','d.ID_RAM=a.ID_RAM');
|
||||
$this->db->join('hdd e','e.ID_HDD=a.ID_HDD');
|
||||
$this->db->join('ssd f','f.ID_SSD=a.ID_SSD');
|
||||
$this->db->join('os g','g.ID_OS=a.ID_OS');
|
||||
$this->db->join('vga h','h.ID_VGA=a.ID_VGA');
|
||||
$this->db->join('monitor i','i.ID_MONITOR=a.ID_MONITOR');
|
||||
$this->db->join('warna j','j.ID_WARNA=a.ID_WARNA');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(NAMA_TYPE,"|",NAMA_PROCESSOR,"|",NAMA_RAM,"|",NAMA_SSD,"|",NAMA_HDD,"|",NAMA_OS,"|",NAMA_VGA,"|",NAMA_MONITOR,"|",NAMA_WARNA) AS NAMA_SKU');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.ID_TYPE');
|
||||
$this->db->join('processor c','c.ID_PROCESSOR=a.ID_PROCESSOR');
|
||||
$this->db->join('ram d','d.ID_RAM=a.ID_RAM');
|
||||
$this->db->join('hdd e','e.ID_HDD=a.ID_HDD');
|
||||
$this->db->join('ssd f','f.ID_SSD=a.ID_SSD');
|
||||
$this->db->join('os g','g.ID_OS=a.ID_OS');
|
||||
$this->db->join('vga h','h.ID_VGA=a.ID_VGA');
|
||||
$this->db->join('monitor i','i.ID_MONITOR=a.ID_MONITOR');
|
||||
$this->db->join('warna j','j.ID_WARNA=a.ID_WARNA');
|
||||
$this->db->where(['ID_BARANG' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNamaBarangSku($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(NAMA_TYPE,"|",NAMA_PROCESSOR,"|",SUBSTR(NAMA_RAM,1,4),"|",NAMA_SSD,"|",NAMA_HDD,"|",NAMA_OS,"|",NAMA_VGA,"|",NAMA_MONITOR,"|",NAMA_WARNA) AS SKU');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.ID_TYPE');
|
||||
$this->db->join('processor c','c.ID_PROCESSOR=a.ID_PROCESSOR');
|
||||
$this->db->join('ram d','d.ID_RAM=a.ID_RAM');
|
||||
$this->db->join('hdd e','e.ID_HDD=a.ID_HDD');
|
||||
$this->db->join('ssd f','f.ID_SSD=a.ID_SSD');
|
||||
$this->db->join('os g','g.ID_OS=a.ID_OS');
|
||||
$this->db->join('vga h','h.ID_VGA=a.ID_VGA');
|
||||
$this->db->join('monitor i','i.ID_MONITOR=a.ID_MONITOR');
|
||||
$this->db->join('warna j','j.ID_WARNA=a.ID_WARNA');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(NAMA_TYPE,"|",NAMA_PROCESSOR,"|",SUBSTR(NAMA_RAM,1,4),"|",NAMA_SSD,"|",NAMA_HDD,"|",NAMA_OS,"|",NAMA_VGA,"|",NAMA_MONITOR,"|",NAMA_WARNA) AS SKU');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.ID_TYPE');
|
||||
$this->db->join('processor c','c.ID_PROCESSOR=a.ID_PROCESSOR');
|
||||
$this->db->join('ram d','d.ID_RAM=a.ID_RAM');
|
||||
$this->db->join('hdd e','e.ID_HDD=a.ID_HDD');
|
||||
$this->db->join('ssd f','f.ID_SSD=a.ID_SSD');
|
||||
$this->db->join('os g','g.ID_OS=a.ID_OS');
|
||||
$this->db->join('vga h','h.ID_VGA=a.ID_VGA');
|
||||
$this->db->join('monitor i','i.ID_MONITOR=a.ID_MONITOR');
|
||||
$this->db->join('warna j','j.ID_WARNA=a.ID_WARNA');
|
||||
$this->db->where(['ID_BARANG' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelInventoryPC extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataInventoryPC($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*','b.NAMA_TYPE','c.NAMA_PROCESSOR','d.NAMA_RAM','e.NAMA_HDD','f.NAMA_SSD','g.NAMA_VGA','h.NAMA_OS','i.NAMA_DVD','j.NAMA_SP','k.NAMA_KEYMOU');
|
||||
$this->db->from('pc a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.ID_TYPE');
|
||||
$this->db->join('processor c','c.ID_PROCESSOR=a.ID_PROCESSOR');
|
||||
$this->db->join('ram d','d.ID_RAM=a.ID_RAM');
|
||||
$this->db->join('hdd e','e.ID_HDD=a.ID_HDD');
|
||||
$this->db->join('ssd f','f.ID_SSD=a.ID_SSD');
|
||||
$this->db->join('vga g','g.ID_VGA=a.ID_VGA');
|
||||
$this->db->join('os h','h.ID_OS=a.ID_OS');
|
||||
$this->db->join('dvd i','i.ID_DVD=a.ID_DVD');
|
||||
$this->db->join('sp j','j.ID_SP=a.ID_SP');
|
||||
$this->db->join('keymou k','k.ID_KEYMOU=a.ID_KEYMOU');
|
||||
}else{
|
||||
$this->db->select('*','b.NAMA_TYPE','c.NAMA_PROCESSOR','d.NAMA_RAM','e.NAMA_HDD','f.NAMA_SSD','g.NAMA_VGA','h.NAMA_OS','i.NAMA_DVD','j.NAMA_SP','k.NAMA_KEYMOU');
|
||||
$this->db->from('pc a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.ID_TYPE');
|
||||
$this->db->join('processor c','c.ID_PROCESSOR=a.ID_PROCESSOR');
|
||||
$this->db->join('ram d','d.ID_RAM=a.ID_RAM');
|
||||
$this->db->join('hdd e','e.ID_HDD=a.ID_HDD');
|
||||
$this->db->join('ssd f','f.ID_SSD=a.ID_SSD');
|
||||
$this->db->join('vga g','g.ID_VGA=a.ID_VGA');
|
||||
$this->db->join('os h','h.ID_OS=a.ID_OS');
|
||||
$this->db->join('dvd i','i.ID_DVD=a.ID_DVD');
|
||||
$this->db->join('sp j','j.ID_SP=a.ID_SP');
|
||||
$this->db->join('keymou k','k.ID_KEYMOU=a.ID_KEYMOU');
|
||||
$this->db->where(['ID_PC' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNamaBarang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(NAMA_TYPE,"|",NAMA_PROCESSOR,"|",NAMA_RAM,"|",NAMA_SSD,"|",NAMA_HDD,"|",NAMA_OS,"|",NAMA_VGA,"|",NAMA_MONITOR,"|",NAMA_WARNA) AS NAMA_SKU');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.ID_TYPE');
|
||||
$this->db->join('processor c','c.ID_PROCESSOR=a.ID_PROCESSOR');
|
||||
$this->db->join('ram d','d.ID_RAM=a.ID_RAM');
|
||||
$this->db->join('hdd e','e.ID_HDD=a.ID_HDD');
|
||||
$this->db->join('ssd f','f.ID_SSD=a.ID_SSD');
|
||||
$this->db->join('os g','g.ID_OS=a.ID_OS');
|
||||
$this->db->join('vga h','h.ID_VGA=a.ID_VGA');
|
||||
$this->db->join('monitor i','i.ID_MONITOR=a.ID_MONITOR');
|
||||
$this->db->join('warna j','j.ID_WARNA=a.ID_WARNA');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(NAMA_TYPE,"|",NAMA_PROCESSOR,"|",NAMA_RAM,"|",NAMA_SSD,"|",NAMA_HDD,"|",NAMA_OS,"|",NAMA_VGA,"|",NAMA_MONITOR,"|",NAMA_WARNA) AS NAMA_SKU');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.ID_TYPE');
|
||||
$this->db->join('processor c','c.ID_PROCESSOR=a.ID_PROCESSOR');
|
||||
$this->db->join('ram d','d.ID_RAM=a.ID_RAM');
|
||||
$this->db->join('hdd e','e.ID_HDD=a.ID_HDD');
|
||||
$this->db->join('ssd f','f.ID_SSD=a.ID_SSD');
|
||||
$this->db->join('os g','g.ID_OS=a.ID_OS');
|
||||
$this->db->join('vga h','h.ID_VGA=a.ID_VGA');
|
||||
$this->db->join('monitor i','i.ID_MONITOR=a.ID_MONITOR');
|
||||
$this->db->join('warna j','j.ID_WARNA=a.ID_WARNA');
|
||||
$this->db->where(['ID_BARANG' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNamaBarangSku($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(NAMA_TYPE,"|",NAMA_PROCESSOR,"|",SUBSTR(NAMA_RAM,1,4),"|",NAMA_SSD,"|",NAMA_HDD,"|",NAMA_OS,"|",NAMA_VGA,"|",NAMA_MONITOR,"|",NAMA_WARNA) AS SKU');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.ID_TYPE');
|
||||
$this->db->join('processor c','c.ID_PROCESSOR=a.ID_PROCESSOR');
|
||||
$this->db->join('ram d','d.ID_RAM=a.ID_RAM');
|
||||
$this->db->join('hdd e','e.ID_HDD=a.ID_HDD');
|
||||
$this->db->join('ssd f','f.ID_SSD=a.ID_SSD');
|
||||
$this->db->join('os g','g.ID_OS=a.ID_OS');
|
||||
$this->db->join('vga h','h.ID_VGA=a.ID_VGA');
|
||||
$this->db->join('monitor i','i.ID_MONITOR=a.ID_MONITOR');
|
||||
$this->db->join('warna j','j.ID_WARNA=a.ID_WARNA');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(NAMA_TYPE,"|",NAMA_PROCESSOR,"|",SUBSTR(NAMA_RAM,1,4),"|",NAMA_SSD,"|",NAMA_HDD,"|",NAMA_OS,"|",NAMA_VGA,"|",NAMA_MONITOR,"|",NAMA_WARNA) AS SKU');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.ID_TYPE');
|
||||
$this->db->join('processor c','c.ID_PROCESSOR=a.ID_PROCESSOR');
|
||||
$this->db->join('ram d','d.ID_RAM=a.ID_RAM');
|
||||
$this->db->join('hdd e','e.ID_HDD=a.ID_HDD');
|
||||
$this->db->join('ssd f','f.ID_SSD=a.ID_SSD');
|
||||
$this->db->join('os g','g.ID_OS=a.ID_OS');
|
||||
$this->db->join('vga h','h.ID_VGA=a.ID_VGA');
|
||||
$this->db->join('monitor i','i.ID_MONITOR=a.ID_MONITOR');
|
||||
$this->db->join('warna j','j.ID_WARNA=a.ID_WARNA');
|
||||
$this->db->where(['ID_BARANG' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,130 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelInventorySRV extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataInventorySRV($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*','b.NAMA_TYPE','c.NAMA_PROCESSOR','d.NAMA_RAM','e.NAMA_HDD','f.NAMA_SSD','g.NAMA_DVD','h.NAMA_RAID','i.NAMA_KEYMOU');
|
||||
$this->db->from('server a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.ID_TYPE');
|
||||
$this->db->join('processor c','c.ID_PROCESSOR=a.ID_PROCESSOR');
|
||||
$this->db->join('ram d','d.ID_RAM=a.ID_RAM');
|
||||
$this->db->join('hdd e','e.ID_HDD=a.ID_HDD');
|
||||
$this->db->join('ssd f','f.ID_SSD=a.ID_SSD');
|
||||
$this->db->join('dvd g','g.ID_DVD=a.ID_DVD');
|
||||
$this->db->join('raid h','h.ID_RAID=a.ID_RAID');
|
||||
$this->db->join('keymou i','i.ID_KEYMOU=a.ID_KEYMOU');
|
||||
}else{
|
||||
$this->db->select('*','b.NAMA_TYPE','c.NAMA_PROCESSOR','d.NAMA_RAM','e.NAMA_HDD','f.NAMA_SSD','g.NAMA_DVD','h.NAMA_RAID','i.NAMA_KEYMOU');
|
||||
$this->db->from('server a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.ID_TYPE');
|
||||
$this->db->join('processor c','c.ID_PROCESSOR=a.ID_PROCESSOR');
|
||||
$this->db->join('ram d','d.ID_RAM=a.ID_RAM');
|
||||
$this->db->join('hdd e','e.ID_HDD=a.ID_HDD');
|
||||
$this->db->join('ssd f','f.ID_SSD=a.ID_SSD');
|
||||
$this->db->join('dvd g','g.ID_DVD=a.ID_DVD');
|
||||
$this->db->join('raid h','h.ID_RAID=a.ID_RAID');
|
||||
$this->db->join('keymou i','i.ID_KEYMOU=a.ID_KEYMOU');
|
||||
$this->db->where(['ID_SRV' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNamaBarang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(NAMA_TYPE,"|",NAMA_PROCESSOR,"|",NAMA_RAM,"|",NAMA_SSD,"|",NAMA_HDD,"|",NAMA_OS,"|",NAMA_VGA,"|",NAMA_MONITOR,"|",NAMA_WARNA) AS NAMA_SKU');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.ID_TYPE');
|
||||
$this->db->join('processor c','c.ID_PROCESSOR=a.ID_PROCESSOR');
|
||||
$this->db->join('ram d','d.ID_RAM=a.ID_RAM');
|
||||
$this->db->join('hdd e','e.ID_HDD=a.ID_HDD');
|
||||
$this->db->join('ssd f','f.ID_SSD=a.ID_SSD');
|
||||
$this->db->join('os g','g.ID_OS=a.ID_OS');
|
||||
$this->db->join('vga h','h.ID_VGA=a.ID_VGA');
|
||||
$this->db->join('monitor i','i.ID_MONITOR=a.ID_MONITOR');
|
||||
$this->db->join('warna j','j.ID_WARNA=a.ID_WARNA');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(NAMA_TYPE,"|",NAMA_PROCESSOR,"|",NAMA_RAM,"|",NAMA_SSD,"|",NAMA_HDD,"|",NAMA_OS,"|",NAMA_VGA,"|",NAMA_MONITOR,"|",NAMA_WARNA) AS NAMA_SKU');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.ID_TYPE');
|
||||
$this->db->join('processor c','c.ID_PROCESSOR=a.ID_PROCESSOR');
|
||||
$this->db->join('ram d','d.ID_RAM=a.ID_RAM');
|
||||
$this->db->join('hdd e','e.ID_HDD=a.ID_HDD');
|
||||
$this->db->join('ssd f','f.ID_SSD=a.ID_SSD');
|
||||
$this->db->join('os g','g.ID_OS=a.ID_OS');
|
||||
$this->db->join('vga h','h.ID_VGA=a.ID_VGA');
|
||||
$this->db->join('monitor i','i.ID_MONITOR=a.ID_MONITOR');
|
||||
$this->db->join('warna j','j.ID_WARNA=a.ID_WARNA');
|
||||
$this->db->where(['ID_BARANG' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNamaBarangSku($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(NAMA_TYPE,"|",NAMA_PROCESSOR,"|",SUBSTR(NAMA_RAM,1,4),"|",NAMA_SSD,"|",NAMA_HDD,"|",NAMA_OS,"|",NAMA_VGA,"|",NAMA_MONITOR,"|",NAMA_WARNA) AS SKU');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.ID_TYPE');
|
||||
$this->db->join('processor c','c.ID_PROCESSOR=a.ID_PROCESSOR');
|
||||
$this->db->join('ram d','d.ID_RAM=a.ID_RAM');
|
||||
$this->db->join('hdd e','e.ID_HDD=a.ID_HDD');
|
||||
$this->db->join('ssd f','f.ID_SSD=a.ID_SSD');
|
||||
$this->db->join('os g','g.ID_OS=a.ID_OS');
|
||||
$this->db->join('vga h','h.ID_VGA=a.ID_VGA');
|
||||
$this->db->join('monitor i','i.ID_MONITOR=a.ID_MONITOR');
|
||||
$this->db->join('warna j','j.ID_WARNA=a.ID_WARNA');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(NAMA_TYPE,"|",NAMA_PROCESSOR,"|",SUBSTR(NAMA_RAM,1,4),"|",NAMA_SSD,"|",NAMA_HDD,"|",NAMA_OS,"|",NAMA_VGA,"|",NAMA_MONITOR,"|",NAMA_WARNA) AS SKU');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.ID_TYPE');
|
||||
$this->db->join('processor c','c.ID_PROCESSOR=a.ID_PROCESSOR');
|
||||
$this->db->join('ram d','d.ID_RAM=a.ID_RAM');
|
||||
$this->db->join('hdd e','e.ID_HDD=a.ID_HDD');
|
||||
$this->db->join('ssd f','f.ID_SSD=a.ID_SSD');
|
||||
$this->db->join('os g','g.ID_OS=a.ID_OS');
|
||||
$this->db->join('vga h','h.ID_VGA=a.ID_VGA');
|
||||
$this->db->join('monitor i','i.ID_MONITOR=a.ID_MONITOR');
|
||||
$this->db->join('warna j','j.ID_WARNA=a.ID_WARNA');
|
||||
$this->db->where(['ID_BARANG' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelInventorySn extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataInventorySn($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*','c.NAMA_TYPE');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('inventory b','b.ID_INVENTORY=a.ID_INVENTORY');
|
||||
$this->db->join('type c','c.ID_TYPE=b.ID_TYPE');
|
||||
}else{
|
||||
$this->db->select('*','c.NAMA_TYPE');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('inventory b','b.ID_INVENTORY=a.ID_INVENTORY');
|
||||
$this->db->join('type c','c.ID_TYPE=b.ID_TYPE');
|
||||
$this->db->where(['ID_SN' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getInventory()
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('inventory a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.ID_TYPE');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getSnn($id)
|
||||
{
|
||||
$this->db->select('ID_SN, NAMA_SN');
|
||||
$this->db->from('sn');
|
||||
$this->db->where(['ID_INVENTORY' => $id]);
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelInventoryView extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataInventoryView($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,c.NAMA_PROCESSOR,d.NAMA_RAM,e.NAMA_HDD,f.NAMA_SSD,g.NAMA_VGA,h.NAMA_OS,i.NAMA_DVD,j.NAMA_WARNA,k.NAMA_KEYMOU,l.NAMA_SP,m.NAMA_RAID');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('inventory b','b.ID_INVENTORY=a.ID_INVENTORY');
|
||||
$this->db->join('processor c','c.ID_PROCESSOR=b.ID_PROCESSOR');
|
||||
$this->db->join('ram d','d.ID_RAM=b.ID_RAM');
|
||||
$this->db->join('hdd e','e.ID_HDD=b.ID_HDD');
|
||||
$this->db->join('ssd f','f.ID_SSD=b.ID_SSD');
|
||||
$this->db->join('vga g','g.ID_VGA=b.ID_VGA');
|
||||
$this->db->join('os h','h.ID_OS=b.ID_OS');
|
||||
$this->db->join('dvd i','i.ID_DVD=b.ID_DVD');
|
||||
$this->db->join('warna j','j.ID_WARNA=b.ID_WARNA');
|
||||
$this->db->join('keymou k','k.ID_KEYMOU=b.ID_KEYMOU');
|
||||
$this->db->join('sp l','l.ID_SP=b.ID_SP');
|
||||
$this->db->join('raid m','m.ID_RAID=b.ID_RAID');
|
||||
}else{
|
||||
$this->db->select('*,c.NAMA_PROCESSOR,d.NAMA_RAM,e.NAMA_HDD,f.NAMA_SSD,g.NAMA_VGA,h.NAMA_OS,i.NAMA_DVD,j.NAMA_WARNA,k.NAMA_KEYMOU,l.NAMA_SP,m.NAMA_RAID');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('inventory b','b.ID_INVENTORY=a.ID_INVENTORY');
|
||||
$this->db->join('processor c','c.ID_PROCESSOR=b.ID_PROCESSOR');
|
||||
$this->db->join('ram d','d.ID_RAM=b.ID_RAM');
|
||||
$this->db->join('hdd e','e.ID_HDD=b.ID_HDD');
|
||||
$this->db->join('ssd f','f.ID_SSD=b.ID_SSD');
|
||||
$this->db->join('vga g','g.ID_VGA=b.ID_VGA');
|
||||
$this->db->join('os h','h.ID_OS=b.ID_OS');
|
||||
$this->db->join('dvd i','i.ID_DVD=b.ID_DVD');
|
||||
$this->db->join('warna j','j.ID_WARNA=b.ID_WARNA');
|
||||
$this->db->join('keymou k','k.ID_KEYMOU=b.ID_KEYMOU');
|
||||
$this->db->join('sp l','l.ID_SP=b.ID_SP');
|
||||
$this->db->join('raid m','m.ID_RAID=b.ID_RAID');
|
||||
$this->db->where(['ID_SN' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
class ModelInvoice extends CI_Model
|
||||
{
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if ($batch === false) {
|
||||
$insert = $this->db->insert($table, $data);
|
||||
} else {
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if ($batch === false) {
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
} else {
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataInvoice($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,a.NO_INVOICE,a.TGL_INVOICE,b.NAMA_DISTRIBUTOR,a.NAMA_SKU,FORMAT(a.HPP,0) as HARGA_HPP,a.JUMLAH');
|
||||
$this->db->from('invoice a');
|
||||
$this->db->join('distributor b','b.ID_DISTRIBUTOR=a.ID_DISTRIBUTOR');
|
||||
}else{
|
||||
$this->db->select('*,a.NO_INVOICE,a.TGL_INVOICE,b.NAMA_DISTRIBUTOR,a.NAMA_SKU,FORMAT(a.HPP,0) as HARGA_HPP,a.JUMLAH');
|
||||
$this->db->from('invoice a');
|
||||
$this->db->join('distributor b','b.ID_DISTRIBUTOR=a.ID_DISTRIBUTOR');
|
||||
$this->db->where(['ID_INVOICE' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelJabatan extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Model getData
|
||||
public function getData_Jabatan($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('jabatan');
|
||||
$this->db->order_by('NAMA_JABATAN ASC');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('jabatan');
|
||||
$this->db->where(['ID_JABATAN' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Karyawan_byJABATAN($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan a');
|
||||
$this->db->join('jabatan b','b.ID_JABATAN=a.JABATAN_ID');
|
||||
$this->db->where(['a.JABATAN_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Karyawan_byUSERNAME($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['USERNAME' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Model getID
|
||||
public function getID_SetdataMax(){
|
||||
$this->db->select_max('ID_SETDATA');
|
||||
$this->db->from('setdata');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelJenis extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
//Terpakai
|
||||
public function getData_Jenis($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('jenis');
|
||||
$this->db->order_by('NAMA_JENIS ASC');
|
||||
} else {
|
||||
$this->db->select('*');
|
||||
$this->db->from('jenis');
|
||||
$this->db->where(['ID_JENIS' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Barang_byJENIS($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang');
|
||||
$this->db->where(['JENIS_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Jenis_forKlaim($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('jenis');
|
||||
$this->db->where('TYPE_JENIS=1');
|
||||
$this->db->where('ID_JENIS<=5 OR ID_JENIS=8');
|
||||
$this->db->order_by('NAMA_JENIS ASC');
|
||||
} else {
|
||||
$this->db->select('*');
|
||||
$this->db->from('jenis');
|
||||
$this->db->where(['ID_JENIS' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Tidak Terpakai
|
||||
public function getDataJenisBarang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('jenis');
|
||||
$this->db->where('NAMA_JENIS!="Cabutan"');
|
||||
$this->db->order_by('NAMA_JENIS ASC');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('jenis');
|
||||
$this->db->where(['ID_JENIS' => $id]);
|
||||
$this->db->where('NAMA_JENIS!="Cabutan"');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataJenisKonsistensi($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('jenis b','b.ID_JENIS=a.JENIS_ID','right');
|
||||
$this->db->order_by('b.NAMA_JENIS ASC');
|
||||
$this->db->group_by('b.ID_JENIS');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('jenis b','b.ID_JENIS=a.JENIS_ID','right');
|
||||
$this->db->order_by('b.NAMA_JENIS ASC');
|
||||
$this->db->group_by('b.ID_JENIS');
|
||||
$this->db->where(['b.ID_JENIS' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,233 @@
|
||||
<?php
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
class ModelKaryawan extends CI_Model
|
||||
{
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if ($batch === false) {
|
||||
$insert = $this->db->insert($table, $data);
|
||||
} else {
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if ($batch === false) {
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
} else {
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
//model getID
|
||||
public function getID_NotifikasiMax() {
|
||||
$this->db->select_max('ID_NOTIFIKASI');
|
||||
$this->db->from('notifikasi');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//model getData
|
||||
public function getData_Karyawan($id = null) {
|
||||
if ($id === null) {
|
||||
$this->db->select('*, b.NAMA_JABATAN');
|
||||
$this->db->from('karyawan a');
|
||||
$this->db->join('jabatan b', 'b.ID_JABATAN=a.JABATAN_ID');
|
||||
$this->db->where('a.ID_KARYAWAN!=1');
|
||||
$this->db->where('a.STATUS_KARYAWAN=1');
|
||||
$this->db->order_by('a.NAMA_PANGGILAN_KARYAWAN ASC');
|
||||
} else {
|
||||
$this->db->select('*, b.NAMA_JABATAN');
|
||||
$this->db->from('karyawan a');
|
||||
$this->db->join('jabatan b', 'b.ID_JABATAN=a.JABATAN_ID');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_SalesOrder_byKARYAWAN($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('sales_order a');
|
||||
$this->db->join('karyawan b', 'b.ID_KARYAWAN=a.SALES_ID');
|
||||
$this->db->where(['a.SALES_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_PiutangKaryawan_byKARYAWAN($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('piutang_karyawan a');
|
||||
$this->db->join('karyawan b', 'b.ID_KARYAWAN=a.KARYAWAN_ID');
|
||||
$this->db->where(['a.KARYAWAN_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_QualityControl_byKARYAWAN($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('quality_control a');
|
||||
$this->db->join('karyawan b', 'b.ID_KARYAWAN=a.KARYAWAN_ID');
|
||||
$this->db->where(['a.KARYAWAN_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_GudangAll($id = null) {
|
||||
if ($id === null) {
|
||||
$this->db->select('*, b.NAMA_JABATAN');
|
||||
$this->db->from('karyawan a');
|
||||
$this->db->join('jabatan b', 'b.ID_JABATAN=a.JABATAN_ID');
|
||||
$this->db->where('b.NAMA_JABATAN="GUDANG"');
|
||||
$this->db->or_where('b.NAMA_JABATAN="ADMIN GUDANG"');
|
||||
$this->db->or_where('b.NAMA_JABATAN="ADMINISTRATOR"');
|
||||
} else {
|
||||
$this->db->select('*, b.NAMA_JABATAN');
|
||||
$this->db->from('karyawan a');
|
||||
$this->db->join('jabatan b', 'b.ID_JABATAN=a.JABATAN_ID');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_SalesAll($id = null) {
|
||||
if ($id === null) {
|
||||
$this->db->select('*, b.NAMA_JABATAN');
|
||||
$this->db->from('karyawan a');
|
||||
$this->db->join('jabatan b', 'b.ID_JABATAN=a.JABATAN_ID');
|
||||
$this->db->where('b.NAMA_JABATAN="SALES"');
|
||||
$this->db->or_where('b.NAMA_JABATAN="ADMIN SALES"');
|
||||
$this->db->or_where('b.NAMA_JABATAN="ADMINISTRATOR"');
|
||||
$this->db->order_by('a.NAMA_PANGGILAN_KARYAWAN');
|
||||
} else {
|
||||
$this->db->select('*, b.NAMA_JABATAN');
|
||||
$this->db->from('karyawan a');
|
||||
$this->db->join('jabatan b', 'b.ID_JABATAN=a.JABATAN_ID');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_ServiceAll($id = null) {
|
||||
if ($id === null) {
|
||||
$this->db->select('*, b.NAMA_JABATAN');
|
||||
$this->db->from('karyawan a');
|
||||
$this->db->join('jabatan b', 'b.ID_JABATAN=a.JABATAN_ID');
|
||||
$this->db->where('b.NAMA_JABATAN="SUPPORT"');
|
||||
$this->db->or_where('b.NAMA_JABATAN="SERVICE"');
|
||||
$this->db->or_where('b.NAMA_JABATAN="ADMINISTRATOR"');
|
||||
$this->db->order_by('a.NAMA_PANGGILAN_KARYAWAN ASC');
|
||||
} else {
|
||||
$this->db->select('*, b.NAMA_JABATAN');
|
||||
$this->db->from('karyawan a');
|
||||
$this->db->join('jabatan b', 'b.ID_JABATAN=a.JABATAN_ID');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_AdministratorAll() {
|
||||
$this->db->select('*, b.NAMA_JABATAN');
|
||||
$this->db->from('karyawan a');
|
||||
$this->db->join('jabatan b', 'b.ID_JABATAN=a.JABATAN_ID');
|
||||
$this->db->where('b.NAMA_JABATAN="ADMINISTRATOR"');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function getData_Sales($id = null) {
|
||||
if ($id === null) {
|
||||
$this->db->select('*, b.NAMA_JABATAN');
|
||||
$this->db->from('karyawan a');
|
||||
$this->db->join('jabatan b', 'b.ID_JABATAN=a.JABATAN_ID');
|
||||
$this->db->where('b.NAMA_JABATAN="SALES"');
|
||||
} else {
|
||||
$this->db->select('*, b.NAMA_JABATAN');
|
||||
$this->db->from('karyawan a');
|
||||
$this->db->join('jabatan b', 'b.ID_JABATAN=a.JABATAN_ID');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_AdminGudang($id = null) {
|
||||
if ($id === null) {
|
||||
$this->db->select('*, b.NAMA_JABATAN');
|
||||
$this->db->from('karyawan a');
|
||||
$this->db->join('jabatan b', 'b.ID_JABATAN=a.JABATAN_ID');
|
||||
$this->db->where('b.NAMA_JABATAN="ADMIN GUDANG"');
|
||||
$this->db->or_where('b.NAMA_JABATAN="ADMINISTRATOR"');
|
||||
} else {
|
||||
$this->db->select('*, b.NAMA_JABATAN');
|
||||
$this->db->from('karyawan a');
|
||||
$this->db->join('jabatan b', 'b.ID_JABATAN=a.JABATAN_ID');
|
||||
$this->db->where('b.NAMA_JABATAN="ADMIN GUDANG"');
|
||||
$this->db->or_where('b.NAMA_JABATAN="ADMINISTRATOR"');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataGudang() {
|
||||
$this->db->select('*, b.NAMA_JABATAN');
|
||||
$this->db->from('karyawan a');
|
||||
$this->db->join('jabatan b', 'b.ID_JABATAN=a.JABATAN_ID');
|
||||
$this->db->where('b.NAMA_JABATAN="GUDANG"');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataService() {
|
||||
$this->db->select('*, b.NAMA_JABATAN');
|
||||
$this->db->from('karyawan a');
|
||||
$this->db->join('jabatan b', 'b.ID_JABATAN=a.JABATAN_ID');
|
||||
$this->db->where('b.NAMA_JABATAN="SERVICE"');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataSupport() {
|
||||
$this->db->select('*, b.NAMA_JABATAN');
|
||||
$this->db->from('karyawan a');
|
||||
$this->db->join('jabatan b', 'b.ID_JABATAN=a.JABATAN_ID');
|
||||
$this->db->where('b.NAMA_JABATAN="SUPPORT"');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Piutang Karyawan
|
||||
public function getDataPiutangKaryawan($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PKAR,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(b.HUTANG_KARYAWAN,2)) as PIUTANG,CONCAT("Rp ",FORMAT(a.NOMINAL_PKAR,2)) as PKAR');
|
||||
$this->db->from('piutang_karyawan a');
|
||||
$this->db->join('karyawan b','b.ID_KARYAWAN=a.KARYAWAN_ID','left');
|
||||
$this->db->group_by('a.ID_PKAR');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PKAR,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(b.HUTANG_KARYAWAN,2)) as PIUTANG,CONCAT("Rp ",FORMAT(a.NOMINAL_PKAR,2)) as PKAR');
|
||||
$this->db->from('piutang_karyawan a');
|
||||
$this->db->join('karyawan b','b.ID_KARYAWAN=a.KARYAWAN_ID','left');
|
||||
$this->db->group_by('a.ID_PKAR');
|
||||
$this->db->where(['a.ID_PKAR' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodePKAR() {
|
||||
$this->db->select('MAX(KODE_PKAR) AS KODE');
|
||||
$this->db->from('piutang_karyawan');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelKas extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getData_Kas($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('kas');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('kas');
|
||||
$this->db->where(['ID_KAS' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Kas_forDkb($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('kas');
|
||||
$this->db->where('ID_KAS !=', $id);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Kasbank_byKAS($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('kasbank');
|
||||
$this->db->where(['KAS_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_SaldoKas_byKAS_byTGL($id1,$id2){
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT((SUM(DEBET_SK)),2)) as DEBET,CONCAT("Rp ",FORMAT((SUM(KREDIT_SK)),2)) as KREDIT,CONCAT("Rp ",FORMAT((SUM(DEBET_SK-KREDIT_SK)),2)) as TOTAL');
|
||||
$this->db->from('saldo_kas');
|
||||
$this->db->where(['KAS_ID' => $id1]);
|
||||
$this->db->where('TGL_SK="'.$id2.'"');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataKasDetail($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(SALDO_KAS,2)) as SALDO');
|
||||
$this->db->from('kas');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(SALDO_KAS,2)) as SALDO');
|
||||
$this->db->from('kas');
|
||||
$this->db->where(['ID_KAS' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataKasDkas(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('kas a');
|
||||
$this->db->join('detail_kas b','b.KAS_ID=a.ID_KAS','left');
|
||||
$this->db->where('b.KAS_ID is NULL');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDKAS() {
|
||||
$this->db->select('MAX(KODE_DKAS) AS KODE');
|
||||
$this->db->from('detail_kas');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDetailKas($id=null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(b.SALDO_KAS,2)) as SALDO,CONCAT("Rp ",FORMAT(a.DEBIT_DKAS,2)) as DEBIT');
|
||||
$this->db->from('detail_kas a');
|
||||
$this->db->join('kas b','b.ID_KAS=a.KAS_ID','left');
|
||||
$this->db->group_by('a.ID_DKAS');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(b.SALDO_KAS,2)) as SALDO,CONCAT("Rp ",FORMAT(a.DEBIT_DKAS,2)) as DEBIT');
|
||||
$this->db->from('detail_kas a');
|
||||
$this->db->join('kas b','b.ID_KAS=a.KAS_ID','left');
|
||||
$this->db->group_by('a.ID_DKAS');
|
||||
$this->db->where(['a.KAS_ID' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDetailDkas($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('detail_kas');
|
||||
$this->db->where(['ID_DKAS' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,643 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelKasKeluar extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
//Step One, Input Kas Keluar
|
||||
public function getDataKasKeluar($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_KASKELUAR,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.KREDIT_KASKELUAR,2)) as KREDIT');
|
||||
$this->db->from('kaskeluar a');
|
||||
$this->db->join('kas b','b.ID_KAS=a.KAS_ID','left');
|
||||
$this->db->join('kasbank_kk c','c.KASKELUAR_ID=a.ID_KASKELUAR','left');
|
||||
$this->db->group_by('a.ID_KASKELUAR');
|
||||
$this->db->where('a.STATUS_KASKELUAR is NULL');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_KASKELUAR,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.KREDIT_KASKELUAR,2)) as KREDIT');
|
||||
$this->db->from('kaskeluar a');
|
||||
$this->db->join('kas b','b.ID_KAS=a.KAS_ID','left');
|
||||
$this->db->join('kasbank_kk c','c.KASKELUAR_ID=a.ID_KASKELUAR','left');
|
||||
$this->db->group_by('a.ID_KASKELUAR');
|
||||
$this->db->where('a.STATUS_KASKELUAR is NULL');
|
||||
$this->db->where(['a.ID_KASKELUAR' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataKasKeluarRev($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_KASKELUAR,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_KASKELUAR,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.KREDIT_KASKELUAR,2)) as KREDIT');
|
||||
$this->db->from('kaskeluar a');
|
||||
$this->db->join('kas b','b.ID_KAS=a.KAS_ID','left');
|
||||
$this->db->join('kasbank_kk c','c.KASKELUAR_ID=a.ID_KASKELUAR','left');
|
||||
$this->db->group_by('a.ID_KASKELUAR');
|
||||
$this->db->where('a.STATUS_KASKELUAR="0"');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_KASKELUAR,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_KASKELUAR,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.KREDIT_KASKELUAR,2)) as KREDIT');
|
||||
$this->db->from('kaskeluar a');
|
||||
$this->db->join('kas b','b.ID_KAS=a.KAS_ID','left');
|
||||
$this->db->join('kasbank_kk c','c.KASKELUAR_ID=a.ID_KASKELUAR','left');
|
||||
$this->db->group_by('a.ID_KASKELUAR');
|
||||
$this->db->where('a.STATUS_KASKELUAR="0"');
|
||||
$this->db->where(['a.ID_KASKELUAR' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeKasKeluar() {
|
||||
$this->db->select('MAX(KODE_KASKELUAR) AS KODE');
|
||||
$this->db->from('kaskeluar');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function hapusKasbankKK($id){
|
||||
$this->db->where(['KASKELUAR_ID' => $id]);
|
||||
$this->db->delete('kasbank_kk');
|
||||
}
|
||||
|
||||
//Step Two, Input Transaksi
|
||||
public function getDataKasbankKK($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_KASKELUAR,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_KASKELUAR,2)) as DEBITALL,CONCAT("Rp ",FORMAT(c.NOMINAL_KBKK,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.KREDIT_KASKELUAR,2)) as KREDIT');
|
||||
$this->db->from('kaskeluar a');
|
||||
$this->db->join('kas b','b.ID_KAS=a.KAS_ID','left');
|
||||
$this->db->join('kasbank_kk c','c.KASKELUAR_ID=a.ID_KASKELUAR');
|
||||
$this->db->join('perkiraan d','d.ID_PERKIRAAN=c.PERKIRAAN_ID','left');
|
||||
$this->db->group_by('c.ID_KBKK');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_KASKELUAR,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_KASKELUAR,2)) as DEBITALL,CONCAT("Rp ",FORMAT(c.NOMINAL_KBKK,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.KREDIT_KASKELUAR,2)) as KREDIT');
|
||||
$this->db->from('kaskeluar a');
|
||||
$this->db->join('kas b','b.ID_KAS=a.KAS_ID','left');
|
||||
$this->db->join('kasbank_kk c','c.KASKELUAR_ID=a.ID_KASKELUAR');
|
||||
$this->db->join('perkiraan d','d.ID_PERKIRAAN=c.PERKIRAAN_ID','left');
|
||||
$this->db->group_by('c.ID_KBKK');
|
||||
$this->db->where(['a.ID_KASKELUAR' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTitleKK($id) {
|
||||
$this->db->select('KODE_KASKELUAR,CONCAT("Rp ",FORMAT(DEBIT_KASKELUAR,2)) as DEBIT,CONCAT("Rp ",FORMAT(KREDIT_KASKELUAR,2)) as KREDIT');
|
||||
$this->db->from('kaskeluar');
|
||||
$this->db->where(['ID_KASKELUAR' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeKasbankKK() {
|
||||
$this->db->select('MAX(KODE_KBKK) AS KODE');
|
||||
$this->db->from('kasbank_kk');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getID_KBKK() {
|
||||
$this->db->select('MAX(ID_KBKK) AS KODE');
|
||||
$this->db->from('kasbank_kk');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDebitData($id) {
|
||||
$this->db->select('a.DEBIT_KASKELUAR,a.ID_KASKELUAR,b.NOMINAL_KBKK');
|
||||
$this->db->from('kaskeluar a');
|
||||
$this->db->join('kasbank_kk b','b.KASKELUAR_ID=a.ID_KASKELUAR');
|
||||
$this->db->where(['b.ID_KBKK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Step Three, Input Detail
|
||||
public function getTitleKBKK($id) {
|
||||
$this->db->select('KODE_KBKK,KASKELUAR_ID,CONCAT("Rp ",FORMAT(NOMINAL_KBKK,2)) as DEBIT');
|
||||
$this->db->from('kasbank_kk');
|
||||
$this->db->where(['ID_KBKK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataKBKK($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('kasbank_kk');
|
||||
$this->db->where(['ID_KBKK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, KAS
|
||||
public function getSaldoKAS($id) {
|
||||
$this->db->select('SALDO_KAS');
|
||||
$this->db->from('kas');
|
||||
$this->db->where(['ID_KAS' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataKAS($id) {
|
||||
$this->db->select('b.SALDO_KAS,b.ID_KAS');
|
||||
$this->db->from('detail_kas a');
|
||||
$this->db->join('kas b','b.ID_KAS=a.KAS_ID','left');
|
||||
$this->db->where(['ID_DKAS' => $id]);
|
||||
$this->db->group_by('ID_DKAS');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDetailKAS() {
|
||||
$this->db->select('MAX(KODE_DKAS) AS KODE');
|
||||
$this->db->from('detail_kas');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDKAS() {
|
||||
$this->db->select_max('ID_DKAS');
|
||||
$this->db->from('detail_kas');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDKASID($id) {
|
||||
$this->db->select('DKAS_ID');
|
||||
$this->db->from('kasbank_kk');
|
||||
$this->db->where(['ID_KBKK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, BANK
|
||||
public function getSaldoBANK($id) {
|
||||
$this->db->select('SALDO_BANK');
|
||||
$this->db->from('bank');
|
||||
$this->db->where(['ID_BANK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBANK($id) {
|
||||
$this->db->select('b.SALDO_BANK,b.ID_BANK');
|
||||
$this->db->from('detail_bank a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->where(['ID_DBANK' => $id]);
|
||||
$this->db->group_by('ID_DBANK');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDetailBANK() {
|
||||
$this->db->select('MAX(KODE_DBANK) AS KODE');
|
||||
$this->db->from('detail_bank');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDBANK() {
|
||||
$this->db->select_max('ID_DBANK');
|
||||
$this->db->from('detail_bank');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDBANKID($id) {
|
||||
$this->db->select('DBANK_ID');
|
||||
$this->db->from('kasbank_kk');
|
||||
$this->db->where(['ID_KBKK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, DP Pembelian
|
||||
public function getSaldoDPB($id) {
|
||||
$this->db->select('SALDO_SUPPLIER');
|
||||
$this->db->from('supplier');
|
||||
$this->db->where(['ID_SUPPLIER' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataSUP($id) {
|
||||
$this->db->select('b.SALDO_SUPPLIER,b.ID_SUPPLIER');
|
||||
$this->db->from('dp_pembelian a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID','left');
|
||||
$this->db->where(['ID_DPB' => $id]);
|
||||
$this->db->group_by('ID_DPB');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDPB() {
|
||||
$this->db->select('MAX(KODE_DPB) AS KODE');
|
||||
$this->db->from('dp_pembelian');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDPB() {
|
||||
$this->db->select_max('ID_DPB');
|
||||
$this->db->from('dp_pembelian');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDPBID($id) {
|
||||
$this->db->select('DPB_ID');
|
||||
$this->db->from('kasbank_kk');
|
||||
$this->db->where(['ID_KBKK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, DP Pajak
|
||||
public function getSaldoDPP($id) {
|
||||
$this->db->select('SALDO_PAJAK');
|
||||
$this->db->from('pajak');
|
||||
$this->db->where(['ID_PAJAK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPAJ($id) {
|
||||
$this->db->select('b.SALDO_PAJAK,b.ID_PAJAK');
|
||||
$this->db->from('dp_pajak a');
|
||||
$this->db->join('pajak b','b.ID_PAJAK=a.PAJAK_ID','left');
|
||||
$this->db->where(['ID_DPP' => $id]);
|
||||
$this->db->group_by('ID_DPP');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDPP() {
|
||||
$this->db->select('MAX(KODE_DPP) AS KODE');
|
||||
$this->db->from('dp_pajak');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDPP() {
|
||||
$this->db->select_max('ID_DPP');
|
||||
$this->db->from('dp_pajak');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDPPID($id) {
|
||||
$this->db->select('DPP_ID');
|
||||
$this->db->from('kasbank_kk');
|
||||
$this->db->where(['ID_KBKK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Piutang Karyawan
|
||||
public function getKodePiutangKARYAWAN() {
|
||||
$this->db->select('MAX(KODE_PKAR) AS KODE');
|
||||
$this->db->from('piutang_karyawan');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getPiutangKARYAWAN($id) {
|
||||
$this->db->select('HUTANG_KARYAWAN');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDPKAR() {
|
||||
$this->db->select_max('ID_PKAR');
|
||||
$this->db->from('piutang_karyawan');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPKAR($id) {
|
||||
$this->db->select('b.HUTANG_KARYAWAN,b.ID_KARYAWAN');
|
||||
$this->db->from('piutang_karyawan a');
|
||||
$this->db->join('karyawan b','b.ID_KARYAWAN=a.KARYAWAN_ID','left');
|
||||
$this->db->where(['ID_PKAR' => $id]);
|
||||
$this->db->group_by('ID_PKAR');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getPKARID($id) {
|
||||
$this->db->select('PKAR_ID');
|
||||
$this->db->from('kasbank_kk');
|
||||
$this->db->where(['ID_KBKK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Piutang Pihak Ke3
|
||||
public function getKodePiutangPIHAKKE3() {
|
||||
$this->db->select('MAX(KODE_PPI) AS KODE');
|
||||
$this->db->from('piutang_pihakke3');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getPiutangPIHAKKE3($id) {
|
||||
$this->db->select('HUTANG_PIHAKKE3');
|
||||
$this->db->from('pihakke3');
|
||||
$this->db->where(['ID_PIHAKKE3' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDPPI() {
|
||||
$this->db->select_max('ID_PPI');
|
||||
$this->db->from('piutang_pihakke3');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPPI($id) {
|
||||
$this->db->select('b.HUTANG_PIHAKKE3,b.ID_PIHAKKE3');
|
||||
$this->db->from('piutang_pihakke3 a');
|
||||
$this->db->join('pihakke3 b','b.ID_PIHAKKE3=a.PIHAKKE3_ID','left');
|
||||
$this->db->where(['ID_PPI' => $id]);
|
||||
$this->db->group_by('ID_PPI');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getPPIID($id) {
|
||||
$this->db->select('PPI_ID');
|
||||
$this->db->from('kasbank_kk');
|
||||
$this->db->where(['ID_KBKK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Detail Hutang Dagang
|
||||
public function getKodeDetailHDA() {
|
||||
$this->db->select('MAX(KODE_DHDA) AS KODE');
|
||||
$this->db->from('detail_hda');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDHDA() {
|
||||
$this->db->select_max('ID_DHDA');
|
||||
$this->db->from('detail_hda');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockconHDA($id) {
|
||||
$this->db->select('BLOCKCON');
|
||||
$this->db->from('hutang_dagang');
|
||||
$this->db->where(['ID_HDA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDHDAID($id) {
|
||||
$this->db->select('DHDA_ID');
|
||||
$this->db->from('kasbank_kk');
|
||||
$this->db->where(['ID_KBKK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHDA($id) {
|
||||
$this->db->select('b.BLOCKCON,b.ID_HDA,a.KREDIT_DHDA,d.PIUTANG_SUPPLIER,d.ID_SUPPLIER');
|
||||
$this->db->from('detail_hda a');
|
||||
$this->db->join('hutang_dagang b','b.ID_HDA=a.HDA_ID','left');
|
||||
$this->db->join('pembelian c','c.ID_PEMBELIAN=b.PEMBELIAN_ID','left');
|
||||
$this->db->join('supplier d','d.ID_SUPPLIER=c.SUPPLIER_ID','left');
|
||||
$this->db->where(['a.ID_DHDA' => $id]);
|
||||
$this->db->group_by('a.ID_DHDA');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Detail Hutang Pajak
|
||||
public function getKodeDetailHPA() {
|
||||
$this->db->select('MAX(KODE_DHPA) AS KODE');
|
||||
$this->db->from('detail_hpa');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDHPA() {
|
||||
$this->db->select_max('ID_DHPA');
|
||||
$this->db->from('detail_hpa');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockconHPA($id) {
|
||||
$this->db->select('BLOCKCON');
|
||||
$this->db->from('hutang_pajak');
|
||||
$this->db->where(['ID_HPA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDHPAID($id) {
|
||||
$this->db->select('DHPA_ID');
|
||||
$this->db->from('kasbank_kk');
|
||||
$this->db->where(['ID_KBKK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHPA($id) {
|
||||
$this->db->select('b.BLOCKCON,b.ID_HPA,a.KREDIT_DHPA,c.HUTANG_PAJAK,c.ID_PAJAK');
|
||||
$this->db->from('detail_hpa a');
|
||||
$this->db->join('hutang_pajak b','b.ID_HPA=a.HPA_ID','left');
|
||||
$this->db->join('pajak c','c.ID_PAJAK=b.PAJAK_ID','left');
|
||||
$this->db->where(['a.ID_DHPA' => $id]);
|
||||
$this->db->group_by('a.ID_DHPA');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Detail Hutang Bank
|
||||
public function getKodeDetailHBA() {
|
||||
$this->db->select('MAX(KODE_DHBA) AS KODE');
|
||||
$this->db->from('detail_hba');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDHBA() {
|
||||
$this->db->select_max('ID_DHBA');
|
||||
$this->db->from('detail_hba');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockconHBA($id) {
|
||||
$this->db->select('BLOCKCON');
|
||||
$this->db->from('hutang_bank');
|
||||
$this->db->where(['ID_HBA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDHBAID($id) {
|
||||
$this->db->select('DHBA_ID');
|
||||
$this->db->from('kasbank_kk');
|
||||
$this->db->where(['ID_KBKK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHBA($id) {
|
||||
$this->db->select('b.BLOCKCON,b.ID_HBA,a.KREDIT_DHBA,c.HUTANG_BANK,c.SALDO_BANK,c.ID_BANK');
|
||||
$this->db->from('detail_hba a');
|
||||
$this->db->join('hutang_bank b','b.ID_HBA=a.HBA_ID','left');
|
||||
$this->db->join('bank c','c.ID_BANK=b.BANK_ID','left');
|
||||
$this->db->where(['a.ID_DHBA' => $id]);
|
||||
$this->db->group_by('a.ID_DHBA');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Detail Hutang Lain
|
||||
public function getKodeDetailHLA() {
|
||||
$this->db->select('MAX(KODE_DHLA) AS KODE');
|
||||
$this->db->from('detail_hla');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDHLA() {
|
||||
$this->db->select_max('ID_DHLA');
|
||||
$this->db->from('detail_hla');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockconHLA($id) {
|
||||
$this->db->select('BLOCKCON');
|
||||
$this->db->from('hutang_lain');
|
||||
$this->db->where(['ID_HLA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDHLAID($id) {
|
||||
$this->db->select('DHLA_ID');
|
||||
$this->db->from('kasbank_kk');
|
||||
$this->db->where(['ID_KBKK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHLA($id) {
|
||||
$this->db->select('b.BLOCKCON,b.ID_HLA,a.KREDIT_DHLA');
|
||||
$this->db->from('detail_hla a');
|
||||
$this->db->join('hutang_lain b','b.ID_HLA=a.HLA_ID','left');
|
||||
$this->db->where(['a.ID_DHLA' => $id]);
|
||||
$this->db->group_by('a.ID_DHLA');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Detail Biaya Fee
|
||||
public function getKodeDetailBF() {
|
||||
$this->db->select('MAX(KODE_DBF) AS KODE');
|
||||
$this->db->from('detail_bf');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDBF() {
|
||||
$this->db->select_max('ID_DBF');
|
||||
$this->db->from('detail_bf');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockconBF($id) {
|
||||
$this->db->select('BLOCKCON');
|
||||
$this->db->from('biaya_fee');
|
||||
$this->db->where(['ID_BF' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDBFID($id) {
|
||||
$this->db->select('DBF_ID');
|
||||
$this->db->from('kasbank_kk');
|
||||
$this->db->where(['ID_KBKK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBF($id) {
|
||||
$this->db->select('b.BLOCKCON,b.ID_BF,a.KREDIT_DBF');
|
||||
$this->db->from('detail_bf a');
|
||||
$this->db->join('biaya_fee b','b.ID_BF=a.BF_ID','left');
|
||||
$this->db->where(['a.ID_DBF' => $id]);
|
||||
$this->db->group_by('a.ID_DBF');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Biaya Pengiriman
|
||||
public function getKodeDetailBP() {
|
||||
$this->db->select('MAX(KODE_DBP) AS KODE');
|
||||
$this->db->from('detail_bp');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDBP() {
|
||||
$this->db->select_max('ID_DBP');
|
||||
$this->db->from('detail_bp');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockkreBP($id) {
|
||||
$this->db->select('BLOCKKRE_BP');
|
||||
$this->db->from('biaya_pengiriman');
|
||||
$this->db->where(['ID_BP' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDBPID($id) {
|
||||
$this->db->select('DBP_ID');
|
||||
$this->db->from('kasbank_kk');
|
||||
$this->db->where(['ID_KBKK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBP($id) {
|
||||
$this->db->select('a.KODE_BP,a.ID_BP,b.ID_PENJUALAN,a.NOMINAL_BP,a.BLOCKDEB_BP,a.BLOCKKRE_BP,c.KREDIT_DBP');
|
||||
$this->db->from('biaya_pengiriman a');
|
||||
$this->db->join('penjualan b','b.ID_PENJUALAN=a.PENJUALAN_ID','left');
|
||||
$this->db->join('detail_bp c','c.BP_ID=a.ID_BP','left');
|
||||
$this->db->where(['c.ID_DBP' => $id]);
|
||||
$this->db->group_by('a.ID_BP');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Biaya Service Kendaraan
|
||||
public function getKodeDetailBSK() {
|
||||
$this->db->select('MAX(KODE_DBSK) AS KODE');
|
||||
$this->db->from('detail_bsk');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDBSK() {
|
||||
$this->db->select_max('ID_DBSK');
|
||||
$this->db->from('detail_bsk');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDBSKID($id) {
|
||||
$this->db->select('DBSK_ID');
|
||||
$this->db->from('kasbank_kk');
|
||||
$this->db->where(['ID_KBKK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBSK($id) {
|
||||
$this->db->select('a.KODE_BSK,a.ID_BSK,b.ID_KENDARAAN,a.NOMINAL_BSK');
|
||||
$this->db->from('biaya_sk a');
|
||||
$this->db->join('kendaraan b','b.ID_KENDARAAN=a.KENDARAAN_ID','left');
|
||||
$this->db->where(['a.ID_BSK' => $id]);
|
||||
$this->db->group_by('a.ID_BSK');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Biaya Bensin
|
||||
public function getKodeDetailBB() {
|
||||
$this->db->select('MAX(KODE_DBB) AS KODE');
|
||||
$this->db->from('detail_bb');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDBB() {
|
||||
$this->db->select_max('ID_DBB');
|
||||
$this->db->from('detail_bb');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDBBID($id) {
|
||||
$this->db->select('DBB_ID');
|
||||
$this->db->from('kasbank_kk');
|
||||
$this->db->where(['ID_KBKK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBB($id) {
|
||||
$this->db->select('a.KODE_BB,a.ID_BB,b.ID_KENDARAAN,c.ID_KARYAWAN,a.NOMINAL_BB');
|
||||
$this->db->from('biaya_bensin a');
|
||||
$this->db->join('kendaraan b','b.ID_KENDARAAN=a.KENDARAAN_ID','left');
|
||||
$this->db->join('karyawan c','c.ID_KARYAWAN=a.KARYAWAN_ID','left');
|
||||
$this->db->where(['a.ID_BB' => $id]);
|
||||
$this->db->group_by('a.ID_BB');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,424 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelKasMasuk extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
//Step One, Input Kas Masuk
|
||||
public function getDataKasMasuk($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_KASMASUK,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_KASMASUK,2)) as DEBIT');
|
||||
$this->db->from('kasmasuk a');
|
||||
$this->db->join('kas b','b.ID_KAS=a.KAS_ID','left');
|
||||
$this->db->join('kasbank_km c','c.KASMASUK_ID=a.ID_KASMASUK','left');
|
||||
$this->db->group_by('a.ID_KASMASUK');
|
||||
$this->db->where('a.STATUS_KASMASUK is NULL');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_KASMASUK,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_KASMASUK,2)) as DEBIT');
|
||||
$this->db->from('kasmasuk a');
|
||||
$this->db->join('kas b','b.ID_KAS=a.KAS_ID','left');
|
||||
$this->db->join('kasbank_km c','c.KASMASUK_ID=a.ID_KASMASUK','left');
|
||||
$this->db->group_by('a.ID_KASMASUK');
|
||||
$this->db->where('a.STATUS_KASMASUK is NULL');
|
||||
$this->db->where(['a.ID_KASMASUK' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataKasMasukRev($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_KASMASUK,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_KASMASUK,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.KREDIT_KASMASUK,2)) as KREDIT');
|
||||
$this->db->from('kasmasuk a');
|
||||
$this->db->join('kas b','b.ID_KAS=a.KAS_ID','left');
|
||||
$this->db->join('kasbank_km c','c.KASMASUK_ID=a.ID_KASMASUK','left');
|
||||
$this->db->group_by('a.ID_KASMASUK');
|
||||
$this->db->where('a.STATUS_KASMASUK="0"');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_KASMASUK,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_KASMASUK,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.KREDIT_KASMASUK,2)) as KREDIT');
|
||||
$this->db->from('kasmasuk a');
|
||||
$this->db->join('kas b','b.ID_KAS=a.KAS_ID','left');
|
||||
$this->db->join('kasbank_km c','c.KASMASUK_ID=a.ID_KASMASUK','left');
|
||||
$this->db->group_by('a.ID_KASMASUK');
|
||||
$this->db->where('a.STATUS_KASMASUK="0"');
|
||||
$this->db->where(['a.ID_KASMASUK' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeKasMasuk() {
|
||||
$this->db->select('MAX(KODE_KASMASUK) AS KODE');
|
||||
$this->db->from('kasmasuk');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function hapusKasbankKM($id){
|
||||
$this->db->where(['KASMASUK_ID' => $id]);
|
||||
$this->db->delete('kasbank_km');
|
||||
}
|
||||
|
||||
//Step Two, Input Transaksi
|
||||
public function getDataKasbankKM($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_KASMASUK,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_KASMASUK,2)) as DEBIT,CONCAT("Rp ",FORMAT(c.NOMINAL_KBKM,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.KREDIT_KASMASUK,2)) as KREDITALL');
|
||||
$this->db->from('kasmasuk a');
|
||||
$this->db->join('kas b','b.ID_KAS=a.KAS_ID','left');
|
||||
$this->db->join('kasbank_km c','c.KASMASUK_ID=a.ID_KASMASUK');
|
||||
$this->db->join('perkiraan d','d.ID_PERKIRAAN=c.PERKIRAAN_ID','left');
|
||||
$this->db->group_by('c.ID_KBKM');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_KASMASUK,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.DEBIT_KASMASUK,2)) as DEBIT,CONCAT("Rp ",FORMAT(c.NOMINAL_KBKM,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.KREDIT_KASMASUK,2)) as KREDITALL');
|
||||
$this->db->from('kasmasuk a');
|
||||
$this->db->join('kas b','b.ID_KAS=a.KAS_ID','left');
|
||||
$this->db->join('kasbank_km c','c.KASMASUK_ID=a.ID_KASMASUK');
|
||||
$this->db->join('perkiraan d','d.ID_PERKIRAAN=c.PERKIRAAN_ID','left');
|
||||
$this->db->where(['a.ID_KASMASUK' => $id]);
|
||||
$this->db->group_by('c.ID_KBKM');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTitleKM($id) {
|
||||
$this->db->select('KODE_KASMASUK,CONCAT("Rp ",FORMAT(DEBIT_KASMASUK,2)) as DEBIT,CONCAT("Rp ",FORMAT(KREDIT_KASMASUK,2)) as KREDIT');
|
||||
$this->db->from('kasmasuk');
|
||||
$this->db->where(['ID_KASMASUK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeKasbankKM() {
|
||||
$this->db->select('MAX(KODE_KBKM) AS KODE');
|
||||
$this->db->from('kasbank_km');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getID_KBKM() {
|
||||
$this->db->select('MAX(ID_KBKM) AS KODE');
|
||||
$this->db->from('kasbank_km');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKreditData($id) {
|
||||
$this->db->select('a.KREDIT_KASMASUK,a.ID_KASMASUK,b.NOMINAL_KBKM');
|
||||
$this->db->from('kasmasuk a');
|
||||
$this->db->join('kasbank_km b','b.KASMASUK_ID=a.ID_KASMASUK');
|
||||
$this->db->where(['b.ID_KBKM' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Step Three, Input Detail
|
||||
public function getTitleKBKM($id) {
|
||||
$this->db->select('KODE_KBKM,KASMASUK_ID,CONCAT("Rp ",FORMAT(NOMINAL_KBKM,2)) as KREDIT');
|
||||
$this->db->from('kasbank_km');
|
||||
$this->db->where(['ID_KBKM' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataKBKM($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('kasbank_km');
|
||||
$this->db->where(['ID_KBKM' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, KAS
|
||||
public function getSaldoKAS($id) {
|
||||
$this->db->select('SALDO_KAS');
|
||||
$this->db->from('kas');
|
||||
$this->db->where(['ID_KAS' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataKAS($id) {
|
||||
$this->db->select('b.SALDO_KAS,b.ID_KAS');
|
||||
$this->db->from('detail_kas a');
|
||||
$this->db->join('kas b','b.ID_KAS=a.KAS_ID','left');
|
||||
$this->db->where(['ID_DKAS' => $id]);
|
||||
$this->db->group_by('ID_DKAS');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDetailKAS() {
|
||||
$this->db->select('MAX(KODE_DKAS) AS KODE');
|
||||
$this->db->from('detail_kas');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDKAS() {
|
||||
$this->db->select_max('ID_DKAS');
|
||||
$this->db->from('detail_kas');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDKASID($id) {
|
||||
$this->db->select('DKAS_ID');
|
||||
$this->db->from('kasbank_km');
|
||||
$this->db->where(['ID_KBKM' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, BANK
|
||||
public function getSaldoBANK($id) {
|
||||
$this->db->select('SALDO_BANK');
|
||||
$this->db->from('bank');
|
||||
$this->db->where(['ID_BANK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBANK($id) {
|
||||
$this->db->select('b.SALDO_BANK,b.ID_BANK');
|
||||
$this->db->from('detail_bank a');
|
||||
$this->db->join('bank b','b.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->where(['ID_DBANK' => $id]);
|
||||
$this->db->group_by('ID_DBANK');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDetailBANK() {
|
||||
$this->db->select('MAX(KODE_DBANK) AS KODE');
|
||||
$this->db->from('detail_bank');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDBANK() {
|
||||
$this->db->select_max('ID_DBANK');
|
||||
$this->db->from('detail_bank');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDBANKID($id) {
|
||||
$this->db->select('DBANK_ID');
|
||||
$this->db->from('kasbank_km');
|
||||
$this->db->where(['ID_KBKM' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, DP Penjualan
|
||||
public function getSaldoDPJ($id) {
|
||||
$this->db->select('SALDO_PELANGGAN');
|
||||
$this->db->from('pelanggan');
|
||||
$this->db->where(['ID_PELANGGAN' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPEL($id) {
|
||||
$this->db->select('b.SALDO_PELANGGAN,b.ID_PELANGGAN');
|
||||
$this->db->from('dp_penjualan a');
|
||||
$this->db->join('pelanggan b','b.ID_PELANGGAN=a.PELANGGAN_ID','left');
|
||||
$this->db->where(['ID_DPJ' => $id]);
|
||||
$this->db->group_by('ID_DPJ');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDPJ() {
|
||||
$this->db->select('MAX(KODE_DPJ) AS KODE');
|
||||
$this->db->from('dp_penjualan');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDPJ() {
|
||||
$this->db->select_max('ID_DPJ');
|
||||
$this->db->from('dp_penjualan');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDPJID($id) {
|
||||
$this->db->select('DPJ_ID');
|
||||
$this->db->from('kasbank_km');
|
||||
$this->db->where(['ID_KBKM' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Hutang LAIN
|
||||
public function getKodeHutangLAIN() {
|
||||
$this->db->select('MAX(KODE_HLA) AS KODE');
|
||||
$this->db->from('hutang_lain');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDHLA() {
|
||||
$this->db->select_max('ID_HLA');
|
||||
$this->db->from('hutang_lain');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getHLAID($id) {
|
||||
$this->db->select('HLA_ID');
|
||||
$this->db->from('kasbank_km');
|
||||
$this->db->where(['ID_KBKM' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Detail Piutang Karyawan
|
||||
public function getKodeDetailPKAR() {
|
||||
$this->db->select('MAX(KODE_DPKAR) AS KODE');
|
||||
$this->db->from('detail_pkar');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDPKAR() {
|
||||
$this->db->select_max('ID_DPKAR');
|
||||
$this->db->from('detail_pkar');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockconPKAR($id) {
|
||||
$this->db->select('BLOCKCON');
|
||||
$this->db->from('piutang_karyawan');
|
||||
$this->db->where(['ID_PKAR' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDPKARID($id) {
|
||||
$this->db->select('DPKAR_ID');
|
||||
$this->db->from('kasbank_km');
|
||||
$this->db->where(['ID_KBKM' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPKAR($id) {
|
||||
$this->db->select('b.BLOCKCON,b.ID_PKAR,a.DEBIT_DPKAR,c.HUTANG_KARYAWAN,c.ID_KARYAWAN');
|
||||
$this->db->from('detail_pkar a');
|
||||
$this->db->join('piutang_karyawan b','b.ID_PKAR=a.PKAR_ID','left');
|
||||
$this->db->join('karyawan c','c.ID_KARYAWAN=b.KARYAWAN_ID','left');
|
||||
$this->db->where(['a.ID_DPKAR' => $id]);
|
||||
$this->db->group_by('a.ID_DPKAR');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Detail Piutang Pihak Ke3
|
||||
public function getKodeDetailPPI() {
|
||||
$this->db->select('MAX(KODE_DPPI) AS KODE');
|
||||
$this->db->from('detail_ppi');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDPPI() {
|
||||
$this->db->select_max('ID_DPPI');
|
||||
$this->db->from('detail_ppi');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockconPPI($id) {
|
||||
$this->db->select('BLOCKCON');
|
||||
$this->db->from('piutang_pihakke3');
|
||||
$this->db->where(['ID_PPI' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDPPIID($id) {
|
||||
$this->db->select('DPPI_ID');
|
||||
$this->db->from('kasbank_km');
|
||||
$this->db->where(['ID_KBKM' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPPI($id) {
|
||||
$this->db->select('b.BLOCKCON,b.ID_PPI,a.DEBIT_DPPI,c.ID_PIHAKKE3,c.HUTANG_PIHAKKE3');
|
||||
$this->db->from('detail_ppi a');
|
||||
$this->db->join('piutang_pihakke3 b','b.ID_PPI=a.PPI_ID','left');
|
||||
$this->db->join('pihakke3 c','c.ID_PIHAKKE3=b.PIHAKKE3_ID','left');
|
||||
$this->db->where(['a.ID_DPPI' => $id]);
|
||||
$this->db->group_by('a.ID_DPPI');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Detail Piutang Dagang
|
||||
public function getKodeDetailPDA() {
|
||||
$this->db->select('MAX(KODE_DPDA) AS KODE');
|
||||
$this->db->from('detail_pda');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDPDA() {
|
||||
$this->db->select_max('ID_DPDA');
|
||||
$this->db->from('detail_pda');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockconPDA($id) {
|
||||
$this->db->select('BLOCKCON');
|
||||
$this->db->from('piutang_dagang');
|
||||
$this->db->where(['ID_PDA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDPDAID($id) {
|
||||
$this->db->select('DPDA_ID');
|
||||
$this->db->from('kasbank_km');
|
||||
$this->db->where(['ID_KBKM' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPDA($id) {
|
||||
$this->db->select('b.BLOCKCON,b.ID_PDA,a.DEBIT_DPDA,c.ID_PENJUALAN,d.ID_PELANGGAN,d.HUTANG_PELANGGAN');
|
||||
$this->db->from('detail_pda a');
|
||||
$this->db->join('piutang_dagang b','b.ID_PDA=a.PDA_ID','left');
|
||||
$this->db->join('penjualan c','c.ID_PENJUALAN=b.PENJUALAN_ID','left');
|
||||
$this->db->join('pelanggan d','d.ID_PELANGGAN=c.PELANGGAN_ID','left');
|
||||
$this->db->where(['a.ID_DPDA' => $id]);
|
||||
$this->db->group_by('a.ID_DPDA');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Submenu Three, Biaya Pengiriman
|
||||
public function getKodeDetailBP() {
|
||||
$this->db->select('MAX(KODE_DBP) AS KODE');
|
||||
$this->db->from('detail_bp');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDDBP() {
|
||||
$this->db->select_max('ID_DBP');
|
||||
$this->db->from('detail_bp');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockdebBP($id) {
|
||||
$this->db->select('BLOCKDEB_BP');
|
||||
$this->db->from('biaya_pengiriman');
|
||||
$this->db->where(['ID_BP' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDBPID($id) {
|
||||
$this->db->select('DBP_ID');
|
||||
$this->db->from('kasbank_km');
|
||||
$this->db->where(['ID_KBKM' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBP($id) {
|
||||
$this->db->select('a.KODE_BP,a.ID_BP,b.ID_PENJUALAN,a.NOMINAL_BP,a.BLOCKDEB_BP,a.BLOCKKRE_BP,c.DEBIT_DBP');
|
||||
$this->db->from('biaya_pengiriman a');
|
||||
$this->db->join('penjualan b','b.ID_PENJUALAN=a.PENJUALAN_ID','left');
|
||||
$this->db->join('detail_bp c','c.BP_ID=a.ID_BP','left');
|
||||
$this->db->where(['c.ID_DBP' => $id]);
|
||||
$this->db->group_by('a.ID_BP');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,135 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelKelompok extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getData_Kelompok($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('kelompok');
|
||||
$this->db->order_by('NAMA_KELOMPOK ASC');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('kelompok');
|
||||
$this->db->where(['ID_KELOMPOK' => $id]);
|
||||
$this->db->order_by('NAMA_KELOMPOK ASC');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Pelanggan_byKELOMPOK($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('kelompok b','b.ID_KELOMPOK=a.KELOMPOK_ID');
|
||||
$this->db->where(['a.KELOMPOK_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function getKelompokKelompok($id)
|
||||
{
|
||||
$this->db->select('*,f.NAMA_KOTA as KS,g.NAMA_KOTA as KP,h.NAMA_KOTA as KTp');
|
||||
$this->db->from('kelompok a');
|
||||
$this->db->join('kelompok b', 'b.KELOMPOK_ID=a.ID_KELOMPOK');
|
||||
$this->db->join('supplier c', 'c.ID_SUPPLIER=b.ANGGOTA_ID','left');
|
||||
$this->db->join('pelanggan d', 'd.ID_PELANGGAN=b.ANGGOTA_ID','left');
|
||||
$this->db->join('tp e', 'e.ID_TP=b.ANGGOTA_ID','left');
|
||||
$this->db->join('kota f', 'f.ID_KOTA=c.KOTA_ID','left');
|
||||
$this->db->join('kota g', 'g.ID_KOTA=d.KOTA_ID','left');
|
||||
$this->db->join('kota h', 'h.ID_KOTA=e.KOTA_ID','left');
|
||||
$this->db->where(['a.ID_KELOMPOK' => $id]);
|
||||
$this->db->group_by('b.ID_KELOMPOK');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNamaKelompok($id)
|
||||
{
|
||||
$this->db->select('NAMA_KELOMPOK');
|
||||
$this->db->from('kelompok');
|
||||
$this->db->where(['ID_KELOMPOK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKelompokID($id)
|
||||
{
|
||||
$this->db->select('KELOMPOK_ID');
|
||||
$this->db->from('kelompok');
|
||||
$this->db->where(['ID_KELOMPOK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function updateStatusKelompok($id)
|
||||
{
|
||||
$data = "None";
|
||||
$this->db->set('STATUS_KELOMPOK',$data);
|
||||
$this->db->update('kelompok');
|
||||
$this->db->where(['KELOMPOK_ID' => $id]);
|
||||
}
|
||||
|
||||
public function defaultStatusKelompok($id)
|
||||
{
|
||||
$data = NULL;
|
||||
$this->db->set('STATUS_KELOMPOK',$data);
|
||||
$this->db->update('kelompok');
|
||||
$this->db->where(['KELOMPOK_ID' => $id]);
|
||||
}
|
||||
|
||||
public function getDataTeknisi($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('operator');
|
||||
$this->db->where('ID_OPERATOR >=3');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('operator');
|
||||
$this->db->where('ID_OPERATOR >=3');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelKendaraan extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getData_Kendaraan($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('kendaraan');
|
||||
$this->db->order_by('TYPE_KENDARAAN ASC');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('kendaraan');
|
||||
$this->db->where(['ID_KENDARAAN' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_BiayaBensin_byKENDARAAN($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('biaya_bensin');
|
||||
$this->db->where(['KENDARAAN_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_BiayaServiceKendaraan_byKENDARAAN($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('biaya_servicekendaraan');
|
||||
$this->db->where(['KENDARAAN_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelKeyMou extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataKeyMou($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('keymou');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('keymou');
|
||||
$this->db->where(['ID_KEYMOU' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelKm extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataKm($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('km');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('km');
|
||||
$this->db->where(['ID_KM' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,316 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelKomisi extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getData_Komisi($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('jenis');
|
||||
$this->db->order_by('NAMA_JENIS ASC');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('jenis');
|
||||
$this->db->where(['ID_JENIS' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_DaftarKasbank($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('daftar_kasbank a');
|
||||
$this->db->join('kasbank b','b.ID_KB=a.KB_ID');
|
||||
$this->db->where('a.SETDATA_ID is NULL');
|
||||
$this->db->where('a.TGL_DKB is NULL');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('transaksi_stock a');
|
||||
$this->db->join('sales_order b','b.ID_SO=a.SO_ID');
|
||||
$this->db->where(['ID_IO' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Pembelian($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('daftar_beli a');
|
||||
$this->db->join('pembelian b','b.ID_PEMBELIAN=a.PEMBELIAN_ID');
|
||||
$this->db->where('b.STATUS_PEMBELIAN=1');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('transaksi_stock a');
|
||||
$this->db->join('sales_order b','b.ID_SO=a.SO_ID');
|
||||
$this->db->where(['ID_IO' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_ReturPembelian(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('daftar_returbeli a');
|
||||
$this->db->join('retur_pembelian b','b.ID_RB=a.RB_ID');
|
||||
$this->db->where('b.STATUS_RB=1');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_HargaAvg($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('harga_avg');
|
||||
$this->db->where(['BARANG_ID' => $id]);
|
||||
$this->db->order_by('ID_HAVG DESC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_DaftarBeli_forAVG($id){
|
||||
$this->db->select('a.BARANG_ID,a.QTY_DB as QTY,a.HARGA_DB as HARGA');
|
||||
$this->db->from('daftar_beli a');
|
||||
$this->db->join('pembelian b','b.ID_PEMBELIAN=a.PEMBELIAN_ID');
|
||||
$this->db->where(['a.BARANG_ID' => $id]);
|
||||
$this->db->where('b.STATUS_PEMBELIAN=1');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_DaftarReturBeli_forAVG($id){
|
||||
$this->db->select('a.BARANG_ID,a.QTY_DRB as QTY,a.HARGA_DRB as HARGA');
|
||||
$this->db->from('daftar_returbeli a');
|
||||
$this->db->join('retur_pembelian b','b.ID_RB=a.RB_ID');
|
||||
$this->db->where(['a.BARANG_ID' => $id]);
|
||||
$this->db->where('b.STATUS_RB=1');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_TransaksiStock_Masuk_forAVG($id){
|
||||
$this->db->select('BARANG_ID,QTY_IO as QTY,HARGA_IO as HARGA');
|
||||
$this->db->from('transaksi_stock');
|
||||
$this->db->where(['BARANG_ID' => $id]);
|
||||
$this->db->where('STATUS_IO=1');
|
||||
$this->db->where('JENIS_IO=1');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Penjualan_Pda(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('penjualan a');
|
||||
$this->db->join('piutang_dagang b','b.PENJUALAN_ID=a.ID_PENJUALAN');
|
||||
$this->db->where('a.STATUS_PENJUALAN=1');
|
||||
$this->db->group_by('b.PENJUALAN_ID');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
|
||||
public function getData_SalesOrder_1(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('sales_order');
|
||||
$this->db->where('STATUS_SO=1');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_DaftarOrder_bySO($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('daftar_order');
|
||||
$this->db->where('SO_ID=', $id);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_DaftarOrder(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('daftar_order a');
|
||||
$this->db->join('sales_order b','b.ID_SO=a.SO_ID');
|
||||
$this->db->where('b.STATUS_SO=5');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Barang_byID($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('jenis b','b.ID_JENIS=a.JENIS_ID');
|
||||
$this->db->where('a.ID_BARANG=', $id);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Pelanggan_byID($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('pelanggan');
|
||||
$this->db->where('ID_PELANGGAN=', $id);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_DaftarKasbank_bySETDATA(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('daftar_kasbank');
|
||||
$this->db->where('SETDATA_ID=1');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeKasMasuk() {
|
||||
$this->db->select('MAX(KODE_KB) AS KODE');
|
||||
$this->db->from('kasbank');
|
||||
$this->db->like('KODE_KB','BSD', 'after');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getID_KasbankMax() {
|
||||
$this->db->select_max('ID_KB');
|
||||
$this->db->from('kasbank');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_HargaAvg_TransaksiStock($id=null){
|
||||
if ($id==null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('harga_avg a');
|
||||
$this->db->join('transaksi_stock b','b.BARANG_ID=a.BARANG_ID');
|
||||
$this->db->where('a.KODE_BUKTI=b.KODE_BUKTI');
|
||||
$this->db->where('a.KODE_BUKTI="SD22-0001"');
|
||||
} else {
|
||||
$this->db->select('*');
|
||||
$this->db->from('harga_avg a');
|
||||
$this->db->join('transaksi_stock b','b.BARANG_ID=a.BARANG_ID');
|
||||
$this->db->where('a.KODE_BUKTI=b.KODE_BUKTI');
|
||||
$this->db->where('a.KODE_BUKTI="SD22-0001"');
|
||||
$this->db->where('a.BARANG_ID=', $id);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_HargaAvg_Pembelian(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('harga_avg a');
|
||||
$this->db->join('pembelian b','b.KODE_PEMBELIAN=a.KODE_BUKTI');
|
||||
$this->db->where('a.ID_HAVG>=931 AND a.ID_HAVG<=1417');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_HistoriKuantiti_Io(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('histori_kuantiti a');
|
||||
$this->db->join('transaksi_stock b','b.BARANG_ID=a.BARANG_ID');
|
||||
$this->db->where('a.KODE_BUKTI=b.KODE_BUKTI');
|
||||
$this->db->where('a.KODE_BUKTI="SD22-0001"');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_HistoriKuantiti_Havg(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('histori_kuantiti a');
|
||||
$this->db->join('harga_avg b','b.BARANG_ID=a.BARANG_ID');
|
||||
$this->db->where('a.KODE_BUKTI=b.KODE_BUKTI');
|
||||
$this->db->where('a.KODE_BUKTI="SD22-0001"');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_HargaAvg_byID($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('harga_avg');
|
||||
$this->db->where('ID_HAVG=', $id);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_TransaksiStock_byID($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('transaksi_stock');
|
||||
$this->db->where('ID_IO=', $id);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_HistoriKuantiti_MasukLebih0(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('histori_kuantiti');
|
||||
$this->db->where('MASUK_HQ>0');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_HistoriKuantiti_byBARANG_beforeID($id_barang, $id_hq){
|
||||
$this->db->select('*');
|
||||
$this->db->from('histori_kuantiti');
|
||||
$this->db->where('BARANG_ID=', $id_barang);
|
||||
$this->db->where('ID_HQ<', $id_hq);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_HistoriKuantiti_byBARANG_beforeID_forHAVG($id_barang, $id_hq){
|
||||
$this->db->select('*');
|
||||
$this->db->from('histori_kuantiti');
|
||||
$this->db->where('BARANG_ID=', $id_barang);
|
||||
$this->db->where('ID_HQ<', $id_hq);
|
||||
$this->db->where('HAVG_ID IS NOT NULL');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getSum_HistoriKuantiti_byBARANG_beforeID($id_barang, $id_hq){
|
||||
$this->db->select('SUM(MASUK_HQ-KELUAR_HQ) as REAL');
|
||||
$this->db->from('histori_kuantiti');
|
||||
$this->db->where('BARANG_ID=', $id_barang);
|
||||
$this->db->where('ID_HQ<', $id_hq);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_DaftarBeli_byPEMBELIAN($id_pembelian, $id_barang){
|
||||
$this->db->select('*');
|
||||
$this->db->from('daftar_beli');
|
||||
$this->db->where('PEMBELIAN_ID=', $id_pembelian);
|
||||
$this->db->where('BARANG_ID=', $id_barang);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_DaftarBeli_byKODE_byBARANG($kode_pembelian, $id_barang){
|
||||
$this->db->select('*');
|
||||
$this->db->from('daftar_beli a');
|
||||
$this->db->join('pembelian b','b.ID_PEMBELIAN=a.PEMBELIAN_ID');
|
||||
$this->db->where('b.KODE_PEMBELIAN=', $kode_pembelian);
|
||||
$this->db->where('a.BARANG_ID=', $id_barang);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_DaftarReturJual_byKODE_byBARANG($kode_rj, $id_barang){
|
||||
$this->db->select('*');
|
||||
$this->db->from('daftar_returjual a');
|
||||
$this->db->join('retur_penjualan b','b.ID_RJ=a.RJ_ID');
|
||||
$this->db->where('b.KODE_RJ=', $kode_rj);
|
||||
$this->db->where('a.BARANG_ID=', $id_barang);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_TransaksiStock_byKODE_byBARANG($kode_bukti, $id_barang, $qty){
|
||||
$this->db->select('*');
|
||||
$this->db->from('transaksi_stock a');
|
||||
$this->db->join('sales_order b','b.ID_SO=a.SO_ID');
|
||||
$this->db->join('penjualan c','c.SO_ID=b.ID_SO');
|
||||
$this->db->where('c.KODE_PENJUALAN=', $kode_bukti);
|
||||
$this->db->where('a.BARANG_ID=', $id_barang);
|
||||
$this->db->where('a.QTY_IO=', $qty);
|
||||
$this->db->where('a.JENIS_IO=1');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,403 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelKontak extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
//Model getData
|
||||
public function getData_Kontak($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('kontak a');
|
||||
$this->db->join('posisi b','b.ID_POSISI=a.POSISI_ID');
|
||||
$this->db->join('akun c','c.ID_AKUN=a.AKUN_ID');
|
||||
$this->db->order_by('c.NAMA_AKUN ASC, a.NAMA_KONTAK ASC');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('kontak a');
|
||||
$this->db->join('posisi b','b.ID_POSISI=a.POSISI_ID');
|
||||
$this->db->join('akun c','c.ID_AKUN=a.AKUN_ID');
|
||||
$this->db->order_by('c.NAMA_AKUN ASC, a.NAMA_KONTAK ASC');
|
||||
$this->db->where(['a.AKUN_ID' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Kontak_byNAMA($id1, $id2){
|
||||
if ($id2 == null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('kontak');
|
||||
$this->db->where(['NAMA_KONTAK' => $id1]);
|
||||
} else {
|
||||
$this->db->select('*');
|
||||
$this->db->from('kontak');
|
||||
$this->db->where(['NAMA_KONTAK' => $id1]);
|
||||
$this->db->where('ID_KONTAK!=', $id2);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function getData_Pelanggan_byNAMA($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('pelanggan');
|
||||
$this->db->where(['NAMA_PELANGGAN' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Pembelian_byID(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('pembelian a');
|
||||
$this->db->join('hutang_dagang b','b.PEMBELIAN_ID=a.ID_PEMBELIAN');
|
||||
$this->db->where('a.STATUS_PEMBELIAN=1');
|
||||
$this->db->group_by('a.ID_PEMBELIAN');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Pelanggan_forAdmin($id = null){
|
||||
if ($id == null) {
|
||||
$this->db->select('a.*,b.NAMA_KOTA,c.NAMA_KELOMPOK');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('kota b','b.ID_KOTA=a.KOTA_ID');
|
||||
$this->db->join('kelompok c','c.ID_KELOMPOK=a.KELOMPOK_ID','left');
|
||||
$this->db->order_by('a.ID_PELANGGAN DESC');
|
||||
$this->db->group_by('a.ID_PELANGGAN');
|
||||
$this->db->where('a.ID_PELANGGAN is NULL');
|
||||
} else {
|
||||
$this->db->select('*');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('kota b','b.ID_KOTA=a.KOTA_ID','left');
|
||||
$this->db->join('kelompok c','c.ID_KELOMPOK=a.KELOMPOK_ID','left');
|
||||
$this->db->order_by('a.TYPE_PELANGGAN ASC');
|
||||
$this->db->group_by('a.ID_PELANGGAN');
|
||||
$this->db->where(['a.ID_PELANGGAN' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Pelanggan_forView(){
|
||||
$this->db->select('a.*,b.NAMA_KOTA,c.NAMA_KELOMPOK');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('kota b','b.ID_KOTA=a.KOTA_ID');
|
||||
$this->db->join('kelompok c','c.ID_KELOMPOK=a.KELOMPOK_ID','left');
|
||||
$this->db->order_by('a.ID_PELANGGAN DESC');
|
||||
$this->db->group_by('a.ID_PELANGGAN');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Pelanggan_Corporate(){
|
||||
$this->db->select('a.*,b.NAMA_KOTA,c.NAMA_KELOMPOK');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('kota b','b.ID_KOTA=a.KOTA_ID');
|
||||
$this->db->join('kelompok c','c.ID_KELOMPOK=a.KELOMPOK_ID','left');
|
||||
$this->db->where('a.TYPE_PELANGGAN=0');
|
||||
$this->db->order_by('a.NAMA_PELANGGAN ASC');
|
||||
$this->db->group_by('a.ID_PELANGGAN');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getExcel_Pelanggan($type_cetak)
|
||||
{
|
||||
if ($type_cetak!="9") {
|
||||
$this->db->select('*');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('kota b', 'b.ID_KOTA=a.KOTA_ID');
|
||||
$this->db->join('kelompok c', 'c.ID_KELOMPOK=a.KELOMPOK_ID','left');
|
||||
$this->db->where('a.TYPE_PELANGGAN=', $type_cetak);
|
||||
$this->db->order_by('a.NAMA_PELANGGAN ASC');
|
||||
} else {
|
||||
$this->db->select('*');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('kota b', 'b.ID_KOTA=a.KOTA_ID');
|
||||
$this->db->join('kelompok c', 'c.ID_KELOMPOK=a.KELOMPOK_ID','left');
|
||||
$this->db->order_by('a.TYPE_PELANGGAN ASC, a.NAMA_PELANGGAN ASC');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function getData_Pelanggan_byID($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('kota b','b.ID_KOTA=a.KOTA_ID','left');
|
||||
$this->db->join('kelompok c','c.ID_KELOMPOK=a.KELOMPOK_ID','left');
|
||||
$this->db->join('sales_order d','d.PELANGGAN_ID=a.ID_PELANGGAN','left');
|
||||
$this->db->join('penjualan e','e.SO_ID=d.ID_SO','left');
|
||||
$this->db->order_by('a.TYPE_PELANGGAN ASC');
|
||||
$this->db->group_by('a.ID_PELANGGAN');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('kota b','b.ID_KOTA=a.KOTA_ID','left');
|
||||
$this->db->join('kelompok c','c.ID_KELOMPOK=a.KELOMPOK_ID','left');
|
||||
$this->db->join('sales_order d','d.PELANGGAN_ID=a.ID_PELANGGAN','left');
|
||||
$this->db->join('penjualan e','e.SO_ID=d.ID_SO','left');
|
||||
$this->db->order_by('a.TYPE_PELANGGAN ASC');
|
||||
$this->db->group_by('a.ID_PELANGGAN');
|
||||
$this->db->where(['a.ID_PELANGGAN' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Sales($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan a');
|
||||
$this->db->join('jabatan b','b.ID_JABATAN=a.JABATAN_ID','left');
|
||||
$this->db->where('a.JABATAN_ID=4');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan a');
|
||||
$this->db->join('jabatan b','b.ID_JABATAN=a.JABATAN_ID','left');
|
||||
$this->db->where('a.JABATAN_ID=4');
|
||||
$this->db->where(['a.ID_KARYAWAN' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDpPenjualan($id=null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(b.SALDO_PELANGGAN,2)) as SALDO,CONCAT("Rp ",FORMAT(a.NOMINAL_DPJ,2)) as DP');
|
||||
$this->db->from('dp_penjualan a');
|
||||
$this->db->join('pelanggan b','b.ID_PELANGGAN=a.PELANGGAN_ID','left');
|
||||
$this->db->join('kota c','c.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->group_by('a.ID_DPJ');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(b.SALDO_PELANGGAN,2)) as SALDO,CONCAT("Rp ",FORMAT(a.NOMINAL_DPJ,2)) as DP');
|
||||
$this->db->from('dp_penjualan a');
|
||||
$this->db->join('pelanggan b','b.ID_PELANGGAN=a.PELANGGAN_ID','left');
|
||||
$this->db->join('kota c','c.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->group_by('a.ID_DPJ');
|
||||
$this->db->where(['a.PELANGGAN_ID' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPelangganDpj(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('dp_penjualan b','b.PELANGGAN_ID=a.ID_PELANGGAN','left');
|
||||
$this->db->join('kota c','c.ID_KOTA=a.KOTA_ID','left');
|
||||
$this->db->where('b.PELANGGAN_ID is NULL');
|
||||
$this->db->order_by('a.TYPE_PELANGGAN','ASC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDpj($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('dp_penjualan');
|
||||
$this->db->where(['ID_DPJ' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDPJ() {
|
||||
$this->db->select('MAX(KODE_DPJ) AS KODE');
|
||||
$this->db->from('dp_penjualan');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function hapusDPJ($id){
|
||||
$this->db->where(['PELANGGAN_ID' => $id]);
|
||||
$this->db->delete('dp_penjualan');
|
||||
}
|
||||
|
||||
public function getIDPelangganMax(){
|
||||
$this->db->select_max('ID_PELANGGAN');
|
||||
$this->db->from('pelanggan');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKelompokPelanggan(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('kota b','b.ID_KOTA=a.KOTA_ID','left');
|
||||
$this->db->join('kelompok c','c.ANGGOTA_ID=a.ID_PELANGGAN','left');
|
||||
$this->db->group_by('a.ID_PELANGGAN');
|
||||
$this->db->where('c.ANGGOTA_ID is NULL');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPelangganNormal($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('pelanggan');
|
||||
$this->db->where('ID_PELANGGAN>=3');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('pelanggan');
|
||||
$this->db->where('ID_PELANGGAN>=3');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPelangganService($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,b.ID_SERVICE');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('service b','b.PELANGGAN_ID=a.ID_PELANGGAN');
|
||||
}else{
|
||||
$this->db->select('*,b.ID_SERVICE');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('service b','b.PELANGGAN_ID=a.ID_PELANGGAN');
|
||||
$this->db->where(['ID_PELANGGAN' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Step Two, Input Piutang Dagang
|
||||
public function getDataPiutangDagang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PDA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(d.HUTANG_PELANGGAN,2)) as HUTANG,CONCAT("Rp ",FORMAT(a.NOMINAL_PDA,2)) as PDA');
|
||||
$this->db->from('piutang_dagang a');
|
||||
$this->db->join('penjualan b','b.ID_PENJUALAN=a.PENJUALAN_ID','left');
|
||||
$this->db->join('corp c','c.ID_CORP=b.CORP_ID','left');
|
||||
$this->db->join('pelanggan d','d.ID_PELANGGAN=b.PELANGGAN_ID','left');
|
||||
$this->db->join('kota e','e.ID_KOTA=d.KOTA_ID','left');
|
||||
$this->db->join('karyawan f','f.ID_KARYAWAN=b.SALES_ID','left');
|
||||
$this->db->group_by('a.ID_PDA');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PDA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(d.HUTANG_PELANGGAN,2)) as HUTANG,CONCAT("Rp ",FORMAT(a.NOMINAL_PDA,2)) as PDA');
|
||||
$this->db->from('piutang_dagang a');
|
||||
$this->db->join('penjualan b','b.ID_PENJUALAN=a.PENJUALAN_ID','left');
|
||||
$this->db->join('corp c','c.ID_CORP=b.CORP_ID','left');
|
||||
$this->db->join('pelanggan d','d.ID_PELANGGAN=b.PELANGGAN_ID','left');
|
||||
$this->db->join('kota e','e.ID_KOTA=d.KOTA_ID','left');
|
||||
$this->db->join('karyawan f','f.ID_KARYAWAN=b.SALES_ID','left');
|
||||
$this->db->group_by('a.ID_PDA');
|
||||
$this->db->where(['d.ID_PELANGGAN' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPenjualan($id) {
|
||||
$this->db->select('PENJUALAN_ID,PELANGGAN_ID,CORP_ID,NOMINAL_PDA');
|
||||
$this->db->from('piutang_dagang a');
|
||||
$this->db->join('penjualan b','b.ID_PENJUALAN=a.PENJUALAN_ID','left');
|
||||
$this->db->where(['a.ID_PDA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataCorp($id) {
|
||||
$this->db->select('PIUTANG_CORP');
|
||||
$this->db->from('corp');
|
||||
$this->db->where(['ID_CORP' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodePDA() {
|
||||
$this->db->select('MAX(KODE_PDA) AS KODE');
|
||||
$this->db->from('piutang_dagang');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodePenjualan() {
|
||||
$this->db->select('MAX(KODE_PENJUALAN) AS KODE');
|
||||
$this->db->from('penjualan');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDPenjualan() {
|
||||
$this->db->select_max('ID_PENJUALAN');
|
||||
$this->db->from('penjualan');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Karyawan_MasterPelanggan($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan a');
|
||||
$this->db->join('jabatan b','b.ID_JABATAN=a.JABATAN_ID');
|
||||
$this->db->where('a.USERNAME="iwan" OR a.USERNAME="helda" OR a.USERNAME="admin"');
|
||||
$this->db->where(['a.ID_KARYAWAN' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_SalesOrder_byPELANGGAN($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('sales_order');
|
||||
$this->db->where(['PELANGGAN_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_HistoriSn_byPELANGGAN($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('histori_sn');
|
||||
$this->db->where(['PELANGGAN_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_PiutangDagang_byPELANGGAN($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('piutang_dagang');
|
||||
$this->db->where(['PELANGGAN_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_DpPenjualan_byPELANGGAN($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('dp_penjualan');
|
||||
$this->db->where(['PELANGGAN_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelKota extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataKota($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('kota');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('kota');
|
||||
$this->db->where(['ID_KOTA' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelKota extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getData_Kota($id = null) {
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('kota');
|
||||
$this->db->order_by('NAMA_KOTA ASC');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('kota ');
|
||||
$this->db->order_by('NAMA_KOTA ASC');
|
||||
$this->db->where(['ID_KOTA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Supplier_byKOTA($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('supplier a');
|
||||
$this->db->join('kota b','b.ID_KOTA=a.KOTA_ID');
|
||||
$this->db->where(['a.KOTA_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Pelanggan_byKOTA($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('kota b','b.ID_KOTA=a.KOTA_ID');
|
||||
$this->db->where(['a.KOTA_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Pihakke3_byKOTA($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('pihakke3 a');
|
||||
$this->db->join('kota b','b.ID_KOTA=a.KOTA_ID');
|
||||
$this->db->where(['a.KOTA_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelKuartal extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getData_Kuartal($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('kuartal');
|
||||
$this->db->order_by('NAMA_KUARTAL ASC');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('kuartal');
|
||||
$this->db->where(['ID_KUARTAL' => $id]);
|
||||
$this->db->order_by('NAMA_KUARTAL ASC');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_ManajemenKuartal_byKUARTAL($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('manajemen_kuartal a');
|
||||
$this->db->join('kuartal b','b.ID_KUARTAL=a.KUARTAL_ID');
|
||||
$this->db->where(['a.KUARTAL_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelKurir extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataKurir($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('kurir');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('kurir');
|
||||
$this->db->where(['ID_KURIR' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelLain extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataLain($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('lain');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('lain');
|
||||
$this->db->where(['ID_LAIN' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeLain(){
|
||||
$this->db->select('CONCAT(NAMA_LAIN,"|",TGL) as COBA');
|
||||
$this->db->from('lain');
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataTeknisi($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('operator');
|
||||
$this->db->where('ID_OPERATOR >=3');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('operator');
|
||||
$this->db->where('ID_OPERATOR >=3');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
class ModelLaporan1 extends CI_Model
|
||||
{
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if ($batch === false) {
|
||||
$insert = $this->db->insert($table, $data);
|
||||
} else {
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if ($batch === false) {
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
} else {
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataLaporan1($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,b.NO_INVOICE,FORMAT(b.HPP,0) as BRUTO,FORMAT(SUM(a.POTONGAN),0) as TARA,FORMAT(b.HPP-SUM(a.POTONGAN),0) as NETTO');
|
||||
$this->db->from('promo a');
|
||||
$this->db->join('invoice b','b.ID_INVOICE=a.ID_INVOICE');
|
||||
$this->db->group_by('b.ID_INVOICE');
|
||||
}else{
|
||||
$this->db->select('*,b.NO_INVOICE,FORMAT(b.HPP,0) as BRUTO,FORMAT(SUM(a.POTONGAN),0) as TARA,FORMAT(b.HPP-SUM(a.POTONGAN),0) as NETTO');
|
||||
$this->db->from('promo a');
|
||||
$this->db->join('invoice b','b.ID_INVOICE=a.ID_INVOICE');
|
||||
$this->db->group_by('b.ID_INVOICE');
|
||||
$this->db->where(['ID_PROMO' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelLayar extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataLayar($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('layar');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('layar');
|
||||
$this->db->where(['ID_LAYAR' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataLayarNB($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('layar');
|
||||
$this->db->where('ID_LAYAR<=2');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataLayarAIO($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('layar');
|
||||
$this->db->where('ID_LAYAR=3 OR ID_LAYAR=4');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelLicense extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataLicense($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('license a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.TYPE_ID','left');
|
||||
$this->db->join('kurir c','c.ID_KURIR=a.KURIR_ID','left');
|
||||
$this->db->order_by('ID_LICENSE','ASC');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('license a');
|
||||
$this->db->join('type b','b.ID_TYPE=a.TYPE_ID','left');
|
||||
$this->db->join('kurir c','c.ID_KURIR=a.KURIR_ID','left');
|
||||
$this->db->order_by('ID_LICENSE','ASC');
|
||||
$this->db->where(['ID_LICENSE' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getCountLicense($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('ID_LICENSE');
|
||||
$this->db->from('license');
|
||||
}else{
|
||||
$this->db->select('ID_LICENSE');
|
||||
$this->db->from('license');
|
||||
}
|
||||
|
||||
return $this->db->count_all_results();
|
||||
}
|
||||
|
||||
public function getCountLicenseBelum($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('ID_LICENSE');
|
||||
$this->db->from('license');
|
||||
$this->db->where('STATUS_LICENSE="Belum Ready"');
|
||||
}
|
||||
return $this->db->count_all_results();
|
||||
}
|
||||
|
||||
public function getCountLicenseSudah($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('ID_LICENSE');
|
||||
$this->db->from('license');
|
||||
$this->db->where('STATUS_LICENSE="Ready"');
|
||||
}
|
||||
return $this->db->count_all_results();
|
||||
}
|
||||
|
||||
public function getCountLicenseTerkirim($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('ID_LICENSE');
|
||||
$this->db->from('license');
|
||||
$this->db->where('STATUS_LICENSE="Terkirim"');
|
||||
}
|
||||
return $this->db->count_all_results();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelMerk extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getData_Merk($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('merk');
|
||||
$this->db->order_by('NAMA_MERK ASC');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('merk');
|
||||
$this->db->where(['ID_MERK' => $id]);
|
||||
$this->db->order_by('NAMA_MERK ASC');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Barang_byMERK($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('merk b','b.ID_MERK=a.MERK_ID');
|
||||
$this->db->where(['a.MERK_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Merk_byNAMA($id1, $id2=null){
|
||||
if ($id2 == null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('merk');
|
||||
$this->db->where(['NAMA_MERK' => $id1]);
|
||||
} else {
|
||||
$this->db->select('*');
|
||||
$this->db->from('merk');
|
||||
$this->db->where(['NAMA_MERK' => $id1]);
|
||||
$this->db->where('ID_MERK!=', $id2);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelModel extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getData_Model($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('model');
|
||||
$this->db->order_by('NAMA_MODEL ASC');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('model');
|
||||
$this->db->where(['ID_MODEL' => $id]);
|
||||
$this->db->order_by('NAMA_MODEL ASC');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Barang_byMODEL($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('model b','b.ID_MODEL=a.MODEL_ID');
|
||||
$this->db->where(['a.MODEL_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Model_byNAMA($id1, $id2=null){
|
||||
if ($id2 == null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('model');
|
||||
$this->db->where(['NAMA_MODEL' => $id1]);
|
||||
} else {
|
||||
$this->db->select('*');
|
||||
$this->db->from('model');
|
||||
$this->db->where(['NAMA_MODEL' => $id1]);
|
||||
$this->db->where('ID_MODEL!=', $id2);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelMonitor extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataMonitor($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('monitor');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('monitor');
|
||||
$this->db->where(['ID_MONITOR' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelNeraca extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataNeraca($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(NILAI_NERACA,2)) as NILAI');
|
||||
$this->db->from('neraca');
|
||||
$this->db->group_by('ID_NERACA');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(NILAI_NERACA,2)) as NILAI');
|
||||
$this->db->from('neraca');
|
||||
$this->db->group_by('ID_NERACA');
|
||||
$this->db->where(['ID_NERACA' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataNilaiNeraca($setdata,$perkiraan){
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(NILAI_NERACA,2)) as NILAI');
|
||||
$this->db->from('neraca');
|
||||
$this->db->where(['SETDATA_ID' => $setdata]);
|
||||
$this->db->where(['PERKIRAAN_ID' => $perkiraan]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getSetdata_ID() {
|
||||
$this->db->select_max('SETDATA_ID');
|
||||
$this->db->from('neraca');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Neraca Spesifik, tergantung dari jenis transaksinya.
|
||||
public function getDataNeracaBiaya($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('neraca');
|
||||
$this->db->group_by('ID_NERACA');
|
||||
$this->db->order_by('KODE_NERACA');
|
||||
$this->db->where('TYPE_NERACA="BIAYA PENJUALAN"');
|
||||
$this->db->or_where('TYPE_NERACA="BIAYA UMUM DAN ADMINISTRASI"');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('neraca');
|
||||
$this->db->group_by('ID_NERACA');
|
||||
$this->db->order_by('KODE_NERACA');
|
||||
$this->db->where('TYPE_NERACA="BIAYA PENJUALAN"');
|
||||
$this->db->or_where('TYPE_NERACA="BIAYA UMUM DAN ADMINISTRASI"');
|
||||
$this->db->where(['ID_NERACA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataNeracaHutang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('neraca');
|
||||
$this->db->group_by('ID_NERACA');
|
||||
$this->db->order_by('KODE_NERACA');
|
||||
$this->db->where('TYPE_NERACA="KEWAJIBAN LANCAR"');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('neraca');
|
||||
$this->db->group_by('ID_NERACA');
|
||||
$this->db->order_by('KODE_NERACA');
|
||||
$this->db->where('TYPE_NERACA="KEWAJIBAN LANCAR"');
|
||||
$this->db->where(['ID_NERACA' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataNeracaPiutang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('neraca');
|
||||
$this->db->group_by('ID_NERACA');
|
||||
$this->db->order_by('KODE_NERACA');
|
||||
$this->db->where('TYPE_NERACA="AKTIVA LANCAR" AND KODE_NERACA!="1140"');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('neraca');
|
||||
$this->db->group_by('ID_NERACA');
|
||||
$this->db->order_by('KODE_NERACA');
|
||||
$this->db->where('TYPE_NERACA="AKTIVA LANCAR" AND KODE_NERACA!="1140"');
|
||||
$this->db->where(['ID_NERACA' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Hutang Lain
|
||||
public function getDataHutangLain($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(TGL_HLA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(NOMINAL_HLA,2)) as HLA');
|
||||
$this->db->from('hutang_lain');
|
||||
$this->db->group_by('ID_HLA');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(TGL_HLA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(NOMINAL_HLA,2)) as HLA');
|
||||
$this->db->from('hutang_lain');
|
||||
$this->db->group_by('ID_HLA');
|
||||
$this->db->where(['ID_HLA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeHLA() {
|
||||
$this->db->select('MAX(KODE_HLA) AS KODE');
|
||||
$this->db->from('hutang_lain');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelOperator extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataOperator($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('operator');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('operator');
|
||||
$this->db->where(['ID_OPERATOR' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataTeknisi($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('operator');
|
||||
$this->db->where('ID_OPERATOR >=3');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('operator');
|
||||
$this->db->where('ID_OPERATOR >=3');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelOperator extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataOperator($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('operator');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('operator');
|
||||
$this->db->where(['ID_OPERATOR' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataTeknisi($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('operator');
|
||||
$this->db->where('ID_OPERATOR >=3');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('operator');
|
||||
$this->db->where('ID_OPERATOR >=3');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataAdminService($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('operator');
|
||||
$this->db->where('ID_OPERATOR <=2');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('operator');
|
||||
$this->db->where('ID_OPERATOR <=2');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelOs extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataOs($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('os a');
|
||||
$this->db->join('spek b','b.OS_ID=a.ID_OS','left');
|
||||
$this->db->group_by('a.ID_OS');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('os a');
|
||||
$this->db->join('spek b','b.OS_ID=a.ID_OS','left');
|
||||
$this->db->group_by('a.ID_OS');
|
||||
$this->db->where(['a.ID_OS' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelPajak extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataPajak($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(SALDO_PAJAK,2)) as SALDO');
|
||||
$this->db->from('pajak');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(SALDO_PAJAK,2)) as SALDO');
|
||||
$this->db->from('pajak');
|
||||
$this->db->where(['ID_PAJAK' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDPP() {
|
||||
$this->db->select('MAX(KODE_DPP) AS KODE');
|
||||
$this->db->from('dp_pajak');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function hapusDPP($id){
|
||||
$this->db->where(['PAJAK_ID' => $id]);
|
||||
$this->db->delete('dp_pajak');
|
||||
}
|
||||
|
||||
//Hutang Pajak
|
||||
public function getDataHutangPajak($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HPA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(b.HUTANG_PAJAK,2)) as HUTANG,CONCAT("Rp ",FORMAT(a.NOMINAL_HPA,2)) as HPA');
|
||||
$this->db->from('hutang_pajak a');
|
||||
$this->db->join('pajak b','b.ID_PAJAK=a.PAJAK_ID','left');
|
||||
$this->db->group_by('a.ID_HPA');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_HPA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(b.HUTANG_PAJAK,2)) as HUTANG,CONCAT("Rp ",FORMAT(a.NOMINAL_HPA,2)) as HPA');
|
||||
$this->db->from('hutang_pajak a');
|
||||
$this->db->join('pajak b','b.ID_PAJAK=a.PAJAK_ID','left');
|
||||
$this->db->group_by('a.ID_HPA');
|
||||
$this->db->where(['a.ID_HPA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeHPA() {
|
||||
$this->db->select('MAX(KODE_HPA) AS KODE');
|
||||
$this->db->from('hutang_pajak');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelPart extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getData_Part($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,FORMAT(b.HPP_HPAR,2) as HPP,DATE_FORMAT(b.TGL_HPAR,"%d/%m/%Y") as TANGGAL');
|
||||
$this->db->from('part a');
|
||||
$this->db->join('harga_part b','b.PART_ID=a.ID_PART','left');
|
||||
$this->db->order_by('a.NAMA_PART ASC, b.ID_HPAR DESC');
|
||||
}else{
|
||||
$this->db->select('*,FORMAT(b.HPP_HPAR,2) as HPP');
|
||||
$this->db->from('part a');
|
||||
$this->db->join('harga_part b','b.PART_ID=a.ID_PART','left');
|
||||
$this->db->order_by('a.NAMA_PART ASC, b.ID_HPAR DESC');
|
||||
$this->db->where(['b.PART_ID' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getID_PartMax() {
|
||||
$this->db->select_max('ID_PART');
|
||||
$this->db->from('part');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_TransaksiStock_byPART($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('transaksi_stock a');
|
||||
$this->db->join('harga_part b','b.ID_HPAR=a.HPAR_ID');
|
||||
$this->db->where(['b.PART_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,384 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelPelanggan extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
//Model getData
|
||||
public function getData_Pelanggan($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('a.*,b.NAMA_KOTA');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('kota b','b.ID_KOTA=a.KOTA_ID');
|
||||
$this->db->order_by('a.NAMA_PELANGGAN ASC');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('kota b','b.ID_KOTA=a.KOTA_ID','left');
|
||||
$this->db->join('kelompok c','c.ID_KELOMPOK=a.KELOMPOK_ID','left');
|
||||
$this->db->order_by('a.TYPE_PELANGGAN ASC');
|
||||
$this->db->group_by('a.ID_PELANGGAN');
|
||||
$this->db->where(['a.ID_PELANGGAN' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Pelanggan_byNAMA($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('pelanggan');
|
||||
$this->db->where(['NAMA_PELANGGAN' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Pembelian_byID(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('pembelian a');
|
||||
$this->db->join('hutang_dagang b','b.PEMBELIAN_ID=a.ID_PEMBELIAN');
|
||||
$this->db->where('a.STATUS_PEMBELIAN=1');
|
||||
$this->db->group_by('a.ID_PEMBELIAN');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Pelanggan_forAdmin($id = null){
|
||||
if ($id == null) {
|
||||
$this->db->select('a.*,b.NAMA_KOTA,c.NAMA_KELOMPOK');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('kota b','b.ID_KOTA=a.KOTA_ID');
|
||||
$this->db->join('kelompok c','c.ID_KELOMPOK=a.KELOMPOK_ID','left');
|
||||
$this->db->order_by('a.ID_PELANGGAN DESC');
|
||||
$this->db->group_by('a.ID_PELANGGAN');
|
||||
$this->db->where('a.ID_PELANGGAN is NULL');
|
||||
} else {
|
||||
$this->db->select('*');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('kota b','b.ID_KOTA=a.KOTA_ID','left');
|
||||
$this->db->join('kelompok c','c.ID_KELOMPOK=a.KELOMPOK_ID','left');
|
||||
$this->db->order_by('a.TYPE_PELANGGAN ASC');
|
||||
$this->db->group_by('a.ID_PELANGGAN');
|
||||
$this->db->where(['a.ID_PELANGGAN' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Pelanggan_forView(){
|
||||
$this->db->select('a.*,b.NAMA_KOTA,c.NAMA_KELOMPOK');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('kota b','b.ID_KOTA=a.KOTA_ID');
|
||||
$this->db->join('kelompok c','c.ID_KELOMPOK=a.KELOMPOK_ID','left');
|
||||
$this->db->order_by('a.ID_PELANGGAN DESC');
|
||||
$this->db->group_by('a.ID_PELANGGAN');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Pelanggan_Corporate(){
|
||||
$this->db->select('a.*,b.NAMA_KOTA,c.NAMA_KELOMPOK');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('kota b','b.ID_KOTA=a.KOTA_ID');
|
||||
$this->db->join('kelompok c','c.ID_KELOMPOK=a.KELOMPOK_ID','left');
|
||||
$this->db->where('a.TYPE_PELANGGAN=0');
|
||||
$this->db->order_by('a.NAMA_PELANGGAN ASC');
|
||||
$this->db->group_by('a.ID_PELANGGAN');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getExcel_Pelanggan($type_cetak)
|
||||
{
|
||||
if ($type_cetak!="9") {
|
||||
$this->db->select('*');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('kota b', 'b.ID_KOTA=a.KOTA_ID');
|
||||
$this->db->join('kelompok c', 'c.ID_KELOMPOK=a.KELOMPOK_ID','left');
|
||||
$this->db->where('a.TYPE_PELANGGAN=', $type_cetak);
|
||||
$this->db->order_by('a.NAMA_PELANGGAN ASC');
|
||||
} else {
|
||||
$this->db->select('*');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('kota b', 'b.ID_KOTA=a.KOTA_ID');
|
||||
$this->db->join('kelompok c', 'c.ID_KELOMPOK=a.KELOMPOK_ID','left');
|
||||
$this->db->order_by('a.TYPE_PELANGGAN ASC, a.NAMA_PELANGGAN ASC');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Service_byPELANGGAN($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('service');
|
||||
$this->db->where('PELANGGAN_ID=', $id);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function getData_Pelanggan_byID($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('kota b','b.ID_KOTA=a.KOTA_ID','left');
|
||||
$this->db->join('kelompok c','c.ID_KELOMPOK=a.KELOMPOK_ID','left');
|
||||
$this->db->join('sales_order d','d.PELANGGAN_ID=a.ID_PELANGGAN','left');
|
||||
$this->db->join('penjualan e','e.SO_ID=d.ID_SO','left');
|
||||
$this->db->order_by('a.TYPE_PELANGGAN ASC');
|
||||
$this->db->group_by('a.ID_PELANGGAN');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('kota b','b.ID_KOTA=a.KOTA_ID','left');
|
||||
$this->db->join('kelompok c','c.ID_KELOMPOK=a.KELOMPOK_ID','left');
|
||||
$this->db->join('sales_order d','d.PELANGGAN_ID=a.ID_PELANGGAN','left');
|
||||
$this->db->join('penjualan e','e.SO_ID=d.ID_SO','left');
|
||||
$this->db->order_by('a.TYPE_PELANGGAN ASC');
|
||||
$this->db->group_by('a.ID_PELANGGAN');
|
||||
$this->db->where(['a.ID_PELANGGAN' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Sales($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan a');
|
||||
$this->db->join('jabatan b','b.ID_JABATAN=a.JABATAN_ID','left');
|
||||
$this->db->where('a.JABATAN_ID=4');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan a');
|
||||
$this->db->join('jabatan b','b.ID_JABATAN=a.JABATAN_ID','left');
|
||||
$this->db->where('a.JABATAN_ID=4');
|
||||
$this->db->where(['a.ID_KARYAWAN' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDpPenjualan($id=null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(b.SALDO_PELANGGAN,2)) as SALDO,CONCAT("Rp ",FORMAT(a.NOMINAL_DPJ,2)) as DP');
|
||||
$this->db->from('dp_penjualan a');
|
||||
$this->db->join('pelanggan b','b.ID_PELANGGAN=a.PELANGGAN_ID','left');
|
||||
$this->db->join('kota c','c.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->group_by('a.ID_DPJ');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(b.SALDO_PELANGGAN,2)) as SALDO,CONCAT("Rp ",FORMAT(a.NOMINAL_DPJ,2)) as DP');
|
||||
$this->db->from('dp_penjualan a');
|
||||
$this->db->join('pelanggan b','b.ID_PELANGGAN=a.PELANGGAN_ID','left');
|
||||
$this->db->join('kota c','c.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->group_by('a.ID_DPJ');
|
||||
$this->db->where(['a.PELANGGAN_ID' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPelangganDpj(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('dp_penjualan b','b.PELANGGAN_ID=a.ID_PELANGGAN','left');
|
||||
$this->db->join('kota c','c.ID_KOTA=a.KOTA_ID','left');
|
||||
$this->db->where('b.PELANGGAN_ID is NULL');
|
||||
$this->db->order_by('a.TYPE_PELANGGAN','ASC');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDpj($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('dp_penjualan');
|
||||
$this->db->where(['ID_DPJ' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeDPJ() {
|
||||
$this->db->select('MAX(KODE_DPJ) AS KODE');
|
||||
$this->db->from('dp_penjualan');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function hapusDPJ($id){
|
||||
$this->db->where(['PELANGGAN_ID' => $id]);
|
||||
$this->db->delete('dp_penjualan');
|
||||
}
|
||||
|
||||
public function getIDPelangganMax(){
|
||||
$this->db->select_max('ID_PELANGGAN');
|
||||
$this->db->from('pelanggan');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKelompokPelanggan(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('kota b','b.ID_KOTA=a.KOTA_ID','left');
|
||||
$this->db->join('kelompok c','c.ANGGOTA_ID=a.ID_PELANGGAN','left');
|
||||
$this->db->group_by('a.ID_PELANGGAN');
|
||||
$this->db->where('c.ANGGOTA_ID is NULL');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPelangganNormal($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('pelanggan');
|
||||
$this->db->where('ID_PELANGGAN>=3');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('pelanggan');
|
||||
$this->db->where('ID_PELANGGAN>=3');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPelangganService($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,b.ID_SERVICE');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('service b','b.PELANGGAN_ID=a.ID_PELANGGAN');
|
||||
}else{
|
||||
$this->db->select('*,b.ID_SERVICE');
|
||||
$this->db->from('pelanggan a');
|
||||
$this->db->join('service b','b.PELANGGAN_ID=a.ID_PELANGGAN');
|
||||
$this->db->where(['ID_PELANGGAN' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Step Two, Input Piutang Dagang
|
||||
public function getDataPiutangDagang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PDA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(d.HUTANG_PELANGGAN,2)) as HUTANG,CONCAT("Rp ",FORMAT(a.NOMINAL_PDA,2)) as PDA');
|
||||
$this->db->from('piutang_dagang a');
|
||||
$this->db->join('penjualan b','b.ID_PENJUALAN=a.PENJUALAN_ID','left');
|
||||
$this->db->join('corp c','c.ID_CORP=b.CORP_ID','left');
|
||||
$this->db->join('pelanggan d','d.ID_PELANGGAN=b.PELANGGAN_ID','left');
|
||||
$this->db->join('kota e','e.ID_KOTA=d.KOTA_ID','left');
|
||||
$this->db->join('karyawan f','f.ID_KARYAWAN=b.SALES_ID','left');
|
||||
$this->db->group_by('a.ID_PDA');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PDA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(d.HUTANG_PELANGGAN,2)) as HUTANG,CONCAT("Rp ",FORMAT(a.NOMINAL_PDA,2)) as PDA');
|
||||
$this->db->from('piutang_dagang a');
|
||||
$this->db->join('penjualan b','b.ID_PENJUALAN=a.PENJUALAN_ID','left');
|
||||
$this->db->join('corp c','c.ID_CORP=b.CORP_ID','left');
|
||||
$this->db->join('pelanggan d','d.ID_PELANGGAN=b.PELANGGAN_ID','left');
|
||||
$this->db->join('kota e','e.ID_KOTA=d.KOTA_ID','left');
|
||||
$this->db->join('karyawan f','f.ID_KARYAWAN=b.SALES_ID','left');
|
||||
$this->db->group_by('a.ID_PDA');
|
||||
$this->db->where(['d.ID_PELANGGAN' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPenjualan($id) {
|
||||
$this->db->select('PENJUALAN_ID,PELANGGAN_ID,CORP_ID,NOMINAL_PDA');
|
||||
$this->db->from('piutang_dagang a');
|
||||
$this->db->join('penjualan b','b.ID_PENJUALAN=a.PENJUALAN_ID','left');
|
||||
$this->db->where(['a.ID_PDA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataCorp($id) {
|
||||
$this->db->select('PIUTANG_CORP');
|
||||
$this->db->from('corp');
|
||||
$this->db->where(['ID_CORP' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodePDA() {
|
||||
$this->db->select('MAX(KODE_PDA) AS KODE');
|
||||
$this->db->from('piutang_dagang');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodePenjualan() {
|
||||
$this->db->select('MAX(KODE_PENJUALAN) AS KODE');
|
||||
$this->db->from('penjualan');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDPenjualan() {
|
||||
$this->db->select_max('ID_PENJUALAN');
|
||||
$this->db->from('penjualan');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Karyawan_MasterPelanggan($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan a');
|
||||
$this->db->join('jabatan b','b.ID_JABATAN=a.JABATAN_ID');
|
||||
$this->db->where('a.USERNAME="iwan" OR a.USERNAME="helda" OR a.USERNAME="admin"');
|
||||
$this->db->where(['a.ID_KARYAWAN' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_SalesOrder_byPELANGGAN($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('sales_order');
|
||||
$this->db->where(['PELANGGAN_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_HistoriSn_byPELANGGAN($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('histori_sn');
|
||||
$this->db->where(['PELANGGAN_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_PiutangDagang_byPELANGGAN($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('piutang_dagang');
|
||||
$this->db->where(['PELANGGAN_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_DpPenjualan_byPELANGGAN($id) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('dp_penjualan');
|
||||
$this->db->where(['PELANGGAN_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,205 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelPerkiraan extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
//Perkiraan Bebas, data berisi semua perkiraan
|
||||
public function getDataPerkiraan($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('perkiraan');
|
||||
$this->db->group_by('ID_PERKIRAAN');
|
||||
$this->db->order_by('KODE_PERKIRAAN');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('perkiraan');
|
||||
$this->db->group_by('ID_PERKIRAAN');
|
||||
$this->db->order_by('KODE_PERKIRAAN');
|
||||
$this->db->where(['ID_PERKIRAAN' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Perkiraan Spesifik, tergantung dari jenis transaksinya.
|
||||
public function getData_Perkiraan_PiutangDagang($id = null){
|
||||
if ($id == null) {
|
||||
$this->db->select('b.INV_PENJUALAN,c.NAMA_PELANGGAN,d.NAMA_KOTA,SUM(a.DEBET_PDA) as DEBET,SUM(a.KREDIT_PDA) as KREDIT');
|
||||
$this->db->from('piutang_dagang a');
|
||||
$this->db->join('penjualan b','b.ID_PENJUALAN=a.PENJUALAN_ID');
|
||||
$this->db->join('pelanggan c','c.ID_PELANGGAN=a.PELANGGAN_ID');
|
||||
$this->db->join('kota d','d.ID_KOTA=c.KOTA_ID');
|
||||
$this->db->group_by('a.PENJUALAN_ID');
|
||||
$this->db->having('DEBET!=KREDIT');
|
||||
}else{
|
||||
$this->db->select('b.INV_PENJUALAN,c.NAMA_PELANGGAN,d.NAMA_KOTA,SUM(a.DEBET_PDA) as DEBET,SUM(a.KREDIT_PDA) as KREDIT');
|
||||
$this->db->from('piutang_dagang a');
|
||||
$this->db->join('penjualan b','b.ID_PENJUALAN=a.PENJUALAN_ID');
|
||||
$this->db->join('pelanggan c','c.ID_PELANGGAN=a.PELANGGAN_ID');
|
||||
$this->db->join('kota d','d.ID_KOTA=c.KOTA_ID');
|
||||
$this->db->group_by('a.PENJUALAN_ID');
|
||||
$this->db->having('DEBET!=KREDIT');
|
||||
$this->db->where(['a.PENJUALAN_ID' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Perkiraan_HutangDagang($id = null){
|
||||
if ($id == null) {
|
||||
$this->db->select('b.INV_PEMBELIAN,c.NAMA_SUPPLIER,d.NAMA_KOTA,SUM(a.DEBET_HDA) as DEBET,SUM(a.KREDIT_HDA) as KREDIT');
|
||||
$this->db->from('hutang_dagang a');
|
||||
$this->db->join('pembelian b','b.ID_PEMBELIAN=a.PEMBELIAN_ID');
|
||||
$this->db->join('supplier c','c.ID_SUPPLIER=a.SUPPLIER_ID');
|
||||
$this->db->join('kota d','d.ID_KOTA=c.KOTA_ID');
|
||||
$this->db->group_by('a.PEMBELIAN_ID');
|
||||
$this->db->having('DEBET!=KREDIT');
|
||||
}else{
|
||||
$this->db->select('b.INV_PEMBELIAN,c.NAMA_SUPPLIER,d.NAMA_KOTA,SUM(a.DEBET_HDA) as DEBET,SUM(a.KREDIT_HDA) as KREDIT');
|
||||
$this->db->from('hutang_dagang a');
|
||||
$this->db->join('pembelian b','b.ID_PEMBELIAN=a.PEMBELIAN_ID');
|
||||
$this->db->join('supplier c','c.ID_SUPPLIER=a.SUPPLIER_ID');
|
||||
$this->db->join('kota d','d.ID_KOTA=c.KOTA_ID');
|
||||
$this->db->group_by('a.PEMBELIAN_ID');
|
||||
$this->db->having('DEBET!=KREDIT');
|
||||
$this->db->where(['a.PEMBELIAN_ID' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Perkiraan_Lain_Kasbankmasuk() {
|
||||
$this->db->select('*');
|
||||
$this->db->from('perkiraan');
|
||||
$this->db->like('KODE_PERKIRAAN','6', 'after');
|
||||
$this->db->not_like('KODE_PERKIRAAN','6103');
|
||||
$this->db->not_like('KODE_PERKIRAAN','6104');
|
||||
$this->db->not_like('KODE_PERKIRAAN','6227');
|
||||
$this->db->not_like('KODE_PERKIRAAN','6233');
|
||||
$this->db->or_like('KODE_PERKIRAAN','7', 'after');
|
||||
$this->db->not_like('KODE_PERKIRAAN','7500');
|
||||
$this->db->or_like('KODE_PERKIRAAN','8', 'after');
|
||||
$this->db->or_like('KODE_PERKIRAAN','9', 'after');
|
||||
$this->db->or_like('KODE_PERKIRAAN','2130');
|
||||
$this->db->or_like('KODE_PERKIRAAN','2140');
|
||||
$this->db->or_like('KODE_PERKIRAAN','3100');
|
||||
$this->db->or_like('KODE_PERKIRAAN','4130');
|
||||
$this->db->or_like('KODE_PERKIRAAN','5122');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Perkiraan_Lain_Kasbankkeluar() {
|
||||
$this->db->select('*');
|
||||
$this->db->from('perkiraan');
|
||||
$this->db->like('KODE_PERKIRAAN','6', 'after');
|
||||
$this->db->not_like('KODE_PERKIRAAN','6103');
|
||||
$this->db->not_like('KODE_PERKIRAAN','6104');
|
||||
//$this->db->not_like('KODE_PERKIRAAN','6203');
|
||||
$this->db->not_like('KODE_PERKIRAAN','6227');
|
||||
$this->db->not_like('KODE_PERKIRAAN','6230');
|
||||
$this->db->not_like('KODE_PERKIRAAN','6233');
|
||||
$this->db->or_like('KODE_PERKIRAAN','7', 'after');
|
||||
$this->db->not_like('KODE_PERKIRAAN','7500');
|
||||
$this->db->or_like('KODE_PERKIRAAN','8', 'after');
|
||||
$this->db->or_like('KODE_PERKIRAAN','9', 'after');
|
||||
$this->db->or_like('KODE_PERKIRAAN','1180');
|
||||
$this->db->or_like('KODE_PERKIRAAN','1210');
|
||||
$this->db->or_like('KODE_PERKIRAAN','1220');
|
||||
$this->db->or_like('KODE_PERKIRAAN','1230');
|
||||
$this->db->or_like('KODE_PERKIRAAN','2130');
|
||||
$this->db->or_like('KODE_PERKIRAAN','2140');
|
||||
$this->db->or_like('KODE_PERKIRAAN','4130');
|
||||
$this->db->or_like('KODE_PERKIRAAN','5122');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Perkiraan_FormLemburLuarKota() {
|
||||
$this->db->select('*');
|
||||
$this->db->from('perkiraan');
|
||||
$this->db->like('KODE_PERKIRAAN','6203');
|
||||
$this->db->or_like('KODE_PERKIRAAN','6233');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPerkiraanBiaya($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('perkiraan');
|
||||
$this->db->group_by('ID_PERKIRAAN');
|
||||
$this->db->order_by('KODE_PERKIRAAN');
|
||||
$this->db->where('TYPE_PERKIRAAN="BIAYA PENJUALAN"');
|
||||
$this->db->or_where('TYPE_PERKIRAAN="BIAYA UMUM DAN ADMINISTRASI"');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('perkiraan');
|
||||
$this->db->group_by('ID_PERKIRAAN');
|
||||
$this->db->order_by('KODE_PERKIRAAN');
|
||||
$this->db->where('TYPE_PERKIRAAN="BIAYA PENJUALAN"');
|
||||
$this->db->or_where('TYPE_PERKIRAAN="BIAYA UMUM DAN ADMINISTRASI"');
|
||||
$this->db->where(['ID_PERKIRAAN' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPerkiraanHutang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('perkiraan');
|
||||
$this->db->group_by('ID_PERKIRAAN');
|
||||
$this->db->order_by('KODE_PERKIRAAN');
|
||||
$this->db->where('TYPE_PERKIRAAN="KEWAJIBAN LANCAR"');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('perkiraan');
|
||||
$this->db->group_by('ID_PERKIRAAN');
|
||||
$this->db->order_by('KODE_PERKIRAAN');
|
||||
$this->db->where('TYPE_PERKIRAAN="KEWAJIBAN LANCAR"');
|
||||
$this->db->where(['ID_PERKIRAAN' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPerkiraanPiutang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('perkiraan');
|
||||
$this->db->group_by('ID_PERKIRAAN');
|
||||
$this->db->order_by('KODE_PERKIRAAN');
|
||||
$this->db->where('TYPE_PERKIRAAN="AKTIVA LANCAR" AND KODE_PERKIRAAN!="1140"');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('perkiraan');
|
||||
$this->db->group_by('ID_PERKIRAAN');
|
||||
$this->db->order_by('KODE_PERKIRAAN');
|
||||
$this->db->where('TYPE_PERKIRAAN="AKTIVA LANCAR" AND KODE_PERKIRAAN!="1140"');
|
||||
$this->db->where(['ID_PERKIRAAN' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,126 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelPihakKe3 extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getData_PihakKe3($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('pihakke3 a');
|
||||
$this->db->join('kota b','b.ID_KOTA=a.KOTA_ID');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('pihakke3 a');
|
||||
$this->db->join('kota b','b.ID_KOTA=a.KOTA_ID');
|
||||
$this->db->where(['a.ID_PIHAKKE3' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_PiutangPihakKe3_byPIHAKKE3($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('piutang_pihakke3 a');
|
||||
$this->db->join('pihakke3 b','b.ID_PIHAKKE3=a.PIHAKKE3_ID');
|
||||
$this->db->where(['a.PIHAKKE3_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKelompokTp(){
|
||||
$this->db->select('*');
|
||||
$this->db->from('tp a');
|
||||
$this->db->join('kota b','b.ID_KOTA=a.KOTA_ID','left');
|
||||
$this->db->join('kelompok c','c.ANGGOTA_ID=a.ID_TP','left');
|
||||
$this->db->group_by('a.ID_TP');
|
||||
$this->db->where('c.ANGGOTA_ID is NULL');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataTpNormal($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('tp');
|
||||
$this->db->where('ID_TP>=3');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('tp');
|
||||
$this->db->where('ID_TP>=3');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataTpService($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,b.ID_SERVICE');
|
||||
$this->db->from('tp a');
|
||||
$this->db->join('service b','b.TP_ID=a.ID_TP');
|
||||
}else{
|
||||
$this->db->select('*,b.ID_SERVICE');
|
||||
$this->db->from('tp a');
|
||||
$this->db->join('service b','b.TP_ID=a.ID_TP');
|
||||
$this->db->where(['ID_TP' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Piutang PihakKe3
|
||||
public function getDataPiutangPihakKe3($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PPI,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(b.HUTANG_PIHAKKE3,2)) as PIUTANG,CONCAT("Rp ",FORMAT(a.NOMINAL_PPI,2)) as PPI');
|
||||
$this->db->from('piutang_pihakke3 a');
|
||||
$this->db->join('pihakke3 b','b.ID_PIHAKKE3=a.PIHAKKE3_ID','left');
|
||||
$this->db->join('kota c','c.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->group_by('a.ID_PPI');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PPI,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(b.HUTANG_PIHAKKE3,2)) as PIUTANG,CONCAT("Rp ",FORMAT(a.NOMINAL_PPI,2)) as PPI');
|
||||
$this->db->from('piutang_pihakke3 a');
|
||||
$this->db->join('pihakke3 b','b.ID_PIHAKKE3=a.PIHAKKE3_ID','left');
|
||||
$this->db->join('kota c','c.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->group_by('a.ID_PPI');
|
||||
$this->db->where(['a.ID_PPI' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodePPI() {
|
||||
$this->db->select('MAX(KODE_PPI) AS KODE');
|
||||
$this->db->from('piutang_pihakke3');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelPiutangDagang extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataPiutangDagang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PDA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PDA,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('piutang_dagang a');
|
||||
$this->db->join('penjualan b','b.ID_PENJUALAN=a.PENJUALAN_ID','left');
|
||||
$this->db->join('pelanggan c','c.ID_PELANGGAN=b.PELANGGAN_ID','left');
|
||||
$this->db->join('kota d','d.ID_KOTA=c.KOTA_ID','left');
|
||||
$this->db->join('detail_pda e','e.PDA_ID=a.ID_PDA','left');
|
||||
$this->db->group_by('a.ID_PDA');
|
||||
$this->db->where('a.STATUS_PDA is NULL');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PDA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PDA,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('piutang_dagang a');
|
||||
$this->db->join('penjualan b','b.ID_PENJUALAN=a.PENJUALAN_ID','left');
|
||||
$this->db->join('pelanggan c','c.ID_PELANGGAN=b.PELANGGAN_ID','left');
|
||||
$this->db->join('kota d','d.ID_KOTA=c.KOTA_ID','left');
|
||||
$this->db->join('detail_pda e','e.PDA_ID=a.ID_PDA','left');
|
||||
$this->db->group_by('a.ID_PDA');
|
||||
$this->db->where('a.STATUS_PDA is NULL');
|
||||
$this->db->where(['a.ID_PDA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPiutangDagangDetail($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PDA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PDA,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('piutang_dagang a');
|
||||
$this->db->join('penjualan b','b.ID_PENJUALAN=a.PENJUALAN_ID','left');
|
||||
$this->db->join('pelanggan c','c.ID_PELANGGAN=b.PELANGGAN_ID','left');
|
||||
$this->db->join('kota d','d.ID_KOTA=c.KOTA_ID','left');
|
||||
$this->db->join('detail_pda e','e.PDA_ID=a.ID_PDA','left');
|
||||
$this->db->group_by('a.ID_PDA');
|
||||
$this->db->where('a.NOMINAL_PDA!=a.BLOCKCON');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PDA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PDA,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('piutang_dagang a');
|
||||
$this->db->join('penjualan b','b.ID_PENJUALAN=a.PENJUALAN_ID','left');
|
||||
$this->db->join('pelanggan c','c.ID_PELANGGAN=b.PELANGGAN_ID','left');
|
||||
$this->db->join('kota d','d.ID_KOTA=c.KOTA_ID','left');
|
||||
$this->db->join('detail_pda e','e.PDA_ID=a.ID_PDA','left');
|
||||
$this->db->group_by('a.ID_PDA');
|
||||
$this->db->where('a.NOMINAL_PDA!=a.BLOCKCON');
|
||||
$this->db->where(['a.ID_PDA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPiutangDagangDPJ($id){
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PDA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PDA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as KREDIT');
|
||||
$this->db->from('piutang_dagang a');
|
||||
$this->db->join('penjualan b','b.ID_PENJUALAN=a.PENJUALAN_ID');
|
||||
$this->db->join('pelanggan c','c.ID_PELANGGAN=b.PELANGGAN_ID');
|
||||
$this->db->join('dp_penjualan d','d.PELANGGAN_ID=c.ID_PELANGGAN');
|
||||
$this->db->join('kota e','e.ID_KOTA=c.KOTA_ID','left');
|
||||
$this->db->where('a.NOMINAL_PDA!=a.BLOCKCON');
|
||||
$this->db->group_by('a.ID_PDA');
|
||||
$this->db->where(['d.PELANGGAN_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDeskripsiPDA($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PDA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PDA,2)) as KREDIT,CONCAT("Rp ",FORMAT(b.DEBIT_DPDA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBITALL');
|
||||
$this->db->from('piutang_dagang a');
|
||||
$this->db->join('detail_pda b','b.PDA_ID=a.ID_PDA');
|
||||
$this->db->group_by('b.ID_DPDA');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PDA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PDA,2)) as KREDIT,CONCAT("Rp ",FORMAT(b.DEBIT_DPDA,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBITALL');
|
||||
$this->db->from('piutang_dagang a');
|
||||
$this->db->join('detail_pda b','b.PDA_ID=a.ID_PDA');
|
||||
$this->db->group_by('b.ID_DPDA');
|
||||
$this->db->where(['a.ID_PDA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTitlePDA($id)
|
||||
{
|
||||
$this->db->select('KODE_PDA,CONCAT("Rp ",FORMAT(NOMINAL_PDA,2)) as KREDIT,CONCAT("Rp ",FORMAT(BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('piutang_dagang');
|
||||
$this->db->where(['ID_PDA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDPJ($id)
|
||||
{
|
||||
$this->db->select('PELANGGAN_ID');
|
||||
$this->db->from('dp_penjualan');
|
||||
$this->db->where(['ID_DPJ' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelPiutangKaryawan extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataPiutangKaryawan($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PKAR,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PKAR,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('piutang_karyawan a');
|
||||
$this->db->join('karyawan b','b.ID_KARYAWAN=a.KARYAWAN_ID','left');
|
||||
$this->db->join('detail_pkar c','c.PKAR_ID=a.ID_PKAR','left');
|
||||
$this->db->group_by('a.ID_PKAR');
|
||||
$this->db->where('a.STATUS_PKAR is NULL');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PKAR,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PKAR,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('piutang_karyawan a');
|
||||
$this->db->join('karyawan b','b.ID_KARYAWAN=a.KARYAWAN_ID','left');
|
||||
$this->db->join('detail_pkar c','c.PKAR_ID=a.ID_PKAR','left');
|
||||
$this->db->group_by('a.ID_PKAR');
|
||||
$this->db->where('a.STATUS_PKAR is NULL');
|
||||
$this->db->where(['a.ID_PKAR' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPiutangKaryawanDetail($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PKAR,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PKAR,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('piutang_karyawan a');
|
||||
$this->db->join('karyawan b','b.ID_KARYAWAN=a.KARYAWAN_ID','left');
|
||||
$this->db->join('detail_pkar c','c.PKAR_ID=a.ID_PKAR','left');
|
||||
$this->db->group_by('a.ID_PKAR');
|
||||
$this->db->where('a.NOMINAL_PKAR!=a.BLOCKCON');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PKAR,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PKAR,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('piutang_karyawan a');
|
||||
$this->db->join('karyawan b','b.ID_KARYAWAN=a.KARYAWAN_ID','left');
|
||||
$this->db->join('detail_pkar c','c.PKAR_ID=a.ID_PKAR','left');
|
||||
$this->db->group_by('a.ID_PKAR');
|
||||
$this->db->where('a.NOMINAL_PKAR!=a.BLOCKCON');
|
||||
$this->db->where(['a.ID_PKAR' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDeskripsiPKAR($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PKAR,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PKAR,2)) as KREDIT,CONCAT("Rp ",FORMAT(b.DEBIT_DPKAR,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBITALL');
|
||||
$this->db->from('piutang_karyawan a');
|
||||
$this->db->join('detail_pkar b','b.PKAR_ID=a.ID_PKAR');
|
||||
$this->db->group_by('b.ID_DPKAR');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PKAR,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PKAR,2)) as KREDIT,CONCAT("Rp ",FORMAT(b.DEBIT_DPKAR,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBITALL');
|
||||
$this->db->from('piutang_karyawan a');
|
||||
$this->db->join('detail_pkar b','b.PKAR_ID=a.ID_PKAR');
|
||||
$this->db->group_by('b.ID_DPKAR');
|
||||
$this->db->where(['a.ID_PKAR' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTitlePKAR($id)
|
||||
{
|
||||
$this->db->select('KODE_PKAR,CONCAT("Rp ",FORMAT(NOMINAL_PKAR,2)) as KREDIT,CONCAT("Rp ",FORMAT(BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('piutang_karyawan');
|
||||
$this->db->where(['ID_PKAR' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelPiutangPihakKe3 extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataPiutangPihakKe3($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PPI,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PPI,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('piutang_pihakke3 a');
|
||||
$this->db->join('pihakke3 b','b.ID_PIHAKKE3=a.PIHAKKE3_ID','left');
|
||||
$this->db->join('detail_ppi c','c.PPI_ID=a.ID_PPI','left');
|
||||
$this->db->join('kota d','d.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->group_by('a.ID_PPI');
|
||||
$this->db->where('a.STATUS_PPI is NULL');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PPI,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PPI,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('piutang_pihakke3 a');
|
||||
$this->db->join('pihakke3 b','b.ID_PIHAKKE3=a.PIHAKKE3_ID','left');
|
||||
$this->db->join('detail_ppi c','c.PPI_ID=a.ID_PPI','left');
|
||||
$this->db->join('kota d','d.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->group_by('a.ID_PPI');
|
||||
$this->db->where('a.STATUS_PPI is NULL');
|
||||
$this->db->where(['a.ID_PPI' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPiutangPihakKe3Detail($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PPI,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PPI,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('piutang_pihakke3 a');
|
||||
$this->db->join('pihakke3 b','b.ID_PIHAKKE3=a.PIHAKKE3_ID','left');
|
||||
$this->db->join('detail_ppi c','c.PPI_ID=a.ID_PPI','left');
|
||||
$this->db->join('kota d','d.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->group_by('a.ID_PPI');
|
||||
$this->db->where('a.NOMINAL_PPI!=a.BLOCKCON');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PPI,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PPI,2)) as KREDIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('piutang_pihakke3 a');
|
||||
$this->db->join('pihakke3 b','b.ID_PIHAKKE3=a.PIHAKKE3_ID','left');
|
||||
$this->db->join('detail_ppi c','c.PPI_ID=a.ID_PPI','left');
|
||||
$this->db->join('kota d','d.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->group_by('a.ID_PPI');
|
||||
$this->db->where('a.NOMINAL_PPI!=a.BLOCKCON');
|
||||
$this->db->where(['a.ID_PPI' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDeskripsiPPI($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PPI,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PPI,2)) as KREDIT,CONCAT("Rp ",FORMAT(b.DEBIT_DPPI,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBITALL');
|
||||
$this->db->from('piutang_pihakke3 a');
|
||||
$this->db->join('detail_ppi b','b.PPI_ID=a.ID_PPI');
|
||||
$this->db->group_by('b.ID_DPPI');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_PPI,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(a.NOMINAL_PPI,2)) as KREDIT,CONCAT("Rp ",FORMAT(b.DEBIT_DPPI,2)) as DEBIT,CONCAT("Rp ",FORMAT(a.BLOCKCON,2)) as DEBITALL');
|
||||
$this->db->from('piutang_pihakke3 a');
|
||||
$this->db->join('detail_ppi b','b.PPI_ID=a.ID_PPI');
|
||||
$this->db->group_by('b.ID_DPPI');
|
||||
$this->db->where(['a.ID_PPI' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTitlePPI($id)
|
||||
{
|
||||
$this->db->select('KODE_PPI,CONCAT("Rp ",FORMAT(NOMINAL_PPI,2)) as KREDIT,CONCAT("Rp ",FORMAT(BLOCKCON,2)) as DEBIT');
|
||||
$this->db->from('piutang_pihakke3');
|
||||
$this->db->where(['ID_PPI' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelPosisi extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getData_Posisi($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('posisi');
|
||||
$this->db->order_by('NAMA_POSISI ASC');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('posisi');
|
||||
$this->db->where(['ID_POSISI' => $id]);
|
||||
$this->db->order_by('NAMA_POSISI ASC');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Kontak_byPOSISI($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('kontak a');
|
||||
$this->db->join('posisi b','b.ID_POSISI=a.POSISI_ID');
|
||||
$this->db->where(['a.POSISI_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelDaftarHarga extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataDaftarHarga($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('daftar_harga');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('daftar_harga');
|
||||
$this->db->where(['ID_DH' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataDaftarHargaKonsistensi($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('daftar_harga b','b.ID_DH=a.DH_ID','right');
|
||||
$this->db->order_by('b.ID_DH','ASC');
|
||||
$this->db->group_by('b.ID_DH','ASC');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang a');
|
||||
$this->db->join('daftar_harga b','b.ID_DH=a.DH_ID','right');
|
||||
$this->db->order_by('b.ID_DH','ASC');
|
||||
$this->db->group_by('b.ID_DH','ASC');
|
||||
$this->db->where(['b.ID_DH' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelProcessor extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataProcessor($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('processor');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('processor');
|
||||
$this->db->where(['ID_PROCESSOR' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNamaProcessor($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('NAMA_PROCESSOR');
|
||||
$this->db->from('processor');
|
||||
}else{
|
||||
$this->db->select('NAMA_PROCESSOR');
|
||||
$this->db->from('processor');
|
||||
$this->db->where(['ID_PROCESSOR' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelProgram extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getData_Program($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('program');
|
||||
$this->db->order_by('NAMA_PROGRAM ASC');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('program');
|
||||
$this->db->where(['ID_PROGRAM' => $id]);
|
||||
$this->db->order_by('NAMA_PROGRAM ASC');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_LinkKlaimProgram_byPROGRAM($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('link_klaimprogram a');
|
||||
$this->db->join('program b','b.ID_PROGRAM=a.PROGRAM_ID');
|
||||
$this->db->where(['a.PROGRAM_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_Program_byNAMA($id1, $id2=null){
|
||||
if ($id2 == null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('program');
|
||||
$this->db->where(['NAMA_PROGRAM' => $id1]);
|
||||
} else {
|
||||
$this->db->select('*');
|
||||
$this->db->from('program');
|
||||
$this->db->where(['NAMA_PROGRAM' => $id1]);
|
||||
$this->db->where('ID_PROGRAM!=', $id2);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,275 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelProgress extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataProgress($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(b.TANGGAL_SERVICE,"%d %M %Y %H:%i")) AS WAKTU_TERIMA,CONCAT(DATE_FORMAT(a.CHECK_PROGRESS,"%d %M %Y %H:%i")) AS WAKTU_PROGRESS');
|
||||
$this->db->from('progress a');
|
||||
$this->db->join('service b','b.PROGRESS_ID=a.ID_PROGRESS');
|
||||
$this->db->join('pelanggan c','c.ID_PELANGGAN=b.PELANGGAN_ID');
|
||||
$this->db->join('barang d','d.ID_BARANG=b.BARANG_ID');
|
||||
$this->db->join('operator e','e.ID_OPERATOR=b.OPERATOR_ID');
|
||||
$this->db->join('operator f','f.ID_OPERATOR=a.TEKNISI_ID');
|
||||
$this->db->order_by('ID_PROGRESS','ASC');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(b.TANGGAL_SERVICE,"%d %M %Y %H:%i")) AS WAKTU_TERIMA,CONCAT(DATE_FORMAT(a.CHECK_PROGRESS,"%d %M %Y %H:%i")) AS WAKTU_PROGRESS');
|
||||
$this->db->from('progress a');
|
||||
$this->db->join('service b','b.PROGRESS_ID=a.ID_PROGRESS');
|
||||
$this->db->join('pelanggan c','c.ID_PELANGGAN=b.PELANGGAN_ID');
|
||||
$this->db->join('barang d','d.ID_BARANG=b.BARANG_ID');
|
||||
$this->db->join('operator e','e.ID_OPERATOR=b.OPERATOR_ID');
|
||||
$this->db->join('operator f','f.ID_OPERATOR=a.TEKNISI_ID');
|
||||
$this->db->order_by('ID_PROGRESS','ASC');
|
||||
$this->db->where(['ID_PROGRESS' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getViewCheck($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TANGGAL_SERVICE,"%d %M %Y %H:%i")) AS TERIMA,CONCAT(DATE_FORMAT(e.CHECK_PROGRESS,"%d %M %Y %H:%i")) AS CHECKPRO');
|
||||
$this->db->from('service a');
|
||||
$this->db->join('barang b','b.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('operator c','c.ID_OPERATOR=a.OPERATOR_ID');
|
||||
$this->db->join('pelanggan d','d.ID_PELANGGAN=a.PELANGGAN_ID');
|
||||
$this->db->join('progress e','a.PROGRESS_ID=e.ID_PROGRESS','left');
|
||||
$this->db->join('teknisi f','f.ID_TEKNISI=e.TEKNISI_ID','left');
|
||||
$this->db->where('e.STATUS_PROGRESS="Belum Check"');
|
||||
$this->db->or_where('e.STATUS_PROGRESS="Claim Garansi"');
|
||||
$this->db->or_where('e.STATUS_PROGRESS="Part Discontinued"');
|
||||
$this->db->or_where('e.STATUS_PROGRESS="Selesai Check"');
|
||||
$this->db->or_where('e.STATUS_PROGRESS="Check Ulang"');
|
||||
$this->db->or_where('e.STATUS_PROGRESS="Re-check Claim"');
|
||||
$this->db->order_by('TANGGAL_SERVICE','DESC');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getViewKonfirmasi($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TANGGAL_SERVICE,"%d %M %Y %H:%i")) AS TEPRO,CONCAT(DATE_FORMAT(e.CHECK_PROGRESS,"%d %M %Y %H:%i")) AS CHECKPRO,CONCAT(DATE_FORMAT(e.KONFIRM_PROGRESS,"%d %M %Y %H:%i")) AS KONPRO');
|
||||
$this->db->from('service a');
|
||||
$this->db->join('barang b','b.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('operator c','c.ID_OPERATOR=a.OPERATOR_ID');
|
||||
$this->db->join('pelanggan d','d.ID_PELANGGAN=a.PELANGGAN_ID');
|
||||
$this->db->join('progress e','a.PROGRESS_ID=e.ID_PROGRESS','left');
|
||||
$this->db->join('teknisi f','f.ID_TEKNISI=e.TEKNISI_ID','left');
|
||||
$this->db->where('e.STATUS_PROGRESS="Selesai Check"');
|
||||
$this->db->or_where('e.STATUS_PROGRESS="Belum Check"');
|
||||
$this->db->or_where('e.STATUS_PROGRESS="Check Ulang"');
|
||||
$this->db->or_where('e.STATUS_PROGRESS="Part Discontinued"');
|
||||
$this->db->order_by('TANGGAL_SERVICE','DESC');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getViewKonfirmasiGudang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TANGGAL_SERVICE,"%d %M %Y %H:%i")) AS TEPRO,CONCAT(DATE_FORMAT(e.SS_PROGRESS,"%d %M %Y %H:%i")) AS SSPRO');
|
||||
$this->db->from('service a');
|
||||
$this->db->join('barang b','b.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('operator c','c.ID_OPERATOR=a.OPERATOR_ID');
|
||||
$this->db->join('pelanggan d','d.ID_PELANGGAN=a.PELANGGAN_ID');
|
||||
$this->db->join('progress e','a.PROGRESS_ID=e.ID_PROGRESS','left');
|
||||
$this->db->join('teknisi f','f.ID_TEKNISI=e.ADMINSERVICE_ID','left');
|
||||
$this->db->join('admingudang g','g.ID_ADMINGUDANG=e.ADMINGUDANG_ID','left');
|
||||
$this->db->where('e.STATUS_PROGRESS="SELESAI SERVICE" AND a.PELANGGAN_ID=1');
|
||||
$this->db->order_by('TANGGAL_SERVICE','DESC');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getViewSerahTerima($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TANGGAL_SERVICE,"%d %M %Y %H:%i")) AS TEPRO,CONCAT(DATE_FORMAT(e.CHECK_PROGRESS,"%d %M %Y %H:%i")) AS CHECKPRO,CONCAT(DATE_FORMAT(e.SS_PROGRESS,"%d %M %Y %H:%i")) AS SSPRO');
|
||||
$this->db->from('service a');
|
||||
$this->db->join('barang b','b.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('operator c','c.ID_OPERATOR=a.OPERATOR_ID');
|
||||
$this->db->join('pelanggan d','d.ID_PELANGGAN=a.PELANGGAN_ID');
|
||||
$this->db->join('progress e','a.PROGRESS_ID=e.ID_PROGRESS','left');
|
||||
$this->db->join('teknisi f','f.ID_TEKNISI=e.TEKNISI_ID','left');
|
||||
$this->db->where('e.STATUS_PROGRESS="KONFIRMASI SELESAI"');
|
||||
$this->db->or_where('e.STATUS_PROGRESS="BATAL SERVICE"');
|
||||
$this->db->order_by('TANGGAL_SERVICE','ASC');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataProgressID($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select_max('ID_PROGRESS');
|
||||
$this->db->from('progress');
|
||||
}else{
|
||||
$this->db->select_max('ID_PROGRESS');
|
||||
$this->db->from('progress');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getCountProgressCheck($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('ID_PROGRESS');
|
||||
$this->db->from('progress');
|
||||
$this->db->where('STATUS_PROGRESS="Belum Check"');
|
||||
}else{
|
||||
$this->db->select('ID_PROGRESS');
|
||||
$this->db->from('progress');
|
||||
$this->db->where('STATUS_PROGRESS="Belum Check"');
|
||||
}
|
||||
|
||||
return $this->db->count_all_results();
|
||||
}
|
||||
|
||||
public function getCountProgressClaim($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('ID_PROGRESS');
|
||||
$this->db->from('progress');
|
||||
$this->db->where('STATUS_PROGRESS="Claim Garansi"');
|
||||
}else{
|
||||
$this->db->select('ID_PROGRESS');
|
||||
$this->db->from('progress');
|
||||
$this->db->where('STATUS_PROGRESS="Claim Garansi"');
|
||||
}
|
||||
|
||||
return $this->db->count_all_results();
|
||||
}
|
||||
|
||||
public function getCountProgressGudang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('b.ID_PROGRESS');
|
||||
$this->db->from('service a');
|
||||
$this->db->join('progress b','b.ID_PROGRESS=a.PROGRESS_ID');
|
||||
$this->db->where('b.STATUS_PROGRESS!="DITERIMA GUDANG" AND a.PELANGGAN_ID=1');
|
||||
}
|
||||
return $this->db->count_all_results();
|
||||
}
|
||||
|
||||
public function getCountProgressAll($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('a.ID_SERVICE');
|
||||
$this->db->from('service a');
|
||||
$this->db->join('progress b','b.ID_PROGRESS=a.PROGRESS_ID');
|
||||
$this->db->where('b.STATUS_PROGRESS="Belum Check"');
|
||||
$this->db->or_where('b.STATUS_PROGRESS="Part Discontinued"');
|
||||
$this->db->or_where('b.STATUS_PROGRESS="Check Ulang"');
|
||||
$this->db->or_where('b.STATUS_PROGRESS="Selesai Check"');
|
||||
$this->db->or_where('b.STATUS_PROGRESS="Selesai Claim"');
|
||||
$this->db->or_where('b.STATUS_PROGRESS="KONFIRMASI SELESAI"');
|
||||
}
|
||||
return $this->db->count_all_results();
|
||||
}
|
||||
|
||||
public function getCountProgressKonfirm($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('ID_PROGRESS');
|
||||
$this->db->from('progress');
|
||||
$this->db->where('STATUS_PROGRESS="Part Discontinued"');
|
||||
$this->db->or_where('STATUS_PROGRESS="Check Ulang"');
|
||||
$this->db->or_where('STATUS_PROGRESS="Selesai Check"');
|
||||
$this->db->or_where('STATUS_PROGRESS="Belum Check"');
|
||||
}else{
|
||||
$this->db->select('ID_PROGRESS');
|
||||
$this->db->from('progress');
|
||||
$this->db->where('STATUS_PROGRESS="Part Discontinued"');
|
||||
$this->db->or_where('STATUS_PROGRESS="Check Ulang"');
|
||||
$this->db->or_where('STATUS_PROGRESS="Selesai Check"');
|
||||
$this->db->or_where('STATUS_PROGRESS="Belum Check"');
|
||||
}
|
||||
|
||||
return $this->db->count_all_results();
|
||||
}
|
||||
|
||||
public function getCountProgressKonfirmGudang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('b.ID_PROGRESS');
|
||||
$this->db->from('service a');
|
||||
$this->db->join('progress b','b.ID_PROGRESS=a.PROGRESS_ID');
|
||||
$this->db->where('b.STATUS_PROGRESS="SELESAI SERVICE" AND a.PELANGGAN_ID=1');
|
||||
}else{
|
||||
$this->db->select('b.ID_PROGRESS');
|
||||
$this->db->from('service a');
|
||||
$this->db->join('progress b','b.ID_PROGRESS=a.PROGRESS_ID');
|
||||
$this->db->where('b.STATUS_PROGRESS="SELESAI SERVICE" AND a.PELANGGAN_ID=1');
|
||||
}
|
||||
|
||||
return $this->db->count_all_results();
|
||||
}
|
||||
|
||||
public function getCountProgressSS($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('ID_PROGRESS');
|
||||
$this->db->from('progress');
|
||||
$this->db->where('STATUS_PROGRESS="KONFIRMASI SELESAI"');
|
||||
$this->db->or_where('STATUS_PROGRESS="BATAL SERVICE"');
|
||||
}else{
|
||||
$this->db->select('ID_PROGRESS');
|
||||
$this->db->from('progress');
|
||||
$this->db->where('STATUS_PROGRESS="KONFIRMASI SELESAI"');
|
||||
$this->db->or_where('STATUS_PROGRESS="BATAL SERVICE"');
|
||||
}
|
||||
|
||||
return $this->db->count_all_results();
|
||||
}
|
||||
|
||||
public function getCountProgressLaporanGudang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('b.ID_PROGRESS');
|
||||
$this->db->from('service a');
|
||||
$this->db->join('progress b','b.ID_PROGRESS=a.PROGRESS_ID');
|
||||
$this->db->where('a.PELANGGAN_ID=1');
|
||||
}
|
||||
|
||||
return $this->db->count_all_results();
|
||||
}
|
||||
|
||||
public function getDataTeknisiID($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('ID_PROGRESS,STATUS_PROGRESS,TEKNISI_ID');
|
||||
$this->db->from('progress');
|
||||
}else{
|
||||
$this->db->select('ID_PROGRESS,STATUS_PROGRESS,TEKNISI_ID');
|
||||
$this->db->from('progress');
|
||||
$this->db->where(['ID_PROGRESS' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
class ModelPromo extends CI_Model
|
||||
{
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if ($batch === false) {
|
||||
$insert = $this->db->insert($table, $data);
|
||||
} else {
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if ($batch === false) {
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
} else {
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataPromo($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,a.NAMA_PROMO,a.TGL_PROMO,CONCAT(FORMAT(a.POTONGAN,0)) as POTONGANHARGA,b.NO_INVOICE');
|
||||
$this->db->from('promo a');
|
||||
$this->db->join('invoice b','b.ID_INVOICE=a.ID_INVOICE');
|
||||
}else{
|
||||
$this->db->select('*,a.NAMA_PROMO,a.TGL_PROMO,CONCAT(FORMAT(a.POTONGAN,0)) as POTONGANHARGA,b.NO_INVOICE');
|
||||
$this->db->from('promo a');
|
||||
$this->db->join('invoice b','b.ID_INVOICE=a.ID_INVOICE');
|
||||
$this->db->where(['ID_PROMO' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelRaid extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataRaid($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('raid a');
|
||||
$this->db->join('spek b','b.RAID_ID=a.ID_RAID','left');
|
||||
$this->db->group_by('a.ID_RAID');
|
||||
}else{
|
||||
$this->db->from('raid a');
|
||||
$this->db->join('spek b','b.RAID_ID=a.ID_RAID','left');
|
||||
$this->db->group_by('a.ID_RAID');
|
||||
$this->db->where(['a.ID_RAID' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelRam extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataRam($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('ram');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('ram a');
|
||||
$this->db->where(['ID_RAM' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,265 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelRekening extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataRekening($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('rekening');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('rekening');
|
||||
$this->db->where(['ID_REKENING' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDRekeningMax(){
|
||||
$this->db->select_max('ID_REKENING');
|
||||
$this->db->from('rekening');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPembelianHarga($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_SJBELI,"%d %M %Y")) AS WAKTU');
|
||||
$this->db->from('pembelian a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID','left');
|
||||
$this->db->join('kota c','c.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->where('a.STATUS_PEMBELIAN="SJ SUDAH PROSES"');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_SJBELI,"%d %M %Y")) AS WAKTU');
|
||||
$this->db->from('pembelian a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID','left');
|
||||
$this->db->join('kota c','c.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->where(['a.ID_PEMBELIAN' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPembelianStock($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_SJBELI,"%d %M %Y")) AS WAKTU');
|
||||
$this->db->from('pembelian a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID','left');
|
||||
$this->db->join('kota c','c.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->join('stock d','d.PEMBELIAN_ID=a.ID_PEMBELIAN','left');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_SJBELI,"%d %M %Y")) AS WAKTU');
|
||||
$this->db->from('pembelian a');
|
||||
$this->db->join('supplier b','b.ID_SUPPLIER=a.SUPPLIER_ID','left');
|
||||
$this->db->join('kota c','c.ID_KOTA=b.KOTA_ID','left');
|
||||
$this->db->join('stock d','d.PEMBELIAN_ID=a.ID_PEMBELIAN','left');
|
||||
$this->db->where(['a.ID_PEMBELIAN' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getStock($id = null) {
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('stock a');
|
||||
$this->db->join('barang b', 'b.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->where(['a.ID_STOCK' => $id]);
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('stock a');
|
||||
$this->db->join('barang b', 'b.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->where(['a.ID_STOCK' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataTambahStock($id)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('pembelian a');
|
||||
$this->db->join('stock b', 'b.PEMBELIAN_ID=a.ID_PEMBELIAN');
|
||||
$this->db->join('barang c', 'c.ID_BARANG=b.BARANG_ID');
|
||||
$this->db->join('jenis d', 'd.ID_JENIS=c.JENIS_ID');
|
||||
$this->db->join('gudang e', 'e.ID_GUDANG=b.GUDANG_ID');
|
||||
$this->db->join('sn f', 'f.STOCK_ID=b.ID_STOCK','left');
|
||||
$this->db->where(['a.ID_PEMBELIAN' => $id]);
|
||||
$this->db->group_by('b.ID_STOCK');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getPembelianHarga($id)
|
||||
{
|
||||
$this->db->select('*,CONCAT("Rp ",FORMAT(f.DPP_BELI_SATUAN,0)) as SATUAN,CONCAT("Rp ",FORMAT(f.DPP_BELI_TOTAL,0)) as JUMLAH');
|
||||
$this->db->from('pembelian a');
|
||||
$this->db->join('stock b', 'b.PEMBELIAN_ID=a.ID_PEMBELIAN');
|
||||
$this->db->join('barang c', 'c.ID_BARANG=b.BARANG_ID');
|
||||
$this->db->join('jenis d', 'd.ID_JENIS=c.JENIS_ID');
|
||||
$this->db->join('gudang e', 'e.ID_GUDANG=b.GUDANG_ID');
|
||||
$this->db->join('harga f', 'f.STOCK_ID=b.ID_STOCK','left');
|
||||
$this->db->where(['a.ID_PEMBELIAN' => $id]);
|
||||
$this->db->group_by('b.ID_STOCK');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getStockID($id)
|
||||
{
|
||||
$this->db->select('a.*, b.KODE_BARANG, b.NAMA_BARANG,b.QTY_REAL,c.TYPE_JENIS');
|
||||
$this->db->from('stock a');
|
||||
$this->db->join('barang b', 'b.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('jenis c', 'c.ID_JENIS=b.JENIS_ID');
|
||||
$this->db->where(['a.ID_STOCK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getStockTitle($id)
|
||||
{
|
||||
$this->db->select('b.NAMA_BARANG');
|
||||
$this->db->from('stock a');
|
||||
$this->db->join('barang b', 'b.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->where(['a.ID_STOCK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getStockHarga($id)
|
||||
{
|
||||
$this->db->select('a.*, b.KODE_BARANG, b.NAMA_BARANG');
|
||||
$this->db->from('stock a');
|
||||
$this->db->join('barang b', 'b.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('harga c', 'c.STOCK_ID=a.ID_STOCK');
|
||||
$this->db->where(['a.ID_STOCK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getQtyPembelian($id)
|
||||
{
|
||||
$this->db->select('QTY,BLOCKADDSN');
|
||||
$this->db->from('stock');
|
||||
$this->db->where(['ID_STOCK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getQtyPembelianSn($id)
|
||||
{
|
||||
$this->db->select('b.ID_SN');
|
||||
$this->db->from('stock a');
|
||||
$this->db->join('sn b','b.STOCK_ID=a.ID_STOCK');
|
||||
$this->db->where(['ID_STOCK' => $id]);
|
||||
return $this->db->count_all_results();
|
||||
}
|
||||
|
||||
public function getStockSn($id)
|
||||
{
|
||||
$this->db->select('b.ID_STOCK');
|
||||
$this->db->from('pembelian a');
|
||||
$this->db->join('stock b','b.PEMBELIAN_ID=a.ID_PEMBELIAN');
|
||||
$this->db->join('sn c','c.STOCK_ID=b.ID_STOCK');
|
||||
$this->db->where(['a.ID_PEMBELIAN' => $id]);
|
||||
$this->db->group_by('b.ID_STOCK');
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBlockAddSn($id)
|
||||
{
|
||||
$this->db->select('a.ID_SN');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('stock b','b.ID_STOCK=a.STOCK_ID');
|
||||
$this->db->where(['b.ID_STOCK' => $id]);
|
||||
|
||||
return $this->db->count_all_results();
|
||||
}
|
||||
|
||||
public function getQtyStockSn($id)
|
||||
{
|
||||
$this->db->select('a.ID_SN');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('stock b','b.ID_STOCK=a.STOCK_ID');
|
||||
$this->db->join('pembelian c','c.ID_PEMBELIAN=b.PEMBELIAN_ID');
|
||||
$this->db->where(['b.ID_STOCK' => $id]);
|
||||
|
||||
return $this->db->count_all_results();
|
||||
}
|
||||
|
||||
public function getDataSn($id)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('sn');
|
||||
$this->db->where(['STOCK_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDetailPembelianID($id)
|
||||
{
|
||||
$this->db->select('STOCK_ID');
|
||||
$this->db->from('sn');
|
||||
$this->db->where(['ID_SN' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getSJPembelian($id)
|
||||
{
|
||||
$this->db->select('SJ_PEMBELIAN');
|
||||
$this->db->from('pembelian');
|
||||
$this->db->where(['ID_PEMBELIAN' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getGudangSN()
|
||||
{
|
||||
$this->db->select_max('ID_SN');
|
||||
$this->db->from('sn');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getStockHargaID()
|
||||
{
|
||||
$this->db->select_max('ID_HARGA');
|
||||
$this->db->from('harga');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getGudangStock($id)
|
||||
{
|
||||
$this->db->select('b.GUDANG_ID');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('stock b','b.ID_STOCK=a.STOCK_ID');
|
||||
$this->db->where(['a.ID_SN' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBarangStock($id)
|
||||
{
|
||||
$this->db->select('b.BARANG_ID,b.BLOCKADDSN,c.QTY_REAL');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('stock b','b.ID_STOCK=a.STOCK_ID');
|
||||
$this->db->join('barang c','c.ID_BARANG=b.BARANG_ID');
|
||||
$this->db->where(['b.ID_STOCK' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelRelasi extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataRelasi($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('relasi a');
|
||||
$this->db->join('kasbank b','b.RELASI_ID=a.ID_RELASI','left');
|
||||
$this->db->group_by('a.ID_RELASI');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('relasi a');
|
||||
$this->db->join('kasbank b','b.RELASI_ID=a.ID_RELASI','left');
|
||||
$this->db->group_by('a.ID_RELASI');
|
||||
$this->db->where(['a.ID_RELASI' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHddPC($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('hdd');
|
||||
$this->db->where('TYPE_HDD="SATA"');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHddNB($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('hdd');
|
||||
$this->db->where('TYPE_HDD="SATA" AND DIMENSI_HDD="2,5 Inch"');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHddAIO($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('hdd');
|
||||
$this->db->where('TYPE_HDD="SATA" AND DIMENSI_HDD="2,5 Inch"');
|
||||
$this->db->or_where('TYPE_HDD="SATA" AND DIMENSI_HDD="3,5 Inch"');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHddWS($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('hdd');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataHddSRV($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('hdd');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelSerahTerima extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataProgress($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(b.TANGGAL_SERVICE,"%d %M %Y %H:%i")) AS WAKTU_TERIMA,CONCAT(DATE_FORMAT(a.CHECK_PROGRESS,"%d %M %Y %H:%i")) AS WAKTU_PROGRESS');
|
||||
$this->db->from('progress a');
|
||||
$this->db->join('service b','b.PROGRESS_ID=a.ID_PROGRESS');
|
||||
$this->db->join('pelanggan c','c.ID_PELANGGAN=b.PELANGGAN_ID');
|
||||
$this->db->join('barang d','d.ID_BARANG=b.BARANG_ID');
|
||||
$this->db->join('operator e','e.ID_OPERATOR=b.OPERATOR_ID');
|
||||
$this->db->join('operator f','f.ID_OPERATOR=a.TEKNISI_ID');
|
||||
$this->db->order_by('ID_PROGRESS','ASC');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(b.TANGGAL_SERVICE,"%d %M %Y %H:%i")) AS WAKTU_TERIMA,CONCAT(DATE_FORMAT(a.CHECK_PROGRESS,"%d %M %Y %H:%i")) AS WAKTU_PROGRESS');
|
||||
$this->db->from('progress a');
|
||||
$this->db->join('service b','b.PROGRESS_ID=a.ID_PROGRESS');
|
||||
$this->db->join('pelanggan c','c.ID_PELANGGAN=b.PELANGGAN_ID');
|
||||
$this->db->join('barang d','d.ID_BARANG=b.BARANG_ID');
|
||||
$this->db->join('operator e','e.ID_OPERATOR=b.OPERATOR_ID');
|
||||
$this->db->join('operator f','f.ID_OPERATOR=a.TEKNISI_ID');
|
||||
$this->db->order_by('ID_PROGRESS','ASC');
|
||||
$this->db->where(['ID_PROGRESS' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getViewSTCustomer($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TANGGAL_SERVICE,"%d %M %Y %H:%i")) AS TEPRO,CONCAT(DATE_FORMAT(e.CHECK_PROGRESS,"%d %M %Y %H:%i")) AS CHECKPRO,CONCAT(DATE_FORMAT(e.SS_PROGRESS,"%d %M %Y %H:%i")) AS SSPRO');
|
||||
$this->db->from('service a');
|
||||
$this->db->join('barang b','b.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('operator c','c.ID_OPERATOR=a.OPERATOR_ID');
|
||||
$this->db->join('pelanggan d','d.ID_PELANGGAN=a.PELANGGAN_ID');
|
||||
$this->db->join('progress e','a.PROGRESS_ID=e.ID_PROGRESS','left');
|
||||
$this->db->join('teknisi f','f.ID_TEKNISI=e.TEKNISI_ID','left');
|
||||
$this->db->where('a.PELANGGAN_ID>=3 AND e.STATUS_PROGRESS="KONFIRMASI SELESAI"');
|
||||
$this->db->or_where('a.PELANGGAN_ID>=3 AND e.STATUS_PROGRESS="BATAL SERVICE"');
|
||||
$this->db->order_by('a.ID_SERVICE');
|
||||
$this->db->group_by('a.ID_SERVICE');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getViewSTInternal($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('a.ID_SERVICE,d.NAMA_PELANGGAN,b.MODEL_BARANG,a.SN_SERVICE,a.KELUHAN_SERVICE,f.NAMA_TEKNISI,e.KERUSAKAN_PROGRESS,e.STATUS_PROGRESS,e.ID_PROGRESS');
|
||||
$this->db->from('service a');
|
||||
$this->db->join('barang b','b.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('operator c','c.ID_OPERATOR=a.OPERATOR_ID');
|
||||
$this->db->join('pelanggan d','d.ID_PELANGGAN=a.PELANGGAN_ID');
|
||||
$this->db->join('progress e','a.PROGRESS_ID=e.ID_PROGRESS','left');
|
||||
$this->db->join('teknisi f','f.ID_TEKNISI=e.ADMINSERVICE_ID','left');
|
||||
$this->db->where('a.PELANGGAN_ID=1 AND e.STATUS_PROGRESS="KONFIRMASI SELESAI"');
|
||||
$this->db->or_where('a.PELANGGAN_ID=1 AND e.STATUS_PROGRESS="BATAL SERVICE"');
|
||||
$this->db->order_by('a.ID_SERVICE');
|
||||
$this->db->group_by('a.ID_SERVICE');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getViewSTOutlet($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('a.ID_SERVICE,d.NAMA_PELANGGAN,b.MODEL_BARANG,a.SN_SERVICE,a.KELUHAN_SERVICE,f.NAMA_TEKNISI,e.KERUSAKAN_PROGRESS,e.STATUS_PROGRESS,e.ID_PROGRESS');
|
||||
$this->db->from('service a');
|
||||
$this->db->join('barang b','b.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('operator c','c.ID_OPERATOR=a.OPERATOR_ID');
|
||||
$this->db->join('pelanggan d','d.ID_PELANGGAN=a.PELANGGAN_ID');
|
||||
$this->db->join('progress e','a.PROGRESS_ID=e.ID_PROGRESS','left');
|
||||
$this->db->join('teknisi f','f.ID_TEKNISI=e.TEKNISI_ID','left');
|
||||
$this->db->where('a.PELANGGAN_ID=2 AND e.STATUS_PROGRESS="KONFIRMASI SELESAI"');
|
||||
$this->db->or_where('a.PELANGGAN_ID=2 AND e.STATUS_PROGRESS="BATAL SERVICE"');
|
||||
$this->db->order_by('a.ID_SERVICE');
|
||||
$this->db->group_by('a.ID_SERVICE');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataProgressID($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select_max('ID_PROGRESS');
|
||||
$this->db->from('progress');
|
||||
}else{
|
||||
$this->db->select_max('ID_PROGRESS');
|
||||
$this->db->from('progress');
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataTeknisiID($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('ID_PROGRESS,STATUS_PROGRESS,TEKNISI_ID');
|
||||
$this->db->from('progress');
|
||||
}else{
|
||||
$this->db->select('ID_PROGRESS,STATUS_PROGRESS,TEKNISI_ID');
|
||||
$this->db->from('progress');
|
||||
$this->db->where(['ID_PROGRESS' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelService extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataService($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('service a');
|
||||
$this->db->join('pelanggan b','b.ID_PELANGGAN=a.PELANGGAN_ID');
|
||||
$this->db->join('operator c','c.ID_OPERATOR=a.OPERATOR_ID');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('service a');
|
||||
$this->db->join('pelanggan b','b.ID_PELANGGAN=a.PELANGGAN_ID');
|
||||
$this->db->join('operator c','c.ID_OPERATOR=a.OPERATOR_ID');
|
||||
$this->db->where(['ID_SERVICE' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataService2($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(b.TANGGAL_SERVICE,"%d %M %Y")) AS WAKTU');
|
||||
$this->db->from('progress a');
|
||||
$this->db->join('service b','b.ID_SERVICE=a.SERVICE_ID');
|
||||
$this->db->join('barang c','c.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('pelanggan d','d.ID_PELANGGAN=b.PELANGGAN_ID');
|
||||
$this->db->join('operator e','e.ID_OPERATOR=b.OPERATOR_ID');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(b.TANGGAL_SERVICE,"%d %M %Y")) AS WAKTU');
|
||||
$this->db->from('progress a');
|
||||
$this->db->join('service b','b.ID_SERVICE=a.SERVICE_ID');
|
||||
$this->db->join('barang c','c.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('pelanggan d','d.ID_PELANGGAN=b.PELANGGAN_ID');
|
||||
$this->db->join('operator e','e.ID_OPERATOR=b.OPERATOR_ID');
|
||||
$this->db->where(['ID_PROGRESS' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataOperator($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('operator');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('operator');
|
||||
$this->db->where(['ID_OPERATOR' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataPelanggan($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('pelanggan');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('pelanggan');
|
||||
$this->db->where(['ID_PELANGGAN' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataBarang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('barang');
|
||||
$this->db->where(['ID_BARANG' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataProgress($id = null){
|
||||
$this->db->select('*');
|
||||
$this->db->from('progress a');
|
||||
$this->db->join('barang b','b.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->where(['a.SERVICE_ID' => null]);
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDService($kode_service)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('service');
|
||||
$this->db->where(['KODE_SERVICE' => $kode_service]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDProgress()
|
||||
{
|
||||
|
||||
$this->db->select('*');
|
||||
$this->db->from('progress');
|
||||
$this->db->where(['SERVICE_ID' => null]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelServiceCenter extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getData_ServiceCenter($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('servicecenter');
|
||||
$this->db->order_by('NAMA_SERVICECENTER');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('servicecenter');
|
||||
$this->db->where(['ID_SERVICECENTER' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_ServiceCenter_byNAMA($nama, $id=null){
|
||||
$this->db->select('*');
|
||||
$this->db->from('servicecenter');
|
||||
$this->db->where(['NAMA_SERVICECENTER' => $nama]);
|
||||
if ($id!=null) {
|
||||
$this->db->where('ID_SERVICECENTER!=', $id);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getData_KlaimService_bySERVICECENTER($id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('klaim_service');
|
||||
$this->db->where(['SERVICECENTER_ID' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,995 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelSetKasbank extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
//Step One, Input Set Kasbank
|
||||
public function getDataSetKasbank($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_SETKASBANK,"%d/%m/%Y")) AS WAKTU');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('kas b','b.ID_KAS=a.KAS_ID','left');
|
||||
$this->db->join('bank c','c.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('piutang_dagang d','d.ID_PDA=a.PDA_ID','left');
|
||||
$this->db->join('piutang_karyawan e','e.ID_PKAR=a.PKAR_ID','left');
|
||||
$this->db->join('piutang_pihakke3 f','f.ID_PPI=a.PPI_ID','left');
|
||||
$this->db->join('dp_pembelian g','g.ID_DPB=a.DPB_ID','left');
|
||||
$this->db->join('dp_pajak h','h.ID_DPP=a.DPP_ID','left');
|
||||
$this->db->join('hutang_dagang i','i.ID_HDA=a.HDA_ID','left');
|
||||
$this->db->join('hutang_bank j','j.ID_HBA=a.HBA_ID','left');
|
||||
$this->db->join('hutang_lain k','k.ID_HLA=a.HLA_ID','left');
|
||||
$this->db->join('dp_penjualan l','l.ID_DPJ=a.DPJ_ID','left');
|
||||
$this->db->group_by('a.ID_SETKASBANK');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_SETKASBANK,"%d/%m/%Y")) AS WAKTU');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('kas b','b.ID_KAS=a.KAS_ID','left');
|
||||
$this->db->join('bank c','c.ID_BANK=a.BANK_ID','left');
|
||||
$this->db->join('piutang_dagang d','d.ID_PDA=a.PDA_ID','left');
|
||||
$this->db->join('piutang_karyawan e','e.ID_PKAR=a.PKAR_ID','left');
|
||||
$this->db->join('piutang_pihakke3 f','f.ID_PPI=a.PPI_ID','left');
|
||||
$this->db->join('dp_pembelian g','g.ID_DPB=a.DPB_ID','left');
|
||||
$this->db->join('dp_pajak h','h.ID_DPP=a.DPP_ID','left');
|
||||
$this->db->join('hutang_dagang i','i.ID_HDA=a.HDA_ID','left');
|
||||
$this->db->join('hutang_bank j','j.ID_HBA=a.HBA_ID','left');
|
||||
$this->db->join('hutang_lain k','k.ID_HLA=a.HLA_ID','left');
|
||||
$this->db->join('dp_penjualan l','l.ID_DPJ=a.DPJ_ID','left');
|
||||
$this->db->group_by('a.ID_SETKASBANK');
|
||||
$this->db->where(['a.ID_SETKASBANK' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getKodeSetKasbank() {
|
||||
$this->db->select('MAX(KODE_SETDATA) AS KODE');
|
||||
$this->db->from('setkasbank');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDSETKASBANK() {
|
||||
$this->db->select_max('ID_SETKASBANK');
|
||||
$this->db->from('setkasbank');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//Step Two, Input Transaksi
|
||||
public function getDataNeracaAwal($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_SETDATA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(b.NILAI_NERACA,2)) as NILAI');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA','left');
|
||||
$this->db->join('perkiraan c','c.ID_PERKIRAAN=b.PERKIRAAN_ID','left');
|
||||
$this->db->group_by('b.ID_NERACA');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_SETDATA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(b.NILAI_NERACA,2)) as NILAI');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA','left');
|
||||
$this->db->join('perkiraan c','c.ID_PERKIRAAN=b.PERKIRAAN_ID','left');
|
||||
$this->db->group_by('b.ID_NERACA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.ID_NERACA=9');
|
||||
$this->db->or_where('b.ID_NERACA=10');
|
||||
$this->db->or_where('b.ID_NERACA=11');
|
||||
$this->db->or_where('b.ID_NERACA=12');
|
||||
$this->db->or_where('b.ID_NERACA=13');
|
||||
$this->db->or_where('b.ID_NERACA=14');
|
||||
$this->db->or_where('b.ID_NERACA=20');
|
||||
$this->db->or_where('b.ID_NERACA=21');
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataNeraca($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_SETDATA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(b.NILAI_NERACA,2)) as NILAI');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA','left');
|
||||
$this->db->join('perkiraan c','c.ID_PERKIRAAN=b.PERKIRAAN_ID','left');
|
||||
$this->db->group_by('b.ID_NERACA');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_SETDATA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(b.NILAI_NERACA,2)) as NILAI');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA','left');
|
||||
$this->db->join('perkiraan c','c.ID_PERKIRAAN=b.PERKIRAAN_ID','left');
|
||||
$this->db->group_by('b.ID_NERACA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataNeracaTotal($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_SETDATA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(b.NILAI_TOTALNERACA,2)) as NILAI');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('totalneraca b','b.SETDATA_ID=a.ID_SETDATA','left');
|
||||
$this->db->group_by('b.ID_TOTALNERACA');
|
||||
}else{
|
||||
$this->db->select('*,CONCAT(DATE_FORMAT(a.TGL_SETDATA,"%d/%m/%Y")) AS WAKTU,CONCAT("Rp ",FORMAT(b.NILAI_TOTALNERACA,2)) as NILAI');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('totalneraca b','b.SETDATA_ID=a.ID_SETDATA','left');
|
||||
$this->db->group_by('b.ID_TOTALNERACA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTitleSD($id) {
|
||||
$this->db->select('KODE_SETDATA,CONCAT(DATE_FORMAT(TGL_SETDATA,"%d/%m/%Y")) AS WAKTU');
|
||||
$this->db->from('setkasbank');
|
||||
$this->db->where(['ID_SETDATA' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai1110($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=1');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai1120($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=2');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai1130($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=3');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai1140($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=4');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai1150($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=5');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai1160($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=6');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai1170($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=7');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai1180($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=8');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai1210($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=9');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai1211($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=10');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai1220($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=11');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai1221($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=12');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai1230($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=13');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai1231($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=14');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai2110($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=15');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai2120($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=16');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai2130($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=17');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai2140($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=18');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai2150($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=19');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai3100($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=20');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai3200($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=21');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai3210($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=22');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai4110($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=23');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai4120($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=24');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai4130($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=25');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai5110($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=26');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai5120($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=27');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai5121($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=28');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai5122($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=29');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai5130($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=30');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6101($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=31');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6102($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=32');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6103($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=33');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6104($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=34');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6105($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=35');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6106($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=36');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6107($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=37');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6201($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=38');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6202($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=39');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6203($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=40');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6204($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=41');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6205($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=42');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6206($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=43');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6207($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=44');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6208($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=45');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6209($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=46');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6210($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=47');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6211($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=48');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6212($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=49');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6213($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=50');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6214($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=51');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6215($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=52');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6216($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=53');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6217($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=54');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6218($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=55');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6219($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=56');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6220($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=57');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6221($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=58');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6222($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=59');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6223($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=60');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6224($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=61');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6225($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=62');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6226($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=63');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6227($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=64');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6228($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=65');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6229($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=66');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6230($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=67');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6231($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=68');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6232($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=69');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6233($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=70');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6234($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=71');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6235($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=72');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6236($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=73');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai6237($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=74');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai7100($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=75');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai7200($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=76');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai7300($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=77');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getNilai7400($id) {
|
||||
$this->db->select('b.NILAI_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=78');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTotalAktivaLancar($id) {
|
||||
$this->db->select('b.NILAI_TOTALNERACA,b.ID_TOTALNERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('totalneraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.NAMA_TOTALNERACA="Aktiva Lancar"');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTotalAktivaTetap($id) {
|
||||
$this->db->select('b.NILAI_TOTALNERACA,b.ID_TOTALNERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('totalneraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.NAMA_TOTALNERACA="Aktiva Tetap"');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTotalAktiva($id) {
|
||||
$this->db->select('b.NILAI_TOTALNERACA,b.ID_TOTALNERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('totalneraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.NAMA_TOTALNERACA="Total Aktiva"');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTotalKewajibanLancar($id) {
|
||||
$this->db->select('b.NILAI_TOTALNERACA,b.ID_TOTALNERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('totalneraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.NAMA_TOTALNERACA="Kewajiban Lancar"');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTotalModal($id) {
|
||||
$this->db->select('b.NILAI_TOTALNERACA,b.ID_TOTALNERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('totalneraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.NAMA_TOTALNERACA="Modal"');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTotalPasiva($id) {
|
||||
$this->db->select('b.NILAI_TOTALNERACA,b.ID_TOTALNERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('totalneraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.NAMA_TOTALNERACA="Total Pasiva"');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTotalPenjualan($id) {
|
||||
$this->db->select('b.NILAI_TOTALNERACA,b.ID_TOTALNERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('totalneraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.NAMA_TOTALNERACA="Total Penjualan"');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTotalHargaPokokJual($id) {
|
||||
$this->db->select('b.NILAI_TOTALNERACA,b.ID_TOTALNERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('totalneraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.NAMA_TOTALNERACA="Harga Pokok Jual"');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTotalLabaKotor($id) {
|
||||
$this->db->select('b.NILAI_TOTALNERACA,b.ID_TOTALNERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('totalneraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.NAMA_TOTALNERACA="Laba Kotor"');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTotalBiaya($id) {
|
||||
$this->db->select('b.NILAI_TOTALNERACA,b.ID_TOTALNERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('totalneraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.NAMA_TOTALNERACA="Total Biaya"');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTotalLabaUsaha($id) {
|
||||
$this->db->select('b.NILAI_TOTALNERACA,b.ID_TOTALNERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('totalneraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.NAMA_TOTALNERACA="Laba Usaha"');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTotalLuarUsaha($id) {
|
||||
$this->db->select('b.NILAI_TOTALNERACA,b.ID_TOTALNERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('totalneraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.NAMA_TOTALNERACA="Luar Usaha"');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTotalLabaBersihSebelumPajak($id) {
|
||||
$this->db->select('b.NILAI_TOTALNERACA,b.ID_TOTALNERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('totalneraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.NAMA_TOTALNERACA="Laba Bersih Sebelum Pajak"');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getTotalLabaBersihSetelahPajak($id) {
|
||||
$this->db->select('b.NILAI_TOTALNERACA,b.ID_TOTALNERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('totalneraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['a.ID_SETDATA' => $id]);
|
||||
$this->db->where('b.NAMA_TOTALNERACA="Laba Bersih Setelah Pajak"');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDNeracaLabaThnBerjalan($id) {
|
||||
$this->db->select('b.ID_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['b.SETDATA_ID' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=22');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDNeracaPersediaan($id) {
|
||||
$this->db->select('b.ID_NERACA');
|
||||
$this->db->from('setkasbank a');
|
||||
$this->db->join('neraca b','b.SETDATA_ID=a.ID_SETDATA');
|
||||
$this->db->where(['b.SETDATA_ID' => $id]);
|
||||
$this->db->where('b.PERKIRAAN_ID=4');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
class ModelSku extends CI_Model
|
||||
{
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if ($batch === false) {
|
||||
$insert = $this->db->insert($table, $data);
|
||||
} else {
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if ($batch === false) {
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
} else {
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataSku($id = null)
|
||||
{
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('sku a');
|
||||
$this->db->join('distributor b', 'b.ID_DISTRIBUTOR=a.ID_DISTRIBUTOR');
|
||||
$this->db->join('processor c', 'c.ID_PROCESSOR=a.ID_PROCESSOR');
|
||||
$this->db->join('ram d', 'd.ID_RAM=a.ID_RAM');
|
||||
$this->db->join('hdd e', 'e.ID_HDD=a.ID_HDD');
|
||||
$this->db->join('ssd f', 'f.ID_SSD=a.ID_SSD');
|
||||
$this->db->join('os g', 'g.ID_OS=a.ID_OS');
|
||||
$this->db->join('vga h', 'h.ID_VGA=a.ID_VGA');
|
||||
$this->db->join('monitor i', 'i.ID_MONITOR=a.ID_MONITOR');
|
||||
$this->db->join('warna j', 'j.ID_WARNA=a.ID_WARNA');
|
||||
} else {
|
||||
$this->db->select('*');
|
||||
$this->db->from('sku a');
|
||||
$this->db->join('distributor b', 'b.ID_DISTRIBUTOR=a.ID_DISTRIBUTOR');
|
||||
$this->db->join('processor c', 'c.ID_PROCESSOR=a.ID_PROCESSOR');
|
||||
$this->db->join('ram d', 'd.ID_RAM=a.ID_RAM');
|
||||
$this->db->join('hdd e', 'e.ID_HDD=a.ID_HDD');
|
||||
$this->db->join('ssd f', 'f.ID_SSD=a.ID_SSD');
|
||||
$this->db->join('os g', 'g.ID_OS=a.ID_OS');
|
||||
$this->db->join('vga h', 'h.ID_VGA=a.ID_VGA');
|
||||
$this->db->join('monitor i', 'i.ID_MONITOR=a.ID_MONITOR');
|
||||
$this->db->join('warna j', 'j.ID_WARNA=a.ID_WARNA');
|
||||
$this->db->where(['ID_SKU' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelSku extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataSku($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('sku a');
|
||||
$this->db->join('processor b','b.ID_PROCESSOR=a.PROCESSOR_ID');
|
||||
$this->db->join('ram c','c.ID_RAM=a.RAM_ID');
|
||||
$this->db->join('hdd d','d.ID_HDD=a.HDD_ID');
|
||||
$this->db->join('ssd e','e.ID_SSD=a.SSD_ID');
|
||||
$this->db->join('vga f','f.ID_VGA=a.VGA_ID');
|
||||
$this->db->join('os g','g.ID_OS=a.OS_ID');
|
||||
$this->db->join('dvd h','h.ID_DVD=a.DVD_ID');
|
||||
$this->db->join('warna i','i.ID_WARNA=a.WARNA_ID');
|
||||
$this->db->join('keymou j','j.ID_KEYMOU=a.KEYMOU_ID');
|
||||
$this->db->join('sp k','k.ID_SP=a.SP_ID');
|
||||
$this->db->join('raid l','l.ID_RAID=a.RAID_ID');
|
||||
}else{
|
||||
$this->db->select('*');
|
||||
$this->db->from('sku a');
|
||||
$this->db->join('processor b','b.ID_PROCESSOR=a.PROCESSOR_ID');
|
||||
$this->db->join('ram c','c.ID_RAM=a.RAM_ID');
|
||||
$this->db->join('hdd d','d.ID_HDD=a.HDD_ID');
|
||||
$this->db->join('ssd e','e.ID_SSD=a.SSD_ID');
|
||||
$this->db->join('vga f','f.ID_VGA=a.VGA_ID');
|
||||
$this->db->join('os g','g.ID_OS=a.OS_ID');
|
||||
$this->db->join('dvd h','h.ID_DVD=a.DVD_ID');
|
||||
$this->db->join('warna i','i.ID_WARNA=a.WARNA_ID');
|
||||
$this->db->join('keymou j','j.ID_KEYMOU=a.KEYMOU_ID');
|
||||
$this->db->join('sp k','k.ID_SP=a.SP_ID');
|
||||
$this->db->join('raid l','l.ID_RAID=a.RAID_ID');
|
||||
$this->db->where(['ID_SKU' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataSnSku($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,b.KODE_BARANG,c.PO_BELI');
|
||||
$this->db->from('sku a');
|
||||
$this->db->join('barang b','b.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('beli c','c.BARANG_ID=b.ID_BARANG');
|
||||
}else{
|
||||
$this->db->select('*,b.KODE_BARANG,c.PO_BELI');
|
||||
$this->db->from('sku a');
|
||||
$this->db->join('barang b','b.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->join('beli c','c.BARANG_ID=b.ID_BARANG');
|
||||
$this->db->where(['ID_SKU' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataSkuID($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('ID_SKU');
|
||||
$this->db->from('sku');
|
||||
}else{
|
||||
$this->db->select('ID_SKU');
|
||||
$this->db->from('sku');
|
||||
$this->db->where(['NAMA_SKU' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
class ModelSkuHarga extends CI_Model
|
||||
{
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if ($batch === false) {
|
||||
$insert = $this->db->insert($table, $data);
|
||||
} else {
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if ($batch === false) {
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
} else {
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataSkuHarga($id = null)
|
||||
{
|
||||
if ($id === null) {
|
||||
$this->db->select('*, b.HPP,c.NO_PO');
|
||||
$this->db->from('skuharga a');
|
||||
$this->db->join('harga b', 'b.ID_HARGA=a.ID_HARGA');
|
||||
$this->db->join('sku c', 'c.ID_SKU=a.ID_SKU');
|
||||
} else {
|
||||
$this->db->select('*, b.HPP,c.NO_PO');
|
||||
$this->db->from('skuharga a');
|
||||
$this->db->join('harga b', 'b.ID_HARGA=a.ID_HARGA');
|
||||
$this->db->join('sku c', 'c.ID_SKU=a.ID_SKU');
|
||||
$this->db->where(['ID_SKUHARGA' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelSkuView extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataSkuView($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,c.NAMA_TYPE,d.NAMA_PROCESSOR,e.NAMA_RAM,f.NAMA_HDD,g.NAMA_SSD,h.NAMA_VGA,i.NAMA_OS,j.NAMA_DVD,k.NAMA_WARNA,l.NAMA_KEYMOU,m.NAMA_SP,n.NAMA_RAID');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('sku b','b.ID_SKU=a.ID_SKU');
|
||||
$this->db->join('type c','c.ID_TYPE=b.ID_TYPE');
|
||||
$this->db->join('processor d','d.ID_PROCESSOR=b.ID_PROCESSOR');
|
||||
$this->db->join('ram e','e.ID_RAM=b.ID_RAM');
|
||||
$this->db->join('hdd f','f.ID_HDD=b.ID_HDD');
|
||||
$this->db->join('ssd g','g.ID_SSD=b.ID_SSD');
|
||||
$this->db->join('vga h','h.ID_VGA=b.ID_VGA');
|
||||
$this->db->join('os i','i.ID_OS=b.ID_OS');
|
||||
$this->db->join('dvd j','j.ID_DVD=b.ID_DVD');
|
||||
$this->db->join('warna k','k.ID_WARNA=b.ID_WARNA');
|
||||
$this->db->join('keymou l','l.ID_KEYMOU=b.ID_KEYMOU');
|
||||
$this->db->join('sp m','m.ID_SP=b.ID_SP');
|
||||
$this->db->join('raid n','n.ID_RAID=b.ID_RAID');
|
||||
}else{
|
||||
$this->db->select('*,c.NAMA_TYPE,d.NAMA_PROCESSOR,e.NAMA_RAM,f.NAMA_HDD,g.NAMA_SSD,h.NAMA_VGA,i.NAMA_OS,j.NAMA_DVD,k.NAMA_WARNA,l.NAMA_KEYMOU,m.NAMA_SP,n.NAMA_RAID');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('sku b','b.ID_SKU=a.ID_SKU');
|
||||
$this->db->join('type c','c.ID_TYPE=b.ID_TYPE');
|
||||
$this->db->join('processor d','d.ID_PROCESSOR=b.ID_PROCESSOR');
|
||||
$this->db->join('ram e','e.ID_RAM=b.ID_RAM');
|
||||
$this->db->join('hdd f','f.ID_HDD=b.ID_HDD');
|
||||
$this->db->join('ssd g','g.ID_SSD=b.ID_SSD');
|
||||
$this->db->join('vga h','h.ID_VGA=b.ID_VGA');
|
||||
$this->db->join('os i','i.ID_OS=b.ID_OS');
|
||||
$this->db->join('dvd j','j.ID_DVD=b.ID_DVD');
|
||||
$this->db->join('warna k','k.ID_WARNA=b.ID_WARNA');
|
||||
$this->db->join('keymou l','l.ID_KEYMOU=b.ID_KEYMOU');
|
||||
$this->db->join('sp m','m.ID_SP=b.ID_SP');
|
||||
$this->db->join('raid n','n.ID_RAID=b.ID_RAID');
|
||||
$this->db->where(['ID_SN' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelSn extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataSn($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,b.PO_BELI,c.KODE_BARANG');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('beli b','b.ID_BELI=a.BELI_ID');
|
||||
$this->db->join('barang c','c.ID_BARANG=a.BARANG_ID');
|
||||
}else{
|
||||
$this->db->select('*,b.PO_BELI,c.KODE_BARANG');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('beli b','b.ID_BELI=a.BELI_ID');
|
||||
$this->db->join('barang c','c.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->where(['ID_SN' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataIDX($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,c.ID_TYPE,d.ID_PROCESSOR,e.ID_RAM,f.ID_HDD,g.ID_SSD,h.ID_VGA,i.ID_OS,j.ID_DVD,k.ID_WARNA,l.ID_KEYMOU,m.ID_SP,n.ID_RAID');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('sku b','b.ID_SKU=a.ID_SKU');
|
||||
$this->db->join('type c','c.ID_TYPE=b.ID_TYPE');
|
||||
$this->db->join('processor d','d.ID_PROCESSOR=b.ID_PROCESSOR');
|
||||
$this->db->join('ram e','e.ID_RAM=b.ID_RAM');
|
||||
$this->db->join('hdd f','f.ID_HDD=b.ID_HDD');
|
||||
$this->db->join('ssd g','g.ID_SSD=b.ID_SSD');
|
||||
$this->db->join('vga h','h.ID_VGA=b.ID_VGA');
|
||||
$this->db->join('os i','i.ID_OS=b.ID_OS');
|
||||
$this->db->join('dvd j','j.ID_DVD=b.ID_DVD');
|
||||
$this->db->join('warna k','k.ID_WARNA=b.ID_WARNA');
|
||||
$this->db->join('keymou l','l.ID_KEYMOU=b.ID_KEYMOU');
|
||||
$this->db->join('sp m','m.ID_SP=b.ID_SP');
|
||||
$this->db->join('raid n','n.ID_RAID=b.ID_RAID');
|
||||
}else{
|
||||
$this->db->select('*,c.ID_TYPE,d.ID_PROCESSOR,e.ID_RAM,f.ID_HDD,g.ID_SSD,h.ID_VGA,i.ID_OS,j.ID_DVD,k.ID_WARNA,l.ID_KEYMOU,m.ID_SP,n.ID_RAID');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('sku b','b.ID_SKU=a.ID_SKU');
|
||||
$this->db->join('type c','c.ID_TYPE=b.ID_TYPE');
|
||||
$this->db->join('processor d','d.ID_PROCESSOR=b.ID_PROCESSOR');
|
||||
$this->db->join('ram e','e.ID_RAM=b.ID_RAM');
|
||||
$this->db->join('hdd f','f.ID_HDD=b.ID_HDD');
|
||||
$this->db->join('ssd g','g.ID_SSD=b.ID_SSD');
|
||||
$this->db->join('vga h','h.ID_VGA=b.ID_VGA');
|
||||
$this->db->join('os i','i.ID_OS=b.ID_OS');
|
||||
$this->db->join('dvd j','j.ID_DVD=b.ID_DVD');
|
||||
$this->db->join('warna k','k.ID_WARNA=b.ID_WARNA');
|
||||
$this->db->join('keymou l','l.ID_KEYMOU=b.ID_KEYMOU');
|
||||
$this->db->join('sp m','m.ID_SP=b.ID_SP');
|
||||
$this->db->join('raid n','n.ID_RAID=b.ID_RAID');
|
||||
$this->db->where(['ID_SKU' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataID($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('b.ID_TYPE,b.ID_PROCESSOR,b.ID_RAM,b.ID_HDD,b.ID_SSD,b.ID_VGA,b.ID_OS,b.ID_DVD,b.ID_WARNA,b.ID_KEYMOU,b.ID_SP,b.ID_RAID');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('sku b','b.ID_SKU=a.ID_SKU');
|
||||
}else{
|
||||
$this->db->select('b.ID_TYPE,b.ID_PROCESSOR,b.ID_RAM,b.ID_HDD,b.ID_SSD,b.ID_VGA,b.ID_OS,b.ID_DVD,b.ID_WARNA,b.ID_KEYMOU,b.ID_SP,b.ID_RAID');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('sku b','b.ID_SKU=a.ID_SKU');
|
||||
$this->db->where(['b.ID_SKU' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDBarang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('a.BARANG_ID');
|
||||
$this->db->from('beli a');
|
||||
$this->db->join('barang b','b.ID_BARANG=a.BARANG_ID');
|
||||
}else{
|
||||
$this->db->select('a.BARANG_ID');
|
||||
$this->db->from('beli a');
|
||||
$this->db->join('barang b','b.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->where(['a.ID_BELI' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBeli()
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('beli a');
|
||||
$this->db->join('barang b','b.ID_BARANG=a.BARANG_ID');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getSnn($id)
|
||||
{
|
||||
$this->db->select('ID_SN, NAMA_SN');
|
||||
$this->db->from('sn');
|
||||
$this->db->where(['BELI_ID' => $id]);
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelSnBarang extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataSnBarang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,b.PO_BELI,c.KODE_BARANG');
|
||||
$this->db->from('snbarang a');
|
||||
$this->db->join('beli b','b.ID_BELI=a.BELI_ID');
|
||||
$this->db->join('barang c','c.ID_BARANG=a.BARANG_ID');
|
||||
}else{
|
||||
$this->db->select('*,b.PO_BELI,c.KODE_BARANG');
|
||||
$this->db->from('snbarang a');
|
||||
$this->db->join('beli b','b.ID_BELI=a.BELI_ID');
|
||||
$this->db->join('barang c','c.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->where(['ID_SNBARANG' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataIDX($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,c.ID_TYPE,d.ID_PROCESSOR,e.ID_RAM,f.ID_HDD,g.ID_SSD,h.ID_VGA,i.ID_OS,j.ID_DVD,k.ID_WARNA,l.ID_KEYMOU,m.ID_SP,n.ID_RAID');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('sku b','b.ID_SKU=a.ID_SKU');
|
||||
$this->db->join('type c','c.ID_TYPE=b.ID_TYPE');
|
||||
$this->db->join('processor d','d.ID_PROCESSOR=b.ID_PROCESSOR');
|
||||
$this->db->join('ram e','e.ID_RAM=b.ID_RAM');
|
||||
$this->db->join('hdd f','f.ID_HDD=b.ID_HDD');
|
||||
$this->db->join('ssd g','g.ID_SSD=b.ID_SSD');
|
||||
$this->db->join('vga h','h.ID_VGA=b.ID_VGA');
|
||||
$this->db->join('os i','i.ID_OS=b.ID_OS');
|
||||
$this->db->join('dvd j','j.ID_DVD=b.ID_DVD');
|
||||
$this->db->join('warna k','k.ID_WARNA=b.ID_WARNA');
|
||||
$this->db->join('keymou l','l.ID_KEYMOU=b.ID_KEYMOU');
|
||||
$this->db->join('sp m','m.ID_SP=b.ID_SP');
|
||||
$this->db->join('raid n','n.ID_RAID=b.ID_RAID');
|
||||
}else{
|
||||
$this->db->select('*,c.ID_TYPE,d.ID_PROCESSOR,e.ID_RAM,f.ID_HDD,g.ID_SSD,h.ID_VGA,i.ID_OS,j.ID_DVD,k.ID_WARNA,l.ID_KEYMOU,m.ID_SP,n.ID_RAID');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('sku b','b.ID_SKU=a.ID_SKU');
|
||||
$this->db->join('type c','c.ID_TYPE=b.ID_TYPE');
|
||||
$this->db->join('processor d','d.ID_PROCESSOR=b.ID_PROCESSOR');
|
||||
$this->db->join('ram e','e.ID_RAM=b.ID_RAM');
|
||||
$this->db->join('hdd f','f.ID_HDD=b.ID_HDD');
|
||||
$this->db->join('ssd g','g.ID_SSD=b.ID_SSD');
|
||||
$this->db->join('vga h','h.ID_VGA=b.ID_VGA');
|
||||
$this->db->join('os i','i.ID_OS=b.ID_OS');
|
||||
$this->db->join('dvd j','j.ID_DVD=b.ID_DVD');
|
||||
$this->db->join('warna k','k.ID_WARNA=b.ID_WARNA');
|
||||
$this->db->join('keymou l','l.ID_KEYMOU=b.ID_KEYMOU');
|
||||
$this->db->join('sp m','m.ID_SP=b.ID_SP');
|
||||
$this->db->join('raid n','n.ID_RAID=b.ID_RAID');
|
||||
$this->db->where(['ID_SKU' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataID($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('b.ID_TYPE,b.ID_PROCESSOR,b.ID_RAM,b.ID_HDD,b.ID_SSD,b.ID_VGA,b.ID_OS,b.ID_DVD,b.ID_WARNA,b.ID_KEYMOU,b.ID_SP,b.ID_RAID');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('sku b','b.ID_SKU=a.ID_SKU');
|
||||
}else{
|
||||
$this->db->select('b.ID_TYPE,b.ID_PROCESSOR,b.ID_RAM,b.ID_HDD,b.ID_SSD,b.ID_VGA,b.ID_OS,b.ID_DVD,b.ID_WARNA,b.ID_KEYMOU,b.ID_SP,b.ID_RAID');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('sku b','b.ID_SKU=a.ID_SKU');
|
||||
$this->db->where(['b.ID_SKU' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDBarang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('a.BARANG_ID');
|
||||
$this->db->from('beli a');
|
||||
$this->db->join('barang b','b.ID_BARANG=a.BARANG_ID');
|
||||
}else{
|
||||
$this->db->select('a.BARANG_ID');
|
||||
$this->db->from('beli a');
|
||||
$this->db->join('barang b','b.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->where(['a.ID_BELI' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBeli()
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('beli a');
|
||||
$this->db->join('barang b','b.ID_BARANG=a.BARANG_ID');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getSnn($id)
|
||||
{
|
||||
$this->db->select('ID_SNBARANG, NAMA_SNBARANG');
|
||||
$this->db->from('snbarang');
|
||||
$this->db->where(['BELI_ID' => $id]);
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class ModelSnSku extends CI_Model {
|
||||
public function create($table, $data, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->insert($table, $data);
|
||||
}else{
|
||||
$insert = $this->db->insert_batch($table, $data);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function update($table, $data, $pk, $id = null, $batch = false)
|
||||
{
|
||||
if($batch === false){
|
||||
$insert = $this->db->update($table, $data, array($pk => $id));
|
||||
}else{
|
||||
$insert = $this->db->update_batch($table, $data, $pk);
|
||||
}
|
||||
return $insert;
|
||||
}
|
||||
|
||||
public function delete($table, $data, $pk)
|
||||
{
|
||||
$this->db->where_in($pk, $data);
|
||||
return $this->db->delete($table);
|
||||
}
|
||||
|
||||
public function getDataSnSku($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,b.PO_BELI,c.KODE_BARANG');
|
||||
$this->db->from('snsku a');
|
||||
$this->db->join('beli b','b.ID_BELI=a.BELI_ID');
|
||||
$this->db->join('barang c','c.ID_BARANG=a.BARANG_ID');
|
||||
}else{
|
||||
$this->db->select('*,b.PO_BELI,c.KODE_BARANG');
|
||||
$this->db->from('snsku a');
|
||||
$this->db->join('beli b','b.ID_BELI=a.BELI_ID');
|
||||
$this->db->join('barang c','c.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->where(['ID_SNSKU' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataIDX($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('*,c.ID_TYPE,d.ID_PROCESSOR,e.ID_RAM,f.ID_HDD,g.ID_SSD,h.ID_VGA,i.ID_OS,j.ID_DVD,k.ID_WARNA,l.ID_KEYMOU,m.ID_SP,n.ID_RAID');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('sku b','b.ID_SKU=a.ID_SKU');
|
||||
$this->db->join('type c','c.ID_TYPE=b.ID_TYPE');
|
||||
$this->db->join('processor d','d.ID_PROCESSOR=b.ID_PROCESSOR');
|
||||
$this->db->join('ram e','e.ID_RAM=b.ID_RAM');
|
||||
$this->db->join('hdd f','f.ID_HDD=b.ID_HDD');
|
||||
$this->db->join('ssd g','g.ID_SSD=b.ID_SSD');
|
||||
$this->db->join('vga h','h.ID_VGA=b.ID_VGA');
|
||||
$this->db->join('os i','i.ID_OS=b.ID_OS');
|
||||
$this->db->join('dvd j','j.ID_DVD=b.ID_DVD');
|
||||
$this->db->join('warna k','k.ID_WARNA=b.ID_WARNA');
|
||||
$this->db->join('keymou l','l.ID_KEYMOU=b.ID_KEYMOU');
|
||||
$this->db->join('sp m','m.ID_SP=b.ID_SP');
|
||||
$this->db->join('raid n','n.ID_RAID=b.ID_RAID');
|
||||
}else{
|
||||
$this->db->select('*,c.ID_TYPE,d.ID_PROCESSOR,e.ID_RAM,f.ID_HDD,g.ID_SSD,h.ID_VGA,i.ID_OS,j.ID_DVD,k.ID_WARNA,l.ID_KEYMOU,m.ID_SP,n.ID_RAID');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('sku b','b.ID_SKU=a.ID_SKU');
|
||||
$this->db->join('type c','c.ID_TYPE=b.ID_TYPE');
|
||||
$this->db->join('processor d','d.ID_PROCESSOR=b.ID_PROCESSOR');
|
||||
$this->db->join('ram e','e.ID_RAM=b.ID_RAM');
|
||||
$this->db->join('hdd f','f.ID_HDD=b.ID_HDD');
|
||||
$this->db->join('ssd g','g.ID_SSD=b.ID_SSD');
|
||||
$this->db->join('vga h','h.ID_VGA=b.ID_VGA');
|
||||
$this->db->join('os i','i.ID_OS=b.ID_OS');
|
||||
$this->db->join('dvd j','j.ID_DVD=b.ID_DVD');
|
||||
$this->db->join('warna k','k.ID_WARNA=b.ID_WARNA');
|
||||
$this->db->join('keymou l','l.ID_KEYMOU=b.ID_KEYMOU');
|
||||
$this->db->join('sp m','m.ID_SP=b.ID_SP');
|
||||
$this->db->join('raid n','n.ID_RAID=b.ID_RAID');
|
||||
$this->db->where(['ID_SKU' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getDataID($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('b.ID_TYPE,b.ID_PROCESSOR,b.ID_RAM,b.ID_HDD,b.ID_SSD,b.ID_VGA,b.ID_OS,b.ID_DVD,b.ID_WARNA,b.ID_KEYMOU,b.ID_SP,b.ID_RAID');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('sku b','b.ID_SKU=a.ID_SKU');
|
||||
}else{
|
||||
$this->db->select('b.ID_TYPE,b.ID_PROCESSOR,b.ID_RAM,b.ID_HDD,b.ID_SSD,b.ID_VGA,b.ID_OS,b.ID_DVD,b.ID_WARNA,b.ID_KEYMOU,b.ID_SP,b.ID_RAID');
|
||||
$this->db->from('sn a');
|
||||
$this->db->join('sku b','b.ID_SKU=a.ID_SKU');
|
||||
$this->db->where(['b.ID_SKU' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getIDBarang($id = null){
|
||||
if ($id === null) {
|
||||
$this->db->select('a.BARANG_ID');
|
||||
$this->db->from('beli a');
|
||||
$this->db->join('barang b','b.ID_BARANG=a.BARANG_ID');
|
||||
}else{
|
||||
$this->db->select('a.BARANG_ID');
|
||||
$this->db->from('beli a');
|
||||
$this->db->join('barang b','b.ID_BARANG=a.BARANG_ID');
|
||||
$this->db->where(['a.ID_BELI' => $id]);
|
||||
}
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function cekPass($id, $pass)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('karyawan');
|
||||
$this->db->where(['ID_KARYAWAN' => $id]);
|
||||
$this->db->where(['PASSWORD' => $pass]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getBeli()
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('beli a');
|
||||
$this->db->join('barang b','b.ID_BARANG=a.BARANG_ID');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function getSnn($id)
|
||||
{
|
||||
$this->db->select('ID_SNSKU, NAMA_SNSKU');
|
||||
$this->db->from('snsku');
|
||||
$this->db->where(['BELI_ID' => $id]);
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user