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
fa27a3e9
authored
2019-06-29 00:48:05 +0530
by
Manish Mihsra
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Added some important value in the dialline table and report changes
1 parent
a02abcee
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
168 additions
and
32 deletions
application/app/Http/Controllers/DialerController.php
application/app/Http/Controllers/ReportController.php
application/app/Jobs/KPAMIListen.php
application/resources/views/layout/module/reports/campaignwise.blade.php
application/resources/views/layout/module/reports/liveusers.blade.php
application/app/Http/Controllers/DialerController.php
View file @
fa27a3e
...
...
@@ -364,8 +364,11 @@ $users=$this->getCallSequencing(1);
$dialline
=
$dialline
->
orderBy
(
'updated_at'
,
'ASC'
)
->
first
();
if
(
$dialline
)
{
{
$dialline
->
user_id
=
Auth
::
user
()
->
id
;
$dialline
->
number
=
$callnumber
;
$dialline
->
status
=
"Blocked"
;
$dialline
->
regexstr
=
$client
;
$dialline
->
save
();
$nowts
=
microtime
(
true
)
*
1000
;
...
...
application/app/Http/Controllers/ReportController.php
View file @
fa27a3e
...
...
@@ -9,21 +9,14 @@ use Input;
use
Response
;
use
Config
;
use
App\Http\Requests
;
use
App\Models\Group
;
use
App\Models\Master
;
use
App\Models\Record
;
use
App\Models\CRMCall
;
use
App\Models\CRMCallArchive
;
use
App\Models\CRM
;
use
App\Models\CRMCampaign
;
use
App\Models\CRMList
;
use
App\Models\Cutoff
;
use
App\Jobs\KHRMSLib
;
use
App\Models\Sipid
;
use
App\Models\Dialline
;
use
App\Models\User
;
use
App\Models\UserLog
;
use
App\Models\Kqueue
;
use
DB
;
use
Log
;
use
Session
;
...
...
@@ -81,6 +74,7 @@ class ReportController extends Controller
$waitCall
=
0
;
$inCall
=
0
;
$availChnl
=
0
;
$freeUsr
=
0
;
$usrIdArr
=
array
();
$tabHeadStr
=
""
;
$tabBodyStr
=
""
;
...
...
@@ -97,18 +91,19 @@ class ReportController extends Controller
$mastersdata
=
$wakka
->
getCompanyMaster
(
$campaign
);
if
(
!
empty
(
$mastersdata
[
"autodialercampaign"
]))
$ratio
=
$mastersdata
[
"autodialercampaign"
];
$userArr
=
User
::
where
(
'presence'
,
'='
,
"1"
)
->
where
(
'
sel_campaign'
,
'='
,
$campaign
)
->
select
(
'id'
,
'username'
,
'fullname
'
,
'current_dialmode'
)
->
get
();
$diallineArr
=
Dialline
::
where
(
"enabled"
,
"="
,
"1"
)
->
get
();
$userArr
=
User
::
where
(
'presence'
,
'='
,
"1"
)
->
where
(
'
usertype'
,
'='
,
'User'
)
->
where
(
'sel_campaign'
,
'='
,
$campaign
)
->
select
(
'id'
,
'username'
,
'fullname'
,
'sel_campaign
'
,
'current_dialmode'
)
->
get
();
$diallineArr
=
Dialline
::
where
(
'server'
,
'='
,
env
(
'app_ip'
))
->
where
(
"enabled"
,
"="
,
"1"
)
->
get
();
$totalChnl
=
$diallineArr
->
count
();
foreach
(
$diallineArr
as
$dialline
)
{
if
(
$dialline
->
regexstr
==
$campaign
){
if
(
$dialline
->
status
!=
'Free'
)
$totalCall
++
;
if
(
$dialline
->
status
!=
'Free'
&&
$dialline
->
s
rc_channel
!=
''
&&
$dialline
->
channel
==
'
'
)
$dialedCall
++
;
if
(
$dialline
->
status
!=
'Free'
&&
$dialline
->
s
tatus
!=
'Auto
'
)
$dialedCall
++
;
if
(
$dialline
->
status
==
'Auto'
&&
$dialline
->
conf
==
''
&&
$dialline
->
src_channel
!=
''
&&
$dialline
->
channel
!=
''
)
$waitCall
++
;
if
(
$dialline
->
status
!=
'Free'
&&
$dialline
->
conf
!=
''
)
$inCall
++
;
}
}
$availChnl
=
$totalChnl
-
$totalCall
;
...
...
@@ -121,23 +116,24 @@ class ReportController extends Controller
</tr>"
;
foreach
(
$userArr
as
$usr
)
{
$usrIdArr
[]
=
$usr
->
id
;
$statusStr
=
"<span class='btn btn-sm btn-warning'>Free</span>"
;
$statusStr
=
"<span class='btn btn-xs btn-warning'><strong>Free</strong></span>"
;
$sipIdArr
=
Sipid
::
where
(
'user'
,
"="
,
$usr
->
id
)
->
where
(
'status'
,
'='
,
1
)
->
select
(
'id'
,
'status'
,
'ready'
,
'patched'
)
->
first
();
$sipIdArr
=
Sipid
::
where
(
'server'
,
'='
,
env
(
'app_ip'
))
->
where
(
'user'
,
"="
,
$usr
->
id
)
->
where
(
'status'
,
'='
,
1
)
->
select
(
'id'
,
'status'
,
'ready'
,
'patched'
,
'prepare_call'
)
->
first
();
//if($sipIdArr->user!=$usr->id) continue;
if
(
$sipIdArr
->
patched
==
0
)
$freeUsr
++
;
if
(
$sipIdArr
->
ready
==
1
)
$statusStr
=
"<span class='btn btn-sm btn-success'>Available</span>"
;
if
(
$sipIdArr
->
patched
==
1
)
$statusStr
=
"<span class='btn btn-sm btn-info'>OnCall</span>"
;
if
(
$sipIdArr
->
prepare_call
==
1
&&
$sipIdArr
->
patched
==
0
)
$statusStr
=
"<span class='btn btn-sm btn-info'>Wrap-Up</span>"
;
if
(
$sipIdArr
->
ready
==
1
)
$statusStr
=
"<span class='btn btn-xs btn-success'><strong>Available</strong></span>"
;
if
(
$sipIdArr
->
patched
==
1
)
$statusStr
=
"<span class='btn btn-xs btn-info'><strong>InCall</strong></span>"
;
$wrapUp
=
DB
::
table
(
'crmcalls'
)
->
where
(
'user_id'
,
'='
,
$usr
->
id
)
->
where
(
'state'
,
'='
,
'Hangup'
)
->
orderBy
(
'id'
,
'desc'
)
->
select
(
'id'
,
'userstatus'
)
->
first
();
if
(
$wrapUp
->
userstatus
==
""
)
$statusStr
=
"<span class='btn btn-xs btn-info'><strong>WrapUp</strong></span>"
;
$tabBodyStr
.=
"<tr><td>"
.
$usr
->
fullname
.
"</td>"
;
$tabBodyStr
.=
"<td>"
.
$campaign
.
"</td>"
;
$tabBodyStr
.=
"<td>"
.
$
usr
->
sel_
campaign
.
"</td>"
;
$tabBodyStr
.=
"<td>"
.
$usr
->
current_dialmode
.
"</td>"
;
$tabBodyStr
.=
"<td>"
.
$statusStr
.
"</td></tr>"
;
}
$freeUsr
=
Sipid
::
whereIn
(
'user'
,
$usrIdArr
)
->
where
(
'status'
,
'='
,
1
)
->
where
(
'ready'
,
'='
,
1
)
->
where
(
'patched'
,
'='
,
0
)
->
count
();
$data
[
'ratio'
]
=
$ratio
;
$data
[
'totalUsr'
]
=
$userArr
->
count
();
$data
[
'totalChnl'
]
=
$totalChnl
;
...
...
@@ -145,7 +141,7 @@ class ReportController extends Controller
$data
[
'dialedCall'
]
=
$dialedCall
;
$data
[
'waitCall'
]
=
$waitCall
;
$data
[
'inCall'
]
=
$inCall
;
$data
[
'freeUsr'
]
=
$
totalChnl
;
$data
[
'freeUsr'
]
=
$
freeUsr
;
$data
[
'tabHeadStr'
]
=
$tabHeadStr
;
$data
[
'tabBodyStr'
]
=
$tabBodyStr
;
...
...
@@ -181,9 +177,9 @@ class ReportController extends Controller
return
view
(
"layout.module.reports.statusreport"
,
array
());
}
if
(
$id
==
"
relationshipreport
"
)
if
(
$id
==
"
campaignwise
"
)
{
return
view
(
"layout.module.reports.
relationshipreport
"
,
array
());
return
view
(
"layout.module.reports.
campaignwise
"
,
array
());
}
}
}
...
...
application/app/Jobs/KPAMIListen.php
View file @
fa27a3e
...
...
@@ -205,7 +205,7 @@ class KPAMIListen implements IEventListener
$record
=
$wakka
->
getPerson
(
$crmcall
->
crm_id
,
$crmcall
->
client
);
if
(
$record
)
{
DB
::
table
(
'records_'
.
$crmcall
->
client
)
->
where
(
$crmcall
->
crm_id
)
->
update
([
'filter_condition'
=>
'4'
]);
DB
::
table
(
'records_'
.
$crmcall
->
client
)
->
where
(
'id'
,
'='
,
$crmcall
->
crm_id
)
->
update
([
'filter_condition'
=>
'4'
]);
$record
[
"peopledata"
][
"dialer_status"
]
=
"FORCEDCLOSE"
;
$record
[
"peopledata"
][
"dialer_substatus"
]
=
"FORCEDCLOSE"
;
$record
[
"peopledata"
][
"dialer_callback"
]
=
""
;
...
...
@@ -467,10 +467,12 @@ class KPAMIListen implements IEventListener
$dialline
=
Dialline
::
find
(
$crmcall
->
dialline_id
);
if
(
$dialline
)
{
$dialline
->
user_id
=
0
;
$dialline
->
status
=
"Free"
;
$dialline
->
conf
=
""
;
$dialline
->
number
=
""
;
$dialline
->
uniqueid
=
""
;
$dialline
->
src_channel
=
""
;
$dialline
->
channel
=
""
;
$dialline
->
did
=
""
;
$dialline
->
save
();
...
...
@@ -579,10 +581,13 @@ class KPAMIListen implements IEventListener
{
$tsip
->
patched
=
0
;
$tsip
->
save
();
$newqueue
=
new
Kqueue
();
$newqueue
->
sipNotify
(
$tsip
,
"dialerUI"
,
"hangup"
,
"c"
,
$crmcall
->
id
.
"~"
.
$crmcall
->
number
.
"~"
.
base64_encode
(
$channel
));
}
$newqueue
=
new
Kqueue
();
$newqueue
->
sipNotify
(
$tsip
,
"dialerUI"
,
"hangup"
,
"c"
,
$crmcall
->
id
.
"~"
.
$crmcall
->
number
.
"~"
.
base64_encode
(
$channel
));
//
$newqueue=new Kqueue();
//
$newqueue->sipNotify($tsip,"dialerUI","hangup","c",$crmcall->id."~".$crmcall->number."~".base64_encode($channel));
}
$crmcall
->
addEventLog
(
$nowts
,
"
$accountcode
:HangupEvent :
$eventname
$channelstate
:
$channelstatedesc
$uniqueid
$exten
:
$priority
$channel
$cause
:
$causetxt
"
);
...
...
@@ -844,7 +849,7 @@ class KPAMIListen implements IEventListener
$dialline
=
Dialline
::
find
(
$crmcall
->
dialline_id
);
if
(
$dialline
)
{
$dialline
->
conf
=
"1000"
.
$tsip
->
id
;
if
(
$dialline
->
status
!=
"AutoCall"
)
$dialline
->
conf
=
"1000"
.
$tsip
->
id
;
$dialline
->
channel
=
$channel
;
$dialline
->
save
();
}
...
...
@@ -1100,7 +1105,7 @@ class KPAMIListen implements IEventListener
$dialline
=
Dialline
::
find
(
$crmcall
->
dialline_id
);
if
(
$dialline
)
{
$dialline
->
conf
=
"1000"
.
$tsip
->
id
;
if
(
$dialline
->
status
!=
"AutoCall"
)
$dialline
->
conf
=
"1000"
.
$tsip
->
id
;
$dialline
->
channel
=
$channel
;
$dialline
->
save
();
}
...
...
application/resources/views/layout/module/reports/campaignwise.blade.php
0 → 100755
View file @
fa27a3e
<style>
#logtable
.td
{
vertical-align
:
top
;
padding
:
20px
;}
#logtable
.tr
{
height
:
28px
;
overflow-y
:
hidden
;}
/*#logtable.table thead tr{
display:block;
}
#logtable.table tbody{
display:block;
height:500px;
overflow:auto;//set tbody to auto
}*/
</style>
<div
class=
innerAll
>
<h4
style=
"float:left;width:50%;margin:10px 0;"
>
Campaign Report
</small></h4>
<div
style=
"float:right;width:50%"
>
@if(Auth::user()->username=='admin')
<button
class=
"pull-right btn btn-sm btn-default"
onclick=
'dlAgentlogXls();return false;'
title=
'Download'
><i
class=
'fa fa-download'
></i>
Download
</button>
@endif
</div>
<div
style=
"clear:both"
></div>
<hr
style=
"margin-bottom: 5px;"
>
<div>
Search
<input
id=
filter
name=
"filter"
type=
"text"
style=
"border:1px solid #efefef; padding: 2px 10px;"
>
Date: From
<input
size=
10
id=
'modfrom'
name=
'modfrom'
type=
'text'
value=
'
<?php
echo
date
(
"Y-m-d"
,
$logdate
);
?>
'
/>
<select
id=
"modtime"
style=
"border:1px solid #efefef;"
>
<?php
foreach
(
range
(
0
,
23
)
as
$hour
)
{
$selected
=
(
$hour
==
$logtime
)
?
"selected"
:
""
;
echo
"<option value='
$hour
'
$selected
>"
.
str_pad
(
$hour
,
2
,
"0"
,
STR_PAD_LEFT
)
.
":00</option>"
;
}
?>
</select>
To
<input
size=
10
id=
'modto'
name=
'modto'
type=
'text'
value=
'
<?php
echo
date
(
"Y-m-d"
,
$logdateto
);
?>
'
/>
<select
id=
"modtimeto"
style=
"border:1px solid #efefef;"
>
<?php
foreach
(
range
(
0
,
23
)
as
$hour
)
{
$selected
=
(
$hour
==
$logtimeto
)
?
"selected"
:
""
;
echo
"<option value='
$hour
'
$selected
>"
.
str_pad
(
$hour
,
2
,
"0"
,
STR_PAD_LEFT
)
.
":00</option>"
;
}
?>
</select>
<input
type=
"button"
value=
'Submit'
class=
"btn btn-xs btn-info"
>
</div>
<div
style=
"clear:both"
></div>
<hr
style=
"margin:5px;"
>
<div
style=
"overflow: auto; margin-top: 10px;"
>
<table
id=
logtable
class=
'footable table table-striped table-bordered table-white table-primary footable-loaded'
style=
'font-size:12px; margin:0; border:1px solid #BBB;'
>
<thead>
<th>
Campaign
</th>
<th>
Dials
</th>
<th>
Connects
</th>
<th>
Contacts
</th>
<th>
Callbacks
</th>
<th>
Sales
</th>
<th>
No Answer
</th>
<th>
Busy
</th>
<th>
Sit Tones
</th>
<th>
Abandoned
</th>
<th>
Connect %
</th>
<th>
No Answer %
</th>
<th>
Busy %
</th>
<th>
Sit Tones %
</th>
<th>
Abandoned %
</th>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div
id=
dialoglog
></div>
</div>
<script>
$(document).ready(function() {
if(!$('#dialoglog').hasClass('ui-dialog-content'))
{
$('#dialoglog').dialog({
autoOpen: false,
width: '70%',
buttons: {
"Ok": function() {
$(this).dialog("close");
},
"Cancel": function() {
$(this).dialog("close");
}
}
});
}
waitKeyUpRun("filter",function() { filter2(document.getElementById('filter'), 'logTableData') },"2000");
$('#modfrom').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '
<?php
echo
(
date
(
'Y'
)
-
70
)
.
":"
.
(
date
(
'Y'
)
+
5
);
?>
'});
$('#modto').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '
<?php
echo
(
date
(
'Y'
)
-
70
)
.
":"
.
(
date
(
'Y'
)
+
5
);
?>
'});
});
function dataString()
{
return '
logdate
=
'+$("#modfrom").val()+'
&
logtime
=
'+$("#modtime").val()+'
&
logdateto
=
'+$("#modto").val()+'
&
logtimeto
=
'+$("#modtimeto").val()+'
&
campaign
=
'+$("#campaign").val();
}
function statusLogReloadFun(sortby)
{
var sortstr='';if(sortby!="")sortstr="&sort="+sortby
var searchStr = dataString();
doAjax('
dialer
/
campaignwise
?
'+searchStr+sortstr,'','
rightmainreportdiv
','
ajax_dialer_reports
','
singlethis
','
GET
');
}
function dlAgentlogXls()
{
var searchStr = dataString();
//window.open('
dialer
/
agenttime
?
dllogxls
=
1
&
'
+
searchStr
);
return
false
;
}
</script>
application/resources/views/layout/module/reports/liveusers.blade.php
View file @
fa27a3e
<style>
#logtable
.td
{
vertical-align
:
top
;}
#logtable
.tr
{
height
:
28px
;
overflow-y
:
hidden
;}
</style>
<div
class=
innerAll
>
<h4
style=
"float:left;width:50%;margin:10px 0;"
>
Monitor
</h4>
<h4
style=
"float:left;width:50%;margin:10px 0;"
>
Campaign
Monitor
</h4>
<div
style=
"float:right;width:50%"
>
</div>
<div
style=
"clear:both"
></div>
...
...
@@ -98,6 +98,8 @@
</div>
<script>
var
selectedCampaign
=
$
(
"#campaign"
).
val
();
console
.
log
(
selectedCampaign
);
function
dataString
()
{
return
'campaign='
+
$
(
"#campaign"
).
val
();
...
...
@@ -109,5 +111,5 @@ function statusLogReloadFun(sortby)
doAjax
(
'report/liveusers?'
+
searchStr
+
sortstr
,
''
,
'rightmainreportdiv'
,
'ajax_dialer_reports'
,
'singlethis'
,
'GET'
);
}
setTimeout
(
function
(){
statusLogReloadFun
(
""
)
},
10000
);
</script>
\ No newline at end of file
if
(
selectedCampaign
!=
"Select"
)
setTimeout
(
function
(){
statusLogReloadFun
(
""
)
},
10000
);
</script>
...
...
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