| Server IP : 68.178.202.69 / Your IP : 216.73.216.122 Web Server : Apache System : Linux 69.202.178.68.host.secureserver.net 3.10.0-1160.139.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Nov 3 13:30:41 UTC 2025 x86_64 User : ikioworld ( 1005) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/ikioworld/www/application/models/ |
Upload File : |
<?php
class Jobmodel extends CI_Model
{
function __construct()
{
parent::__construct();
$this->load->database();
$this->table_name = 'jobs';
$this->career_table ='careers';
}
function add($data){
if(!empty($data)){
// print_r($data);exit;
unset($data['sbt']);
$data['status']="Active";
$this->db->insert($this->table_name,$data);
$insert_id = $this->db->insert_id();
return $insert_id;
// echo $this->db->last_query(); die;
}
}
function edit($id,$data){
if(!empty($data) && $id!=''){
unset($data['sbt']);
$this->db->where('id',$id);
return $this->db->update($this->table_name,$data);
//echo $this->db->last_query(); die;
}
}
function addCareer($data){
if(!empty($data)){
unset($data['sbt']);
$this->db->insert($this->career_table,$data);
$insert_id = $this->db->insert_id();
return $insert_id;
//echo $this->db->last_query(); die;
}
}
function fetch_details($id){
if($id!=''){
$this->db->select('*');
$this->db->where('id',$id);
$query = $this->db->get($this->table_name);
return $query->row();
}
}
function get_total_records(){
return $query = $this->db->count_all_results($this->table_name);
}
function get_contents($start, $limit){
$this->db->select('*');
$this->db->order_by($this->table_name.".id", "desc");
$query = $this->db->get($this->table_name);
return $query->result();
}
function deletejob($id){
$this->db->where('id', $id);
$this->db->delete($this->table_name);
}
function getJobs()
{
$this->db->where("job_type='open'");
$this->db->where("status='active'");
$query = $this->db->get('jobs');
return $query->result();
}
function update_status($id,$svalue){
$svalue=$_REQUEST['svalue'];
if($svalue=='active'){
$status='inactive';
}else{
$status='active';
}
$data= array(
'status' => $status
);
$this->db->where('id',$id);
return $this->db->update('job',$data);
}
function delete_job($id)
{
$this->db->where('id', $id);
$this->db->delete('job');
}
function make_featured($id)
{
$this->db->set('is_featured','yes');
$this->db->where('id', $id);
$this->db->update('job');
}
function remove_featured($id)
{
$this->db->set('is_featured','no');
$this->db->where('id', $id);
$this->db->update('job');
}
function make_activated($id)
{
$this->db->set('status','active');
$this->db->where('id', $id);
$this->db->update('job');
}
function remove_activated($id)
{
$this->db->set('status','inactive');
$this->db->where('id', $id);
$this->db->update('job');
}
}