D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
ksclnmuac
/
public_html
/
alumni
/
application
/
models
/
admin
/
Filename :
CourseManagement.php
back
Copy
<?php /** * Description of User * * @author Softpro India Pvt. Ltd. */ class CourseManagement extends CI_Model { //put your code here public function __construct() { parent::__construct(); } function saveCourse($courseDetails) { $this->db->insert("tbl_course", $courseDetails); return $this->db->insert_id(); } function getCourses() { $this->db->select("*"); $this->db->from("tbl_course"); $this->db->order_by("c_name","ASC"); return $this->db->get(); } function getCourseById($courseid){ $this->db->select("*"); $this->db->from("tbl_course"); $this->db->where("c_id",$courseid); return $this->db->get(); } function updateCourse($courseData,$c_id){ $this->db->where("c_id",$c_id); return $this->db->update("tbl_course",$courseData); } }