<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Paket_model extends CI_Model {
  
    /**
     * CONSTRUCTOR | LOAD DB
    */
    public function __construct() {
     parent::__construct();
     $this->load->database();
 }

    /**
     * SHOW | GET method.
     *
     * @return Response
    */
    public function show($id_cust = 0,$id_club = 0, $page = 0, $limit = 10)
    {
        if(empty($id_cust)) $id_cust=0;
        if(empty($id_club)) $id_club=0;
        if(empty($page)) $page=0;
        if(empty($limit)) $limit=10;

        $offset = ($page-1)*$limit;
        $sql = "SELECT * ".
        " FROM `transaksi_paket` ".
        " where id_customer='".$id_cust."' and id_club='".$id_club."' ".
        " order by id DESC limit ".$offset.",".$limit;      

        $query = $this->db->query($sql)->result();
        return $query;
    }
    

}
