copy dari repo om Irfan
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class SinkronModel 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 getIpServer()
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('ip_server');
|
||||
$this->db->order_by('id_ip ASC');
|
||||
$this->db->limit(1);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
public function cekTabel($tabel)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from($tabel);
|
||||
$this->db->where(['SYNC' => 0]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
public function getDataJabatan($id)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('jabatan');
|
||||
$this->db->where(['ID_JABATAN' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
public function getDataCabangByKode($id)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('cabang');
|
||||
$this->db->where(['KODE_CABANG' => $id]);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user