<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class IndexModel extends CI_Model{

	function __construct(){
		parent::__construct();
	}

    function selectGalleryInfo(){

        $sql ="SELECT id,NAME,STATUS,image_formate,CURRENT_DATE FROM gallery_tb ;";

      $query = $this->db->query($sql);

		if($query){
//	print_r($query->result()); die;

		return $query->result();

		}else{
			return false;
		}


	}

          // insert Query For Insert Data

	public function insertInfo($table, $data) {
		if ($this->db->insert($table, $data)) {
            $insert_id = $this->db->insert_id();
			return $insert_id;
		}else{
			return false;
		}
	}


    	function getInfoById($id){

    	 $sql ='SELECT 	id,POSITION,specialization,qualification,post,DATE,scale,STATUS FROM career_tb  WHERE id ="'.$id.'" ';

      $query = $this->db->query($sql);

     //	print_r($query->result()); die;
          $result = $query->result();
    return $result;
}


// Update Query For Selected Student
function updateInfoById($id,$data){
$this->db->where('id', $id);
$this->db->update('career_tb', $data);
}

function deleteInfo($id)
{

 $sql ='DELETE FROM career_tb WHERE id= "'.$id.'"; ';
  //print_r(base_url("GalleryImages/".$id.".png")); die;
	 //unlink(base_url("GalleryImages/".$id));
$this->db->query($sql);
}

}



?>
