Master screen issue Fixes
This commit is contained in:
parent
2b1815ed23
commit
0d2102c715
@ -2,38 +2,7 @@
|
|||||||
|
|
||||||
class assetdetails_model extends CI_Model
|
class assetdetails_model 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
|
|
||||||
*/
|
|
||||||
function assetListingCount($searchText = ''){
|
|
||||||
|
|
||||||
$this->db->select('*');
|
|
||||||
$this->db->from('T_Asset_Details');
|
|
||||||
|
|
||||||
|
|
||||||
if(!empty($searchText)) {
|
|
||||||
$likeCriteria = "(AssetCode LIKE '%".$searchText."%'
|
|
||||||
OR AssetName LIKE '%".$searchText."%'
|
|
||||||
OR Description LIKE '%".$searchText."%'
|
|
||||||
OR Description LIKE '%".$searchText."%'
|
|
||||||
OR DEPCode LIKE '%".$searchText."%'
|
|
||||||
OR Location LIKE '%".$searchText."%'
|
|
||||||
OR UserName LIKE '%".$searchText."%'
|
|
||||||
OR SupplierCode LIKE '%".$searchText."%'
|
|
||||||
OR DateOfPurchase LIKE '%".$searchText."%'
|
|
||||||
OR DateOfCommison LIKE '%".$searchText."%'
|
|
||||||
OR AssetStatus LIKE '%".$searchText."%'
|
|
||||||
|
|
||||||
)";
|
|
||||||
$this->db->where($likeCriteria);
|
|
||||||
}
|
|
||||||
//$this->db->where('BaseT.userId !=', 1);
|
|
||||||
$query = $this->db->get();
|
|
||||||
|
|
||||||
return count($query->result());
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* This function is used to get the user listing count
|
* This function is used to get the user listing count
|
||||||
* @param string $searchText : This is optional search text
|
* @param string $searchText : This is optional search text
|
||||||
@ -41,30 +10,12 @@ class assetdetails_model extends CI_Model
|
|||||||
* @param number $segment : This is pagination limit
|
* @param number $segment : This is pagination limit
|
||||||
* @return array $result : This is result
|
* @return array $result : This is result
|
||||||
*/
|
*/
|
||||||
function assetListing($searchText = '', $page, $segment)
|
function assetListing()
|
||||||
{
|
{
|
||||||
$this->db->select('*');
|
$this->db->select('*');
|
||||||
$this->db->from('T_Asset_Details');
|
$this->db->from('T_Asset_Details');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(!empty($searchText)) {
|
|
||||||
$likeCriteria = "(AssetCode LIKE '%".$searchText."%'
|
|
||||||
OR AssetName LIKE '%".$searchText."%'
|
|
||||||
OR Description LIKE '%".$searchText."%'
|
|
||||||
OR Description LIKE '%".$searchText."%'
|
|
||||||
OR DEPCode LIKE '%".$searchText."%'
|
|
||||||
OR Location LIKE '%".$searchText."%'
|
|
||||||
OR UserName LIKE '%".$searchText."%'
|
|
||||||
OR SupplierCode LIKE '%".$searchText."%'
|
|
||||||
OR DateOfPurchase LIKE '%".$searchText."%'
|
|
||||||
OR DateOfCommison LIKE '%".$searchText."%'
|
|
||||||
OR AssetStatus LIKE '%".$searchText."%'
|
|
||||||
|
|
||||||
)";
|
|
||||||
$this->db->where($likeCriteria);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->db->limit($page, $segment);
|
|
||||||
$query = $this->db->get();
|
$query = $this->db->get();
|
||||||
|
|
||||||
$result = $query->result();
|
$result = $query->result();
|
||||||
|
|||||||
@ -2,32 +2,7 @@
|
|||||||
|
|
||||||
class costcenter_model extends CI_Model
|
class costcenter_model 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
|
|
||||||
*/
|
|
||||||
function CostListingCount($searchText = '')
|
|
||||||
{
|
|
||||||
$this->db->select('Cost.CostCenterCode,Cost.CostCenterName, Cost.ApprovedBy,Emp.FirstName,Emp.Designation ');
|
|
||||||
$this->db->from('T_CostCenter_Master Cost');
|
|
||||||
$this->db->join('T_Employee_Details as Emp', 'Emp.EmpID=Cost.ApprovedBy');
|
|
||||||
|
|
||||||
if(!empty($searchText)) {
|
|
||||||
$likeCriteria = "( Cost.CostCenterCode LIKE '%".$searchText."%'
|
|
||||||
OR Cost.CostCenterName LIKE '%".$searchText."%'
|
|
||||||
OR Cost.ApprovedBy LIKE '%".$searchText."%'
|
|
||||||
OR Emp.FirstName LIKE '%".$searchText."%'
|
|
||||||
OR Emp.Designation LIKE '%".$searchText."%'
|
|
||||||
)";
|
|
||||||
$this->db->where($likeCriteria);
|
|
||||||
}
|
|
||||||
//$this->db->where('BaseT.isDeleted', 0);
|
|
||||||
//$this->db->where('BaseT.userId !=', 1);
|
|
||||||
$query = $this->db->get();
|
|
||||||
//print_r($this->db->last_query());
|
|
||||||
return count($query->result());
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* This function is used to get the user listing count
|
* This function is used to get the user listing count
|
||||||
* @param string $searchText : This is optional search text
|
* @param string $searchText : This is optional search text
|
||||||
@ -35,27 +10,16 @@ class costcenter_model extends CI_Model
|
|||||||
* @param number $segment : This is pagination limit
|
* @param number $segment : This is pagination limit
|
||||||
* @return array $result : This is result
|
* @return array $result : This is result
|
||||||
*/
|
*/
|
||||||
function CostListing($searchText = '', $page, $segment)
|
function CostListing()
|
||||||
{
|
{
|
||||||
$this->db->select('Cost.CostCenterCode as code,Cost.CostCenterName as CostCenterName , Cost.ApprovedBy as ApprovedBy,Emp.FirstName as FirstName,Emp.Designation as Designation ');
|
$this->db->select('Cost.CostCenterCode as code,Cost.CostCenterName as CostCenterName , Cost.ApprovedBy as ApprovedBy,Emp.FirstName as FirstName,Emp.Designation as Designation ');
|
||||||
$this->db->from('T_CostCenter_Master as Cost');
|
$this->db->from('T_CostCenter_Master as Cost');
|
||||||
$this->db->join('T_Employee_Details as Emp', 'Emp.EmpID=Cost.ApprovedBy');
|
$this->db->join('T_Employee_Details as Emp', 'Emp.EmpID=Cost.ApprovedBy');
|
||||||
|
|
||||||
if(!empty($searchText)) {
|
|
||||||
$likeCriteria = "( Cost.CostCenterCode LIKE '%".$searchText."%'
|
|
||||||
OR Cost.CostCenterName LIKE '%".$searchText."%'
|
|
||||||
OR Cost.ApprovedBy LIKE '%".$searchText."%'
|
|
||||||
OR Emp.FirstName LIKE '%".$searchText."%'
|
|
||||||
OR Emp.Designation LIKE '%".$searchText."%'
|
|
||||||
)";
|
|
||||||
$this->db->where($likeCriteria);
|
|
||||||
}
|
|
||||||
//$this->db->where('BaseT.isDeleted', 0);
|
|
||||||
//$this->db->where('BaseT.userId !=', 1);
|
|
||||||
$this->db->limit($page, $segment);
|
|
||||||
$query = $this->db->get();
|
$query = $this->db->get();
|
||||||
$result = $query->result();
|
$result = $query->result();
|
||||||
// print_r($this->db->last_query());
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -2,38 +2,7 @@
|
|||||||
|
|
||||||
class employeedetails_model extends CI_Model
|
class employeedetails_model 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
|
|
||||||
*/
|
|
||||||
function employeeListingCount($searchText = ''){
|
|
||||||
|
|
||||||
$this->db->select('count(*) as Count');
|
|
||||||
$this->db->from('T_Employee_Details Emp');
|
|
||||||
//$likeCriteria = '';
|
|
||||||
$this->db->join('T_DepartmentDetails Dep', 'Emp.Departmentcode = Dep.DEPCode','left');
|
|
||||||
if(!empty($searchText)) {
|
|
||||||
$likeCriteria = "(Emp.EmpID LIKE '%".$searchText."%'
|
|
||||||
OR Emp.FirstName LIKE '%".$searchText."%'
|
|
||||||
OR Emp.LastName LIKE '%".$searchText."%'
|
|
||||||
OR Emp.ContactNumber LIKE '%".$searchText."%'
|
|
||||||
OR Emp.EmailId LIKE '%".$searchText."%'
|
|
||||||
OR Emp.Designation LIKE '%".$searchText."%'
|
|
||||||
OR Dep.DepartmentName LIKE '%".$searchText."%'
|
|
||||||
|
|
||||||
)";
|
|
||||||
|
|
||||||
$this->db->where($likeCriteria);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// print_r( $this->db->last_query());
|
|
||||||
|
|
||||||
$query = $this->db->get();
|
|
||||||
// print_r( $this->db->last_query());
|
|
||||||
return $query->result_array();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -43,29 +12,19 @@ class employeedetails_model extends CI_Model
|
|||||||
* @param number $segment : This is pagination limit
|
* @param number $segment : This is pagination limit
|
||||||
* @return array $result : This is result
|
* @return array $result : This is result
|
||||||
*/
|
*/
|
||||||
function employeeListing($searchText = '', $page, $segment)
|
function employeeListing()
|
||||||
{
|
{
|
||||||
$this->db->select(' Emp.*,Dep.DepartmentName as DepartmentName');
|
$this->db->select(' Emp.*,Dep.DepartmentName as DepartmentName');
|
||||||
$this->db->from('T_Employee_Details Emp');
|
$this->db->from('T_Employee_Details Emp');
|
||||||
|
|
||||||
$this->db->join('T_DepartmentDetails Dep', 'Emp.Departmentcode = Dep.DEPCode','left');
|
$this->db->join('T_DepartmentDetails Dep', 'Emp.Departmentcode = Dep.DEPCode','left');
|
||||||
if(!empty($searchText)) {
|
|
||||||
$likeCriteria = "(Emp.EmpID LIKE '%".$searchText."%'
|
|
||||||
OR Emp.FirstName LIKE '%".$searchText."%'
|
|
||||||
OR Emp.LastName LIKE '%".$searchText."%'
|
|
||||||
OR Emp.ContactNumber LIKE '%".$searchText."%'
|
|
||||||
OR Emp.EmailId LIKE '%".$searchText."%'
|
|
||||||
OR Emp.Designation LIKE '%".$searchText."%'
|
|
||||||
OR Dep.DepartmentName LIKE '%".$searchText."%'
|
|
||||||
)";
|
|
||||||
$this->db->where($likeCriteria);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$this->db->order_by("Emp.EmpID", "asc");
|
$this->db->order_by("Emp.EmpID", "asc");
|
||||||
$this->db->limit($page, $segment);
|
|
||||||
$query = $this->db->get();
|
$query = $this->db->get();
|
||||||
//print_r( $this->db->last_query());
|
|
||||||
$result = $query->result();
|
$result = $query->result();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,28 +2,7 @@
|
|||||||
|
|
||||||
class rawmaterialdetails_model extends CI_Model
|
class rawmaterialdetails_model 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
|
|
||||||
*/
|
|
||||||
function rawmaterialListingCount($searchText = '')
|
|
||||||
{
|
|
||||||
$this->db->select('*');
|
|
||||||
$this->db->from('T_MaterialMaster');
|
|
||||||
|
|
||||||
if(!empty($searchText)) {
|
|
||||||
$likeCriteria = "(MaterialCode LIKE '%".$searchText."%'
|
|
||||||
OR MaterialName LIKE '%".$searchText."%'
|
|
||||||
OR MaterialType LIKE '%".$searchText."%' OR UOM LIKE '%".$searchText."%')";
|
|
||||||
$this->db->where($likeCriteria);
|
|
||||||
}
|
|
||||||
//$this->db->where('BaseT.isDeleted', 0);
|
|
||||||
//$this->db->where('BaseT.userId !=', 1);
|
|
||||||
$query = $this->db->get();
|
|
||||||
|
|
||||||
return count($query->result());
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* This function is used to get the user listing count
|
* This function is used to get the user listing count
|
||||||
* @param string $searchText : This is optional search text
|
* @param string $searchText : This is optional search text
|
||||||
@ -31,20 +10,12 @@ class rawmaterialdetails_model extends CI_Model
|
|||||||
* @param number $segment : This is pagination limit
|
* @param number $segment : This is pagination limit
|
||||||
* @return array $result : This is result
|
* @return array $result : This is result
|
||||||
*/
|
*/
|
||||||
function rawmaterialListing($searchText = '', $page, $segment)
|
function rawmaterialListing()
|
||||||
{
|
{
|
||||||
$this->db->select('*');
|
$this->db->select('*');
|
||||||
$this->db->from('T_MaterialMaster');
|
$this->db->from('T_MaterialMaster');
|
||||||
|
|
||||||
if(!empty($searchText)) {
|
|
||||||
$likeCriteria = "(MaterialCode LIKE '%".$searchText."%'
|
|
||||||
OR MaterialName LIKE '%".$searchText."%'
|
|
||||||
OR MaterialType LIKE '%".$searchText."%' OR UOM LIKE '%".$searchText."%')";
|
|
||||||
|
|
||||||
$this->db->where($likeCriteria);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->db->limit($page, $segment);
|
|
||||||
$query = $this->db->get();
|
$query = $this->db->get();
|
||||||
|
|
||||||
$result = $query->result();
|
$result = $query->result();
|
||||||
|
|||||||
@ -2,42 +2,7 @@
|
|||||||
|
|
||||||
class supplier_model extends CI_Model
|
class supplier_model 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
|
|
||||||
*/
|
|
||||||
function supplierListingCount($searchText = '')
|
|
||||||
{
|
|
||||||
$this->db->select('BaseT.SupplierID, BaseT.SupplierName, BaseT.Address, BaseT.ContactNumber, BaseT.AlternateContactNumber,BaseT.EmailAddress,BaseT.Exiseregistration,BaseT.TIN,BaseT.PAN,BaseT.GSTNO,BaseT.GSTRange,BaseT.CollectrateAddress,BaseT.UANumber,BaseT.PaymentTerms,BaseT.PaymentDays,BaseT.PayableAT');
|
|
||||||
$this->db->from('T_SupplierDetailsN as BaseT');
|
|
||||||
//$this->db->join('tbl_users as users', 'users.userId = BaseT.userId','left');
|
|
||||||
//$this->db->join('T_SupplierDetails as ID', 'ID.SupplierID = BaseT.SupplierID','left');
|
|
||||||
if(!empty($searchText)) {
|
|
||||||
$likeCriteria = "(BaseT.SupplierID LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.SupplierName LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.Address LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.ContactNumber LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.AlternateContactNumber LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.EmailAddress LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.Exiseregistration LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.TIN LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.PAN LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.GSTNO LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.GSTRange LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.CollectrateAddress LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.UANumber LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.PaymentTerms LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.PaymentDays LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.PayableAT LIKE '%".$searchText."%')";
|
|
||||||
$this->db->where($likeCriteria);
|
|
||||||
}
|
|
||||||
//$this->db->where('BaseT.isDeleted', 0);
|
|
||||||
//$this->db->where('BaseT.userId !=', 1);
|
|
||||||
$query = $this->db->get();
|
|
||||||
|
|
||||||
return count($query->result());
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* This function is used to get the user listing count
|
* This function is used to get the user listing count
|
||||||
* @param string $searchText : This is optional search text
|
* @param string $searchText : This is optional search text
|
||||||
@ -45,35 +10,12 @@ class supplier_model extends CI_Model
|
|||||||
* @param number $segment : This is pagination limit
|
* @param number $segment : This is pagination limit
|
||||||
* @return array $result : This is result
|
* @return array $result : This is result
|
||||||
*/
|
*/
|
||||||
function supplierListing($searchText = '', $page, $segment)
|
function supplierListing()
|
||||||
{
|
{
|
||||||
$this->db->select('BaseT.SupplierID, BaseT.SupplierName, BaseT.Address, BaseT.ContactNumber, BaseT.AlternateContactNumber,BaseT.EmailAddress,BaseT.Exiseregistration, BaseT.TIN, BaseT.PAN,,BaseT.GSTNO,BaseT.GSTRange,BaseT.CollectrateAddress,BaseT.UANumber,BaseT.PaymentTerms,BaseT.PaymentDays,BaseT.PayableAT,BaseT.CreatedOn');
|
$this->db->select('BaseT.SupplierID, BaseT.SupplierName, BaseT.Address, BaseT.ContactNumber, BaseT.AlternateContactNumber,BaseT.EmailAddress,BaseT.Exiseregistration, BaseT.TIN, BaseT.PAN,,BaseT.GSTNO,BaseT.GSTRange,BaseT.CollectrateAddress,BaseT.UANumber,BaseT.PaymentTerms,BaseT.PaymentDays,BaseT.PayableAT,BaseT.CreatedOn');
|
||||||
$this->db->from('T_SupplierDetailsN as BaseT');
|
$this->db->from('T_SupplierDetailsN as BaseT');
|
||||||
//$this->db->join('tbl_users as users', 'users.userId = BaseT.userId','left');
|
|
||||||
//$this->db->join('T_SupplierDetails as ID', 'ID.SupplierID = BaseT.SupplierID','left');
|
|
||||||
if(!empty($searchText)) {
|
|
||||||
$likeCriteria = "(BaseT.SupplierID LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.SupplierName LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.Address LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.ContactNumber LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.AlternateContactNumber LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.EmailAddress LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.Exiseregistration LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.TIN LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.CreatedOn LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.PAN LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.GSTNO LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.GSTRange LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.CollectrateAddress LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.UANumber LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.PaymentTerms LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.PaymentDays LIKE '%".$searchText."%'
|
|
||||||
OR BaseT.PayableAT LIKE '%".$searchText."%')";
|
|
||||||
$this->db->where($likeCriteria);
|
|
||||||
}
|
|
||||||
//$this->db->where('BaseT.isDeleted', 0);
|
|
||||||
//$this->db->where('BaseT.userId !=', 1);
|
|
||||||
$this->db->limit($page, $segment);
|
|
||||||
$query = $this->db->get();
|
$query = $this->db->get();
|
||||||
|
|
||||||
$result = $query->result();
|
$result = $query->result();
|
||||||
|
|||||||
@ -2,36 +2,7 @@
|
|||||||
|
|
||||||
class User_model extends CI_Model
|
class User_model 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
|
|
||||||
*/
|
|
||||||
function userListingCount($searchText = '')
|
|
||||||
{
|
|
||||||
$this->db->select('EMP.EmpID,EMP.FirstName,EMP.LastName,EMP.Designation,EMP.EmailId,EMP.ContactNumber,
|
|
||||||
DEPT.DEPCode,DEPT.DepartmentName,role.role,user.userId');
|
|
||||||
$this->db->from('T_Employee_Details EMP');
|
|
||||||
$this->db->join('T_DepartmentDetails DEPT', 'EMP.Departmentcode = DEPT.DEPCode');
|
|
||||||
$this->db->join('tbl_users user', 'user.EmpID = EMP.EmpID');
|
|
||||||
$this->db->join('tbl_roles role', 'user.roleId = role.roleId');
|
|
||||||
if(!empty($searchText)) {
|
|
||||||
$likeCriteria = "(EMP.FirstName LIKE '%".$searchText."%'
|
|
||||||
OR EMP.LastName LIKE '%".$searchText."%'
|
|
||||||
OR EMP.EmailId LIKE '%".$searchText."%'
|
|
||||||
OR EMP.ContactNumber LIKE '%".$searchText."%'
|
|
||||||
OR EMP.Designation LIKE '%".$searchText."%'
|
|
||||||
OR DEPT.DepartmentName LIKE '%".$searchText."%'
|
|
||||||
OR role.role LIKE '%".$searchText."%'
|
|
||||||
OR EMP.Designation LIKE '%".$searchText."%')";
|
|
||||||
$this->db->where($likeCriteria);
|
|
||||||
}
|
|
||||||
$this->db->where('user.isDeleted !=', 1);
|
|
||||||
|
|
||||||
$query = $this->db->get();
|
|
||||||
|
|
||||||
return count($query->result());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function is used to get the user listing count
|
* This function is used to get the user listing count
|
||||||
@ -40,7 +11,7 @@ class User_model extends CI_Model
|
|||||||
* @param number $segment : This is pagination limit
|
* @param number $segment : This is pagination limit
|
||||||
* @return array $result : This is result
|
* @return array $result : This is result
|
||||||
*/
|
*/
|
||||||
function userListing($searchText = '', $page, $segment)
|
function userListing()
|
||||||
{
|
{
|
||||||
$this->db->select('EMP.EmpID,EMP.FirstName,EMP.LastName,EMP.Designation,EMP.EmailId,EMP.ContactNumber,
|
$this->db->select('EMP.EmpID,EMP.FirstName,EMP.LastName,EMP.Designation,EMP.EmailId,EMP.ContactNumber,
|
||||||
DEPT.DEPCode,DEPT.DepartmentName,role.role,user.userId');
|
DEPT.DEPCode,DEPT.DepartmentName,role.role,user.userId');
|
||||||
@ -48,21 +19,10 @@ class User_model extends CI_Model
|
|||||||
$this->db->join('T_DepartmentDetails DEPT', 'EMP.Departmentcode = DEPT.DEPCode');
|
$this->db->join('T_DepartmentDetails DEPT', 'EMP.Departmentcode = DEPT.DEPCode');
|
||||||
$this->db->join('tbl_users user', 'user.EmpID = EMP.EmpID');
|
$this->db->join('tbl_users user', 'user.EmpID = EMP.EmpID');
|
||||||
$this->db->join('tbl_roles role', 'user.roleId = role.roleId');
|
$this->db->join('tbl_roles role', 'user.roleId = role.roleId');
|
||||||
if(!empty($searchText)) {
|
|
||||||
$likeCriteria = "(EMP.FirstName LIKE '%".$searchText."%'
|
|
||||||
OR EMP.LastName LIKE '%".$searchText."%'
|
|
||||||
OR EMP.EmailId LIKE '%".$searchText."%'
|
|
||||||
OR EMP.ContactNumber LIKE '%".$searchText."%'
|
|
||||||
OR EMP.Designation LIKE '%".$searchText."%'
|
|
||||||
OR DEPT.DepartmentName LIKE '%".$searchText."%'
|
|
||||||
OR role.role LIKE '%".$searchText."%'
|
|
||||||
OR EMP.Designation LIKE '%".$searchText."%')";
|
|
||||||
$this->db->where($likeCriteria);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$this->db->where('user.isDeleted !=', 1);
|
$this->db->where('user.isDeleted !=', 1);
|
||||||
$this->db->limit($page, $segment);
|
|
||||||
$query = $this->db->get();
|
$query = $this->db->get();
|
||||||
|
|
||||||
$result = $query->result();
|
$result = $query->result();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user