D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
ksclnmuac
/
public_html
/
ci_panel
/
application
/
models
/
Filename :
Department_model.php
back
Copy
<?php class Department_model extends CI_model{ public function index() { # code... $department = $this->db->get('tbl_department')->result_array(); return $department; } public function dept_count() { # code... $dept_count = $this->db->count_all_results('tbl_department'); return $dept_count; } public function create($formArray) { # code... $this->db->insert('tbl_department', $formArray); } public function getDept($id) { # code... $this->db->where('dept_id', $id); $dept = $this->db->get('tbl_department')->result_array(); return $dept; } public function deleteDept($id) { # code... $this->db->where('dept_id', $id); $this->db->delete('tbl_department'); } public function editDepartment($id, $formArray) { # code... $this->db->where('dept_id', $id); $this->db->update('tbl_department', $formArray); // echo $this->db->last_query(); } }