Show Users 'sales' on the realtime_report?

Discussions about new features or changes in existing features

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Show Users 'sales' on the realtime_report?

Postby Plat » Fri Oct 19, 2012 4:35 am

Topic pretty much says it all, im trying to get the users sales (total for the day for each agent) to show up on the realtime_report next to their name... any ideas?

I've been messing with AST_timeonVDADall.php ... and adding some code I used before for another project but im having zero luck...just wonder if there is an easier way. Seems like it would be simple?

-----
all it is...basically would be the code from AST_team_performance_detail.php where it shows sales per agent...i just dont know where the heck to put it inside of AST_timeonVDADall.php to make it work next to their name... i keep getting 0's
| VERSION: 2.6-395a | BUILD: 130221-1736 | Asterisk 1.4.44-vici | Clustered Servers (18) | Sangoma UT50 |
Plat
 
Posts: 36
Joined: Fri Aug 31, 2012 11:44 am
Location: Florida

Re: Show Users 'sales' on the realtime_report?

Postby williamconley » Mon Oct 22, 2012 6:57 pm

information on the real time report is pulled by every real time viewer generally every 4 seconds.

you do not want a query to check all call results for every agent for the entire day every 4 seconds. that would be ... cumbersome.

create a new table to store your data in and create a new record in the table for each agent and put a date in one of the fields. wipe it clean every morning (ie: when the date is yesterday, delete the record).

then each time a rep makes a sale, increment the record.

OR ... run a query every 15 minutes (5 minutes?) to populate the table to avoid overloading your cpu.

navigating the real time report, however, to add data ... is a bit of a challenge. it requires data collection and aggregation and then spilling it to the screen individually and then again in the totals section.

you may find it easier to simply create a new web page with this (and any other data on it ...) that refreshes every 5 minutes or so for a different display type. but if you must have it in the real time ... you'll have a bit of a challenge (and when the next version comes out ... you'll have to re-integrate it again ...). the database structure of Vicidial is fairly stable, but the admin/realtime/agent screens have a tendency to have changes with each release, even if minor.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Show Users 'sales' on the realtime_report?

Postby Plat » Sat Oct 27, 2012 1:32 am

williamconley wrote:information on the real time report is pulled by every real time viewer generally every 4 seconds.

you do not want a query to check all call results for every agent for the entire day every 4 seconds. that would be ... cumbersome.

create a new table to store your data in and create a new record in the table for each agent and put a date in one of the fields. wipe it clean every morning (ie: when the date is yesterday, delete the record).

then each time a rep makes a sale, increment the record.

OR ... run a query every 15 minutes (5 minutes?) to populate the table to avoid overloading your cpu.

navigating the real time report, however, to add data ... is a bit of a challenge. it requires data collection and aggregation and then spilling it to the screen individually and then again in the totals section.

you may find it easier to simply create a new web page with this (and any other data on it ...) that refreshes every 5 minutes or so for a different display type. but if you must have it in the real time ... you'll have a bit of a challenge (and when the next version comes out ... you'll have to re-integrate it again ...). the database structure of Vicidial is fairly stable, but the admin/realtime/agent screens have a tendency to have changes with each release, even if minor.


very true that would be stressful on the server... but it would be possible no? ... ive tried so many different ways of just even getting to the point of pulling the sales by editing that code but i still get 0's i dont understand arg :/ ...
| VERSION: 2.6-395a | BUILD: 130221-1736 | Asterisk 1.4.44-vici | Clustered Servers (18) | Sangoma UT50 |
Plat
 
Posts: 36
Joined: Fri Aug 31, 2012 11:44 am
Location: Florida

Re: Show Users 'sales' on the realtime_report?

Postby williamconley » Sat Oct 27, 2012 2:26 pm

you can place a sales total for the day by using status categories, but that won't be "per agent"
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Per Users Sales for today

Postby dhru10 » Wed Jun 04, 2014 2:47 am

we can get per user sales for current date by this code....

$date=date('Y-m-d');
$min_time="00:00:00";
$max_time="23:59:59";
$min_date_and_time = $date. ' ' .$min_time;
$max_date_and_time = $date. ' ' .$max_time;

$stmt="select count(*) as total_sale from vicidial_agent_log, vicidial_list where event_time>='$min_date_and_time' and event_time<='$max_date_and_time' and campaign_id IN('$campaign_id') and vicidial_agent_log.user=$live_agent_id and vicidial_agent_log.status in (select status from vicidial_campaign_statuses where sale='Y' and campaign_id IN('$campaign_id') UNION select status from vicidial_statuses where sale='Y') and vicidial_agent_log.lead_id=vicidial_list.lead_id;";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$agent_sales=$row[0];

we can try this.
dhru10
 
Posts: 9
Joined: Thu May 29, 2014 7:09 am

Re: Show Users 'sales' on the realtime_report?

Postby williamconley » Tue Jun 10, 2014 2:06 am

Beware hefty logs over time with union selects. You may want to keep an eye on that code and how often it runs to avoid slamming your server as the logs grow.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)


Return to Features

Who is online

Users browsing this forum: No registered users and 49 guests