<?php

use app\libraries\Userstamp;

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Referral_code_model extends MY_Model
{
    public $database;
    public $short = "rcode";
    public $table;
    public $tbl;

    public function __construct()
    {
        parent::__construct();
        $this->database = $this->getTenantNo();
        $this->table_prefix = '';
        $this->tbl = 'referral_code';
        $this->table = $this->tbl . ' ' . $this->short;

        $this->db = $this->load->database($this->database, true);
    }

    public function generate_code($code_prefix, $code)
    {
        return $code_prefix . sprintf('%05d', $code);
    }
}
