| Server IP : 127.0.0.1 / Your IP : 192.168.99.1 Web Server : Apache/2.4.35 (Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9 System : Windows NT WIN-JEJMB9EN0L0 10.0 build 14393 (Windows Server 2016) AMD64 User : Administrator ( 0) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : D:/laragon/www/perpus/application/models/archive/ |
Upload File : |
<?php
class Denda_model extends CI_Model
{
function __construct()
{
parent::__construct();
}
function get_all()
{
$data = array();
$Q = $this->db->get('tb_denda');
if ($Q->num_rows() > 0)
{
foreach ($Q->result_array() as $row)
{
$data[] = $row;
}
}
$Q->free_result();
return $data;
}
function get_id($id)
{
$this->db->where('id_denda',$id);
$this->db->limit(1);
$Q = $this->db->get('tb_denda');
if ($Q->num_rows() > 0)
{
$data = $Q->row_array();
}
$Q->free_result();
return $data;
}
function add()
{
$data = array(
'id_denda' => $this->input->post('id_denda'),
'denda' => $this->input->post('denda'),
'status' => $this->input->post('status')
);
$action = $this->db->insert('tb_denda', $data);
return $action;
}
function update($id)
{
$data = array(
'denda' => $this->input->post('denda'),
'status' => $this->input->post('status')
);
$this->db->where('id_denda', $id);
$action = $this->db->update('tb_denda', $data);
return $action;
}
function delete($id)
{
$this->db->where('id_denda', $id);
$action = $this->db->delete('tb_denda');
return $action;
}
}
?>