D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
ksclnmuac
/
public_html
/
grievance
/
application
/
models
/
Filename :
GrievanceCategoryManagement.php
back
Copy
<?php /** * Model Class For Handling All DB Operations Related to Grievance Categories * * @author Softpro India Pvt. Ltd. */ defined('BASEPATH') OR exit('No direct script access allowed'); class GrievanceCategoryManagement extends CI_Model { function __construct() { parent::__construct(); $this->load->database(); } function getTotalNonDeletedGCategoriesOfInstitute($clg_id){ $this->db->select("count(*) totalGCatgs"); $this->db->from('grievance_cat_mst'); $this->db->where('gcm_delete_status','F'); $this->db->where('clg_id',$clg_id); return $this->db->get(); } function getNonDeletedGrievanceCategoriesOfInstitute($clg_id){ $this->db->select("GCM.gcm_id,GCM.gcm_title,GCM.gcm_description,GCM.gcm_active_status,GCM.gcm_delete_status,GCM.gcm_added_on,GCM.gcm_updated_on"); $this->db->from('grievance_cat_mst GCM'); $this->db->where('GCM.gcm_delete_status','F'); $this->db->where('GCM.clg_id',$clg_id); $this->db->order_by('GCM.gcm_added_on desc'); return $this->db->get(); } function getNonDeletedActiveGrievanceCategoriesOfInstitute($clg_id){ $this->db->select("GCM.gcm_id,GCM.gcm_title,GCM.gcm_description,GCM.gcm_active_status,GCM.gcm_delete_status,GCM.gcm_added_on,GCM.gcm_updated_on"); $this->db->from('grievance_cat_mst GCM'); $this->db->where('GCM.gcm_delete_status','F'); $this->db->where('GCM.gcm_active_status','T'); $this->db->where('GCM.clg_id',$clg_id); $this->db->order_by('GCM.gcm_added_on desc'); return $this->db->get(); } function createNewGrievanceCategory(array $newGrievanceCategoryInfo) { $this->db->insert('grievance_cat_mst', $newGrievanceCategoryInfo); return $this->db->insert_id(); } function updateGrievanceCategoryInfo(array $grievanceCategoryUpdatedInfo) { $this->db->where('gcm_id', $grievanceCategoryUpdatedInfo['gcm_id']); return $this->db->update('grievance_cat_mst', $grievanceCategoryUpdatedInfo); } function getGrievanceCategoryInfoById($gcm_id) { $this->db->select("*"); $this->db->from('grievance_cat_mst'); $this->db->where('gcm_id', $gcm_id); return $this->db->get(); } }