siddharth_application/application/models/companydetailsmodel.php
2017-09-04 16:23:34 +05:30

110 lines
2.7 KiB
PHP
Executable File

<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
class companydetailsmodel extends CI_Model
{
/**
* This function is used to get the user listing count
* @param string $searchText : This is optional search text
* @return number $count : This is row count
*/
//inserted data into companydetails table//
function Companyadd($Company)
{
$this->db->insert('T_Company_Details', $Company);
$CompID = $this->db->affected_rows();
return $Company;
}
//inserted data into file table//
function filedetails($myfile)
{
$this->db->insert('file',$myfile);
$CompID = $this->db->affected_rows();
return $myfile;
}
//for listing file//
function filelist()
{
$sql=" select ID,filename,filedescription,createdDate from file where isDeleted IS NULL OR isDeleted=0";
$query = $this->db->query($sql);
return $query->result();
}
//for deleting file//
function deletefile($ID,$userInfo)
{
$this->db->where('ID', $ID);
$this->db->update('file', $userInfo);
return $this->db->affected_rows();
}
function Updatecompany($Comp, $CompID)
{
$this->db->where('CompID', $CompID);
$this->db->update('T_Company_Details', $Comp);
$this->db->last_query();
return TRUE;
}
function checkPhotoExists($Pic)
{
$this->db->select('ProfilePic');
$this->db->from('T_Company_Details');
$this->db->where($Pic);
$query = $this->db->get();
if ($query->num_rows > 0) {
return $query->result_array();
}
}
// updated by //
function companylisting()
{
$this->db->select('com.*,emp.firstname');
$this->db->from('T_Company_Details com');
$this->db->join('tbl_users as tbl',' com.createdby = tbl.userid','left');
$this->db->join('T_Employee_Details as emp', 'emp.empid=tbl.empid','left');
$query = $this->db->get();
$result = $query->result();
return $result;
}
// dropdown for payaple terms @ companydetails//
function getpayment($Configvalue = '')
{
$ConfigID = 'C009';
$this->db->select('ConfigValue');
$this->db->from('T_ConfigDetails');
$this->db->where('Config_ID ',$ConfigID );
$query = $this->db->get();
return $query->result();
}
// dropdown for file description @ companydetails//
/*function getfilename($Configvalue = '')
{
$ConfigID = 'C021';
$this->db->select('ConfigValue');
$this->db->from('t_configdetails');
$this->db->where('Config_ID ',$ConfigID );
$query = $this->db->get();
return $query->result();
}*/
//display the name for createdby @companydetails//
}
?>