c5a7b341 by Manish Mihsra

Working on Report

1 parent c47d5151
Showing 36 changed files with 2575 additions and 248 deletions
<?php
Route::get('/', array('uses'=> 'HomeController@index', 'as'=>'index.root'));
Route::get('index', array('uses'=> 'HomeController@index', 'as'=>'index.index'));
Route::get('test_table_8', 'Rom8Controller@testTable');
Route::get('eg', 'egController@eg');
Route::group(['middleware' => ['web']], function () {
Route::get('home', array('uses' => 'HomeController@home', 'as'=>'home.home'));
Route::get('login', array('uses'=> 'HomeController@login', 'as'=>'home.login'));
Route::post('login', array('uses'=> 'HomeController@do_login', 'as'=>'home.do_login'));
Route::get('logout', array('uses'=> 'HomeController@logout', 'as'=>'home.logout'));
Route::get('signup', array('uses'=> 'HomeController@signup', 'as'=>'home.signup'));
Route::post('signup', array('uses'=> 'HomeController@do_signup', 'as'=>'home.do_signup'));
Route::get('userfiles/{path}',array('uses'=>'HomeController@userfiles','as'=>'userfiles.get'))->where('path', '.*');
Route::get('unsubscribe', array('uses'=> 'HomeController@unsubscribe', 'as'=>'home.unsubscribe'));
Route::any('forgotpassword', array('uses'=> 'HomeController@forgotpassword', 'as'=>'signup.forgotpassword'));
Route::get('profile', array('before' => 'auth','uses' => 'HomeController@profile', 'as'=>'profile.index'));
Route::post('profile', array('before' => 'auth','uses' => 'HomeController@do_profile', 'as'=>'profile.update'));
Route::get('msie', array('uses'=> 'HomeController@msie', 'as'=>'login.msie'));
Route::any('ajaxerror', array('uses'=> 'HomeController@ajaxerror', 'as'=>'home.ajaxerror'));
Route::any('gettoken', array('uses'=> 'HomeController@gettoken', 'as'=>'home.gettoken'));
Route::any('idleapp', array('uses'=> 'HomeController@idleapp', 'as'=>'home.idleapp'));
Route::any('fileupload', array('uses'=> 'HomeController@fileupload', 'as'=>'upload.file'));
Route::get('cron', array('uses'=> 'HomeController@cron', 'as'=>'cron.cron'));
Route::get('style', array('uses'=> 'HomeController@style', 'as'=>'style.index'));
Route::get('jshead', array('uses'=> 'HomeController@jshead', 'as'=>'jshead.index'));
Route::get('jsbody', array('uses'=> 'HomeController@jsbody', 'as'=>'jsbody.index'));
Route::resource('dashboard','DashboardController');
Route::resource('notification','NotificationController');
Route::resource('message','MessageController');
Route::resource('task','TaskController');
Route::resource('user','UserController');
Route::resource('group','GroupController');
Route::resource('role','RoleController');
Route::resource('dispositionPlan','DispositionPlanController');
Route::resource('master','MasterController');
Route::resource('admin','AdminController');
Route::resource('record','RecordController');
Route::resource('campaign','CampaignController');
Route::resource('dialer','DialerController');
Route::resource('hr','HRController');
Route::resource('social','SocialController');
Route::resource('web','WebController');
Route::get('notes', array('uses' => 'NotesController@loadQuestions', 'as'=>'questionare.load_questions'));
Route::post('notes',array('uses' => 'NotesController@store', 'as'=>'notes.store'));
Route::get('questionare/{qid?}/{optid?}/{level?}', array('uses' => 'QuestionareController@loadQuestions', 'as'=>'questionare.load_questions'));
Route::post('questionare', array('uses' => 'QuestionareController@saveQuestionAire', 'as'=>'questionare.save'));
//Route::get('notes', array('uses' => 'NotesController@index', 'as'=>'notes.index'));
//Route::resource('notesupdate','NotesController');
Route::get('exceldownload', function()
{
return view("layout.module.userupload.exceldata");
});
Route::post('useruploaddata', array('uses' => 'UserController@userUpload', 'as'=>'useruploaddata'));
//Supervisor Call Mangement - By Manish on 16-02-17
Route::get('SupervisorModule', array('uses'=> 'RecordController@supervisorUpload', 'as'=>'upload.comments'));
//Supervisor Call Mangement - By Manish on 22-03-17
Route::post('complaint', array('uses'=> 'ComplaintController@saveComplaint', 'as'=>'upload.complaint'));
Route::post('resclassUnit', array('uses'=> 'ComplaintController@getBranchName', 'as'=>'get.branchname'));
Route::post('childcase', array('uses'=> 'ComplaintController@saveChildCase', 'as'=>'upload.case'));
//Supervisor Message Announcement - By Manish on 12-04-17
Route::get('category/{resClassUnit}', array('uses'=> 'ComplaintController@getCat', 'as'=>'get.cat'));
Route::get('subcategory/{catId}/{resClassUnit}', array('uses'=> 'ComplaintController@getSubCat', 'as'=>'get.subcat'));
Route::post('SupervisorMessage', array('uses'=> 'MessageController@sendSupVisorMessage', 'as'=>'send.message'));
Route::get('supmessage/{msg_id?}/{username?}', array('uses'=> 'MessageController@viewSupVisorMessage', 'as'=>'view.allmessage'));
Route::get('viewmessage/{msg_id?}/{username?}', array('uses'=> 'MessageController@viewMessage', 'as'=>'view.message'));
//Addition of Customer Racing
Route::post('custrace', array('uses'=> 'RacingCustomerController@saveRacingCustomer', 'as'=>'upload.raccust'));
//Addition of Lead Entry Form
Route::post('leadentryform', array('uses'=> 'LeadEntryFormController@saveLeadEntryFormDetails', 'as'=>'upload.rleadform'));
Route::post('oaentryform', array('uses'=> 'OneAssistController@saveOneAssistFormDetails', 'as'=>'upload.oaleadform'));
Route::post('racingcustupdate',array('uses'=> 'RacingCustomerController@updateracingcust', 'as'=>'upload.updateraccust'));
Route::get('dialmode', array('uses'=> 'DialModeController@dialmodeview', 'as'=>'view.module'));
Route::post('dialmodeassign', array('uses'=> 'DialModeController@dialmodeassign', 'as'=>'assign.dialmodes'));
///for the rlp pbwise
Route::get('rlp', array('uses'=> 'RecordController@rlpPbwise', 'as'=>'rlppb.comments'));
});
......@@ -1547,42 +1547,7 @@ print_r($supervisorUsers);
$data['count'] = $count;
return view("layout.module.dialer.appointment",$data);
}
if($id=="reports")
{
return view("layout.module.dialer.reports",array());
}
if($id=="campaigns")
{
return view("layout.module.dialer.campaigns",array());
}
if($id=="calllog")
{
return view("layout.module.dialer.calllog",array());
}
if($id=="agentreport")
{
return view("layout.module.dialer.agentreport",array());
}
if($id=="campreport")
{
return view("layout.module.dialer.campreport",array());
}
if($id=="statusreport")
{
return view("layout.module.dialer.statusreport",array());
}
if($id=="questionnaire")
{
return view("layout.module.dialer.questairereport",array());
}
if($id=="callmanagement")
{
return view("layout.module.dialer.callmanagementreport",array());
}
if($id=="supmessages")
{
return view("layout.module.dialer.supmessagesreport",array());
}
if($id=='playrecfile')
{
......@@ -1613,18 +1578,6 @@ print_r($supervisorUsers);
}
return;
}
if($id=="liveusers")
{
return view("layout.module.dialer.liveusers",array());
}
if($id=="recarchive")
{
return view("layout.module.dialer.recarchive",array());
}
if($id=="recqc")
{
return view("layout.module.dialer.recqc",array());
}
//relationship area dropdown option fetched code. code by Yashwant Sir
if($id=="relationship")
{
......
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Auth;
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\UserLog;
use App\Models\Kqueue;
use DB;
use Log;
use Session;
class ReportController extends Controller
{
public function __construct()
{
$this->middleware('auth');
$this->middleware('module_access');
}
public function show($id)
{
if($id=="reports")
{
return view("layout.module.reports.reports",array());
}
if($id=="campaigns")
{
return view("layout.module.reports.campaigns",array());
}
if($id=="calllog")
{
return view("layout.module.reports.calllog",array());
}
if($id=="agentreport")
{
return view("layout.module.reports.agentreport",array());
}
if($id=="campreport")
{
return view("layout.module.reports.campreport",array());
}
if($id=="statusreport")
{
return view("layout.module.reports.statusreport",array());
}
if($id=="questionnaire")
{
return view("layout.module.reports.questairereport",array());
}
if($id=="callmanagement")
{
return view("layout.module.reports.callmanagementreport",array());
}
if($id=="supmessages")
{
return view("layout.module.reports.supmessagesreport",array());
}
if($id=="liveusers")
{
return view("layout.module.reports.liveusers",array());
}
if($id=="recarchive")
{
return view("layout.module.reports.recarchive",array());
}
if($id=="recqc")
{
return view("layout.module.reports.recqc",array());
}
}
}
<?php
Route::get('/', array('uses'=> 'HomeController@index', 'as'=>'index.root'));
Route::get('index', array('uses'=> 'HomeController@index', 'as'=>'index.index'));
Route::get('test_table_8', 'Rom8Controller@testTable');
Route::get('eg', 'egController@eg');
Route::group(['middleware' => ['web']], function () {
Route::get('home', array('uses' => 'HomeController@home', 'as'=>'home.home'));
Route::get('login', array('uses'=> 'HomeController@login', 'as'=>'home.login'));
Route::post('login', array('uses'=> 'HomeController@do_login', 'as'=>'home.do_login'));
Route::get('logout', array('uses'=> 'HomeController@logout', 'as'=>'home.logout'));
Route::get('signup', array('uses'=> 'HomeController@signup', 'as'=>'home.signup'));
Route::post('signup', array('uses'=> 'HomeController@do_signup', 'as'=>'home.do_signup'));
Route::get('userfiles/{path}',array('uses'=>'HomeController@userfiles','as'=>'userfiles.get'))->where('path', '.*');
Route::get('unsubscribe', array('uses'=> 'HomeController@unsubscribe', 'as'=>'home.unsubscribe'));
Route::any('forgotpassword', array('uses'=> 'HomeController@forgotpassword', 'as'=>'signup.forgotpassword'));
Route::get('profile', array('before' => 'auth','uses' => 'HomeController@profile', 'as'=>'profile.index'));
Route::post('profile', array('before' => 'auth','uses' => 'HomeController@do_profile', 'as'=>'profile.update'));
Route::get('msie', array('uses'=> 'HomeController@msie', 'as'=>'login.msie'));
Route::any('ajaxerror', array('uses'=> 'HomeController@ajaxerror', 'as'=>'home.ajaxerror'));
Route::any('gettoken', array('uses'=> 'HomeController@gettoken', 'as'=>'home.gettoken'));
Route::any('idleapp', array('uses'=> 'HomeController@idleapp', 'as'=>'home.idleapp'));
Route::any('fileupload', array('uses'=> 'HomeController@fileupload', 'as'=>'upload.file'));
Route::get('cron', array('uses'=> 'HomeController@cron', 'as'=>'cron.cron'));
Route::get('style', array('uses'=> 'HomeController@style', 'as'=>'style.index'));
Route::get('jshead', array('uses'=> 'HomeController@jshead', 'as'=>'jshead.index'));
Route::get('jsbody', array('uses'=> 'HomeController@jsbody', 'as'=>'jsbody.index'));
Route::resource('dashboard','DashboardController');
Route::resource('notification','NotificationController');
Route::resource('message','MessageController');
Route::resource('task','TaskController');
Route::resource('user','UserController');
Route::resource('group','GroupController');
Route::resource('role','RoleController');
Route::resource('master','MasterController');
Route::resource('admin','AdminController');
Route::resource('record','RecordController');
Route::resource('campaign','CampaignController');
Route::resource('dialer','DialerController');
Route::resource('hr','HRController');
Route::resource('social','SocialController');
Route::resource('web','WebController');
Route::get('notes', array('uses' => 'NotesController@loadQuestions', 'as'=>'questionare.load_questions'));
Route::post('notes',array('uses' => 'NotesController@store', 'as'=>'notes.store'));
Route::get('questionare/{qid?}/{optid?}/{level?}', array('uses' => 'QuestionareController@loadQuestions', 'as'=>'questionare.load_questions'));
Route::post('questionare', array('uses' => 'QuestionareController@saveQuestionAire', 'as'=>'questionare.save'));
//Route::get('notes', array('uses' => 'NotesController@index', 'as'=>'notes.index'));
//Route::resource('notesupdate','NotesController');
Route::get('exceldownload', function()
{
return view("layout.module.userupload.exceldata");
});
Route::post('useruploaddata', array('uses' => 'UserController@userUpload', 'as'=>'useruploaddata'));
//Supervisor Call Mangement - By Manish on 16-02-17
Route::get('SupervisorModule', array('uses'=> 'RecordController@supervisorUpload', 'as'=>'upload.comments'));
//Supervisor Call Mangement - By Manish on 22-03-17
Route::post('complaint', array('uses'=> 'ComplaintController@saveComplaint', 'as'=>'upload.complaint'));
Route::post('resclassUnit', array('uses'=> 'ComplaintController@getBranchName', 'as'=>'get.branchname'));
Route::post('childcase', array('uses'=> 'ComplaintController@saveChildCase', 'as'=>'upload.case'));
//Supervisor Message Announcement - By Manish on 12-04-17
Route::get('category/{resClassUnit}', array('uses'=> 'ComplaintController@getCat', 'as'=>'get.cat'));
Route::get('subcategory/{catId}/{resClassUnit}', array('uses'=> 'ComplaintController@getSubCat', 'as'=>'get.subcat'));
Route::post('SupervisorMessage', array('uses'=> 'MessageController@sendSupVisorMessage', 'as'=>'send.message'));
Route::get('supmessage/{msg_id?}/{username?}', array('uses'=> 'MessageController@viewSupVisorMessage', 'as'=>'view.allmessage'));
Route::get('viewmessage/{msg_id?}/{username?}', array('uses'=> 'MessageController@viewMessage', 'as'=>'view.message'));
//Addition of Customer Racing
Route::post('custrace', array('uses'=> 'RacingCustomerController@saveRacingCustomer', 'as'=>'upload.raccust'));
//Addition of Lead Entry Form
Route::post('leadentryform', array('uses'=> 'LeadEntryFormController@saveLeadEntryFormDetails', 'as'=>'upload.rleadform'));
Route::post('oaentryform', array('uses'=> 'OneAssistController@saveOneAssistFormDetails', 'as'=>'upload.oaleadform'));
Route::post('racingcustupdate',array('uses'=> 'RacingCustomerController@updateracingcust', 'as'=>'upload.updateraccust'));
Route::get('dialmode', array('uses'=> 'DialModeController@dialmodeview', 'as'=>'view.module'));
Route::post('dialmodeassign', array('uses'=> 'DialModeController@dialmodeassign', 'as'=>'assign.dialmodes'));
///for the rlp pbwise
Route::get('rlp', array('uses'=> 'RecordController@rlpPbwise', 'as'=>'rlppb.comments'));
});
......@@ -53,6 +53,7 @@ Route::group(['middleware' => ['web']], function () {
Route::resource('hr','HRController');
Route::resource('social','SocialController');
Route::resource('web','WebController');
Route::resource('report','ReportController');
Route::get('notes', array('uses' => 'NotesController@loadQuestions', 'as'=>'questionare.load_questions'));
Route::post('notes',array('uses' => 'NotesController@store', 'as'=>'notes.store'));
......
......@@ -98,7 +98,7 @@ return [
"Task" => ["disp"=>"Tasks","icon"=>"edit","dash"=>"","onclick"=>"showBlock('Workflow');"],
"Dialer" => ["disp"=>"Dialer","icon"=>"phone","dash"=>"Dialer",
"submenu"=>["Dialer"=>["kDialerModel();"],
"Reports"=>["menuAction('dialer/reports');"],
"Reports"=>["menuAction('report/reports');"],
]],
"DialerCampaign" => ["disp"=>"Dialer","icon"=>"phone","dash"=>"",
"submenu"=>[
......@@ -129,6 +129,7 @@ return [
"Record" => ["disp"=>"Record","icon"=>"file","dash"=>"","onclick"=>""],
"User" => ["disp"=>"User","icon"=>"home","dash"=>"","onclick"=>""],
"Role" => ["disp"=>"Role","icon"=>"home","dash"=>"","onclick"=>""],
"Report" => ["disp"=>"Report","icon"=>"home","dash"=>"","onclick"=>""],
"DialMode" => ["disp"=>"DialMode","icon"=>"home","dash"=>"","onclick"=>""],
"SupervisorModule" => ["disp"=>"SupervisorModule","icon"=>"globe","dash"=>"","onclick"=>"menuAction('SupervisorModule');"],
"Notes" => ["disp"=>"Notes","icon"=>"globe","dash"=>"","onclick"=>"menuAction('notes');"],
......
<?php
use App\Models\CRMCall;
use App\Models\Dialline;
use App\Models\Sipid;
use App\Models\User;
use App\Models\UserLog;
use App\Models\Kqueue;
use App\Jobs\KHRMSLib;
$selectedvals=explode(":",Input::get("selectedvals",":::::"));
$hdfcnodes=array();
$offline=array();
$arr=Config::get("app.hdfcnodes");
foreach($arr as $server=>$arrline)
{
$tvals=explode(":",$arrline);
if($selectedvals[0]=="")$hdfcnodes[]=$server;
else if($selectedvals[0]==$tvals[0])
{
if($selectedvals[1]=="")$hdfcnodes[]=$server;
else if($selectedvals[1]==$tvals[1])
{
if($selectedvals[2]=="")$hdfcnodes[]=$server;
else if($selectedvals[2]==$tvals[2])
{
if($selectedvals[3]=="")$hdfcnodes[]=$server;
else if($selectedvals[3]==$tvals[3])
{
if($selectedvals[4]=="")$hdfcnodes[]=$server;
else if($selectedvals[4]==$tvals[4])
{
$hdfcnodes[]=$server;
}
}
}
}
}
}
$wakka = new KHRMSLib();
$dashboarduser=Auth::user();
$nowts=time();
$chart=array('ts'=>date('H:i:s',time()-($dashboarduser->timezone*60)),'Online'=>0,'NoCall'=>0,'InCall'=>0,'CallWait'=>0,'CmdList'=>0);
$alist=array();
$sipidsfound=array();
$userarr=array();$i=1;
$reporthead=array("#","ID","User","Campaign","Station","Status","CRMId","Number","Type","State","Duration");
$reportarray=array();
foreach($hdfcnodes as $ci=>$server)
{
$conn = array(
'driver' => 'mysql',
'host' => $server,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'options' => array(
PDO::ATTR_TIMEOUT => 5,
),
);
Config::set("database.connections.conn$ci", $conn);
try
{
DB::connection("conn$ci")->getDatabaseName();
$allusers=User::on("conn$ci")->where("status","=","Active")->get();
foreach($allusers as $tuser)$uidlist[]=$tuser->id;
$newcalls=Dialline::on("conn$ci")->where('status','!=','Free')->where('conf','=','')->orderBy('updated_at')->get();
$acalls=Dialline::on("conn$ci")->where('status','!=','Free')->where('conf','!=','')->orderBy('updated_at')->get();
$sipids=Sipid::on("conn$ci")->whereIn("user",$uidlist)->where("status","=","1")->get();
foreach($newcalls as $newcall)
{
$tcall=CRMCall::on("conn$ci")->where('dialline_id','=',$newcall->id)->orderBy('id','DESC')->first();
$un="";$uid="";$us="";
if($tcall->user_id>0)
{
$tuser=User::on("conn$ci")->find($tcall->user_id);
$un=$tuser->username;
$uid=userchatbox($tuser).$tuser->id;
$userlog=UserLog::on("conn$ci")->where('user_id','=',$tuser->id)->orderBy("id","DESC")->first();
$stend=$userlog->getLastStatus();
$us="$stend[0]-$stend[1]";
$chart['Online']++;
$chart['InCall']++;
}
else $chart['CallWait']++;
$obj=array();
$obj["#"]=$i++;
$obj["ID"]=$uid;
$obj["User"]=$un;
$obj["Campaign"]=$tcall->client;
$obj["Station"]=$tcall->sipid_id.userSpyStr($tcall->sipid_id);
$obj["Status"]=$us;
$obj["CRMId"]=$tcall->crm_id;
$obj["Number"]=$tcall->number;
$obj["Type"]=$tcall->type;
$obj["State"]=$tcall->state;
$obj["Duration"]=$nowts-strtotime($tcall->created_at);
$reportarray[$newcall->id]=$obj;
if(!empty($tcall->sipid_id))$sipidsfound[]=$tcall->sipid_id;
}
foreach($acalls as $acall)
{
$tcall=CRMCall::on("conn$ci")->where('dialline_id','=',$acall->id)->orderBy('id','DESC')->first();
$tsipid=substr($acall->conf,4);
$tsip=Sipid::on("conn$ci")->find($tsipid);
$clidata=json_decode($tsip->clients,true);
$tuser=User::on("conn$ci")->find($tsip->user);
$userlog=UserLog::on("conn$ci")->where('user_id','=',$tuser->id)->orderBy("id","DESC")->first();
$stend=$userlog->getLastStatus();
$obj=array();
$obj["#"]=$i++;
$obj["ID"]=userchatbox($tuser).$tsip->user;
$obj["User"]=$tuser->username;
$obj["Campaign"]=substr($clidata['r'],0,20);
$obj["Station"]=$tsip->id.userSpyStr($tsip->id);
$obj["Status"]="$stend[0]-$stend[1]";
$obj["CRMId"]=$tcall->crm_id;
$obj["Number"]=$tcall->number;
$obj["Type"]=$tcall->type;
$obj["State"]=$tcall->state;
$obj["Duration"]=$nowts-strtotime($tcall->created_at);
$reportarray[$acall->id]=$obj;
$sipidsfound[]=$tsipid;
$chart['Online']++;
$chart['InCall']++;
}
foreach($sipids as $sipid)
{
if(!in_array($sipid->id,$sipidsfound))
{
$clidata=json_decode($sipid->clients,true);
$tuser=User::on("conn$ci")->find($sipid->user);
$userlog=UserLog::on("conn$ci")->where('user_id','=',$tuser->id)->orderBy("id","DESC")->first();
$stend=$userlog->getLastStatus();
$obj=array();
$obj["#"]=$i++;
$obj["ID"]=userchatbox($tuser).$sipid->user;
$obj["User"]=$tuser->username;
$obj["Campaign"]=substr($clidata['r'],0,20);
$obj["Station"]=$sipid->id.userSpyStr($sipid->id);
$obj["Status"]="$stend[0]-$stend[1]";
$obj["CRMId"]="";
$obj["Number"]="";
$obj["Type"]="";
$obj["State"]="";
$obj["Duration"]="";
$reportarray[]=$obj;
$chart['Online']++;
$chart['NoCall']++;
}
}
$chart['CmdList']=-1*Kqueue::on("conn$ci")->count();
}catch(Exception $e)
{
$offline[]=$server;
}
}
if(Input::get('chartvals')==1)
{
echo json_encode($chart);
return;
}
$highestColumn = sizeof($reporthead);
$outhead="<tr>";$outstr="";
for ($head = 0; $head < $highestColumn; $head++){
$outhead.="<td>".$reporthead[$head]."</td>";
}
$outhead.="</tr>";
foreach($reportarray as $uid=>$uarr)
{
$outstr.="<tr>";
for ($head = 0; $head < $highestColumn; $head++){
$outstr.="<td>".$uarr[$reporthead[$head]]."</td>";
}
$outstr.="</tr>";
}
function userchatbox($tuser)
{
}
function userSpyStr($sipid)
{
}
//charts
?>
<div class=innerAll>
<style>#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}</style>
<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");
}
}
});
}
});
</script>
<div style="float:left;width:50%">
<h5>Dialer : Live</h5>
</div>
<div style="float:left;width:50%">
<button class="pull-right btn btn-sm btn-default" onclick='liveLogReloadFun(10);return false;' title='Reload' style='margin-top:-8px'><i class='fa fa-refresh'></i> Reload</button>
</div>
<div style="clear:both"></div>
<hr>
<div class=col-md-12>
<div id=liveuserlogschart1{!!$nowts!!} style='min-height:300px;width:100%'></div>
<script>
var livechart001='';
$(function () {
livechart001=$('#liveuserlogschart1{!!$nowts!!}').highcharts({
title: {
text: '',
x: -20 //center
},
subtitle: {
text: '',
x: -20
},
xAxis: {
categories: [<?php $ccc=array();for($c=60;$c>0;$c--){echo "'",date('H:i:s',time()-($c*10)-($dashboarduser->timezone*60))."',";$ccc[]="0";}$ccc="[".implode(",",$ccc)."]"; ?>],
labels:{
enabled:false//default is true
},
},
yAxis: {
title: {
text: ''
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
valueSuffix: ''
},
legend: {
},
series: [{
name: 'Online',
data: {!!Input::get('Online',$ccc)!!}
}, {
name: 'NoCall',
data: {!!Input::get('NoCall',$ccc)!!}
}, {
name: 'InCall',
data: {!!Input::get('InCall',$ccc)!!}
}, {
name: 'CallWait',
data: {!!Input::get('CallWait',$ccc)!!}
}, {
name: 'CmdList',visible: false,
data: {!!Input::get('CmdList',$ccc)!!}
}]
});
});
function liveLogReloadFun(delay)
{
var tchart=livechart001.highcharts();
var sdata='';
sdata+='&Online='+JSON.stringify(tchart.series[0].yData);
sdata+='&NoCall='+JSON.stringify(tchart.series[1].yData);
sdata+='&InCall='+JSON.stringify(tchart.series[2].yData);
sdata+='&CallWait='+JSON.stringify(tchart.series[3].yData);
sdata+='&CmdList='+JSON.stringify(tchart.series[4].yData);
setTimeout(function(){
if($("#liveuserlogschart1{!!$nowts!!}").length)
doAjax('dialer/aliveusers',sdata+'&selectedvals='+getarvalval(),'rightmainreportdiv','ajax_dialer_reports','singlethis','GET');
},delay);
}
function liveLogReloadChartFun(delay)
{
setTimeout(function(){
if($("#liveuserlogschart1{!!$nowts!!}").length)
doAjax('dialer/aliveusers','chartvals=1'+'&selectedvals='+getarvalval(),'__FD__','ajax_dialer_reports','singlethis','GET',function(res)
{
var resobj=JSON.parse(res.responseText);
var tchart=livechart001.highcharts();
var shift = tchart.series[0].data.length > 60;
// add the point
tchart.series[0].addPoint([resobj['ts'],resobj['Online']], true, shift);
tchart.series[1].addPoint([resobj['ts'],resobj['NoCall']], true, shift);
tchart.series[2].addPoint([resobj['ts'],resobj['InCall']], true, shift);
tchart.series[3].addPoint([resobj['ts'],resobj['CallWait']],true,shift);
tchart.series[4].addPoint([resobj['ts'],resobj['CmdList']],true,shift);
// call it again after one second
setTimeout(liveLogReloadChartFun, 5000);
});
},delay);
}
liveLogReloadChartFun(10);
</script>
</div>
<div style='clear:both'></div>
<div style='clear:both'></div>
<div style='overflow:auto'>
<table id=logtable class='footable table table-striped table-bordered table-white table-primary footable-loaded' style='font-size:12px'>
<thead>
<?php echo $outhead; ?>
</thead>
<?php echo $outstr; ?>
</table>
</div>
<div id=dialoglog></div>
</div>
<!--
<?php
//if($dashboarduser->moduleACL("Admin",false,false,true))print_r(Config::get('app.sqllog'));
foreach($arr as $server=>$arrline)
{
if(in_array($server,$hdfcnodes))echo "$server => $arrline\n";
}
?>
-->
<?php
$dashboarduser=Auth::user();
$timeoffset=$dashboarduser->timezone*60;
?>
<div class="container-fluid">
<div class="layout-app">
<div class="row">
<div class="col-md-12">
<div class="col-separator col-separator-first col-unscrollable box">
<div class="innerAll">
<div>
<h4 id='tcampaign_select' value=<?php if(!empty($client)) echo $client; ?>>Appointment <?php if(!empty($client)) echo ": ".$client; ?></h4></div>
<hr style="margin-bottom: 10px;" />
<table class='table'
<thead>
<tr>
<th></th>
<th></th>
<?php if(empty($client)) echo "<th>Campaign</th>" ?>
<th>Cust_ID</th>
<th>Name</th>
<th>Number</th>
<!-- <th>Type</th>-->
<th>LastCall</th>
<!-- <th>Disposition</th> --->
<th>Appointment Date</th>
<!--- <th>Status</th> --->
<!-- <th>Count</th> -->
<!--<th></th>-->
<!-- <th>DID</th> -->
</tr>
</thead>
<tbody>
<?php
if($count > 0){
foreach ($appointment as $key => $value) { //echo "<pre>";print_r($value);exit;?>
<tr>
<td></td>
<td></td>
<?php if(empty($client)) echo "<td>$value->client</td>" ?>
<td><?php echo $value->cust_id; ?></td>
<td><?php echo $value->customer_name; ?></td>
<td><a href=# class='' onclick='dialerQuickOpen("<?php echo $value->id; ?>","<?php echo $value->mobile; ?>","Manual","",0);return false;'><?php echo $value->mobile; ?></a></td>
<td><?php echo date("Y-m-d H:i:s",strtotime($value->dialer_lastcall)-$timeoffset); ?></td>
<!--<td><?php //echo $value->dialer_status; ?></td>-->
<td><?php echo date("Y-m-d H:i:s",strtotime($value->dialer_appointment)-$timeoffset); ?></td>
<!--<td><?php //echo $value->status; ?></td>-->
</tr>
<?php }
}else{ ?>
<td colspan="9" align="center">No Record Available</td>
<?php } ?>
</table>
<div id="campaignDetailsArea"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="layout-app"><!-- row-app -->
<div class="row row-app">
<!-- col -->
<div class="col-md-2 col-sm-3">
<!-- col-separator -->
<div class="col-separator col-separator-first box col-unscrollable">
<!-- col-table -->
<div class="col-table" style='padding-left: 13px;padding-right: 13px;'>
<h4 class="innerAll margin-none border-bottom" style='background: #fff;'>Dialer Reports</h4>
<!-- col-table-row -->
<div class="col-table-row">
<!-- col-app -->
<div class="col-app col-unscrollable">
<!-- col-app -->
<div class="col-app">
<ul class="list-group list-group-1 margin-none borders-none" style='padding-right: 26px;'>
<li class="list-group-item">
<a href="#" onclick="areportsFun('aliveusers');return false"><i class="fa fa-circle-o"></i> Live</a>
</li>
<li class="list-group-item">
<a href="#" onclick="areportsFun('acalllog');return false"><i class="fa fa-circle-o"></i> Call</a>
</li>
<li class="list-group-item">
<a href="#" onclick="areportsFun('aagentreport');return false"><i class="fa fa-circle-o"></i> Login</a>
</li>
<li class="list-group-item">
<a href="#" onclick="areportsFun('acampreport');return false"><i class="fa fa-circle-o"></i> Time</a>
</li>
<li class="list-group-item">
<a href="#" onclick="areportsFun('astatusreport');return false"><i class="fa fa-circle-o"></i> Status</a>
</li>
<li class="list-group-item"></li>
<div class="col-separator-h"></div>
<h5 class="innerAll margin-none border-bottom" style='background: #fff;'>Filters</h5>
<li class="list-group-item">
<select class=form-control id=arval0 onchange='arvalChange(0);'><option value=''></option><option value='COP'>COP</option><option value='Prime'>Prime</option></select>
<select class=form-control id=arval1 onchange='arvalChange(1);'><option value=''></option></select>
<select class=form-control id=arval2 onchange='arvalChange(2);'><option value=''></option></select>
<select class=form-control id=arval3 onchange='arvalChange(3);'><option value=''></option></select>
<select class=form-control id=arval4 onchange='arvalChange(4);'><option value=''></option></select>
</li>
</ul>
</div>
<!-- // END col-app -->
</div>
<!-- // END col-app -->
</div>
<!-- // END col-table-row -->
</div>
<!-- // END col-table -->
</div>
<!-- // END col-separator.box -->
</div>
<!-- // END col -->
<!-- col -->
<div class="col-md-10 col-sm-9" style='border-right:13px solid #eaeaea'>
<!-- col-separator.box -->
<div class="col-separator col-unscrollable box">
<!-- col-table -->
<div class="col-table">
<!-- <h4 class="innerAll margin-none border-bottom">My Sessions</h4> -->
<!-- col-table-row -->
<div class="col-table-row" style='background: #fff;'>
<!-- col-app -->
<div class="col-app col-unscrollable">
<!-- col-app -->
<div class="col-app" style='position:relative'>
<div class="" id=rightmainreportdiv>
</div>
</div>
<!-- // END col-app -->
</div>
<!-- // END col-app.col-unscrollable -->
</div>
<!-- // END col-table-row -->
</div>
<!-- // END col-table -->
</div>
<!-- // END col-separator.box -->
</div>
<!-- // END col -->
</div>
<!-- // END row-app -->
</div>
<script>
function areportsFun(report)
{
doAjax('dialer/'+report,'selectedvals='+getarvalval(),'rightmainreportdiv','ajax_dialer_reports','singlethis','GET');
}
var arvalvalue="::::::";
function arvalChange(x)
{
<?php echo "var arr=JSON.parse('".json_encode(Config::get("app.hdfcnodes"))."');"; ?>
var selectopts=[''];
for(i=4;i>x;i--)updateJSSelect("arval"+i,selectopts);
for (var server in arr)
{
tvals=arr[server].split(":");
if($("#arval"+x).val()==tvals[x])if(jQuery.inArray(tvals[x+1], selectopts)<0)selectopts[selectopts.length]=tvals[x+1];
}
x++;updateJSSelect("arval"+x,selectopts);
}
function getarvalval()
{
arvalvalue="";for(i=0;i<5;i++)arvalvalue+=$("#arval"+i).val()+':';
return arvalvalue;
}
</script>
<?php
use App\Models\CRMCall;
use App\Models\User;
use App\Jobs\KHRMSLib;
use App\Models\SupervisonComments;
$wakka = new KHRMSLib();
$dashboarduser=Auth::user();
if(isset($_GET['logdate']))$logdate=strtotime($_GET['logdate']." 00:00:00");
else $logdate=strtotime(date('Y-m-d')." 00:00:00");
if(isset($_GET['logtodate']))$logtodate=strtotime($_GET['logtodate']." 23:59:59");
else $logtodate=strtotime(date('Y-m-d')." 23:59:59");
$userarr=array();$i=1;
$reporthead=array("id","created_at","updated_at","clientcode","supvisor_id","supvisor_recommends","agent","agent_comments");
$reportarray=DB::table('supervisor_comments')->select('*')->where('updated_at','>=',date("Y-m-d H:i:s",$logdate))->where('updated_at','<=',date("Y-m-d H:i:s",$logtodate))->get();
if(Input::has("dllogxls"))
{
include_once(app_path().'/lib/phpexcel/PHPExcel.php');
$inputFileType = "Excel5";
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel = $objReader->load("assets/extras/blank.xls");
$baseRow = 2;
$highestColumn = sizeof($reporthead);
for ($head = 0; $head < $highestColumn; $head++){
$colstr=PHPExcel_Cell::stringFromColumnIndex($head);
$objPHPExcel->getActiveSheet()->setCellValue($colstr."1", $reporthead[$head]);
}
foreach($reportarray as $uid=>$uarr)
{
$row = $baseRow++;
$col = 0;
for ($head = 0; $head < $highestColumn; $head++){
if($reporthead[$head]=="created_at")
$uarr->$reporthead[$head]=date("Y-m-d H:i:s",strtotime($uarr->$reporthead[$head])+330*60);
if($reporthead[$head]=="updated_at")
$uarr->$reporthead[$head]=date("Y-m-d H:i:s",strtotime($uarr->$reporthead[$head])+330*60);
$colstr=PHPExcel_Cell::stringFromColumnIndex($head);
$objPHPExcel->getActiveSheet()->setCellValue($colstr.$row, $uarr->$reporthead[$head]);
}
}
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="CallManagement.xls"');
header('Cache-Control: max-age=0');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $inputFileType);
$objWriter->save('php://output');
return ;
}
?>
<div class=innerAll>
<style>#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}</style>
<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'), 'logtable') },"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); ?>'});
});
</script>
<div style="float:left;width:50%">
From : <input size=10 id='modfrom' name='modfrom' type='text' value='<?php echo date("Y-m-d",$logdate); ?>' />
&nbsp;&nbsp;To : <input size=10 id='modto' name='modto' type='text' value='<?php echo date("Y-m-d",$logtodate); ?>' />
</div>
<div style="float:right;width:50%">
<button class="pull-right btn btn-sm btn-default" onclick='dlAgentlogXls();return false;' title='Download' style='margin-top:-8px'><i class='fa fa-download'></i> Download</button>
</div>
<div style="clear:both"></div>
<hr>
<div class=col-md-12>
<div id=userlogschart1 style='min-height:300px;width:100%'></div>
</div>
<script>
function dlAgentlogXls()
{
window.open('dialer/callmanagement?dllogxls=1&logdate='+$("#modfrom").val()+'&logtodate='+$("#modto").val());return false;
}
</script>
<div style='clear:both'></div>
<div class=col-md-12>
<div id=userlogschart2 style='min-height:300px;width:100%'></div>
</div>
<div style='clear:both'></div>
<div style='overflow:auto'>
<table id=logtable class='footable table table-striped table-bordered table-white table-primary footable-loaded' style='font-size:12px'>
<thead>
<?php /*echo $outhead;*/ ?>
</thead>
<?php /*echo $outstr;*/ ?>
</table>
</div>
<div id=dialoglog></div>
</div>
<div class="layout-app"><!-- row-app -->
<div class="row row-app">
<!-- col -->
<div class="col-md-2 col-sm-3">
<!-- col-separator -->
<div class="col-separator col-separator-first box col-unscrollable">
<!-- col-table -->
<div class="col-table" style='padding-left: 13px;padding-right: 13px;'>
<h4 class="innerAll margin-none border-bottom" style='background: #fff;'>Campaign Admin</h4>
<!-- col-table-row -->
<div class="col-table-row">
<!-- col-app -->
<div class="col-app col-unscrollable">
<!-- col-app -->
<div class="col-app">
<ul class="list-group list-group-1 margin-none borders-none" style='padding-right: 26px;'>
<li class="list-group-item">
<a href="#" onclick="doAjax('dialer/camplist','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> List Campaigns</a>
</li>
<li class="list-group-item">
<a href="#" onclick="doAjax('dialer/campchurn','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Churn Rules</a>
</li>
<?php if(Auth::user()->moduleACL("Dialer",true,true,true)){ ?>
<?php } ?>
</ul>
</div>
<!-- // END col-app -->
</div>
<!-- // END col-app -->
</div>
<!-- // END col-table-row -->
</div>
<!-- // END col-table -->
</div>
<!-- // END col-separator.box -->
</div>
<!-- // END col -->
<!-- col -->
<div class="col-md-10 col-sm-9" style='border-right:13px solid #eaeaea'>
<!-- col-separator.box -->
<div class="col-separator col-unscrollable box">
<!-- col-table -->
<div class="col-table">
<!-- <h4 class="innerAll margin-none border-bottom">My Sessions</h4> -->
<!-- col-table-row -->
<div class="col-table-row" style='background: #fff;'>
<!-- col-app -->
<div class="col-app col-unscrollable">
<!-- col-app -->
<div class="col-app" style='position:relative'>
<div class="" id=rightmainreportdiv>
<script>
//doAjax('dialer/campaign_list','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');
</script>
</div>
</div>
<!-- // END col-app -->
</div>
<!-- // END col-app.col-unscrollable -->
</div>
<!-- // END col-table-row -->
</div>
<!-- // END col-table -->
</div>
<!-- // END col-separator.box -->
</div>
<!-- // END col -->
</div>
<!-- // END row-app -->
</div>
<?php
use App\Models\CRMCall;
use App\Models\User;
use App\Jobs\KHRMSLib;
use App\Models\SupervisonComments;
$wakka = new KHRMSLib();
$dashboarduser=Auth::user();
if(isset($_GET['logdate']))$logdate=strtotime($_GET['logdate']." 00:00:00");
else $logdate=strtotime(date('Y-m-d')." 00:00:00");
if(isset($_GET['logtodate']))$logtodate=strtotime($_GET['logtodate']." 23:59:59");
else $logtodate=strtotime(date('Y-m-d')." 23:59:59");
$userarr=array();$i=1;
$reporthead=array("id","upload_date","call_id","cust_band","cust_type","source_of_info","service_type","priority","category","sub_category","resolving_branch","cust_city","acknowledge","resolve_class_unit","complainant_name","existing_customer","cust_id","shadow_cust_id","casa_number","docket_number","cust_mobile","contact_number","email","case_reference","logging_branch_name","logging_class_unit","nature_of_complaint","detailed_suggestion","additional_info","cust_name_on_card","card_number","aan","logging_branch_code","resolving_branch_code","status");
$reportarray=DB::table('complaint_details')->select('*')->where('upload_date','>=',date("Y-m-d H:i:s",$logdate))->where('upload_date','<=',date("Y-m-d H:i:s",$logtodate))->get();
//Child Case
if(isset($_GET['clogdate']))$clogdate=strtotime($_GET['clogdate']." 00:00:00");
else $clogdate=strtotime(date('Y-m-d')." 00:00:00");
if(isset($_GET['clogtodate']))$clogtodate=strtotime($_GET['clogtodate']." 23:59:59");
else $clogtodate=strtotime(date('Y-m-d')." 23:59:59");
$cuserarr=array();$i=1;
$creporthead=array("id","upload_date","complaint_id","cust_type","service_type","priority","category","sub_category","resolving_branch","resolve_class_unit","complainant_name","comments","task_desc","additional_info","status");
$creportarray=DB::table('comp_child_details')->select('*')->where('upload_date','>=',date("Y-m-d H:i:s",$clogdate))->where('upload_date','<=',date("Y-m-d H:i:s",$clogtodate))->get();
if(Input::has("dllogxls"))
{
include_once(app_path().'/lib/phpexcel/PHPExcel.php');
$inputFileType = "Excel5";
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel = $objReader->load("assets/extras/blank.xls");
$baseRow = 2;
$highestColumn = sizeof($reporthead);
for ($head = 0; $head < $highestColumn; $head++){
$colstr=PHPExcel_Cell::stringFromColumnIndex($head);
$objPHPExcel->getActiveSheet()->setCellValue($colstr."1", $reporthead[$head]);
}
foreach($reportarray as $uid=>$uarr)
{
$row = $baseRow++;
$col = 0;
for ($head = 0; $head < $highestColumn; $head++){
if($reporthead[$head]=="upload_date")
$uarr->$reporthead[$head]=date("Y-m-d H:i:s",strtotime($uarr->$reporthead[$head])+330*60);
$colstr=PHPExcel_Cell::stringFromColumnIndex($head);
$objPHPExcel->getActiveSheet()->setCellValue($colstr.$row, $uarr->$reporthead[$head]);
}
}
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="Complaint.xls"');
header('Cache-Control: max-age=0');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $inputFileType);
$objWriter->save('php://output');
return ;
}
if(Input::has("cdllogxls"))
{
include_once(app_path().'/lib/phpexcel/PHPExcel.php');
$inputFileType = "Excel5";
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel = $objReader->load("assets/extras/blank.xls");
$baseRow = 2;
$highestColumn = sizeof($creporthead);
for ($head = 0; $head < $highestColumn; $head++){
$colstr=PHPExcel_Cell::stringFromColumnIndex($head);
$objPHPExcel->getActiveSheet()->setCellValue($colstr."1", $creporthead[$head]);
}
foreach($creportarray as $uid=>$uarr)
{
$row = $baseRow++;
$col = 0;
for ($head = 0; $head < $highestColumn; $head++){
if($creporthead[$head]=="upload_date")
$uarr->$reporthead[$head]=date("Y-m-d H:i:s",strtotime($uarr->$creporthead[$head])+330*60);
$colstr=PHPExcel_Cell::stringFromColumnIndex($head);
$objPHPExcel->getActiveSheet()->setCellValue($colstr.$row, $uarr->$creporthead[$head]);
}
}
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="Childcase.xls"');
header('Cache-Control: max-age=0');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $inputFileType);
$objWriter->save('php://output');
return ;
}
?>
<div class=innerAll>
<style>#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}</style>
<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'), 'logtable') },"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); ?>'});
$('#cmodfrom').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'});
$('#cmodto').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'});
});
</script>
<div style="float:left;width:50%">
From : <input size=10 id='modfrom' name='modfrom' type='text' value='<?php echo date("Y-m-d",$logdate); ?>' />
&nbsp;&nbsp;To : <input size=10 id='modto' name='modto' type='text' value='<?php echo date("Y-m-d",$logtodate); ?>' />
</div>
<div style="float:right;width:50%">
<button class="pull-right btn btn-sm btn-default" onclick='dlAgentlogXls();return false;' title='Download' style='margin-top:-8px'><i class='fa fa-download'></i> Download</button>
</div>
<div style="clear:both"></div>
<hr>
<br>
<!--
<div style="float:left;width:50%">
<label>Child Case:</label>&nbsp;
From : <input size=10 id='cmodfrom' name='cmodfrom' type='text' value='<?php echo date("Y-m-d",$logdate); ?>' />
&nbsp;&nbsp;To : <input size=10 id='cmodto' name='cmodto' type='text' value='<?php echo date("Y-m-d",$logtodate); ?>' />
</div>
<div style="float:right;width:50%">
<button class="pull-right btn btn-sm btn-ino" onclick='cdlAgentlogXls();return false;' title='Download' style='margin-top:-8px'><i class='fa fa-download'></i> Download</button>
</div>--!>
<div style="clear:both"></div>
<hr>
<div class=col-md-12>
<div id=userlogschart1 style='min-height:300px;width:100%'></div>
</div>
<script>
function dlAgentlogXls()
{
window.open('dialer/complaintreport?dllogxls=1&logdate='+$("#modfrom").val()+'&logtodate='+$("#modto").val());return false;
}
function cdlAgentlogXls()
{
window.open('dialer/complaintreport?cdllogxls=1&clogdate='+$("#cmodfrom").val()+'&clogtodate='+$("#cmodto").val());return false;
}
</script>
<div style='clear:both'></div>
<div class=col-md-12>
<div id=userlogschart2 style='min-height:300px;width:100%'></div>
</div>
<div style='clear:both'></div>
<div style='overflow:auto'>
<table id=logtable class='footable table table-striped table-bordered table-white table-primary footable-loaded' style='font-size:12px'>
<thead>
<?php /*echo $outhead;*/ ?>
</thead>
<?php /*echo $outstr;*/ ?>
</table>
</div>
<div id=dialoglog></div>
</div>
<?php
$dashboarduser=Auth::user();
$timeoffset=$dashboarduser->timezone*60;
?>
<div class="container-fluid">
<div class="layout-app">
<div class="row">
<div class="col-md-12">
<div class="col-separator col-separator-first col-unscrollable box">
<div class="innerAll">
<h4>Follow up <?php if(!empty($client)) echo ": ".$client; ?></h4>
<hr style="margin-bottom: 10px;" />
<table class='table'
<thead>
<tr>
<th></th>
<th></th>
<?php if(empty($client)) echo "<th>Campaign</th>" ?>
<th>Cust_ID</th>
<th>Name</th>
<th>Number</th>
<!-- <th>Type</th>-->
<th>LastCall</th>
<!-- <th>Disposition</th> --->
<th>NextFollowup</th>
<!--- <th>Status</th> --->
<!-- <th>Count</th> -->
<!--<th></th>-->
<!-- <th>DID</th> -->
</tr>
</thead>
<tbody>
<?php
if($count > 0){
foreach ($calllog as $key => $value) { //echo "<pre>";print_r($value);exit;?>
<tr>
<td></td>
<td></td>
<?php if(empty($client)) echo "<td>$value->client</td>" ?>
<td><?php echo $value->cust_id; ?></td>
<td><?php echo $value->customer_name; ?></td>
<td><a href=# class='' onclick='dialerQuickOpen("<?php echo $value->id; ?>","<?php echo $value->mobile; ?>","Manual","",0);return false;'><?php echo $value->mobile; ?></a></td>
<td><?php echo date("Y-m-d H:i:s",strtotime($value->dialer_lastcall)-$timeoffset); ?></td>
<!--<td><?php //echo $value->dialer_status; ?></td>-->
<td><?php echo date("Y-m-d H:i:s",strtotime($value->dialer_callback)-$timeoffset); ?></td>
<!--<td><?php //echo $value->status; ?></td>-->
</tr>
<?php }
}else{ ?>
<td colspan="9" align="center">No Record Available</td>
<?php } ?>
</table>
<div id="campaignDetailsArea"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
use App\Models\CRMCall;
use App\Models\User;
use App\Jobs\KHRMSLib;
$wakka = new KHRMSLib();
$dashboarduser=Auth::user();
if(isset($_GET['logdate']))$logdate=strtotime($_GET['logdate']." 00:00:00");
else $logdate=strtotime(date('Y-m-d')." 00:00:00");
if(isset($_GET['logtodate']))$logtodate=strtotime($_GET['logtodate']." 23:59:59");
else $logtodate=strtotime(date('Y-m-d')." 23:59:59");
$alist=CRMCall::where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logdate+24*60*60));
//if(!$dashboarduser->moduleACL("Dialer",false,false,true))
if($dashboarduser->usertype != 'Admin')
{
$uidlist=array($dashboarduser->id);
$allusers=User::where(function ($query) use($dashboarduser) {
$query->where('supervisor','=',$dashboarduser->username)
->orWhere('lteam2','=',$dashboarduser->username)
->orWhere('lteam','=',$dashboarduser->username);
})->get();
// ->where(function ($query) {
// $query->where('status', '=', 'Active');
// })->get();
foreach($allusers as $tuser)$uidlist[]=$tuser->id;
$roclientstr=array();$didlinesstr=array();
if($dashboarduser->exten!="")$didlinesstr[]=$dashboarduser->exten;
$oclientlst=$wakka->clientsReadAccess();
if(!empty($oclientlst))foreach($oclientlst as $tclnt)if($tclnt!="")
{
$roclientstr[]="$tclnt";
$mastersdata=$wakka->getCompanyMaster($tclnt);
if(!empty($mastersdata["DialerDID"]))$didlinesstr[]=$mastersdata["DialerDID"];
}
$alist=$alist->where(function ($query) use($roclientstr,$uidlist,$didlinesstr){
$query->orWhereIn('client',$roclientstr)
->orWhereIn('user_id',$uidlist)
->orWhereIn('did',$didlinesstr);
});
}
$alist=$alist->get();
$userarr=array();$i=1;
$reporthead=array("id","created_at","updated_at","user_id","cust_id","call_id","name","number","question_time","question","primary_question","primary_response","primary_text","followup1_question","followup1_response","followup1_text","followup2_question","followup2_response","followup2_text","followup3_question","followup3_response","followup3_text","followup4_question","followup4_response","followup4_text","followup5_question","followup5_response","followup5_text","followup6_question","followup6_response","followup6_text","followup7_question","followup7_response","followup7_text");
//$reportarray=DB::table('questionaire_details')->select('*')->get();
$reportarray=DB::table('questionaire_details')->select('*')->where('updated_at','>=',date("Y-m-d H:i:s",$logdate))->where('updated_at','<=',date("Y-m-d H:i:s",$logtodate))->get();
if(Input::has("dllogxls"))
{
include_once(app_path().'/lib/phpexcel/PHPExcel.php');
$inputFileType = "Excel5";
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel = $objReader->load("assets/extras/blank.xls");
$baseRow = 2;
$highestColumn = sizeof($reporthead);
for ($head = 0; $head < $highestColumn; $head++){
$colstr=PHPExcel_Cell::stringFromColumnIndex($head);
$objPHPExcel->getActiveSheet()->setCellValue($colstr."1", $reporthead[$head]);
}
foreach($reportarray as $uid=>$uarr)
{
$row = $baseRow++;
$col = 0;
if($urr->auth_question!='')
{
$urr->auth_question = (array)json_decode($urr->auth_question);
}
for ($head = 0; $head < $highestColumn; $head++){
if($reporthead[$head]=="created_at")
$uarr->$reporthead[$head]=date("Y-m-d H:i:s",strtotime($uarr->$reporthead[$head])+330*60);
if($reporthead[$head]=="updated_at")
$uarr->$reporthead[$head]=date("Y-m-d H:i:s",strtotime($uarr->$reporthead[$head])+330*60);
if($reporthead[$head]=="question_time")
$uarr->$reporthead[$head]=date("Y-m-d H:i:s",strtotime($uarr->$reporthead[$head])+330*60);
$colstr=PHPExcel_Cell::stringFromColumnIndex($head);
$objPHPExcel->getActiveSheet()->setCellValue($colstr.$row, $uarr->$reporthead[$head]);
}
}
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="QAireLog.xls"');
header('Cache-Control: max-age=0');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $inputFileType);
$objWriter->save('php://output');
return ;
}
?>
<div class=innerAll>
<style>#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}</style>
<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'), 'logtable') },"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); ?>'});
});
</script>
<div style="float:left;width:50%">
From : <input size=10 id='modfrom' name='modfrom' type='text' value='<?php echo date("Y-m-d",$logdate); ?>' />
&nbsp;&nbsp;To : <input size=10 id='modto' name='modto' type='text' value='<?php echo date("Y-m-d",$logtodate); ?>' />
</div>
<div style="float:right;width:50%">
<button class="pull-right btn btn-sm btn-default" onclick='dlAgentlogXls();return false;' title='Download' style='margin-top:-8px'><i class='fa fa-download'></i> Download</button>
</div>
<div style="clear:both"></div>
<hr>
<div class=col-md-12>
<div id=userlogschart1 style='min-height:300px;width:100%'></div>
</div>
<script>
function dlAgentlogXls()
{
//window.open('dialer/questionnaire?dllogxls=1&logdate='+$("#modfrom").val());return false;
window.open('dialer/questionnaire?dllogxls=1&logdate='+$("#modfrom").val()+'&logtodate='+$("#modto").val());return false;
}
</script>
<div style='clear:both'></div>
<div class=col-md-12>
<div id=userlogschart2 style='min-height:300px;width:100%'></div>
</div>
<div style='clear:both'></div>
<div style='overflow:auto'>
<table id=logtable class='footable table table-striped table-bordered table-white table-primary footable-loaded' style='font-size:12px'>
<thead>
<?php /*echo $outhead;*/ ?>
</thead>
<?php /*echo $outstr;*/ ?>
</table>
</div>
<div id=dialoglog></div>
</div>
<?php
use App\Models\CRMCallArchive;
use App\Models\CRMCall;
use App\Models\User;
use App\Jobs\KHRMSLib;
$wakka = new KHRMSLib();
$dashboarduser=Auth::user();
if(isset($_GET['logdate']))$logdate=strtotime($_GET['logdate']." 00:00:00");
else $logdate=strtotime(date('Y-m-d')." 00:00:00");
$prevlogdate = strtotime(date('Y-m-d', strtotime('-7 day')));
$i=0;
if($logdate < $prevlogdate)
{
$alist=CRMCallArchive::where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logdate+24*60*60))->where('type','!=','Inbound');
}
else
{
$alist=CRMCall::where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logdate+24*60*60))->where('type','!=','Inbound');
}
if($dashboarduser->usertype != 'Admin')
{
$uidlist=array($dashboarduser->id);
$allusers=User::where(function ($query) use($dashboarduser) {
$query->where('supervisor','=',$dashboarduser->username)
->orWhere('lteam2','=',$dashboarduser->username)
->orWhere('lteam','=',$dashboarduser->username);
})->get();
foreach($allusers as $tuser)$uidlist[]=$tuser->id;
$roclientstr=array();$didlinesstr=array();
if($dashboarduser->exten!="")$didlinesstr[]=$dashboarduser->exten;
$oclientlst=$wakka->clientsReadAccess();
if(!empty($oclientlst))foreach($oclientlst as $tclnt)if($tclnt!="")
{
$roclientstr[]="$tclnt";
$mastersdata=$wakka->getCompanyMaster($tclnt);
if(!empty($mastersdata["DialerDID"]))$didlinesstr[]=$mastersdata["DialerDID"];
}
$alist=$alist->where(function ($query) use($roclientstr,$uidlist,$didlinesstr){
$query//->orWhereIn('client',$roclientstr)
->orWhereIn('user_id',$uidlist)
->orWhereIn('did',$didlinesstr);
});
}
if(Input::get('sort')=='cpu')$alist=$alist->orderBy("callSec","DESC");
else $alist=$alist->orderBy("id","DESC");
$alist=$alist->get();
/*
$userarr=array();
$i=sizeof($alist);if(!empty($_GET['sort']))$i=1;
$totaltime=0;$ttlovr10=0;$ttlovr5=0;$ttlovr1=0;$ttlovr0=0;$outstr="";$usrcnt=0;
$totaltimeIn=0;$ttlovr10In=0;$ttlovr5In=0;$ttlovr1In=0;$ttlovr0In=0;$usrcntIn=0;
$actionarr=array();$actionarrIn=array();
*/
$callarraid='';
$crm_id='';
foreach($alist as $aline)
{
if($aline->crm_id>0)$crm_id.=$aline->crm_id.",";
}
$crm_id=substr($crm_id,0,-1);
$crm_id=explode(",", $crm_id);
$clientcodearr=DB::table('records')->select('clientcode','id','currentstatus','legalstatus')->whereIn('id',$crm_id)->get();
foreach ($clientcodearr as $clientid)
{
$clientcodeval[$clientid->id]=$clientid->clientcode;
}
if(Input::has("dllogxls"))
{
include_once(app_path().'/lib/phpexcel/PHPExcel.php');
$inputFileType = "Excel5";
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel = $objReader->load("assets/extras/blank.xls");
$baseRow = 3;
$tcol=0;$fieldsarr=array();$extrahdrarr=array();
$fieldsarr[$tcol++]='#';
$fieldsarr[$tcol++]='Date';
$fieldsarr[$tcol++]='User_id';
$fieldsarr[$tcol++]='Disposition';
$fieldsarr[$tcol++]='ClientCode';
$fieldsarr[$tcol++]='Services';
$highestColumn = sizeof($fieldsarr);
for ($head = 0; $head < $highestColumn; $head++)
{
$colstr=PHPExcel_Cell::stringFromColumnIndex($head);
$objPHPExcel->getActiveSheet()->setCellValue($colstr."1", $fieldsarr[$head]);
}
$ii=1;
foreach($alist as $aline)
{
//$row = $baseRow++;
$col = 0;
$clientcode="";
$tpostdata=json_decode($aline->data,true);
$fulldate=date("Y-m-d H:i:s",strtotime($aline->created_at)-($dashboarduser->timezone*60));
if(!isset($userarr[$aline->user_id])&&$aline->user_id>0)$userarr[$aline->user_id]=User::find($aline->user_id);
$dispname="";if(isset($userarr[$aline->user_id]))$dispname=$userarr[$aline->user_id]->dispname();
$username="";if(isset($userarr[$aline->user_id]))$username=$userarr[$aline->user_id]->username;
$val='';
$userdata=json_decode($aline->userdata,true);
//echo "<pre>".print_r($userdata)."<br>";
if(!empty($userdata))
{
foreach ($userdata as $key=>$val)
{
if($val!="")
{
$row = $baseRow++;
$col=0;
$clientcode="";
if($aline->crm_id>0)
{
//$user=$wakka->getPerson($aline->crm_id);
//$clientcode=$user["peopledata"]["clientcode"];
$clientcode=$clientcodeval[$aline->crm_id];
}
$objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($ii++);
$objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($fulldate);
$objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($username);
$objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($aline->userstatus);
$objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($clientcode);
$objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($val);
}
}
}
}
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="Relationship.xls"');
header('Cache-Control: max-age=0');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $inputFileType);
$objWriter->save('php://output');
return ;
}
foreach($alist as $aline)
{
$clientcode="";
$userdata=json_decode($aline->userdata,true);
if($aline->crm_id>0)
{
//$user=$wakka->getPerson($aline->crm_id);
//$clientcode=$user["peopledata"]["clientcode"];
$clientcode=$clientcodeval[$aline->crm_id];
}
$tpostdata=json_decode($aline->data,true);
$fulldate=date("Y-m-d H:i:s",strtotime($aline->created_at)-($dashboarduser->timezone*60));
$talktime=$aline->talkSec+$aline->recstartSec+$aline->recendSec;
$length=round(($aline->waitSec+$aline->callSec+$talktime+$aline->dispoSec)/1000,2);
if(!isset($userarr[$aline->user_id])&&$aline->user_id>0)$userarr[$aline->user_id]=User::find($aline->user_id);
$dispname="";if(isset($userarr[$aline->user_id]))$dispname=$userarr[$aline->user_id]->dispname();
$username="";if(isset($userarr[$aline->user_id]))$username=$userarr[$aline->user_id]->username;
if(!empty($userdata)){
foreach ($userdata as $key=>$val)
{
if($val!="")
{
$outstr.="<tr><td>".$i++."</td>
<td title='$fulldate'>".explode(" ",$fulldate)[0]."</td>
<td>".$username."</td>
<td title='".str_replace("'"," ",$aline->userremarks)."'>".$aline->userstatus."</td>
<td>$clientcode</td>
<td>$val</td>
</tr>";
}
}
}
/*else
{
$outstr.="<tr><td>".$i++."</td>
<td title='$fulldate'>".explode(" ",$fulldate)[0]."</td>
<td>".$username."</td>
<td title='".str_replace("'"," ",$aline->userremarks)."'>".$aline->userstatus."</td>
<td>$clientcode</td>
<td></td>
</tr>";
}*/
}
?>
<div class=innerAll>
<style>#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}</style>
<script>
function showExtraPost(varstr)
{
doAjax("hr?action=LiveUsers","getpostdata="+varstr,"dialoglog");
$('#dialoglog').dialog('open');
return false;
}
$(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'), 'logtable') },"2000");
$('#modfrom').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'});
});
</script>
<div style="float:left;width:50%">
Search <input id=filter name="filter" type="text">
Date : <input size=10 id='modfrom' name='modfrom' type='text' value='<?php echo date("Y-m-d",$logdate); ?>' onchange='callLogReloadFun("");' />
</div>
<div style="float:left;width:50%">
<button class="pull-right btn btn-sm btn-default" onclick='dlCalllogXls();return false;' title='Download' style='margin-top:-8px'><i class='fa fa-download'></i> Download</button>
</div>
<div style="clear:both"></div>
<hr>
<?php
/*$categories=array();$avgarr=array();$cntarr=array();
foreach($actionarr as $act=>$actarr)
{
if($actarr['cnt']>sizeof($alist)/150)
{
$categories[]="'$act'";
$avgarr[]=-round($actarr['time']/$actarr['cnt'],2);
$cntarr[]=$actarr['cnt'];
}
}
array_multisort($cntarr,$avgarr,$categories);
$categoriesIn=array();$avgarrIn=array();$cntarrIn=array();
foreach($actionarrIn as $act=>$actarr)
{
if($actarr['cnt']>sizeof($alist)/150)
{
$categoriesIn[]="'$act'";
$avgarrIn[]=-round($actarr['time']/$actarr['cnt'],2);
$cntarrIn[]=$actarr['cnt'];
}
}
array_multisort($cntarrIn,$avgarrIn,$categoriesIn);*/
?>
<div class=col-md-10>
<script>
function callLogReloadFun(sortby)
{
var sortstr='';if(sortby!="")sortstr="&sort="+sortby
doAjax('dialer/relationshipreport?logdate='+$("#modfrom").val()+sortstr,'','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');
}
function dlCalllogXls()
{
window.open('dialer/relationshipreport?dllogxls=1&logdate='+$("#modfrom").val());return false;
}
</script>
</div>
<div style='clear:both'></div>
<div class=col-md-10>
<script>
</script>
</div>
<div style='clear:both'></div>
<div style='overflow:auto'>
<table id=logtable class='footable table table-striped table-bordered table-white table-primary footable-loaded' style='font-size:12px'>
<thead>
<tr>
<th>#</th>
<th>Date</th>
<th>User_id</th>
<th>Disposition</th>
<th>ClientCode</th>
<th>Services</th>
</tr>
</thead>
<?php echo $outstr; ?>
</table>
</div>
<?php
function convert($size)
{
$unit=array('b','kb','mb','gb','tb','pb');
return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i];
}
echo "<br>".convert(memory_get_peak_usage(true)); // 123 kb
?>
<div id=dialoglog></div>
</div>
<?php
use App\Models\CRMCall;
use App\Models\CRMCallArchive;
use App\Models\User;
use App\Jobs\KHRMSLib;
$wakka = new KHRMSLib();
$dashboarduser=Auth::user();
$timeoffset = $dashboarduser->timezone; //-330; //$dashboarduser->timezone;\
//$timeoffset = $timeoffset*60;
$timeoffset = 0;
$logtime =(isset($_GET['logtime'])) ? $_GET['logtime'] :9;
$logtimeto =(isset($_GET['logtimeto']))? $_GET['logtimeto']:20;
$logdate =(isset($_GET['logdate'])) ? strtotime($_GET['logdate']." ".$logtime.":00:00")
: strtotime(date("Y-m-d")." 09:00:00");
$logdateto =(isset($_GET['logdateto']))? strtotime($_GET['logdateto']." ".$logtimeto.":00:00")
: strtotime(date("Y-m-d")." 20:00:00");
$campaign =explode('||', (isset($_GET['campaign'])) ? $_GET['campaign'] : "All");
$state =explode('||', (isset($_GET['state'])) ? $_GET['state'] : "All");
$product =explode('||', (isset($_GET['product'])) ? $_GET['product'] : "All");
$bucket =explode('||', (isset($_GET['bucket'])) ? $_GET['bucket'] : "All");
$clientlist =$wakka->clientsReadAccess(); $clientlist; $clientlist[0] = 'All';
$alist=DB::table('crmcalls_archive AS c')->leftJoin('records', 'c.crm_id', '=', 'records.id')->where('c.user_id','!=',0);
$alist=$alist ->where('c.created_at','>=',date("Y-m-d H:i:s",$logdate))
->where('c.created_at','<=',date("Y-m-d H:i:s",$logdateto));
$displayAdv = 'none';
if(!in_array('All', $campaign)) {
$displayAdv = 'block';
$alist =$alist->whereIn('c.client',$campaign);
}
$userarr=array();
$allusers = DB::table('users as u1')->leftjoin('users AS u2', 'u2.username', '=', 'u1.supervisor')
->select('u1.id','u1.username','u1.fullname AS telecaller', 'u2.fullname AS sepervisor');
if($dashboarduser->usertype != 'Admin')
{
$uidlist=array($dashboarduser->id);
$allusers=$allusers->where(function ($query) use($dashboarduser) {
$query->where('u1.supervisor','=',$dashboarduser->username)
->orWhere('u1.lteam2','=',$dashboarduser->username)
->orWhere('u1.lteam','=',$dashboarduser->username);
})->get();
foreach($allusers as $tuser)
{
$uidlist[]=$tuser->id;
$userarr[$tuser->id] = $tuser;
}
$alist=$alist->whereIn('c.user_id',$uidlist);
/*$roclientstr=array();$didlinesstr=array();
if($dashboarduser->exten!="")$didlinesstr[]=$dashboarduser->exten;
if(!empty($clientlist))foreach($clientlist as $tclnt)if($tclnt!="")
{
$roclientstr[]="$tclnt";
$mastersdata=$wakka->getCompanyMaster($tclnt);
if(!empty($mastersdata["DialerDID"]))$didlinesstr[]=$mastersdata["DialerDID"];
}
$alist=$alist->where(function ($query) use($roclientstr,$uidlist,$didlinesstr){
$query->orWhereIn('c.client',$roclientstr)
->orWhereIn('c.did',$didlinesstr);
});*/
}
else {
$allusers=$allusers->get();
foreach($allusers as $tuser)
{
$userarr[$tuser->id] = $tuser;
}
}
<div class="layout-app">
<!-- row-app -->
<div class="row row-app">
<!-- col -->
<div class="col-md-2 col-sm-3">
<!-- col-separator -->
<div class="col-separator col-separator-first box col-unscrollable">
<!-- col-table -->
<div class="col-table" style='padding-left: 13px;padding-right: 13px;'>
<h4 class="innerAll margin-none border-bottom" style='background: #fff;'>Dialer Reports</h4>
<!-- col-table-row -->
<div class="col-table-row">
<!-- col-app -->
<div class="col-app col-unscrollable">
<!-- col-app -->
<div class="col-app">
<ul class="list-group list-group-1 margin-none borders-none" style='padding-right: 26px;'>
<li class="list-group-item">
<a href="#" onclick="doAjax('report/liveusers','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Live</a>
</li>
<li class="list-group-item">
<a href="#" onclick="doAjax('report/calllog','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Call</a>
</li>
<li class="list-group-item">
<a href="#" onclick="doAjax('report/agenttime','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Login</a>
</li>
<li class="list-group-item">
<a href="#" onclick="doAjax('report/agenttimeAverage','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Login Average</a>
</li>
<li class="list-group-item">
<a href="#" onclick="doAjax('report/campreport','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Time</a>
</li>
<li class="list-group-item">
<a href="#" onclick="doAjax('report/statusreport','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Status</a>
</li>
<li class="list-group-item">
<a href="#" onclick="doAjax('report/relationshipreport','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i>Relationship</a>
</li>
</ul>
</div>
<!-- // END col-app -->
</div>
<!-- // END col-app -->
</div>
<!-- // END col-table-row -->
</div>
<!-- // END col-table -->
</div>
<!-- // END col-separator.box -->
</div>
<!-- // END col -->
<!-- col -->
<div class="col-md-10 col-sm-9" style='border-right:13px solid #eaeaea'>
<!-- col-separator.box -->
<div class="col-separator col-unscrollable box">
<!-- col-table -->
<div class="col-table">
<!-- col-table-row -->
<div class="col-table-row" style='background: #fff;'>
<!-- col-app -->
<div class="col-app col-unscrollable">
<!-- col-app -->
<div class="col-app" style='position:relative'>
<div class="" id=rightmainreportdiv>
<script>
doAjax('report/liveusers','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');
</script>
</div>
</div>
<!-- // END col-app -->
</div>
<!-- // END col-app.col-unscrollable -->
</div>
<!-- // END col-table-row -->
</div>
<!-- // END col-table -->
</div>
<!-- // END col-separator.box -->
</div>
<!-- // END col -->
</div>
<!-- // END row-app -->
</div>
\ No newline at end of file
<?php
use App\Jobs\KHRMSLib;
use App\Models\CRMCall;
$wakka=new KHRMSLib();
$roclientlst=$wakka->clientsReadAccess();
if(isset($_GET['pbcode']))$pbcode=$_GET['pbcode'];
else $pbcode='';
$alist=DB::table('p11086_cop_rlp_pb_base_uat')
->select(DB::Raw("*"))
->where('pbcode','=',$pbcode)
->get();
//print_r($alist);
?>
<style>#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}</style>
<div class="layout-app"><!-- row-app -->
<div class="row row-app">
<div class="col-md-12">
<div class="col-separator col-separator-first col-unscrollable box">
<div style='clear:both;margin:2% 0 0 1%;border: 2px solid #F5F5F5;padding:2%;border-radius: 5px;'>
<center><h4>RLP PB WISE</center>
<br>
<div class='container'>
PB CODE:<select id='pb_code' class=select2multi style="width:20%;" onclick="pbcodeSelect();">
<?php foreach($roclientlst as $c){$s="";if($c==$pbcode)$s='selected';echo "<option value='$c' $s>$c</option>";} ?>
</select>
</div>
</div>
</div>
<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>
<tr>
<th>Product</th>
<th>Opportunity</th>
<th>Contacted</th>
<th>Pitched</th>
<th>LG</th>
</tr>
</thead>
<tr>
<td>AL</td>
<td><?php echo $alist[0]->al_qm_opp + $alist[0]->al_upg_opp + $alist[0]->al_al_cnc_opp + $alist[0]->al_pa_opp + $alist[0]->al_zip_opp ?></td>
<td><?php echo $alist[0]->al_called_opp ?></td>
<td><?php echo $alist[0]->al_pitch ?></td>
<td><?php echo $alist[0]->al_lg ?></td>
</tr>
<tr>
<td>PL/BL</td>
<td><?php echo $alist[0]->pl_10sec_opp+$alist[0]->pl_pa_opp+$alist[0]->pl_pq_opp+$alist[0]->bl_10sec_opp+$alist[0]->bl_pq_opp ?></td>
<td><?php echo $alist[0]->pl_called_opp ?></td>
<td><?php echo $alist[0]->pl_pitch ?></td>
<td><?php echo $alist[0]->pl_lg ?></td>
</tr>
<tr>
<td>Retail Assets</td>
<td><?php echo $alist[0]->twl_pa_opp+$alist[0]->hl_pq_opp+$alist[0]->hl_bt_opp+$alist[0]->gl_pitch+$alist[0]->las_opp+$alist[0]->lap_opp ?></td>
<td><?php echo $alist[0]->twl_called_opp+$alist[0]->hl_called_opp+$alist[0]->las_called_opp+$alist[0]->lap_called_opp ?></td>
<td><?php echo $alist[0]->twl_pitch+$alist[0]->hl_pitch+$alist[0]->gl_pitch+$alist[0]->las_pitch ?></td>
<td><?php echo $alist[0]->twl_lg+$alist[0]->hl_lg+$alist[0]->gl_lg+$alist[0]->las_lg+$alist[0]->lap_lg ?></td>
</tr>
<tr>
<td>HSL</td>
<td><?php echo $alist[0]->hsl_opp ?></td>
<td><?php echo $alist[0]->hsl_called_opp ?></td>
<td><?php echo $alist[0]->hsl_pitch ?></td>
<td></td>
</tr>
<tr>
<td>Credit Card- New Sourcing</td>
<td><?php echo $alist[0]->cc_eli_new_opp ?></td>
<td><?php echo $alist[0]->cc_activation_opp ?></td>
<td><?php echo $alist[0]->cc_pitch ?></td>
<td><?php echo $alist[0]->cc_lg ?></td>
</tr>
<tr>
<td>Credit Card- LTD Activation on Carded</td>
<td><?php echo $alist[0]->cc_activation_opp ?></td>
<td><?php echo $alist[0]->cc_activation_called_opp ?></td>
<td></td>
<td</td>
</tr>
<tr>
<td>Insurance LI</td>
<td><?php echo $alist[0]->li_opp ?></td>
<td><?php echo $alist[0]->li_called_opp ?></td>
<td></td>
<td></td>
</tr>
<tr>
<td>FD</td>
<td><?php echo $alist[0]->fd_opp ?></td>
<td><?php echo $alist[0]->fd_called_opp ?></td>
<td><?php echo $alist[0]->fd_pitch ?></td>
<td></td>
</tr>
<tr>
<td>LTD Activation-Savings Account</td>
<td><?php echo $alist[0]->ltd_act_saving_opp ?></td>
<td><?php echo $alist[0]->ltd_act_saving_opp ?></td>
<td></td>
<td></td>
</tr>
<tr>
<td>NB/MB Activations</td>
<td><?php echo $alist[0]->mb_opp ?></td>
<td><?php echo $alist[0]->mb_called_opp ?></td>
<td><?php echo $alist[0]->mb_pitch ?></td>
<td><?php echo $alist[0]->nb_mb_lg ?></td>
</tr>
<tr>
<td>Aadhar Seeding</td>
<td><?php echo $alist[0]->aadhaar_opp ?></td>
<td><?php echo $alist[0]->aadhaar_called_opp ?></td>
<td><?php echo $alist[0]->aadhaar_pitch ?></td>
<td><?php echo $alist[0]->aadhaar_activation ?></td>
</tr>
<tr>
<td>Digital Activation</td>
<td><?php echo $alist[0]->digi2_score_opp ?></td>
<td><?php echo $alist[0]->digi2_score_called_opp ?></td>
<td></td>
<td></td>
</tr>
<tr>
<td>BillPayments</td>
<td><?php echo $alist[0]->digi_billpay_opp ?></td>
<td><?php echo $alist[0]->digi_billpay_called_opp ?></td>
<td><?php echo $alist[0]->bill_pay_pitch ?></td>
<td></td>
</tr>
<tr>
<td>Financial Transactions</td>
<td><?php echo $alist[0]->digi_basic_banking_opp ?></td>
<td><?php echo $alist[0]->digi_basic_banking_called_opp ?></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Digital 2.0 Score(Ecom Shopping Inactive)</td>
<td><?php echo $alist[0]->digi_ecom_shopping_opp ?></td>
<td><?php echo $alist[0]->digi_ecom_shopping_called_opp ?></td>
<td></td>
<td> </td>
</tr>
<tr>
<td>Digital 2.0 Score(Investment Inactive)</td>
<td><?php echo $alist[0]->digi_investment_opp ?></td>
<td><?php echo $alist[0]->digi_investment_called_opp ?></td>
<td><?php echo $alist[0]->invest_pitch ?></td>
<td></td>
</tr>
<tr>
<td>Reduction in Physical Transactions</td>
<td><?php echo $alist[0]->invest_pitch ?></td>
<td><?php echo $alist[0]->invest_pitch ?></td>
<td></td>
<td></td>
</tr>
<tr>
<td>% of Groups Contacted</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Movement of Groups to higher engagement</td>
<td> </td>
<td> </td>
<td> </td>
<td></td>
</tr>
<tr>
<td>CASA Growth</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Mutual Fund</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</div>
<div id=dialoglog></div>
</div>
</div>
</div>
<style>#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}</style>
<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'), 'logtable') },"2000");
});
function pbcodeSelect()
{
var pbcode=$('#pb_code').val();
doAjax('rlp?pbcode='+pbcode,'','content','ajax_rlp','singlethis','GET');
}
</script>
\ No newline at end of file
<style>
#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}
.select2-container-multi{height: 90px; overflow-y: auto;border: 1px solid #efefef;border-radius: 3px !important;}
.select2-container-active{height: 90px; overflow-y: auto;border: 1px solid #5897fb;border-radius: 3px !important;}
.select2-container-multi.select2-container-active.select2-choices{border:none !important; box-shadow: none !important;}
.select2-choices{border:none !important; box-shadow: none !important;}
.select2-drop,.select2-drop-active{border-color: #5897fb;margin-top: -9px;}
</style>
<?php
if($param) {
$clientlist = array_filter($clientlist, function($var) use ($param) { return (strpos(trim($var), $param) !== 0) ? false : true; });
}
?>
<div class=innerAll>
<h4 style="float:left;width:50%;margin:10px 0;">{{ $reportTitle }}</h4>
<div style="float:right;width:50%" id="download_btn">
<button class="pull-right btn btn-sm btn-default" onclick='dlAgentlogXls();return false;' title='Download'><i class='fa fa-download'></i> Download</button>
</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;">&nbsp;&nbsp;
Date: From <input size=10 id='modfrom' name='modfrom' type='text' value='<?php echo date("Y-m-d",$logdate); ?>' onchange='statusLogReloadFun("");' />
<select id="modtime" style="border:1px solid #efefef;" onchange='statusLogReloadFun("");'>
<?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); ?>' onchange='statusLogReloadFun("");' />
<select id="modtimeto" style="border:1px solid #efefef;" onchange='statusLogReloadFun("");'>
<?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>&nbsp;&nbsp;
<button class="pull-right btn btn-sm btn-default" onclick='$("#advance").toggle();' title='Advance Search'><i class='fa fa-search'></i> Advance Search</button>
<div style="clear:both"></div>
<div style="margin-top: 5px; display:{{ $displayAdv }};" id="advance">
<div style="width: 80%;" class="pull-left">
Campaign
<select id="campaignbox" multiple="multiple" style="width:25%" class=select2multi>
<?php foreach($clientlist as $c)
{ $s="";
if($param) {
$s='selected';
echo "<option value='$c' $s>$c</option>";
} else {
if(in_array($c, $campaign))$s='selected';
echo "<option value='$c' $s>$c</option>";
}
}?>
</select>
</div>
<div style="margin-top: 5px;" class="pull-right">
<button class="pull-right btn btn-sm btn-default" onclick='statusLogReloadFun("");' title='Search'><i class='fa fa-search'></i> Search</button>
</div>
</div>
</div>
<div style="clear:both"></div>
<hr style="margin:5px;">
<script>
$(document).ready(function() {
waitKeyUpRun("filter",function() { filter2(document.getElementById('filter'), 'logtable') },"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()
{
var campaignStr = '';
$('#campaignbox :selected') .each(function(i, sel){
if(campaignStr != '') campaignStr = campaignStr + '||' + $(sel).val();
else campaignStr = $(sel).val();
});
return 'logdate='+$("#modfrom").val()+'&logtime='+$("#modtime").val()+'&logdateto='+$("#modto").val()+'&logtimeto='+$("#modtimeto").val()+'&campaign='+campaignStr;
}
function statusLogReloadFun(sortby)
{
var sortstr='';if(sortby!="")sortstr="&sort="+sortby
var searchStr = dataString();
doAjax('dialer/{{ $returnblade }}?'+searchStr+sortstr,'','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');
}
function dlAgentlogXls()
{
var searchStr = dataString();
window.open('dialer/{{ $returnblade }}?dllogxls=1&'+searchStr);
return false;
}
function breakupXls(report,userId,column)
{
var searchStr = dataString();
window.open('dialer/breakupxls?report='+report+'&userId='+userId+'&column='+column+'&'+searchStr);
return false;
}
function displayMode(mode) {
if(mode == 'percent') {
$(".summation").hide();
$(".percent").show();
}
else {
$(".percent").hide();
$(".summation").show();
}
}
</script>
<?php
use App\Models\CRMCall;
use App\Models\User;
use App\Jobs\KHRMSLib;
$wakka = new KHRMSLib();
$dashboarduser=Auth::user();
if(isset($_GET['logdate']))$logdate=strtotime($_GET['logdate']." 00:00:00");
else $logdate=strtotime(date('Y-m-d')." 00:00:00");
$alist=CRMCall::where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logdate+24*60*60));
//if(!$dashboarduser->moduleACL("Dialer",false,false,true))
if($dashboarduser->usertype != 'Admin')
{
$uidlist=array($dashboarduser->id);
$allusers=User::where(function ($query) use($dashboarduser) {
$query->where('supervisor','=',$dashboarduser->username)
->orWhere('lteam2','=',$dashboarduser->username)
->orWhere('lteam','=',$dashboarduser->username);
})->get();
// ->where(function ($query) {
// $query->where('status', '=', 'Active');
// })->get();
foreach($allusers as $tuser)$uidlist[]=$tuser->id;
$roclientstr=array();$didlinesstr=array();
if($dashboarduser->exten!="")$didlinesstr[]=$dashboarduser->exten;
$oclientlst=$wakka->clientsReadAccess();
if(!empty($oclientlst))foreach($oclientlst as $tclnt)if($tclnt!="")
{
$roclientstr[]="$tclnt";
$mastersdata=$wakka->getCompanyMaster($tclnt);
if(!empty($mastersdata["DialerDID"]))$didlinesstr[]=$mastersdata["DialerDID"];
}
$alist=$alist->where(function ($query) use($roclientstr,$uidlist,$didlinesstr){
$query->orWhereIn('client',$roclientstr)
->orWhereIn('user_id',$uidlist)
->orWhereIn('did',$didlinesstr);
});
}
$alist=$alist->get();
$userarr=array();$i=1;
$reporthead=array("id","created_at","updated_at","sup_id","message","status");
$reportarray=DB::table('supervisor_message')->where('sup_id','=',Auth::user()->username)->select('*')->get();
if(Input::has("dllogxls"))
{
include_once(app_path().'/lib/phpexcel/PHPExcel.php');
$inputFileType = "Excel5";
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel = $objReader->load("assets/extras/blank.xls");
$baseRow = 2;
$highestColumn = sizeof($reporthead);
for ($head = 0; $head < $highestColumn; $head++){
$colstr=PHPExcel_Cell::stringFromColumnIndex($head);
$objPHPExcel->getActiveSheet()->setCellValue($colstr."1", $reporthead[$head]);
}
foreach($reportarray as $uid=>$uarr)
{
$row = $baseRow++;
$col = 0;
for ($head = 0; $head < $highestColumn; $head++){
if($reporthead[$head]=="created_at")
$uarr->$reporthead[$head]=date("Y-m-d H:i:s",strtotime($uarr->$reporthead[$head])+330*60);
if($reporthead[$head]=="updated_at")
$uarr->$reporthead[$head]=date("Y-m-d H:i:s",strtotime($uarr->$reporthead[$head])+330*60);
$colstr=PHPExcel_Cell::stringFromColumnIndex($head);
$objPHPExcel->getActiveSheet()->setCellValue($colstr.$row, $uarr->$reporthead[$head]);
}
}
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="Messages.xls"');
header('Cache-Control: max-age=0');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $inputFileType);
$objWriter->save('php://output');
return ;
}
?>
<div class=innerAll>
<style>#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}</style>
<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'), 'logtable') },"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); ?>'});
});
</script>
<div style="float:left;width:50%">
</div>
<div style="float:right;width:50%">
<button class="pull-right btn btn-sm btn-default" onclick='dlAgentlogXls();return false;' title='Download' style='margin-top:-8px'><i class='fa fa-download'></i> Download</button>
</div>
<div style="clear:both"></div>
<hr>
<div class=col-md-12>
<div id=userlogschart1 style='min-height:300px;width:100%'></div>
</div>
<script>
function dlAgentlogXls()
{
window.open('dialer/supmessages?dllogxls=1&logdate='+$("#modfrom").val());return false;
}
</script>
<div style='clear:both'></div>
<div class=col-md-12>
<div id=userlogschart2 style='min-height:300px;width:100%'></div>
</div>
<div style='clear:both'></div>
<div style='overflow:auto'>
<table id=logtable class='footable table table-striped table-bordered table-white table-primary footable-loaded' style='font-size:12px'>
<thead>
<?php /*echo $outhead;*/ ?>
</thead>
<?php /*echo $outstr;*/ ?>
</table>
</div>
<div id=dialoglog></div>
</div>
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!