Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flexydial
/
hdfc-beu-v2
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
dff9b077
authored
2019-01-29 16:39:57 +0530
by
prami
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
campaign: removed dublicate sql query request
1 parent
85b15def
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
28 deletions
application/app/Jobs/KHRMSLib.php
application/app/Jobs/KHRMSLib.php
View file @
dff9b07
...
...
@@ -1613,6 +1613,22 @@ function popMail($userid)
}
function clientsReadAccess()
{
$companyarr=$this->LoadAll("select * from hrms_masters where mtype='
company
' and status='
active
'");
$campaigns=array();
$now = new \DateTime();
foreach($companyarr as $tcompany){
$campaignstartdate = new \DateTime($tcompany['
campaignstartdate
']);
$campaignenddate = new \DateTime($tcompany['
campaignenddate
']);
if(empty($tcompany['
campaignstartdate
']) || empty($tcompany['
campaignenddate
'])){
$campaigns[]=$tcompany['
mkey
'];
}else{
if($campaignstartdate < $now and $campaignenddate > $now){
$campaigns[]=$tcompany['
mkey
'];
}
}
}
$clientlst=array();
if($this->GetBBBUserData("readotherdata")=="No")
{
...
...
@@ -1632,44 +1648,21 @@ function popMail($userid)
array_unshift($clientlst," ");
}
else
{
$companyarr=$this->LoadAll("select * from hrms_masters where mtype='
company
' and status='
active
'");
foreach($companyarr as $tcompany)$clientlst[]=$tcompany['
mkey
'];
{
$selectarr=$this->loadAllDBMasters("client",'
select
');
$values=explode(",",$selectarr["mvalue"]);$newvalues=array();foreach($values as $value)$newvalues[]=trim($value);
if(is_array($clientlst))$clientlst=array_unique(array_merge($clientlst,$newvalues));
if(is_array($clientlst))$clientlst=array_unique(array_merge($campaigns,$newvalues));
}
}
$companyarr=$this->LoadAll("select * from hrms_masters where mtype='
company
' and status='
active
'");
$campaigns=array();
$now = new \DateTime();
foreach($companyarr as $tcompany)
{
$campaignstartdate = new \DateTime($tcompany['
campaignstartdate
']);
$campaignenddate = new \DateTime($tcompany['
campaignenddate
']);
if(empty($tcompany['
campaignstartdate
']) || empty($tcompany['
campaignenddate
'])){
$campaigns[]=$tcompany['
mkey
'];
}else{
if($campaignstartdate < $now and $campaignenddate > $now){
$campaigns[]=$tcompany['
mkey
'];
}
}
}
$activeCampaign = array();
$activeClientCampaign = array();
foreach ($clientlst as $key => $value) {
if(in_array($value, $campaigns)){
$activeCampaign[]=$value;
$activeC
lientC
ampaign[]=$value;
}
}
return $activeCampaign;
return $activeC
lientC
ampaign;
}
function clientsOwnerRWAccess()
{
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment