<?php
class Clients_model extends CI_Model
{
public function __construct()
{
parent::__construct();
}
public function getLogos()
{
$this->db->select('*');
$this->db->order_by('client_id','DESC');
$result = $this->db->get('client_logo');
$array = $result->result_array();
return $array;
}
public function insert($save)
{
$this->db->insert('client_logo', $save);
return $this->db->insert_id();
}
public function edit($client_id)
{
$this->db->where('client_id', $client_id);
$this->db->select('*');
$result = $this->db->get('client_logo');
$array = $result->result_array();
return $array;
}
public function update($post)
{
$this->db->where('client_id', $post['client_id']);
$this->db->update('client_logo', $post);
return $post['client_id'];
}
public function delete($client_id)
{
$this->db->where('client_id', $client_id);
$this->db->delete('client_logo');
return true;
}
} |