| 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 Photometricmodel extends CI_Model
{
function __construct()
{
parent::__construct();
$this->load->database();
$this->table_name = 'photometric';
}
function add($data){
if(!empty($data)){
unset($data['sbt']);
$this->db->insert($this->table_name,$data);
$insert_id = $this->db->insert_id();
return $insert_id;
}
}
function edit($id,$data){
if(!empty($data) && $id!=''){
unset($data['sbt']);
$this->db->where('id',$id);
return $this->db->update($this->table_name,$data);
}
}
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 deletephotometric($id){
$this->db->where('id', $id);
$this->db->delete($this->table_name);
}
function addPhotometric($data){
if(!empty($data)){
unset($data['sbt']);
unset($data['requirement']);
unset($data['itemforjob']);
$this->db->insert($this->table_name,$data);
$insert_id = $this->db->insert_id();
return $insert_id;
}
}
function get_export_data(){
$this->db->select(
["requirement","fullname","email","phonenumber","preferred_contact","user_role","project_name","ikio_representative","address","project_state","project_city","project_country","zip_code","project_type","area_dimension","ceiling_height","foot_candles","types_activity","itemforjob","message","document","deadline","deadline_reason","status","mailed","created_at"]);
$this->db->order_by($this->table_name.".id", "desc");
$query = $this->db->get($this->table_name);
return $query->result_array();
}
function delete_photometric($id)
{
$this->db->where('id', $id);
$this->db->delete('photometric');
}
function delete_all_photometric()
{
$this->db->truncate('photometric');
}
function make_featured($id)
{
$this->db->set('is_featured','yes');
$this->db->where('id', $id);
$this->db->update('photometric');
}
function remove_featured($id)
{
$this->db->set('is_featured','no');
$this->db->where('id', $id);
$this->db->update('photometric');
}
function make_activated($id)
{
$this->db->set('status','active');
$this->db->where('id', $id);
$this->db->update('photometric');
}
function remove_activated($id)
{
$this->db->set('status','inactive');
$this->db->where('id', $id);
$this->db->update('photometric');
}
}