ok
Direktori : /home2/selectio/public_html/gangabuvana/admin/cms/application/models/admin/ |
Current File : /home2/selectio/public_html/gangabuvana/admin/cms/application/models/admin/Model_slider.php |
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Model_slider extends CI_Model { function get_auto_increment_id() { $sql = "SHOW TABLE STATUS LIKE 'tbl_slider'"; $query = $this->db->query($sql); return $query->result_array(); } function show() { $sql = "SELECT * FROM tbl_slider t1 JOIN tbl_lang t2 ON t1.lang_id = t2.lang_id"; $query = $this->db->query($sql); return $query->result_array(); } function add($data) { $this->db->insert('tbl_slider',$data); return $this->db->insert_id(); } function update($id,$data) { $this->db->where('id',$id); $this->db->update('tbl_slider',$data); } function delete($id) { $this->db->where('id',$id); $this->db->delete('tbl_slider'); } function getData($id) { $sql = 'SELECT * FROM tbl_slider WHERE id=?'; $query = $this->db->query($sql,array($id)); return $query->first_row('array'); } function slider_check($id) { $sql = 'SELECT * FROM tbl_slider WHERE id=?'; $query = $this->db->query($sql,array($id)); return $query->first_row('array'); } }