[ Mini Kiebo ]
Server: Windows NT AKFAR_SERVER 10.0 build 26200 (Windows 10) AMD64
Path:
D:
/
xampp
/
htdocs
/
smk
/
application
/
models
/
hotspot
/
[
Home
]
File: Logs_model.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Pegawai_model extends CI_Model{ public $database = 'duhotspot'; public $table = 'logs'; function __construct(){ parent::__construct(); } function save($data){ $this->db->insert($this->database.'.'.$this->table, $data); } function delete($id){ $this->db->where('id', $id) ->delete($this->database.'.'.$this->table); } function update($data, $id){ $this->db->where('id', $id) ->update($this->database.'.'.$this->table, $data); } function get_logs_by_id($id){ $this->db->where('id', $id) ->from($this->database.'.'.$this->table) ->limit(1); return $this->db->get(); } function get_all_logs($start, $rows, $search){ $this->db->where('(log LIKE "%'.$search.'%")') ->from($this->database.'.'.$this->table) ->order_by('ts', 'DESC') ->limit($rows, $start); return $this->db->get(); } function get_all_logs_count($search){ $this->db->select('COUNT(*) AS hasil') ->where('(nip LIKE "%'.$search.'%")') ->from($this->database.'.'.$this->table); return $this->db->get(); } }