D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
ksclnmuac
/
public_html
/
ci_panel
/
application
/
models
/
Filename :
Gallery_model.php
back
Copy
<?php class Gallery_model extends CI_model{ public function getGallery() { # code... $gallery = $this->db->get('tbl_gallery')->result_array(); return $gallery; } public function galCount() { # code... $gal_count = $this->db->count_all_results('tbl_gallery'); return $gal_count; } public function addGallery($formArray) { # code... $this->db->insert('tbl_gallery', $formArray); } public function getGal($id) { # code... $this->db->where('gal_id',$id); $gal = $this->db->get('tbl_gallery')->result_array(); return $gal; } public function deleteGal($id) { # code... $this->db->where('gal_id',$id); $this->db->delete('tbl_gallery'); } public function editGallery($id, $formArray) { # code... $this->db->where('gal_id', $id); $this->db->update('tbl_gallery', $formArray); } // ==============Models for front-end start=============== // public function galHome() { # code... $this->db->order_by('gal_id', 'desc'); $this->db->limit(4); $galHome = $this->db->get('tbl_gallery')->result_array(); return $galHome; } public function galFront() { # code... $this->db->order_by('gal_id', 'desc'); $gal = $this->db->get('tbl_gallery')->result_array(); return $gal; } }