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
2ace4d0d
authored
2019-01-28 17:06:59 +0530
by
prami
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
campaign: Added filer query for elegible
1 parent
5b50cf38
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
11 deletions
application/app/Http/Controllers/CampaignController.php
application/app/Models/Record.php
application/resources/views/layout/module/campaign/campaignAssignToAgents.blade.php
application/resources/views/layout/module/campaign/campaignTabSql.blade.php
application/app/Http/Controllers/CampaignController.php
View file @
2ace4d0
...
...
@@ -126,22 +126,32 @@ class CampaignController extends Controller {
}
else
{
$queryConditions
=
'1'
;
}
$queryInCondition
=
Input
::
get
(
"queryInCondition"
);
if
(
$queryInCondition
!=
'null'
){
$queryInCondition
=
str_replace
(
'"'
,
"'"
,
$queryInCondition
);
$queryInCondition
=
str_replace
(
'''
,
"'"
,
$queryInCondition
);
$queryInCondition
=
"or elegible IN (
$queryInCondition
)"
;
$querySelect
.=
',elegible'
;
}
else
{
$queryInCondition
=
''
;
}
$queryLimit
=
Input
::
get
(
"queryLimit"
);
$queryOffset
=
Input
::
get
(
"queryOffset"
);
$checkedValue
=
Input
::
get
(
"checkedValue"
);
$fields
=
explode
(
","
,
$querySelect
);
$i
=
1
;
$output
=
''
;
try
{
try
{
if
(
$campaign
==
"All"
)
{
$selQuery
=
"SELECT
$querySelect
FROM records WHERE
$queryConditions
LIMIT
$queryLimit
OFFSET
$queryOffset
"
;
$selQuery
=
"SELECT
$querySelect
FROM records WHERE
$queryConditions
$queryInCondition
LIMIT
$queryLimit
OFFSET
$queryOffset
"
;
$sqlQuery
=
DB
::
select
(
$selQuery
);
}
else
{
$selQuery
=
"SELECT
$querySelect
FROM records WHERE client = '
$campaign
' AND
$queryConditions
LIMIT
$queryLimit
OFFSET
$queryOffset
"
;
$selQuery
=
"SELECT
$querySelect
FROM records WHERE client = '
$campaign
' AND
$queryConditions
$queryInCondition
LIMIT
$queryLimit
OFFSET
$queryOffset
"
;
$sqlQuery
=
DB
::
select
(
$selQuery
);
}
...
...
@@ -159,7 +169,6 @@ class CampaignController extends Controller {
$output
.=
"<p class='text-danger'>"
.
$ex
->
getMessage
()
.
"</p>"
;
return
$output
;
}
if
(
count
(
$sqlQuery
)){
$output
.=
'<div style="overflow-x:auto;"><table class="table table-bordered"><thead><tr><th class="text-center">#</th>'
;
foreach
(
$fields
as
$key
)
{
...
...
@@ -235,15 +244,25 @@ class CampaignController extends Controller {
}
else
{
$queryConditions
=
'1'
;
}
$queryInCondition
=
Input
::
get
(
"queryInCondition"
);
if
(
$queryInCondition
!=
'null'
){
$queryInCondition
=
str_replace
(
'"'
,
"'"
,
$queryInCondition
);
$queryInCondition
=
str_replace
(
'''
,
"'"
,
$queryInCondition
);
$queryInCondition
=
"or elegible IN (
$queryInCondition
)"
;
$querySelect
.=
',elegible'
;
}
else
{
$queryInCondition
=
''
;
}
$queryLimit
=
Input
::
get
(
"queryLimit"
);
$queryOffset
=
Input
::
get
(
"queryOffset"
);
try
{
if
(
$campaign
==
"All"
){
$selQuery
=
"SELECT
$querySelect
FROM records WHERE
$queryConditions
LIMIT
$queryLimit
OFFSET
$queryOffset
"
;
$selQuery
=
"SELECT
$querySelect
FROM records WHERE
$queryConditions
$queryInCondition
LIMIT
$queryLimit
OFFSET
$queryOffset
"
;
$sqlQuery
=
DB
::
select
(
$selQuery
);
}
else
{
$selQuery
=
"SELECT
$querySelect
FROM records WHERE client = '
$campaign
' AND
$queryConditions
LIMIT
$queryLimit
OFFSET
$queryOffset
"
;
$selQuery
=
"SELECT
$querySelect
FROM records WHERE client = '
$campaign
' AND
$queryConditions
$queryInCondition
LIMIT
$queryLimit
OFFSET
$queryOffset
"
;
$sqlQuery
=
DB
::
select
(
$selQuery
);
}
}
catch
(
\Illuminate\Database\QueryException
$ex
){
...
...
application/app/Models/Record.php
View file @
2ace4d0
...
...
@@ -18,7 +18,7 @@ class Record extends Model{
"exittype"
,
"dateofexit"
,
"abscondtype"
,
"abscondeddate"
,
"workflowstatus"
,
"status"
,
"clientinternalid"
,
"department"
,
"passportstatus"
,
"clientcode"
,
"laborcardpersonalid"
,
"dialer_status"
,
"dialer_substatus"
,
"dialer_callback"
,
"dialer_remarks"
,
"dialer_flag"
,
"dialer_lastcall"
,
"priority"
,
"crmlist_id"
,
"group"
);
"dialer_lastcall"
,
"priority"
,
"crmlist_id"
,
"group"
,
"elegible"
);
private
$keyvals
=
null
;
public
$dataarr
=
array
();
public
$rlogarr
=
array
();
...
...
application/resources/views/layout/module/campaign/campaignAssignToAgents.blade.php
View file @
2ace4d0
...
...
@@ -65,6 +65,21 @@ $dashboarduser=Auth::user();
</div>
<div
class=
"panel panel-info"
>
<div
class=
"panel-body"
>
<div
class=
"col-md-2"
>
<label>
Upload Users:
</label>
</div>
<div
class=
"col-md-6"
>
<input
type=
"file"
name=
"user"
>
</div>
<div
class=
"col-md-2"
>
<button
id=
"upload"
class=
"btn btn-xs btn-info"
>
Upload
</button>
</div>
</div>
</div>
<div
class=
"panel panel-info"
>
<div
class=
"panel-heading "
><strong>
Assigned Users List
</strong><div
style=
"float:right;"
>
<button
id=
"removeuser"
class=
"btn btn-xs btn-info"
>
Edit User
</button>
...
...
application/resources/views/layout/module/campaign/campaignTabSql.blade.php
View file @
2ace4d0
<?php
$queryFields
=
explode
(
","
,
'usr_id,branchCode,organizationName,designation,dob,location,state,residenceAddress,residenceAddressZipCode,officeAddress,officeAddressZipCode,alternateMobile,officeNumber,referenceName,referenceMobile,referenceName2,referenceMobile2,loanStatus,product,bucket,dpd,tenureStartDate,tenureEndDate,tenureRemaining,disbursalDate,rateOfInterest,installmentNo,chequeBounceNo,reasonForLastBounce,reasonForSecondLastBounce,cycleDate,ebnb,bank,lastMonthPaymentMode,lastMonthPaymentAmount,lastMonthPaymentDate,delinquencyString,specialCode,centralECS,emi,pos,bounceCharge,penalMTD,penalLTD,overdueAmount,installmentAmountOverdue,altphone1,altphone2,altphone3,altphone4,altphone5,altphone6,altphone7,altphone8,altphone9,altphone10,priority,dialer_substatus,dialer_callback'
);
$queryFields
=
explode
(
","
,
'usr_id,branchCode,organizationName,designation,dob,location,state,residenceAddress,residenceAddressZipCode,officeAddress,officeAddressZipCode,alternateMobile,officeNumber,referenceName,referenceMobile,referenceName2,referenceMobile2,loanStatus,product,bucket,dpd,tenureStartDate,tenureEndDate,tenureRemaining,disbursalDate,rateOfInterest,installmentNo,chequeBounceNo,reasonForLastBounce,reasonForSecondLastBounce,cycleDate,ebnb,bank,lastMonthPaymentMode,lastMonthPaymentAmount,lastMonthPaymentDate,delinquencyString,specialCode,centralECS,emi,pos,bounceCharge,penalMTD,penalLTD,overdueAmount,installmentAmountOverdue,altphone1,altphone2,altphone3,altphone4,altphone5,altphone6,altphone7,altphone8,altphone9,altphone10,priority,dialer_substatus,dialer_callback
,elegible
'
);
?>
<div
class=
"row"
>
<div
class=
"col-sm-12"
>
...
...
@@ -19,6 +19,12 @@ $queryFields = explode(",", 'usr_id,branchCode,organizationName,designation,dob,
<option
value=
"{{$fields}}"
>
{{$fields}}
</option>
@endforeach
</select>
<label
style=
"margin-top: 5px;"
>
ELEGIBLE FOR
</label>
<select
id=
"queryInCondition"
multiple=
""
data-rel=
"chosen"
style=
'width:100%'
class=
select2multi
>
<option
value=
"'CC'"
>
CC
</option>
<option
value=
"'PL'"
>
PL
</option>
<option
value=
"'OD'"
>
OD
</option>
</select>
<label
style=
"margin-top: 5px;"
>
FROM 'records' WHERE
</label>
<input
type=
"text"
class=
"form-control"
id=
"queryConditions"
placeholder=
"1"
value=
"1"
/>
</div>
...
...
@@ -67,7 +73,7 @@ $queryFields = explode(",", 'usr_id,branchCode,organizationName,designation,dob,
<script>
function
runSqlQuery
(){
var
checkedValue
=
$
(
'.saveQryChck:checked'
).
val
();
var
data
=
'campaign={{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}&querySelect='
+
$
(
"#querySelect"
).
val
()
+
'&queryConditions='
+
$
(
"#queryConditions"
).
val
()
+
'&queryLimit='
+
$
(
"#queryLimit"
).
val
()
+
'&queryOffset='
+
$
(
"#queryOffset"
).
val
()
+
'&checkedValue='
+
checkedValue
;
var
data
=
'campaign={{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}&querySelect='
+
$
(
"#querySelect"
).
val
()
+
'&queryConditions='
+
$
(
"#queryConditions"
).
val
()
+
'&query
InCondition='
+
$
(
"#queryInCondition"
).
val
()
+
'&query
Limit='
+
$
(
"#queryLimit"
).
val
()
+
'&queryOffset='
+
$
(
"#queryOffset"
).
val
()
+
'&checkedValue='
+
checkedValue
;
doAjax
(
"campaign/query"
,
data
,
"sqlQueryOutput"
,
""
,
""
,
"GET"
);
document
.
getElementById
(
"downloadButton"
).
style
=
"margin: 0% 0% 0.1% 84%;display: block"
;
...
...
@@ -92,6 +98,6 @@ function delSqlQuery(id){
function
downloadOutput
()
{
window
.
open
(
'campaign/download?campaign={{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}&querySelect='
+
$
(
"#querySelect"
).
val
()
+
'&queryConditions='
+
$
(
"#queryConditions"
).
val
()
+
'&queryLimit='
+
$
(
"#queryLimit"
).
val
()
+
'&queryOffset='
+
$
(
"#queryOffset"
).
val
());
return
false
;
window
.
open
(
'campaign/download?campaign={{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}&querySelect='
+
$
(
"#querySelect"
).
val
()
+
'&queryConditions='
+
$
(
"#queryConditions"
).
val
()
+
'&query
InCondition='
+
$
(
"#queryInCondition"
).
val
()
+
'&query
Limit='
+
$
(
"#queryLimit"
).
val
()
+
'&queryOffset='
+
$
(
"#queryOffset"
).
val
());
return
false
;
}
</script>
\ No newline at end of file
...
...
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