ok

Mini Shell

Direktori : /home2/selectio/www/mm-tailor-billing/app/models/
Upload File :
Current File : //home2/selectio/www/mm-tailor-billing/app/models/Extra_option_model.php

<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}

class Extra_option_model extends CI_Model
{
    public function __construct()
    {
        parent::__construct();
    }

    public function add_extra_option($data = [])
    {
        if ($this->db->insert_batch('extra_option', $data)) {
            return true;
        }
        return false;
    }

    public function addExtraOption($data)
    {
        if ($this->db->insert('extra_option', $data)) {
            return true;
        }
        return false;
    }

    public function deleteExtraOption($id)
    {
        if ($this->db->delete('extra_option', ['id' => $id])) {
            return true;
        }
        return false;
    }

    public function updateExtraOption($id, $data = null)
    {
        if ($this->db->update('extra_option', $data, ['id' => $id])) {
            return true;
        }
        return false;
    }
    
    public function getExtraoptionByID($id)
    {
        $q = $this->db->get_where('extra_option', ['id' => $id], 1);
        if ($q->num_rows() > 0) {
            return $q->row();
        }
        return false;
    }
    
    // New One
    public function getShirtCategory()
    {
        // $user_id = $this->session->userdata('user_id');
        // $this->db->select('id, date, customer_name, hold_ref')
        // ->order_by('id desc');
        // //->limit(10);
        // $this->db->where('store_id', $this->session->userdata('store_id'));
        $q = $this->db->get_where('extra_option', ['category' => 1]);
        if ($q->num_rows() > 0) {
            foreach (($q->result()) as $row) {
                $data[] = $row;
            }
            return $data;
        }
        return false;
    }
    // public function getAllExtraoption()
    // {
    //     $q = $this->db->get_where('extra_option', ['category' => '1'], 1);
    //     if ($q->num_rows() > 0) {
    //         return $q->row();
    //     }
    //     return false;
    // }
    
    // public function getAllExtraOption() {
    //     $q = $this->db->get('extra_option');
    //     if ($q->num_rows() > 0) {
    //         foreach (($q->result()) as $row) {
    //             $data[] = $row;
    //         }
    //         return $data;
    //     }
    //     return FALSE;
    // }
    
}

Zerion Mini Shell 1.0