ca191993 by G Manojkumar

Merge branch 'dev-beu-phase-1' of http://54.197.18.130/flexydial/hdfc-vrm-v2 into dev-beu-phase-1

2 parents 83620b79 2572c2de
Showing 51 changed files with 2594 additions and 1624 deletions
......@@ -21,7 +21,7 @@ class CampaignController extends Controller {
public function index()
{
$data['campaignList'] = Campaign::where('mtype',"=","company")->orderBy('mkey')->get();
$data['campaignList'] = Campaign::where('mtype',"=","company")->where('status','=','active')->orderBy('mkey')->get();
$dashboarduser=Auth::user();
if($dashboarduser->usertype != 'Admin'){
$allusers=User::where(function ($query) use($dashboarduser) {
......@@ -301,8 +301,45 @@ class CampaignController extends Controller {
return "<script>simpleNotification('error','topRight','Campaign name should not be blank.');</script><br/><p class='text-danger text-center'>Campaign name should not be blank.</p>";
}
}
if($id=="runquery")
{
$campaign = Input::get("campaign");
$querySelect = Input::get("allvalues");
$queryConditions = Input::get("queryConditions");
if($queryConditions){
$queryConditions = str_replace('&quot;', "'", $queryConditions);
$queryConditions = str_replace('&#039;', "'", $queryConditions);
}else{
$queryConditions = '1';
}
$fields = explode(",", $querySelect);
$i = 1; $output = '';
try {
if($id=="query")
if($campaign=="All")
{
// $selQuery = "SELECT $querySelect FROM records WHERE $queryConditions LIMIT $queryLimit OFFSET $queryOffset";
$selQuery = "SELECT $querySelect FROM records WHERE $queryConditions";
$sqlQuery = DB::select($selQuery);
}else
{
//$selQuery = "SELECT $querySelect FROM records WHERE client = '$campaign' AND $queryConditions LIMIT $queryLimit OFFSET $queryOffset";
$selQuery = "SELECT $querySelect FROM records WHERE client = '$campaign' AND $queryConditions";
$sqlQuery = DB::select($selQuery);
}
} catch(\Illuminate\Database\QueryException $ex){
$output .= "<p class='text-danger'>".$ex->getMessage()."</p>";
return $output;
}
if(count($sqlQuery)){
$output .='<div><label>'.count($sqlQuery).'</label></div>';
}
return $output;
}
if($id=="savequery")
{
$campaign = Input::get("campaign");
$querySelect = Input::get("allvalues");
......@@ -385,6 +422,23 @@ class CampaignController extends Controller {
$output .= '</tbody></table></div>';*/
return $output;
}
/*if($id="runcount"){
$output = '';
$i = 1;
$campaign = Input::get("campaign");
$id = Input::get("id");
$queryTxt = DB::table('campaign_query')->where('id','=', $id)->select('query','select_col')->first();
$fields = explode(",", $queryTxt->select_col);
$sqlQuery = DB::select($queryTxt->query);
if(count($sqlQuery)){
$output .= '<div style="overflow-x:auto;"><h5>'.count($sqlQuery).'</h5>';
}else{
$output .= '<h5 class="text-danger"><i class="fa fa-exclamation-circle"></i> No Result!</h5>';
}
return $output;
}*/
if($id=="fquery")
{
......@@ -481,11 +535,17 @@ class CampaignController extends Controller {
if($id=="addCurrQueue")
{
$campQryId = Input::get("radioValue");
$campaign = Input::get("campaign");
DB::table('campaign_query')->where('id','!=', $campQryId)->update(['current_queue'=>'']);
DB::table('campaign_query')->where('id','=', $campQryId)->update(['current_queue'=>'selected']);
//return "<script>simpleNotification('success','topRight','Query Logic Successfully Updated');</script>";
DB::table('campaign_query')->where('id','!=', $campQryId)->where('campaign','=',$campaign)->update(['current_queue'=>'']);
DB::table('campaign_query')->where('id','=', $campQryId)->where('campaign','=',$campaign)->update(['current_queue'=>'selected']);
$queryCond=DB::table('campaign_query')->where('id','=',$campQryId)->where('campaign','=',$campaign)->select('where_cond');
if($queryCond->count() > 0){
$queryCond = $queryCond->first();
DB::update(DB::raw("UPDATE records set filter_condition='1' where $queryCond->where_cond"));
}
return;
//return "<script>simpleNotification('success','topRight','Query Logic Successfully Applied');</script>";
}
if($id=="assigncampaign")
{
......
......@@ -147,6 +147,7 @@ class DialerController extends Controller {
$roclientstr=array();
$oclientlst=$wakka->clientsReadAccess();
//print_r($oclientlst);
if(!empty($oclientlst))foreach($oclientlst as $tclnt)if($tclnt!=""){$roclientstr[]="'$tclnt'";}
if(!empty($roclientstr))$roclientstr="and client in (".implode(",",$roclientstr).")";else $roclientstr="";
......@@ -154,7 +155,11 @@ class DialerController extends Controller {
$users=array();$searchresult="";
if(!empty($kstychCall["previewcrmid"]))$users=$wakka->getPersons("id='".$kstychCall["previewcrmid"]."' $roclientstr limit 1");
else $users=$this->getCallSequencing(1);
//$wakka->setPersonKey($users[0]['id'],"status","Incall");
if($users[0]['id']>0){
Log::info("1----".$users[0]['id']);
DB::table('records')->where('id',$users[0]['id'])->update(['filter_condition'=>'2','modified'=>date("Y-m-d H:i:s")]);
}
if(!empty($users))
{
$searchresult.="<div id=divworking></div><div style='clear:both'></div><script>kSetDData('C','previewcrmid','".$users[0]['id']."');showRecruit(\"".$users[0]['id']."\");</script>";
......@@ -184,15 +189,6 @@ class DialerController extends Controller {
if(!empty($roclientstr))$roclientstr="and client in (".implode(",",$roclientstr).")";else $roclientstr="";
$users=array();$callnumber=$kstychCall['callnumber'];
$callnumber = trim($callnumber);
if($kstychDialer['mDialerState']=="Manual"){
if((!preg_match('/^[0-9]*$/',$callnumber)) || strlen($callnumber)<6){
return Response::make("<script>simpleNotification('error','topRight','Please enter a valid phone number');</script>");
}
}
if($kstychCall['crmid'])
{
$crmid=$kstychCall['crmid'];
......@@ -204,13 +200,7 @@ class DialerController extends Controller {
}
if($kstychDialer['mDialerState']=="Manual")
{
$callnumber=trim($callnumber);
if(!preg_match('/^[1-9][0-9]*$/',$callnumber)){
return Response::make("<script>simpleNotification('error','topRight','Only Digits are allowed');</script>");
}
if(strlen($callnumber)<6){
return Response::make("<script>simpleNotification('error','topRight','Enter a valid Number');</script>");
}
if($crmid!="")
{
$tusers=$wakka->getPersonIDs("(mobile like '%".substr($callnumber,-10)."' OR
......@@ -283,21 +273,21 @@ class DialerController extends Controller {
if($callnumber==""||intval($callnumber)<=0)$callnumber=$ppldata['mobile'];
$callnumber = trim($callnumber);
if($kstychDialer['mDialerState']=="Manual"){
if(!is_numeric($callnumber) || strlen($callnumber)<6){
return Response::make("<script>simpleNotification('error','topRight','Please enter a valid phone number');</script>");
if($kstychDialer['mDialerState']=="Manual"){
if(!is_numeric($callnumber) || strlen($callnumber)<6){
return Response::make("<script>simpleNotification('error','topRight','Please enter a valid phone number');</script>");
}
}
}
if($kstychDialer['mDialerState']=="Progressive"){
if(!is_numeric($callnumber) || strlen($callnumber)<6){
Log::useFiles(storage_path().'/logs/Dialline_block_progressive.log');
Log::info('Number='.$callnumber.' Campaign='.$ppldata['client']);
Log::info('PregMatch='.(!is_numeric($callnumber)).' StringLength='.strlen($callnumber));
if(!is_numeric($callnumber) || strlen($callnumber)<6){
Log::useFiles(storage_path().'/logs/Dialline_block_progressive.log');
Log::info('Number='.$callnumber.' Campaign='.$ppldata['client']);
Log::info('PregMatch='.(!is_numeric($callnumber)).' StringLength='.strlen($callnumber));
}
}
//end
}
}
if($callnumber!=""&&intval($callnumber)>0)
{
$mastersdata=$wakka->getCompanyMaster($ppldata['client']);
......@@ -312,16 +302,14 @@ class DialerController extends Controller {
if($sipid&&$sipid->user==Auth::user()->id&&$sipid->status==1)
{
$dialline=Dialline::where("status","=","Free")->where("enabled","=","1");
$dialline=Dialline::where("status","=","Free")->where("enabled","=","1")->where("server","=",env("app_ip"));
if($dspan!="")$dialline=$dialline->where('dspan','=',$dspan);
$dialline=$dialline->orderBy('updated_at','ASC')->first();
if($dialline)
{
//Log::info("before callconnected".$dialline->status." ^ ".$dialline->dchannel." ^ ".$dialline->dspan." ^ ".$callnumber." ^ ".$dialline->channel);
$dialline->status="Blocked";
$dialline->save();
//Log::info("After diallineset".$dialline->status);
$nowts=microtime(true)*1000;
//get ts_Wait
......@@ -350,7 +338,9 @@ class DialerController extends Controller {
$tdata=array();
$crmcall->data=json_encode($tdata);
$crmcall->save();
if($users[0]['id']>0){
DB::table('records')->where('id',$users[0]['id'])->update(['filter_condition'=>'3','usr_id'=>Auth::user()->id]);
}
//start actual calls
$ppldata['dialer_lastcall']=date("Y-m-d H:i:s");
$preppldata['peopledata'] = serialize($ppldata);
......@@ -415,7 +405,7 @@ if($action=="addconfcall")
$olddialline=Dialline::find($oldcrmcall->dialline_id);
$dspan="1";if($olddialline)$dspan=$olddialline->dspan;
$dialline=Dialline::where("status","=","Free")->where("enabled","=","1");
$dialline=Dialline::where("status","=","Free")->where("enabled","=","1")->where("server","=",env("app_ip"));
if($dspan!="")$dialline=$dialline->where('dspan','=',$dspan);
$dialline=$dialline->orderBy('updated_at','ASC')->first();
......@@ -544,6 +534,7 @@ if($action=="hangupall")
if($action=="closecall")
{
//echo "Manoj";
$callid=intval($kstychCall['callid'])+0;
$crmcall=CRMCall::find($callid);
if($crmcall&&$crmcall->user_id==Auth::user()->id)
......@@ -584,6 +575,7 @@ if($action=="closecall")
if($crmcall->crm_id>0)
{
//print_r("manoj1");
if(is_array($kstychCall["userdata"]))
{
foreach($kstychCall["userdata"] as $tcrmid=>$tuserdata)
......@@ -626,6 +618,7 @@ if($action=="closecall")
$tcrmcall->save();
DB::table('records')->where('id',$crmcall->crm_id)->update(['filter_condition'=>'4']);
$tuser=$wakka->getPerson($tcrmid);
$tuser['peopledata']["dialer_status"]=$kstychCall["userstatus"];
......@@ -639,10 +632,12 @@ if($action=="closecall")
$tuser["resolution"]=$kstychCall["resolution"];
$tuser["satisfy"]=$kstychCall["satisfy"];
$tuser["final_call_assess"]=$kstychCall["final_call_assess"];
//print_r($tuser['peopledata']["status"]);
$tuser['peopledata']["dialer_userdata"]=$kstychCall["userdata"][$tcrmid];
if($tuser['peopledata']["status"]=='New' || $tuser['peopledata']["status"]=='NEW')$tuser['peopledata']["status"]="Called";
if($tuser['peopledata']["status"]=='New' || $tuser['peopledata']["status"]=='NEW' || $tuser['peopledata']["status"]=='Incall')$tuser['peopledata']["status"]="Called";
//Log::info("Manoj ".$tuser['peopledata']["status"]);
//print_r($tuser['peopledata']["status"]);
//for Supervisor Comments - By Manish
$tuser['agentcomments']=$kstychCall["agentcomments"];
$tuser['supcomntid']=$kstychCall["supcomntid"];
......@@ -658,6 +653,9 @@ if($action=="closecall")
$user=$wakka->getPerson($crmcall->crm_id);
if($user['peopledata']['id']==$crmcall->crm_id)
{
if($crmcall->crm_id>0){
DB::table('records')->where('id',$crmcall->crm_id)->update(['filter_condition'=>'4']);
}
$user['peopledata']["dialer_status"]=$kstychCall["userstatus"];
$user['peopledata']["dialer_substatus"]=$kstychCall["usersubstatus"];
$user['peopledata']["dialer_callback"]=$kstychCall["usercallback"];
......@@ -685,7 +683,7 @@ if($action=="closecall")
$user['peopledata']["dialer_userdata"]=$kstychCall["userdata"][$crmcall->crm_id];
$user['peopledata']["dialer_lastcall"]=date("Y-m-d H:i:s");
if($user['peopledata']["status"]=='New' || $user['peopledata']["status"]=='NEW')$user['peopledata']["status"]="Called";
if($user['peopledata']["status"]=='New' || $user['peopledata']["status"]=='NEW' || $user['peopledata']["status"]=='Incall')$user['peopledata']["status"]="Called";
//for Supervisor Comments - By Manish
$user['agentcomments']=$kstychCall["agentcomments"];
$user['supcomntid']=$kstychCall["supcomntid"];
......@@ -700,7 +698,11 @@ if($action=="closecall")
if(!empty($tusers))
{
$tppldata=unserialize($tusers[0]['peopledata']);
if($tppldata['status']=='New')$wakka->setPersonKey($tusers[0]['id'],'status','Called');
if($tppldata['status']=='New' || $tppldata['status']=='Incall')$wakka->setPersonKey($tusers[0]['id'],'status','Called');
//print_r($tppldata['status']);
//Log::info($tppldata['status']);
//if($tppldata['dialer_status']=='') //TODO Config
{
$wakka->setPersonKey($tusers[0]['id'],'dialer_status',$user['peopledata']["dialer_status"]);
......@@ -721,14 +723,6 @@ if($action=="closecall")
$userlog=UserLog::where('user_id','=',Auth::user()->id)->orderBy("id","DESC")->first();
$userlog->getLastTs($crmcall->sipid_id,$nowts);
$userlog->save();
if(Auth::user()->username=='S32732' && $kstychCall['callnumber']=='9324046534'){
try{
$smscontroller = new SmsController();
$smscontroller->sendSmsBasedOnSubDisposition($kstychCall);
} catch(Exception $e) {
Log::info($e->getMessage());
}
}
}
return Response::make("");
......@@ -965,7 +959,6 @@ public function show($id)
$number_list=array();
foreach($mc as $key=>$tcall){
//Log::info($tcall);
$tccal=substr($tcall->number,-10);
$mc_number=CRMCall::where('userstatus','!=','InboundDROP')->where ('created_at','>',$tcall->created_at)->where('number','like',"%".$tccal."%")->orderBy("id","DESC")->first();
......@@ -981,10 +974,8 @@ public function show($id)
$lcalls=DB::select("SELECT * FROM crmcalls where id in (SELECT max(id) FROM crmcalls WHERE number IN ('" . implode("','", $number_list). "') GROUP BY number) ORDER BY id DESC");
//$lcalls=DB::select("SELECT * FROM crmcalls where id in (SELECT max(id) FROM crmcalls WHERE number IN ('" . implode("','", $number_list). "') GROUP BY number)");
//$lcalls=$lcalls->orderBy("id","DESC");
// Log::info($lcalls->id);
foreach($lcalls as $lcall)
{
//Log::info($lcall);
if($lcall->userstatus=="InboundDROP")
{
if($lcall->crm_id>0)
......@@ -1006,13 +997,10 @@ public function show($id)
if(!empty($reccrm_ids))
{
//Log::info($dbres);
$recids_str = implode(",", $reccrm_ids);
$rec=$wakka->getPersonsMissedcall("id in ($recids_str)");
//Log::info($dbres);
$dbres = array_merge($dbres,$rec);
//Log::info($dbres);
}
}
......@@ -1029,12 +1017,11 @@ public function show($id)
$dbres=$wakka->getPersons("dialer_status='$bucket' $currentstatus2 $legalstatus2 $owclientstr limit $bs,$bl");
}
$ccountsummary=array();$k=1;//Log::info(count($dbres));
$ccountsummary=array();$k=1;
foreach($dbres as $dbrow)
{
if(isset($dbrow['callid']))
{
//Log::info($dbrow['callid']);
$lastcall=CRMCall::find($dbrow['callid']);
$callcntmonth=CRMCall::where("number","=",$dbrow['mobile'])->where("created_at",">=",date("Y-m-01 H:i:s",time()+((Auth::user()->timezone)*60)))->count();
}
......@@ -1055,12 +1042,11 @@ public function show($id)
$lasttime=$lastcall->created_at;if($lasttime=="0000-00-00 00:00:00")$lasttime="";else $lasttime=date("d-M-y H:i:s",strtotime($lasttime)-((Auth::user()->timezone)*60));
$dispo=$lastcall->userstatus;
$subdispo=$lastcall->usersubstatus;
$followup=$dbrow[dialer_callback];if($followup=="0000-00-00 00:00:00")$followup="";else $followup=date("d-M-y H:i:s",strtotime($followup)-(Auth::user()->timezone*60));
$followup=$dbrow['dialer_callback'];if($followup=="0000-00-00 00:00:00")$followup="";else $followup=date("d-M-y H:i:s",strtotime($followup)-(Auth::user()->timezone*60));
$remarks=$lastcall->userremarks;
$did=$lastcall->did;
}
//Log::info($dbrow[firstname]);
if(stristr($dbrow[firstname], "_ETHNIC_CODE14") != "")
if(stristr($dbrow['firstname'], "_ETHNIC_CODE14") != "")
{
$rows.="<tr style='background-color: #59ee7c;color:#ffffff;font-weight: bolder;font-size:115%'>";
}
......@@ -1147,7 +1133,7 @@ public function show($id)
$data.="
<div style='clear:both'></div>
<table class='table '>
<table class='table' style='display:none'>
<thead>
<tr>
<th></th>
......@@ -1172,6 +1158,69 @@ public function show($id)
</table>";
return Response::make($data);
}
if($id=="loadFollowupData")
{
$wakka = new KHRMSLib();
$user=Auth::user()->id;
$role = Auth::user()->usertype;
$client = Input::get("client");
$selection = Input::get("selection");
$setClient = '';
$count = 0;
/*$calllog = DB::table('records')
->join('crmcalls', 'records.dialer_callback', '=', 'crmcalls.usercallback')
->select('records.firstname', 'records.cust_id', 'records.mobile', 'records.dialer_callback', 'records.status','records.dialer_lastcall','records.id','records.dialer_status','records.client')
->where("crmcalls.user_id",$user)
//->where("records.dialer_substatus","Follow Up")
->where("records.dialer_callback", "!=","0000-00-00 00:00:00")
//->where("crmcalls.usercallback", "!=","0000-00-00 00:00:00")
//->where("crmcalls.created_at", ">",date("Y-m-d 08:00:00"))
//->where("crmcalls_archive.usercallback", "=","records.dialer_callback")
//->where("records.dialer_lastcall", "<=","crmcalls_archive.usercallback")
->get();*/
$calllog = DB::table('records')
//->join('crmcalls', 'records.dialer_callback', '=', 'crmcalls.usercallback')
->select('records.customer_name', 'records.cust_id', 'records.mobile', 'records.dialer_callback', 'records.status','records.dialer_lastcall','records.id','records.dialer_status','records.client')
->where("records.dialer_callback", "!=","0000-00-00 00:00:00");
if($role == 'Supervisor'){
$userName = Auth::user()->username;
$supervisorUsers=$wakka->LoadAll("select id from users where supervisor='$userName';");
$supervisorUsers = implode(",",$supervisorUsers);
if(!empty($supervisorUsers)){
if($selection == 'all'){
$setClient ='';
}else{
$setClient = $client;
$calllog = $calllog->where('records.client', '=', $client);
}
$calllog = $calllog->whereIn("records.usr_id",[$supervisorUsers])
->get();
$count = count($calllog);
}
}else if($role == 'User'){
if($selection == 'all'){
$setClient ='';
}else{
$setClient = $client;
$calllog = $calllog->where('records.client', '=', $client);
}
$calllog = $calllog->where("records.usr_id",$user)->get();
$count = count($calllog);
}
$data['calllog'] = $calllog;
$data['client'] = $setClient;
$data['count'] = $count;
return view("layout.module.dialer.followUp",$data);
}
if($id=="reports")
{
return view("layout.module.dialer.reports",array());
......@@ -1436,16 +1485,96 @@ public function show($id)
$mroclientstr = $roclientstr;
$client=Input::get("client");
//print_r($client);
if(!empty($roclientstr))$roclientstr="client='$client'";else $roclientstr="";
// echo $roclientstr."Abc";
$users=array();
if(Auth::user()->usertype!="User"){$tusers=array();return $tusers;}
$clientDetails=$wakka->getPersonshome("$roclientstr order by dialer_lastcall asc");
DB::table('records')->where('filter_condition','=','2')->where('modified','<',date('Y-m-d H:i:s',time()-(2*60)))->update(['filter_condition'=>'1']);
// $clientDetails=$wakka->getPersonshome("$roclientstr order by dialer_lastcall asc");
//$campaign=DB::table("campaign_query")->where('campaign', '=', $client)->where('current_queue','=','selected')->first();
if($limit>0)
$tusers=$wakka->getPersonshome("filter_condition IN('0','1','4') and $roclientstr and dialer_callback <'".date('Y-m-d H:i:s',time()+(15*60))."' and usr_id='".Auth::user()->id."' and dialer_substatus='Follow Up' limit 1;");
if(count($tusers)>0){
if($limit>0){
$l=1;
foreach($tusers as $tuser){
if(!isset($users[$tuser['id']])){
$users[$tuser['id']]=$tuser;
$l++;
if($l>$limit)
break;
}
}
$limit=$limit-sizeof($tusers);
}
}
$campaign=DB::table("campaign_query")->where('campaign', '=', $client)->where('current_queue','=','selected')->first();
if($campaign)
{
if(stripos($campaign->where_cond,"order by")===false){
$orderby="order by dialer_lastcall asc";
}else{
$orderby ="";
}
// echo "campaign1";
//print_r($campaign);
$tusers=$wakka->getPersonshome("filter_condition = '1' and $campaign->where_cond $orderby limit 1;");
//print_r($tusers);
if(count($tusers)>0){
if($limit>0){
$l=1;
foreach($tusers as $tuser){
//Log::info($tuser);
if(!isset($users[$tuser['id']])){
//Log::info("2-".$users[$tuser['id']]);
$users[$tuser['id']]=$tuser;
$l++;
if($l>$limit)
break;
}
}
$limit=$limit-sizeof($tusers);
}
}else{
// echo "campaign 2";
$condition=$campaign->where_cond;
if(stripos($condition,"order by")!==false){
// $orderby="order by dialer_lastcall asc";
$condition = substr($condition,0,stripos($condition, 'order by'));
}
//$condition = substr($campaign->where_cond,0,stripos($campaign->where_cond, 'order by'));
$tusers=$wakka->getPersonshome("filter_condition=4 and $condition order by dialer_lastcall asc limit 1;");
if($limit>0){
$l=1;
foreach($tusers as $tuser){
if(!isset($users[$tuser['id']])){
$users[$tuser['id']]=$tuser;
$l++;
if($l>$limit)
break;
}
}
$limit=$limit-sizeof($tusers);
}
}
}else{
$clientDetails=$wakka->getPersonshome("$roclientstr and filter_condition NOT IN ('2','3') order by dialer_lastcall asc limit 1;");
//print_r($clientDetails);
//print_r($clientDetails);
/*if($limit>0)
{
$tusers = array_filter($clientDetails, function($var){
return ($var['dialer_status']=='InboundDROP' && $var['dialer_lastcall']>'2018-09-11 00:00:00' && $var['dialer_lastcall']>date('Y-m-d H:i:s',time()-(7*24*60*60)));
......@@ -1463,9 +1592,9 @@ public function show($id)
}
$limit=$limit-sizeof($tusers);
}
}*/
if($limit>0)
/*if($limit>0)
{
if(!empty($didlinesstr))
{
......@@ -1505,7 +1634,7 @@ public function show($id)
/* Changes For Missed Call - 14/02/17 */
foreach($othermissedcalls as $othermissedcall)
/*foreach($othermissedcalls as $othermissedcall)
{
$crmnumber = substr($othermissedcall->number, -10);
......@@ -1528,11 +1657,11 @@ public function show($id)
/* Changes For Missed Call - 14/02/17 */
foreach($tusers as $tuser)if(!isset($users[$tuser['id']]))$users[$tuser['id']]=$tuser;
/*foreach($tusers as $tuser)if(!isset($users[$tuser['id']]))$users[$tuser['id']]=$tuser;
$limit=$limit-sizeof($tusers);
}
}
}*/
if($limit>0)
......@@ -1540,7 +1669,7 @@ public function show($id)
$tusers = array_filter($clientDetails, function($var){
return ($var['dialer_callback']>'2018-09-11 00:00:00'&&strtotime($var['dialer_callback'])<strtotime(date('Y-m-d H:i:s',time()+(15*60)))&&($var['dialer_status']=='Contacted - FollowUp - Specific' || $var['dialer_substatus']=='Followup Call' || $var['dialer_status']=='Service Call - Inbound Follow up' || $var['dialer_status'])=='Productive Call - Sales Follow Up');
});
// echo "1";
$l=1;
foreach($tusers as $tuser){
if(!isset($users[$tuser['id']])){
......@@ -1556,6 +1685,7 @@ public function show($id)
}
for($p=15;$p>0;$p--)
{
// echo "2";
if($limit>0)
{
$tusers = array_filter($clientDetails, function($var) use ($p){
......@@ -1584,7 +1714,7 @@ public function show($id)
$tusers = array_filter($clientDetails, function($var){
return ($var['status']=='New'&&$var['mobile']!='');
});
// echo "3";
$l=1;
foreach($tusers as $tuser){
if(!isset($users[$tuser['id']])){
......@@ -1602,10 +1732,10 @@ public function show($id)
if($limit>0)
{
$tusers = array_filter($clientDetails, function($var){
//return ($var['status']=='Called'&&($var['dialer_substatus']=='NC - Customer in Meeting' || $var['dialer_substatus']=='NC - Ringing / No response' || $var['dialer_substatus']=='NC - Not Reachable' || $var['dialer_substatus']=='NC - Switched off' || $var['dialer_substatus']=='NC - Third Party' || $var['dialer_status'=='Not Contacted']));
return ($var['status']=='Called'&&$var['dialer_status']=='Not Contacted');
//return ($var['status']=='Called'&&$var['dialer_status']=='Not Contacted');
});
// echo "4";
$l=1;
foreach($tusers as $tuser){
if(!isset($users[$tuser['id']])){
......@@ -1620,7 +1750,7 @@ public function show($id)
$limit=$limit-sizeof($tusers);
}
if($limit>0)
/*if($limit>0)
{
$tusers = array_filter($clientDetails, function($var){
return ($var['status']=='Called'&&$var['dialer_status']=='Contacted - Follow-Up - Generic');
......@@ -1637,10 +1767,11 @@ public function show($id)
}
$limit=$limit-sizeof($tusers);
}
}*/
if($limit>0)
{
// echo "5";
$tusers = array_filter($clientDetails, function($var){
return ($var['status']=='Called'&&$var['dialer_status']=='AUTOWRAPUP');
});
......@@ -1657,7 +1788,7 @@ public function show($id)
$limit=$limit-sizeof($tusers);
}
}
$tusers=array();foreach($users as $tuser)$tusers[]=$tuser;
return $tusers;
}
......
......@@ -103,9 +103,11 @@ class HomeController extends Controller {
$cliarr['keepconf']=Config::get("app.kDialer_keeplocalconf");
//get a free sip id
$server=explode(":",$user->exten);
$sipid=Sipid::where("status","=","0")->where('updated_at','<=',date("Y-m-d H:i:s",time()-600))->orderBy('updated_at','asc')->where('server','!=','');
if(isset($server[2]))$sipid=$sipid->where('server','=',$server[2]);
$sipid=$sipid->first();
//$sipid=Sipid::where("status","=","0")->where('updated_at','<=',date("Y-m-d H:i:s",time()-600))->orderBy('updated_at','asc')->where('server','!=','');
$sipid=Sipid::where("status","=","0")->where('updated_at','<=',date("Y-m-d H:i:s",time()-600))->orderBy('updated_at','asc')->where('server','=',env('app_ip'))->first();
//if(isset($server[2]))$sipid=$sipid->where('server','=',$server[2]);
//$sipid=$sipid->first();
if(!$sipid)return Response::make("Error : Cant Allocate Data Channel. Giving Up.");
$sipid->clients=json_encode($cliarr);
$sipid->user=$user->id;
......
......@@ -148,41 +148,6 @@ class RecordController extends Controller {
return "<script>simpleNotification('error','topRight','Please Get on call first');</script>";
}
}
if($action=="sendsms")
{
$wakka = new KHRMSLib();
$mobile=Input::get("mobile");
$message=Input::get("message");
$url = 'https://10.2.55.165:443/servlet/com.aclwireless.pushconnectivity.listeners.TextListener?';
$inputArray = ['userId'=>'hdfcbalrt',"pass"=>'hdfcbalrt25',"appid"=>"hdfcbalrt","subappid"=>"hdfcbalrt","contenttype"=>"1","to"=>$mobile,"from"=>"HDFCBK","text"=>$message,"selfid"=>"true","alert"=>"1","dlrreq"=>"true","intflag"=>"false"];
$query = http_build_query($inputArray);
$url .= $query;
//echo $url;
// exit;
try{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// curl_setopt($ch,CURLOPT_CONNECTTIMEOUT, 5);
// curl_setopt($ch,CURLOPT_TIMEOUT, 15);
$response = curl_exec($ch);
//echo "Kumar";
// var_dump($response);
//return "<script>simpleNotification('success','topRight',$response);</script>";
curl_close($ch);
return "<script>simpleNotification('success','topRight','Success');</script>";
} catch(Exception $e) {
//echo "Manoj";
$errormessage=$e->getMessage();
return "<script>simpleNotification('error','topRight','Failed to Send Message');</script>";
//var_dump($e->getMessage());
}
//return "<script>simpleNotification('success','topRight','Message is $mobile');</script>";
}
}
public function show($id)
......
......@@ -591,11 +591,11 @@ $data.="</div><div style='width:49%;float:left'>
$attemptsval.="<option value='".$i."'>".$i."</option>";
}
$data.="<p style='clear:both'>
/*$data.="<p style='clear:both'>
<label class=label-small_new style='width:25%;' title=''>Attempts: </label>
<select class='form_hrm_select' id='attempt' name='attempt' style='width:50%'>'".$attemptsval."'
</select>
</p>";
</p>";*/
//Supervisor Comments - By Manish on 16/02/17
......@@ -617,14 +617,14 @@ $data.="</div><div style='width:49%;float:left'>
$data.="<input type='hidden' id='sup_comnt_id' value='".$supComnt['id']."'>
</p>";*/
$data.="<p style='clear:both'>
/*$data.="<p style='clear:both'>
<label class=label-small_new style='width:25%;' title=''>Flag as: </label>
<select class='form_hrm_select' id='dialer_flag' name='dialer_flag'>
<option value=''>Normal</option>
<option value='VIP'>VIP</option>
</select>
<input type='hidden' id='priority' value=''>
</p>";
</p>";*/
$data.="</fieldset></div>
<div style='width:49%;float:left'>
<fieldset>
......@@ -714,7 +714,7 @@ $data.="</fieldset></div>
</p>
</fieldset></div>
<div style='clear:both;width:100%;'>
<!--<div style='clear:both;width:100%;'>
<div style='width:49%;float:left'>
<select class='form_hrm_select' id='serv_vs_prod' name='serv_vs_prod' style='width:49%;background: #f4f4f4;background-image: none;' disabled>
<option value=''>Service vs Product</option>
......@@ -749,7 +749,7 @@ $data.="</fieldset></div>
<option value='Angry'>Angry</option>
</select>
</div>
</div><br><br><br>
</div><br><br><br>--->
<div style='display:none'>
<style>
......@@ -1022,10 +1022,10 @@ $data.="</fieldset></div>
<td class='table_hrm_heading_green'>Remarks</td>
<td class='table_hrm_heading_green'>Custom</td>
<td class='table_hrm_heading_green'>BTTC</td>
<td class='table_hrm_heading_green'>Service vs Product</td>
<!--<td class='table_hrm_heading_green'>Service vs Product</td>
<td class='table_hrm_heading_green'>Resolution</td>
<td class='table_hrm_heading_green'>Satisfaction</td>
<td class='table_hrm_heading_green'>Final Call Assessment</td>
<td class='table_hrm_heading_green'>Final Call Assessment</td>-->
</tr></thead>";
//Log::info($this->varid);
$k=1;
......@@ -1085,10 +1085,10 @@ $data.="</fieldset></div>
<td class=''>".$fullremarkvalue."</td>
<td class=''>".$userdata."</td>
<td class=''>".$records[0]->bttc."</td>
<td class=''>".$records[0]->service_vs_product."</td>
<td class=''>".$records[0]->resolution."</td>
<td class=''>".$records[0]->satisfaction."</td>
<td class=''>".$records[0]->final_call_assessment."</td>
<!-- <td class='' >".$records[0]->service_vs_product."</td>
<td class='' >".$records[0]->resolution."</td>
<td class='' >".$records[0]->satisfaction."</td>
<td class='' >".$records[0]->final_call_assessment."</td>-->
</tr>";
$k++;
}
......@@ -3531,18 +3531,18 @@ function CreateForm(&$frm)
$frm['QuestionAireHist']["{{id}} {{firstname}}"][]=array();}*/
//$frm['QuestionnAire']["{{id}} {{firstname}}"][]=array();
$frm['CLP']["{{id}} {{firstname}}"][]=array();
$frm['CLP History']["{{id}} {{firstname}}"][]=array();
$frm['ComplaintManagement']["{{id}} {{firstname}}"][]=array();
//$frm['CLP']["{{id}} {{firstname}}"][]=array();
//$frm['CLP History']["{{id}} {{firstname}}"][]=array();
//$frm['ComplaintManagement']["{{id}} {{firstname}}"][]=array();
//$frm['ChildCase']["{{id}} {{firstname}}"][]=array();
$frm['Racing Format']["{{id}} {{firstname}}"][]=array();
//$frm['Racing Format']["{{id}} {{firstname}}"][]=array();
//if(Auth::user()->username =="B654321" || Auth::user()->username =="B12345")
//{
$frm['Lead Entry Form']["{{id}} {{firstname}}"][]=array();
$frm['RLP']["{{id}} {{firstname}}"][]=array();
//$frm['Lead Entry Form']["{{id}} {{firstname}}"][]=array();
//$frm['RLP']["{{id}} {{firstname}}"][]=array();
if(Auth::user()->username =="B654321" || Auth::user()->username =="B12345")
{
$frm['One Assist']["{{id}} {{firstname}}"][]=array();
//$frm['One Assist']["{{id}} {{firstname}}"][]=array();
}
}
}
......@@ -3604,15 +3604,15 @@ function CreateForm(&$frm)
if($tbname=='Tasks'&&$edituser)$tabsdata.=$this->createTasksTab();
if($tbname=='Feedback')$tabsdata.=$this->createDispoTab();
if($tbname=='CallHistory')$tabsdata.=$this->createCallsTab();
if($tbname=='CLP')$tabsdata.=$this->createQaireTab();
if($tbname=='CLP History')$tabsdata.=$this->createQaireHistTab();
if($tbname=='ComplaintManagement')$tabsdata.=$this->createCompManage();
if($tbname=='ChildCase')$tabsdata.=$this->createChildCase();
//if($tbname=='CLP')$tabsdata.=$this->createQaireTab();
//if($tbname=='CLP History')$tabsdata.=$this->createQaireHistTab();
//if($tbname=='ComplaintManagement')$tabsdata.=$this->createCompManage();
//if($tbname=='ChildCase')$tabsdata.=$this->createChildCase();
//if($tbname=='RacingCustomer')$tabsdata.=$this->createRacingCust();
if($tbname=='Racing Format')$tabsdata.=$this->createRacingCust();
if($tbname=='Lead Entry Form')$tabsdata.=$this->createLeadEntryForm();
if($tbname=='RLP')$tabsdata.=$this->createRLP();
if($tbname=='One Assist')$tabsdata.=$this->createOneAssistForm();
//if($tbname=='Racing Format')$tabsdata.=$this->createRacingCust();
//if($tbname=='Lead Entry Form')$tabsdata.=$this->createLeadEntryForm();
//if($tbname=='RLP')$tabsdata.=$this->createRLP();
//if($tbname=='One Assist')$tabsdata.=$this->createOneAssistForm();
$tabsdata.="</div>";
$i++;
}
......
......@@ -13,7 +13,7 @@ class KHRMSLib
public $dblink;
public $user=NULL;
public $EMPCacheCols="currentstatus,legalstatus,firstname,lastname,mobile,emailid,altphone1,altphone2,altphone3,altphone4,altphone5,altphone6,altphone7,altphone8,altphone9,altphone10,candidatecategory,nextfollowupdate,passportno,joiningdate,client,designation,supervisor,contracttype,saltotal,ibannumber,servicestoppeddate,employeeexitstatus,exittype,dateofexit,abscondtype,abscondeddate,workflowstatus,status,clientinternalid,department,passportstatus,clientcode,laborcardpersonalid,dialer_status,dialer_substatus,dialer_callback,dialer_remarks,dialer_flag,dialer_lastcall,priority,crmlist_id,group,bttc,service_vs_product,resolution,satisfaction,final_call_assessment,question,mf_isa,DOB,other_information";
public $EMPCacheCols="currentstatus,legalstatus,firstname,lastname,mobile,emailid,altphone1,altphone2,altphone3,altphone4,altphone5,altphone6,altphone7,altphone8,altphone9,altphone10,candidatecategory,nextfollowupdate,passportno,joiningdate,client,designation,supervisor,contracttype,saltotal,ibannumber,servicestoppeddate,employeeexitstatus,exittype,dateofexit,abscondtype,abscondeddate,workflowstatus,status,clientinternalid,department,passportstatus,clientcode,laborcardpersonalid,dialer_status,dialer_substatus,dialer_callback,dialer_remarks,dialer_flag,dialer_lastcall,priority,crmlist_id,group,bttc,service_vs_product,resolution,satisfaction,final_call_assessment,question,mf_isa,DOB,other_information,agreementid,applied_amount,city,comp_code,company,completeddate,cust_id,cust_name,customer_name,disb_date,emi_hl,eqty_amt,foir,ins_amt,int_rate,irr,loan_amount,location,mf_amt,nth,offer_amt,outstanding,pf,ph_mob,ph_off,ph_res,pl_offer,proc_fee,product_flag,profile_new,rank,segment,tenure,tu_application_id,ucic_id,filler1,filler2,filler3,filler4,filler5,filler6,filler7,filler8,filler9,filler10,filler11,filler12,filler13,filler14,filler15";
public $USRCacheCols="id,username,password,fullname,email,status,organization,group,data,presence,timezone,invisible,usertype,diskuse,source,meta,lteam,lteam2,supervisor,created_at,updated_at,remember_token,passwordreset,number1,number2,exten,extencontext,manager";
......
......@@ -469,8 +469,8 @@ class KPAMIListen implements IEventListener
$tsip=Sipid::find($crmcall->sipid_id);
$newqueue=new Kqueue();
$newqueue->playhangupfile($dialline->channel,$dialline->server);
//$newqueue=new Kqueue();
//$newqueue->playhangupfile($dialline->channel,$dialline->server);
$newqueue=new Kqueue();
$newqueue->sipNotify($tsip,"dialerUI","hangup","c",$crmcall->id."~".$crmcall->number."~".base64_encode($channel));
......@@ -497,7 +497,7 @@ class KPAMIListen implements IEventListener
if($crmcall->type=="Inbound"&&$crmcall->user_id==0)//InboundDROP
{
$userslist=User::where('exten','like' ,'%'.$crmcall->did.'%')->where('status','=','Active')->get();
$userslist=User::where('exten','like' ,'%'.$crmcall->did.'%')->get();
foreach ($userslist as $ulist) {
$crmcall->user_id=$ulist->id;
}
......@@ -996,14 +996,10 @@ class KPAMIListen implements IEventListener
$tdata=array();
$tdata['uniqueid']=$uniqueid;
$tdata['inboundchannel']=$channel;
//Log::useFiles(storage_path().'inbound_log_'.date("Y-m-d").'.log');
// Log::info("inboundNumber ".$crmcall->number);
$crmcall->data=json_encode($tdata);
$crmcall->save();
if($crmcall->did=='46130234'){
// Log::useFiles(storage_path().'inbound_log_'.date("Y-m-d").'.log');
Log::info("inboundNumber ".$crmcall->number);
}
$userStatus=User::where("updated_at",">",date("Y-m-d"))->where("exten","like","%".substr($exten,-4)."%")->where("usertype","!=","Admin")->where('presence', '=', '1')->select('*')->get();
if($userStatus=="[]")
......@@ -1060,7 +1056,8 @@ if($crmcall->did=='46130234'){
$users=$wakka->searchPhone("mobile",$crmcall->number);
if(!empty($users))
{
$ppldata=unserialize($users[0]['peopledata']);
$ppldata=unserialize($users[0]['peopledata']);
$crmcall->crm_id=$users[0]['id'];
$crmcall->number=$users[0]['mobile'];
$crmcall->client=($ppldata['client']?$ppldata['client']:"");
......@@ -1078,15 +1075,8 @@ if($crmcall->did=='46130234'){
echo "User Not Found!!\n";
}
$crmcall->save();
// Log::useFiles(storage_path().'inbound_log_'.date("Y-m-d").'.log');
//if($crmcall->did=='46130234'){
// Log::info("inbound 1".$crmcall->crm_id." ~ ".$crmcall->number." ~ ".$crmcall->did);
//}
}
// Log::useFiles(storage_path().'inbound_log_'.date("Y-m-d").'.log');
if($crmcall->did=='46130234'){
Log::info("inbound ".$crmcall->crm_id." ~ ".$crmcall->number." ~ ".$crmcall->did);
}
$sipids=array();
if($crmcall->client!="")
{
......@@ -1206,7 +1196,7 @@ if($crmcall->did=='46130234'){
foreach($allsipids as $tsip)
{
$newqueue=new Kqueue();
$newqueue->sipNotify($tsip,"popupalert"," Incoming Calls",$crmcall->number."|".$crmcall->client,$crmcall->did);
$newqueue->sipNotify($tsip,"popupalert"," Incoming Calls",$crmcall->number."|".$crmcall->client,"");
}
}
else
......
......@@ -109,15 +109,15 @@ return [
"RecordingQC"=>["menuAction('dialer/recqc');","A"],
"RecordingArchive"=>["menuAction('dialer/recarchive');","A"],
]],
"Campaign" => ["disp"=>"FCM","icon"=>"file","dash"=>"",
"submenu"=>["FCM"=>["menuAction('campaign');"],
"Campaign" => ["disp"=>"Campaign Management","icon"=>"file","dash"=>"",
"submenu"=>["Campaign Management"=>["menuAction('campaign');"],
"Bulk Upload"=>["menuAction('campaign/bulkupload');"],
]],
"Admin" => ["disp"=>"Admin","icon"=>"gear","dash"=>"",
"submenu"=>["Masters"=>["showBlock('Masters');"],
"Delete Record"=>["showBlock('DeletePerson');"],
"Access Log"=>["menuAction('admin/accesslog');"],
"DialerReports"=>["menuAction('dialer/areports');"],
//"DialerReports"=>["menuAction('dialer/areports');"],
]],
"Notification"=> ["disp"=>"Notification","icon"=>"home","dash"=>"","onclick"=>""],
"Message" => ["disp"=>"Message","icon"=>"home","dash"=>"","onclick"=>""],
......
......@@ -60,8 +60,8 @@ kstychCall['agentcomments']='';
kstychCall['supcomntid']='';
kstychCall['userdata']={};
kstychCall['previewcrmid']='';
kstychCall['callWrapupTime']=300;
kstychCall['prograssiveDelay']=120;
kstychCall['callWrapupTime']=180;
kstychCall['prograssiveDelay']=10;
kstychCall['ts_now']=0;
kstychCall['bttc_day']='';
......@@ -143,8 +143,6 @@ function kcallHasConnection(number)
function dialerQuickOpen(varid,num,state,substate,autorun)
{
resetCallArray();
console.log("Manojquick");
if(kstychCall['mCallState']=="Wait")
{
var oldpreviewid=kstychCall['previewcrmid'];
......@@ -282,8 +280,7 @@ function kCallAction(num,action)
function dialerDispNumberClick()
{
var lastnumber=$("#spandialer_num").html();
console.log(lastnumber);
kstychCall['callWrapupTime']=300;
kstychCall['callWrapupTime']=180;
if(kstychCall['mCallState']=="Dispo")
{
......@@ -328,9 +325,6 @@ function dialerAddConfCall()
function incomingCall(calllog,crmid,numnchn)
{
//document.getElementById("hangup").play();
//stopRingTone();
console.log("incoming 1");
resetCallArray();
$("#dialersearchresults").html('<div id=divworking></div><div style="clear:both"></div>');
var number = numnchn.substring(0, numnchn.indexOf('@'));
......@@ -342,11 +336,10 @@ function incomingCall(calllog,crmid,numnchn)
kSetDData('C','callid',calllog);
kSetDData('C','crmid',crmid);
console.log(crmid);
if(crmid>0)showRecruit(crmid);
else
{
console.log("incoming else");
createSearchRecordDiv('dialersearchresults');
}
......@@ -362,7 +355,6 @@ function incomingCall(calllog,crmid,numnchn)
function dialerUIUpdate(var1,var2,var3)
{
console.log("UIupdate");
var3parts=var3.split("~");
var3parts[2]=atob(var3parts[2]);
if(var1=="dialstart")
......@@ -431,17 +423,9 @@ function dialerUIUpdate(var1,var2,var3)
function incomingPopupAlert(var1,var2,var3)
{
var loginRoleArray=["R14306"];
var fullexten = $('#userExtension').val();
console.log(fullexten);
var exten =fullexten.split(':')[0];
console.log("exten1 "+exten);
//var incomingnotify=growlSNotify(var1,var2,"top-right");
//setTimeout(function(){$.gritter.remove(incomingnotify, {fade: true,speed: 'slow'});incomingnotify=0;},1500);
if((kstychCall['ts_Talk']===0 && kstychCall['ts_Call']===0)){
if($.inArray($('#userLoginRole').val(), loginRoleArray)>-1 && (var3===exten))startRingTone();
}
console.log(var1+"Var 1"+"Var 2"+var2+"Var 3"+var3);
//document.getElementById("hangup").play();
$.titleAlert(var1+" "+var2, {
requireBlur:true,
stopOnFocus:true,
......@@ -451,7 +435,6 @@ console.log(var1+"Var 1"+"Var 2"+var2+"Var 3"+var3);
//incomingbeepstart();
kDesktopNotification("",var1,var2,1500);
setTimeout(stopRingTone, 3000);
}
function outgoingCall()
......@@ -659,11 +642,11 @@ console.log(fullRem);
}
}*/
if(kstychCall['userstatus'].toLowerCase().indexOf("follow")>-1||kstychCall['userstatus'].toLowerCase().indexOf("callback")>-1)
if(kstychCall['usersubstatus'].toLowerCase().indexOf("follow up")>-1||kstychCall['userstatus'].toLowerCase().indexOf("callback")>-1)
{
if($('#dialer_usercallback').val()=="")
{
console.log("followup");
//console.log("followup");
simpleNotification('error','topRight',"Please select Callback date within one month in future");
return;
}
......@@ -792,7 +775,6 @@ console.log(fullRem);
function showWrapUp()
{
incomingbeepstart();
//document.getElementById("hangup").play();
kstychCall['userstatus']="Paused";
kstychCall['usersubstatus']="WRAPUP";
......@@ -893,8 +875,8 @@ function resetCallArray()
if(typeof customerDispofields != 'undefined')customerDispofields={};
kSetDData('C','previewcrmid',"");
kSetDData('C','callWrapupTime',300);
kSetDData('C','prograssiveDelay',120);
kSetDData('C','callWrapupTime',180);
kSetDData('C','prograssiveDelay',10);
}
function updateDialerState(objstr,key,val,key2,val2)
......@@ -916,16 +898,7 @@ function updateDialerState(objstr,key,val,key2,val2)
{
resetCallArray();
}
console.log("manojstatechanged");
if(val=="Manual"){
console.log("Manoj");
resetCallArray();
}
if(val2=="Incoming"){
console.log("Manoj Incoming");
resetCallArray();
}
$("#dialersearchresults").html("");
......@@ -944,8 +917,7 @@ function updateDialerState(objstr,key,val,key2,val2)
function(retstr){
if(kstychCall['previewcrmid']!="")
{
console.log("manojpreview");
//kSetDData('C','previewcrmid',"");
kSetDData('C','previewcrmid',"");
updateDialerState();
}
else
......@@ -1216,7 +1188,7 @@ function dialerTimersUpdate()
{
if(Math.ceil(((kstychCall['ts_Dispo']-kstychCall['ts_Talk'])/1000))<3)
{
kstychCall['callWrapupTime']=90;
kstychCall['callWrapupTime']=60;
if(typeof dispoClassArray!='undefined' && typeof dispoClassArray['NA'] != 'undefined')
{
if($('#dialer_userstatus').val()=="")
......@@ -1234,7 +1206,7 @@ function dialerTimersUpdate()
saveCloseDialerCall('AUTOWRAPUP');
}
if(thiswraptime==90 || thiswraptime==300)
if(thiswraptime==60 || thiswraptime==180)
{
showWrapUp();
}
......@@ -1245,7 +1217,7 @@ function dialerTimersUpdate()
}
else if(kstychCall['ts_Talk']>1)
{
kstychCall['callWrapupTime']=300;
kstychCall['callWrapupTime']=180;
dispT="Talk : "+Math.ceil(((getNowTS()-kstychCall['ts_Talk'])/1000));
$("#spandialer_ts").html(dispT);
$("#dialertimes1").removeClass("btn-primary").addClass("btn-default");
......
@include("layout/module/campaign/formBuilder")
<?php
$queryFields = explode(",", 'id,created,modified,currentstatus,legalstatus,firstname,lastname,mobile,emailid,client,status,clientinternalid,clientcode,priority,dialer_status,dialer_substatus,dialer_callback,dialer_remarks,dialer_flag,dialer_lastcall,crmlist_id,group,dbc_activation,digital_initiative,original_created_file,original_uploaded_date,partial_uploaded_date,dialer_last_user_id,dialer_lastcall_did,dialer_lastcall_number,bttc,service_vs_product,resolution,satisfaction,final_call_assessment,old_status,old_dialer_status,old_dialer_substatus,question,trigger_details,mf_isa,DOB,other_information,filter_condition,agreementid,applied_amount,city,comp_code,company,completeddate,cust_id,cust_name,customer_name,disb_date,emi_hl,eqty_amt,foir,ins_amt,int_rate,irr,loan_amount,location,mf_amt,nth,offer_amt,outstanding,pf,ph_mob,ph_off,ph_res,pl_offer,proc_fee,product_flag,profile_new,rank,segment,tenure,tu_application_id,ucic_id,filler1,filler2,filler3,filler4,filler5,filler6,filler7,filler8,filler9,filler10,filler11,filler12,filler13,filler14,filler15');
?>
@if($campaignDetails)
<hr style="margin-top: 10px;margin-bottom: 10px;" />
<div class="row">
......@@ -32,6 +34,17 @@
<strong>Total</strong> <span class="badge"><strong>{{ isset($totalRecordsByDisposition) ? $totalRecordsByDisposition : '0' }}</strong></span>
</li>
</ul>
<ul class="list-group">
<li class="list-group-item active">Filter Column</li>
@foreach($queryFields as $fields)
<li class="list-group-item">
{{$fields}}
</li>
@endforeach
</ul>
</div>
<div class="col-sm-10">
<div id="tabs">
......@@ -55,7 +68,7 @@
<a href="#ctSql" aria-controls="sql" role="tab" data-toggle="tab">Filter Condition</a>
</li>
<li role="presentation">
<a href="#ctSql1" aria-controls="sql" role="tab" data-toggle="tab">Filter Apply</a>
<a href="#ctSql1" aria-controls="sql" role="tab" data-toggle="tab">Data Selection Strategy</a>
</li>
<li role="presentation">
<a href="#assign" aria-controls="sql" role="tab" data-toggle="tab">User Assign</a>
......@@ -81,7 +94,7 @@
<div role="tabpanel" class="tab-pane active" id="ctSql">
@include("layout/module/campaign/campaignTabSql")
</div>
<div role="tabpanel" class="tab-pane" id="ctSql1">
<div role="tabpanel" class="tab-pane " id="ctSql1">
@include("layout/module/campaign/campaignTabSqlCond")
</div>
<div role="tabpanel" class="tab-pane" id="assign">
......
<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>Bulk Upload</h4>
<hr style="margin-bottom: 10px;" />
<div class="row">
<div class="col-lg-6">
<div class="form-inline">
<form method="post" id="bulkUpload" enctype="multipart/form-data">
<input type=hidden name=uploadSet value='1'>
{{ csrf_field() }}
<div class="col-md-2">
<label>Upload Users:</label>
</div>
<div class="col-md-4">
<input type="file" name="file" id="file" required />
</div>
<div class="col-md-2">
<input type="submit" name="upload" id="upload" class="btn btn-primary" value="Upload">
</div>
<div class="col-md-2">
<!--- <span><a href="javascript:void(0)" id="downloadExcel">Sample excel format</a></span>--->
</div>
</form>
</div>
</div>
<div class="col-lg-6">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function(){
$('#bulkUpload').on('submit', function(event){
event.preventDefault();
var formData = new FormData(this);
$.ajax({
url:"campaign?action=bulkupload",
method:"POST",
data:formData,
dataType:'JSON',
contentType: false,
cache: false,
processData: false,
success:function(data)
{
simpleNotification('Success','topRight',"Campaign assign suceesfully!");
$('#bulkUpload').trigger("reset");
$("#file").val(null);
},
error: function(error)
{
simpleNotification('Success','topRight',"Something went wrong!");
},
});
});
$('#downloadExcel').click(function(){
event.preventDefault();
doAjax("campaign/sampleDataExcel","","","","","GET");
return false;
});
});
</script>
@include("layout/module/campaign/formBuilder")
@if($campaignDetails)
<hr style="margin-top: 10px;margin-bottom: 10px;" />
<div class="row">
<div class="col-sm-2">
<h4 class="text-center"><span class="text-info"> {{ is_array($campaignDetails)?$campaignDetails['mkey']:$campaignDetails->mkey}}</span> <small>campaign</small></h4>
<ul class="list-group">
<li class="list-group-item active">By Call Status</li>
<?php $totalRecordsByStatus = 0; ?>
@foreach($dataCountByStatus as $data)
<li class="list-group-item">
{{ $data->status ? $data->status : '- Blank -' }} <span class="badge">{{$data->recordCount}}</span>
</li>
<?php $totalRecordsByStatus += $data->recordCount; ?>
@endforeach
<li class="list-group-item" style="background-color:#f6f7fb;">
<strong>Total</strong> <span class="badge"><strong>{{ isset($totalRecordsByStatus) ? $totalRecordsByStatus : '0' }}</strong></span>
</li>
</ul>
<ul class="list-group">
<li class="list-group-item active">By Disposition</li>
<?php $totalRecordsByDisposition = 0; ?>
@foreach($dataCountByDisposition as $data)
<li class="list-group-item">
{{ $data->dialer_status ? $data->dialer_status : '- Blank -' }} <span class="badge">{{$data->recordCount}}</span>
</li>
<?php $totalRecordsByDisposition += $data->recordCount; ?>
@endforeach
<li class="list-group-item" style="background-color:#f6f7fb;">
<strong>Total</strong> <span class="badge"><strong>{{ isset($totalRecordsByDisposition) ? $totalRecordsByDisposition : '0' }}</strong></span>
</li>
</ul>
</div>
<div class="col-sm-10">
<div id="tabs">
<ul class="nav nav-tabs" role="tablist">
<!-- <li role="presentation">
<a href="#ctCrm" aria-controls="home" role="tab" data-toggle="tab">CRM</a>
</li>
<li role="presentation">
<a href="#ctScript" aria-controls="profile" role="tab" data-toggle="tab">Script</a>
</li>
<li role="presentation">
<a href="#ctFeedback" aria-controls="messages" role="tab" data-toggle="tab">Feedback</a>
</li>
<li role="presentation">
<a href="#ctSettings" aria-controls="settings" role="tab" data-toggle="tab">Settings</a>
</li>
<li role="presentation">
<a href="#ctData" aria-controls="data" role="tab" data-toggle="tab">Data</a>
</li> -->
<li role="presentation" class="active">
<a href="#ctSql" aria-controls="sql" role="tab" data-toggle="tab">Filter Condition</a>
</li>
<li role="presentation">
<a href="#ctSql1" aria-controls="sql" role="tab" data-toggle="tab">Filter Apply</a>
</li>
<li role="presentation">
<a href="#assign" aria-controls="sql" role="tab" data-toggle="tab">User Assign</a>
</li>
<li role="presentation">
<a href="#schedule" aria-controls="sql" role="tab" data-toggle="tab">Scheduler</a>
</li>
<li role="presentation">
<a href="#disposition" aria-controls="sql" role="tab" data-toggle="tab">Disposition</a>
</li>
</ul>
<div class="tab-content">
<!-- <div role="tabpanel" class="tab-pane" id="ctCrm">
</div>
<div role="tabpanel" class="tab-pane" id="ctScript">
</div>
<div role="tabpanel" class="tab-pane" id="ctFeedback">
</div>
<div role="tabpanel" class="tab-pane" id="ctSettings">
</div>
<div role="tabpanel" class="tab-pane" id="ctData">
</div> -->
<div role="tabpanel" class="tab-pane active" id="ctSql">
@include("layout/module/campaign/campaignTabSql")
</div>
<div role="tabpanel" class="tab-pane" id="ctSql1">
@include("layout/module/campaign/campaignTabSqlCond")
</div>
<div role="tabpanel" class="tab-pane" id="assign">
@include("layout/module/campaign/campaignAssignToAgents")
</div>
<div role="tabpanel" class="tab-pane" id="schedule">
@include("layout/module/campaign/campaignScheduler")
</div>
<div role="tabpanel" class="tab-pane" id="disposition">
@include("layout/module/campaign/campaignAssignToDisposition")
</div>
</div>
</div>
</div>
</div>
@else
<br/>
<p class="text-danger text-center">Campaign not found.</p>
@endif
<style>
.tab-pane{padding: 10px;border: 1px solid #ed5564;border-top: none;}
.nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus{border: 1px solid #ed5564;border-bottom-color: transparent;}
</style>
<?php
$dashboarduser=Auth::user();
if($dashboarduser->usertype != 'Admin'){
$allusers=User::where(function ($query) use($dashboarduser) {
$query->where('supervisor','=',$dashboarduser->username)
->orWhere('lteam2','=',$dashboarduser->username)
->orWhere('lteam','=',$dashboarduser->username);
})->get();
}
else
{
$allusers=DB::table('users')->select('*')->where('status','=','Active')->get();
}
foreach($userassignedcampign as $userassigned)
{
$userassignedcamp[] = $userassigned->username;
}
foreach($allusers as $alluser)
{
if (isset($userassignedcamp)) {
if (!in_array($alluser->username, $userassignedcamp))
{
$username[] = $alluser->username;
}
}
else{
$username[] = $alluser->username;
}
}
foreach($allusers as $user)
{
$campaigns=$user->clients;
if(isset($data->hrmsdata))
{print_r('man');echo "<br><br>";
$hrmsdata=unserialize($data['hrmsdata']);
// $campaignList = $hrmsdata['clientsownerlist'];print_r($campaignList);
}
//$username[] = $alluser->username;
}
//$data['client'] = $client;
// if(isset($username))$data->username = $username;
?>
<div class="row">
<div class="col-md-12">
<div class="panel panel-info">
<div class="panel-body">
<div class="col-md-2">
<label>Select User:</label>
</div>
<div class="col-md-6">
<select id="username" class="select2multi" style='width:100%' multiple="">
<option value></option>
<?php if(isset($username))foreach($username as $user){;echo "<option value='$user'>$user</option>";} ?>
</select>
</div>
<div class="col-md-2">
<button id="assigncampaign" class="btn btn-xs btn-info">Assign Campaign
</button>
</div>
</div>
</div>
<div class="panel panel-info">
<div class="panel-body">
<form method="post" id="upload_form" enctype="multipart/form-data">
<input type=hidden name=uploadSet value='1'>
{{ csrf_field() }}
<div class="col-md-2">
<label>Upload Users:</label>
</div>
<div class="col-md-6">
<input type="file" name="file" id="file" required />
</div>
<div class="col-md-2">
<input type="submit" name="upload" id="upload" class="btn btn-primary" value="Upload">
</div>
</form>
</div>
</div>
<!--<div class="panel panel-info">
<div class="panel-body">
<div class="col-md-2">
<label>Upload Users:</label>
</div>
<div class="col-md-6">
<input type="file" name="user">
<input type="file" name="file" id="file" required />
</div>
<div class="col-md-2">
<button id="upload" class="btn btn-xs btn-info">Upload
</button>
</div>
</div>
</div> -->
<div class="panel panel-info">
<div class="panel-heading "><strong>Assigned Users List</strong><div style="float:right;">
<button id="removeuser" class="btn btn-xs btn-info">Edit User
</button>
</div></div>
<div class="panel-body">
<div class="col-md-12" id="dbs">
@foreach ($userassignedcampign as $row)
<div class="col-md-1">{{$row->username}}</div>
@endforeach
</div>
<div class="col-md-12" id="abs" style="display:none">
<div class="col-md-6">
<select id="username1" class="select2multi" style='width:100%' multiple="">
<option value></option>
<?php if(isset($userassignedcamp))foreach($userassignedcamp as $userassigned){;echo "<option value='$userassigned' selected>$userassigned</option>";} ?>
</select>
</div>
<div class="col-md-2">
<button id="removecampaign" class="btn btn-xs btn-info">Save
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function(){
$('#upload_form').on('submit', function(event){
var selectCampaignField = $('#selectCampaignField').val();
var formData = new FormData(this);
formData.append('selectCampaignField', selectCampaignField);
event.preventDefault();
$.ajax({
url:"campaign?action=upload",
method:"POST",
data:formData,
dataType:'JSON',
contentType: false,
cache: false,
processData: false,
success:function(data)
{
doAjax("campaign/show","campaign="+selectCampaignField,"campaignDetailsArea","","","GET",function(retrstr){
simpleNotification('Success','topRight',"Campaign assign suceesfully!");
$('.nav-tabs a[href="#assign"]').tab('show');
});
}
});
});
});
</script>
<script>
function addInQueue(){
var data = 'radioValue='+$("input[name='query']:checked").val();
doAjax("campaign/addCurrQueue",data,"","","","GET");
}
$('#assigncampaign').click(function()
{
var agents = $('#username').val();
var selectCampaignField = $('#selectCampaignField').val();
if(agents&&selectCampaignField)
{
var postdata='agents='+agents;
postdata+='&selectCampaignField='+selectCampaignField;
doAjax("campaign/assigncampaign",postdata,"campaignDetailsArea","","","GET",function(retrstr){
doAjax("campaign/show","campaign="+selectCampaignField,"campaignDetailsArea","","","GET",function(retrstr){
simpleNotification('Success','topRight',"Campaign assign suceesfully!");
$("#usrname").select2("val", "Select User...");
$("#selectCampaignField").select("val", "Select Dial Mode...");
$('.nav-tabs a[href="#assign"]').tab('show');
});
});
}
else
{
$("#campaignDetailsArea").html('<br/><p class="text-danger text-center">Please select the campaign and user.</p>');
}
});
$("#removeuser").click(function(){
$("#dbs").hide();
$("#abs").toggle();
});
$('#removecampaign').click(function()
{
var agents = $('#username1').val();
var selectCampaignField = $('#selectCampaignField').val();
if(selectCampaignField)
{
var postdata='agents='+agents;
postdata+='&selectCampaignField='+selectCampaignField;
doAjax("campaign/removecampaign",postdata,"campaignDetailsArea","","","GET",function(retrstr){
doAjax("campaign/show","campaign="+selectCampaignField,"campaignDetailsArea","","","GET",function(retrstr){
simpleNotification('Success','topRight',"Campaign assign suceesfully!");
$("#usrname").select2("val", "Select User...");
$("#selectCampaignField").select("val", "Select Dial Mode...");
$('.nav-tabs a[href="#assign"]').tab('show');
});
});
}
else
{
$("#campaignDetailsArea").html('<br/><p class="text-danger text-center">Please select the campaign and user.</p>');
}
});
</script>
<style>
.list-group{
padding: 5px;
margin: 0px;
overflow:auto;
width:100%
}
</style>
<div class="row">
<div class="col-md-12">
<div class="panel panel-info">
<div class="panel-body">
<div class="row" style="margin: 5px">
<div class="col-md-2">
<label>Select Disposition:</label>
</div>
<div class="col-md-6">
<select id="disposition" class="form-control" onchange='subDisposition($(this).val());'>
<option value></option>
<?php if(isset($disposition))
foreach($disposition as $kay => $val)
{
$code = $dispositionCode[$kay];
echo "<option data-id='$code' data-text='$kay' value='$val'>$kay</option>";
} ?>
</select>
</div>
</div>
<div class="row" style="margin: 5px">
<div class="col-md-2">
<label>Select Sub Disposition:</label>
</div>
<div class="col-md-6">
<select id="subDisposition" class="select2multi" style='width:100%' multiple="">
</select>
</select>
</div>
</div>
<div class="row">
<div class="col-md-2">
<button id="assigndesposition" class="btn btn-xs btn-info">Assign Disposition
</button>
</div>
<div class="col-md-8" id="error">
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-12">
<div class="panel panel-info">
<div class="panel-heading"><strong>Disposition List</strong></div>
<div class="panel-body" id="">
<ul class="list-group">
<?php foreach($dispositionList as $key => $val) { if(!empty($val)){ ?>
<li class="list-group-item list-group">
<div class="col-sm-12">
<div class="col-sm-3"><?php echo $key; ?></div>
<div class="col-sm-6"><?php echo $val; ?></div>
<div class="col-sm-2"><a class="innerAll" href="#" onclick="deleteDesposition('<?php echo $key; ?>');">
<span class="btn btn-primary btn-xs"><i class="fa fa-trash-o"></i></span>
</a></div>
</div>
</li>
<?php }} ?>
</ul>
</div>
</div>
</div>
</div>
<script>
function subDisposition(dispo)
{
var dispolist = dispo.split(',');
/*var dispolist = [];
$.each( dispo, function( index, value ){
dispolist = $.merge( dispolist, value.split(',') );
});*/
$("#subDisposition").select2("val", "Select");
updateJSSelect('subDisposition',dispolist);
}
function deleteDesposition(key)
{
var selectCampaignField = $('#selectCampaignField').val();
var postdata='disposition='+key;
postdata+='&selectCampaignField='+selectCampaignField;
doAjax("campaign/deleteAssignDisposition",postdata,"campaignDetailsArea","","","GET",function(retrstr){
simpleNotification('Success','topRight',"Campaign assign suceesfully!");
doAjax("campaign/show","campaign="+selectCampaignField,"campaignDetailsArea","","","GET",function(retrstr){
$("#subDisposition").select2("val", "Select");
$('.nav-tabs a[href="#disposition"]').tab('show');
});
});
}
$('#assigndesposition').click(function()
{
$("#error").html('');
var code = $('#disposition').find(':selected').attr('data-id')
//var disposition = $("#disposition option:selected").text();
var disposition = $('#disposition').find(':selected').attr('data-text')
var subDisposition = $('#subDisposition').val();
var selectCampaignField = $('#selectCampaignField').val();
//alert(selectCampaignField);
if(disposition&&selectCampaignField)
{
var postdata='disposition='+disposition;
postdata+='&code='+code;
postdata+='&disposition='+disposition;
postdata+='&subDisposition='+subDisposition;
postdata+='&selectCampaignField='+selectCampaignField;
doAjax("campaign/assigndisposition",postdata,"campaignDetailsArea","","","GET",function(retrstr){
simpleNotification('Success','topRight',"Campaign assign suceesfully!");
doAjax("campaign/show","campaign="+selectCampaignField,"campaignDetailsArea","","","GET",function(retrstr){
$("#subDisposition").select2("val", "Select");
$('.nav-tabs a[href="#disposition"]').tab('show');
});
});
}
else
{
$("#error").html('<p class="text-danger text-center">Please select the campaign and disposition.</p>');
return false;
}
});
</script>
<?php
$queryFields = explode(",", 'status,dialer_status,dialer_substatus,usr_id,branchCode,organizationName,designation,dob,location,state,residenceAddress,residenceAddressZipCode,officeAddress,officeAddressZipCode,alternateMobile,officeNumber,referenceName,referenceMobile,referenceName2,referenceMobile2,loanStatus,product,bucket,dpd,tenureStartDate,tenureEndDate,tenureRemaining,disbursalDate,rateOfInterest,installmentNo,chequeBounceNo,reasonForLastBounce,reasonForSecondLastBounce,cycleDate,ebnb,bank,lastMonthPaymentMode,lastMonthPaymentAmount,lastMonthPaymentDate,delinquencyString,specialCode,centralECS,emi,pos,bounceCharge,penalMTD,penalLTD,overdueAmount,installmentAmountOverdue,altphone1,altphone2,altphone3,altphone4,altphone5,altphone6,altphone7,altphone8,altphone9,altphone10,priority,dialer_substatus,dialer_callback,elegible');
?>
<div class="row">
<div class="col-md-12">
<div class="panel panel-info">
<div class="panel-body">
<!--<p><button id='addquery' class="btn btn-xs btn-info">ADD</button></p>--->
<label> Filter Name</label>
<input id='filtername' type='text' />
<select id="columnSelect" multiple="" style='width:100%' class=select2multi>
@foreach($queryFields as $fields)
<option value="{{$fields}}">{{$fields}}</option>
@endforeach
</select>
<button type="submit" class="btn btn-success pull-right" value='Prepare' id='prepare'>Prepare</button>
</div>
<div>
</div>
</div>
</div>
</div>
<script>
$("#prepare").click(function(){
console.log($("#columnSelect").val().length);
});
</script>
<?php
?>
<div class="row">
<div class="col-md-12">
<div class="panel panel-info">
<div class="panel-body">
<p><label class='label-small_new' style='width:15%'>Campaign Start Date :</label><input type=text class='form_new form_new_amend datetimepicker' name=campaignstartdate id=campaignstartdate value="{{ isset($campaignDetails->campaignstartdate)?$campaignDetails->campaignstartdate:'0000-00-00 00:00:00' }}"></p>
<p><label class='label-small_new' style='width:15%'>Campaign End Date :</label><input type=text class='form_new form_new_amend datetimepicker' name=campaignenddate id=campaignenddate value="{{ isset($campaignDetails->campaignenddate)?$campaignDetails->campaignenddate:'0000-00-00 00:00:00' }}" ></p>
<div class="col-md-2">
<button id="scheduleCampaign" class="btn btn-xs btn-info">Schedule
</button>
</div>
</div>
</div>
</div>
</div>
<script>
$('#scheduleCampaign').click(function(){
var selectCampaignField = $('#selectCampaignField').val();
var starttime = $('#campaignstartdate').val();
var endtime = $('#campaignenddate').val();
console.log(endtime);
if(endtime != "0"){
var postdata='selectCampaignField='+selectCampaignField+'&starttime='+starttime+'&endtime='+endtime;
doAjax("campaign/schedulecampaign",postdata,"campaignDetailsArea","","","GET",function(retrstr){
doAjax("campaign/show","campaign="+selectCampaignField,"campaignDetailsArea","","","GET");
simpleNotification('Success','topRight',"Campaign scheduled suceesfully!");
$("#usrname").select2("val", "Select User...");
$("#selectCampaignField").select("val", "Select Dial Mode...");
});
}else{
$("#campaignDetailsArea").html('<br/><p class="text-danger text-center">Please select the Start and End time.</p>');
}
});
$('body').on('focus',".datetimepicker", function(){
$(this).datetimepicker({format: 'YYYY-MM-DD HH:mm'});
});
</script>
<div class="row">
<div class="btn-group pull-right">
<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-fw fa-plus-square"></i> Add Field <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="#" onclick="fbAddField('layout','addCrmArea');return false;"><i class="fa fa-fw fa-th-large"></i> Layout</a></li>
<li><a href="#" onclick="fbAddField('text','addCrmArea');return false;"><i class="fa fa-fw fa-font"></i> Text</a></li>
<li><a href="#" onclick="fbAddField('select','addCrmArea');return false;"><i class="fa fa-fw fa-indent"></i> Select Box</a></li>
<li><a href="#" onclick="fbAddField('date','addCrmArea');return false;"><i class="fa fa-fw fa-calendar"></i> Date</a></li>
<li><a href="#" onclick="fbAddField('textArea','addCrmArea');return false;"><i class="fa fa-fw fa-list-alt"></i> Text Area</a></li>
</ul>
</div>
</div>
<div class="modal fade" id="fbAddFieldForm" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body" id="fbAddFieldFormContent"></div>
</div>
</div>
</div>
<hr style="margin:5px 0;border: 1px solid #ed5564;" />
<div id="addCrmArea"></div>
<script>
var feedbackForm = '{"formData":{"row1":{"column1":{"columnName":"Personal Information","columnCount":"6","fields":{"customerName":{"type":"text","name":"customerName","title":"Customer Name","required":true,"default":"","editable":true},"customerType":{"type":"select","name":"customerType","title":"Customer Type","required":true,"options":"Existing,New,MNP,Corporate","default":"Existing","editable":true},"customerAddress":{"type":"textArea","name":"customerAddress","title":"Customer Address","required":true,"default":"","editable":true},"birthDate":{"type":"date","name":"birthDate","title":"Birth Date","required":true,"default":"","editable":true}}},"column2":{"columnName":"Plan Details","columnCount":"6","fields":{"planName":{"type":"text","name":"planName","title":"Plan Name","required":true,"default":"","editable":true},"planType":{"type":"select","name":"planType","title":"Plan Type","required":true,"options":"Prepaid,Postpaid","default":"Postpaid","editable":true},"planIncludes":{"type":"textArea","name":"planIncludes","title":"Plan Includes","required":true,"default":"","editable":true}}}}},"formFields":"customerName,customerType,customerAddress,birthDate,planName,planType,planIncludes"}';
doAjax("campaign","action=buildForm&rawData="+feedbackForm,"addCrmArea","","","POST");
</script>
\ No newline at end of file
<?php
use App\Models\Campaign;
ini_set("precision", 15);
include_once(app_path().'/lib/phpexcel/PHPExcel.php');
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
$errorMsg = ""; $successMsg = "";$successCount = 0;
if($_FILES['file']['tmp_name'])
{
if($_FILES['file']['type'] == "application/vnd.ms-excel")
{
$fileUploadLimit = 52428800; // files size is in bytes
if($_FILES['file']['size'] < $fileUploadLimit)
{
if ($_POST["uploadFileType"] == "customerInfo" && $_POST["campaignName"] != "")
{
$inputFileType = "Excel5";
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel = $objReader->load($_FILES['file']['tmp_name']);
$objWorksheet = $objPHPExcel->getActiveSheet();
$highestColumn = PHPExcel_Cell::columnIndexFromString($objPHPExcel->getActiveSheet()->getHighestColumn());
$highestrow=$objPHPExcel->getActiveSheet()->getHighestRow();
$excelarray=array();$keys=array();
$listId = time();
$dataColumns = ['id'=>'Id','unique_id'=>'Customer Unique Id','firstname'=>'First Name','lastname'=>'Last Name','mobile'=>'Mobile','phones'=>'Other Phones'];
$campaign=Campaign::where('mkey','=',$_POST["campaignName"])->where('mtype','=','company')->first();
if($campaign->crm != ""){
$crmColumns = json_decode($campaign->crm);
$crmColumns = (array)$crmColumns->formFields;
}
for($i=1;$i<=$highestrow;$i++){
$excelarray[$i]=array();
for($head = 0; $head < $highestColumn; $head++){
if($i==1){
$keys[$head]=trim($objWorksheet->getCellByColumnAndRow($head,$i)->getValue());
}else{
$excelarray[$i][$keys[$head]]=trim($objWorksheet->getCellByColumnAndRow($head, $i)->getValue());
}
}
}
// print_r($crmColumns);exit;
for($i=3;$i<=$highestrow;$i++)
{
if($excelarray[$i]["id"]==""){
$crmData = [];
if(isset($crmColumns)){
foreach ($crmColumns as $key => $value) {
array_push($crmData, [$key => $excelarray[$i][$key]]);
}
}
$data = ["list_id"=>$listId,
"unique_id"=>$excelarray[$i]["unique_id"],
"firstname"=>$excelarray[$i]["firstname"],
"lastname"=>$excelarray[$i]["lastname"],
"mobile"=>$excelarray[$i]["mobile"],
"phones"=>$excelarray[$i]["phones"],
"crm"=>serialize($crmData),
"client"=>$_POST["campaignName"],
"status"=>"New",
'created'=>date('Y-m-d H:i:s'),
'modified'=>date('Y-m-d H:i:s')];
$addToDB = DB::table('records')->insert($data);
$successCount++;
}else{
$excelarray[$i]["id"]=intval($excelarray[$i]["id"]);
}
continue;
// $lanq = DB::table('records')->select('id')->where('lan', '=', $excelarray[$i]["lan"])->first();
// if($lanq){
// $excelarray[$i]["id"]=intval($lanq->id);
// }else{
// $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s')));
// }
if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1)
{
$empdata=$wakka->getPerson($excelarray[$i]["id"]);
// $ppldata=$empdata["peopledata"];
// $createdlog=$empdata['modifylog'];
// $fdirty=$empdata['dirty'];
// $createdlog[$updatetime]=$username."::";
// $createdlog["updated"]=$updatetime;
$newdata=$ppldata;
if($isadmin||strstr($clientlst,$ppldata['client']))
{
$editflag=0;
foreach($excelarray[$i] as $key => $value)
{
$value = preg_replace('/[^A-Za-z0-9\., -]/', '', $value);
if(isset($kformlib->HRFieldNames[$key]))
{
if($value!="")
{
if("A".$ppldata[$key]!="A".$value)//forcing string comparrision //MAGIC
{
$value=str_replace("'"," ",$value);
if(strstr($createdlog[$updatetime],$key)==FALSE)$createdlog[$updatetime].="$key|".str_replace(array("|",",")," ",$ppldata[$key])."|".str_replace(array("|",",")," ",$value).",";
$fdirty[$key]=1;$editflag=1;
if($triggers=='Yes')
{
$kformlib->empAnalytics($excelarray[$i]["id"],$ppldata,$key,$value,$ppldata[$key]);
$kformlib->empWorkflowTrigger($excelarray[$i]["id"],$ppldata['client'],$key,$value,$ppldata[$key],$ppldata,$newdata);
}
$newdata[$key]=$value;
}
//else $message.="same $excelarray[$i][id]:$key:$value, ";
}
//else $message.="empty $excelarray[$i][id]:$key, ";
}else{
// $message.="Invalid key :$key, ";
}
}
if($editflag)
{
$empdata["peopledata"]=$newdata;
$empdata['modifylog']=$createdlog;
$empdata['dirty']=$fdirty;
$wakka->setPerson($excelarray[$i]["id"],$empdata);
$success.=$excelarray[$i]["id"].",";
$successCount++;
}
}else{
$errorMsg.="No access to $excelarray[$i][id], ";
}
}
}
$successMsg .= "Data Uploaded ($successCount)."; // : $success.";
}
}else{
$errorMsg .= "File size too large, Please check file size should be less then ".($fileUploadLimit / (1024*1024))."mb.";
}
}else{
$errorMsg .= "File format not valid, Please attach Excel file (.xls) and try upload again.";
}
@unlink($_FILES['file']);
}else{
$errorMsg .= "File not found, Please attach file and try upload again.";
}
if(isset($successMsg) && $successMsg!="")echo "Success! <br/>".$successMsg;
if(isset($errorMsg) && $errorMsg!="")echo "Error! <br/>".$errorMsg;
}
else
{
if(isset($_GET['format']) && $_GET['format'] == 'dataUpload'){
if(isset($_GET['campaign']) && $_GET['campaign'] != ''){
$dataColumns = ['id'=>'Id','unique_id'=>'Customer Unique Id','firstname'=>'First Name','lastname'=>'Last Name','mobile'=>'Mobile','phones'=>'Other Phones'];
$campaign=Campaign::where('mkey','=',$_GET['campaign'])->where('mtype','=','company')->first();
if($campaign->crm != ''){
$crmColumns = json_decode($campaign->crm);
if($crmColumns->formFields)$dataColumns = array_merge($dataColumns,(array) $crmColumns->formFields);
}
$PHPExcelObj = new PHPExcel(); $head=0;
foreach($dataColumns as $key => $value){
$colstr=PHPExcel_Cell::stringFromColumnIndex($head);
$PHPExcelObj->getActiveSheet()->setCellValue($colstr."1", $key);
$PHPExcelObj->getActiveSheet()->setCellValue($colstr."2", $value);
$head++;
}
$objWriter = PHPExcel_IOFactory::createWriter($PHPExcelObj, 'Excel5');
$objWriter->save('php://output');
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="DataUploadFormat.xls"');
header('Cache-Control: max-age=0');
return;
}else{
echo "Campaign not found";
return;
}
}
?>
<div class="row">
<div class="col-sm-12">
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<div class="panel panel-info">
<div class="panel-heading" role="tab" id="headingOne" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
<strong><i class="fa fa-upload"></i> Data Upload</strong>
<span class="badge pull-right"><i class="fa fa-sort"></i></span>
</div>
<div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
<div class="panel-body">
<div class="tab_generic">
<p><span style="color:#f00;"><strong>Instruction</strong></span> (Works only if you have 'Write access" to the records) Please create an Excel-2003 format file with header as field-keys and rows containing record data. Extream Care is should be taken during bulk upload as previous values will be overwritten and lost.</p>
<hr style="margin-bottom: 10px;" />
<div class="row">
<div class="col-sm-3">
<p><strong>Get Format</strong></p>
<button type="submit" class="btn btn-success" onclick="getDataFormat();return false;"><i class="fa fa-download"></i> Get Format</button>
</div>
<div class="col-sm-9">
<p><strong>Upload File</strong></p>
<form method="POST" enctype="multipart/form-data" target="resultArea" action="campaign?action=dataUpload" class="form-inline">
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
<input type="hidden" name="uploadFileType" value="customerInfo"/>
<input type="hidden" name="campaignName" value="{{ $campaignDetails->mkey }}"/>
<div class="form-group">
<input type="file" class="form-control" name="file" required="required" />
</div>
<div class="form-group">
<button type="submit" class="btn btn-success"><i class="fa fa-upload"></i> Upload</button>
</div>
</form>
</div>
</div>
<hr style="margin-top: 10px;margin-bottom: 10px;" />
<span>Result</span>
<iframe name=resultArea id="resultArea" style="width: 100%;border:1px solid #ccc;"></iframe>
</div>
</div>
</div>
</div>
<div class="panel panel-info">
<div class="panel-heading" role="tab" id="headingTwo" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
<strong><i class="fa fa-table"></i> Data List</strong>
<span class="badge pull-right"><i class="fa fa-sort"></i></span>
</div>
<div id="collapseTwo" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingTwo">
<div class="panel-body">
@if(isset($dataList) && count($dataList))
<table class="table table-bordered" style="margin-bottom: 0;">
<head><tr class="active">
<th>List Id</th>
<th>Record Count</th>
</tr></head>
<body>
@foreach($dataList as $data)
<tr>
<td>{{ $data->list_id }}</td>
<td>{{ $data->recordCount }}</td>
</tr>
@endforeach
</body>
</table>
@else
<p>No data found</p>
@endif
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function getDataFormat(){
var campaign = $("#selectCampaignField").val();
window.open('campaign/getDataFormat?format=dataUpload&campaign='+campaign);return false;
}
</script>
<?php
}
?>
\ No newline at end of file
<div class="row">
<div class="btn-group pull-right">
<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-fw fa-plus-square"></i> Add Field <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="#" onclick="fbAddField('layout','addFieldArea');return false;"><i class="fa fa-fw fa-th-large"></i> Layout</a></li>
<li><a href="#" onclick="fbAddField('text','addFieldArea');return false;"><i class="fa fa-fw fa-font"></i> Text</a></li>
<li><a href="#" onclick="fbAddField('select','addFieldArea');return false;"><i class="fa fa-fw fa-indent"></i> Select Box</a></li>
<li><a href="#" onclick="fbAddField('date','addFieldArea');return false;"><i class="fa fa-fw fa-calendar"></i> Date</a></li>
<li><a href="#" onclick="fbAddField('textArea','addFieldArea');return false;"><i class="fa fa-fw fa-list-alt"></i> Text Area</a></li>
</ul>
</div>
</div>
<div class="modal fade" id="fbAddFieldForm" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body" id="fbAddFieldFormContent"></div>
</div>
</div>
</div>
<hr style="margin:5px 0;border: 1px solid #ed5564;" />
<div id="addFieldArea"></div>
<script>
var feedbackForm = '{"formData":{"row1":{"column1":{"columnName":"Personal Information","columnCount":"6","fields":{"customerName":{"type":"text","name":"customerName","title":"Customer Name","required":true,"default":"","editable":true},"customerType":{"type":"select","name":"customerType","title":"Customer Type","required":true,"options":"Existing,New,MNP,Corporate","default":"Existing","editable":true},"customerAddress":{"type":"textArea","name":"customerAddress","title":"Customer Address","required":true,"default":"","editable":true},"birthDate":{"type":"date","name":"birthDate","title":"Birth Date","required":true,"default":"","editable":true}}},"column2":{"columnName":"Plan Details","columnCount":"6","fields":{"planName":{"type":"text","name":"planName","title":"Plan Name","required":true,"default":"","editable":true},"planType":{"type":"select","name":"planType","title":"Plan Type","required":true,"options":"Prepaid,Postpaid","default":"Postpaid","editable":true},"planIncludes":{"type":"textArea","name":"planIncludes","title":"Plan Includes","required":true,"default":"","editable":true}}}}},"formFields":"customerName,customerType,customerAddress,birthDate,planName,planType,planIncludes"}';
doAjax("campaign","action=buildForm&rawData="+feedbackForm,"addFieldArea","","","POST");
</script>
\ No newline at end of file
<div class="row">
<div class="col-sm-12">
<div class="panel panel-info">
<div class="panel-heading"><strong>Agent Script</strong></div>
<div class="panel-body">
<div>
<div class="form-group" style="margin-bottom: 5px;">
<textarea class="form-control" rows="10" id="agentScript" placeholder="Enter your script here">{{ $campaignDetails->script }}</textarea>
</div>
<div class="form-group" style="margin-bottom: 0;">
<span>Add agent script here</span>
<button type="submit" class="btn btn-success pull-right"><i class="glyphicon glyphicon-floppy-disk"></i> Save</button>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
<?php
//$queryFields = explode(",", 'usr_id,branchCode,organizationName,designation,dob,location,state,residenceAddress,residenceAddressZipCode,officeAddress,officeAddressZipCode,alternateMobile,officeNumber,referenceName,referenceMobile,referenceName2,referenceMobile2,loanStatus,product,bucket,dpd,tenureStartDate,tenureEndDate,tenureRemaining,disbursalDate,rateOfInterest,installmentNo,chequeBounceNo,reasonForLastBounce,reasonForSecondLastBounce,cycleDate,ebnb,bank,lastMonthPaymentMode,lastMonthPaymentAmount,lastMonthPaymentDate,delinquencyString,specialCode,centralECS,emi,pos,bounceCharge,penalMTD,penalLTD,overdueAmount,installmentAmountOverdue,altphone1,altphone2,altphone3,altphone4,altphone5,altphone6,altphone7,altphone8,altphone9,altphone10,priority,dialer_substatus,dialer_callback');
$queryFields = explode(",", 'usr_id,branchCode,organizationName,designation,dob,location,state,residenceAddress,residenceAddressZipCode,officeAddress,officeAddressZipCode,alternateMobile,officeNumber,referenceName,referenceMobile,referenceName2,referenceMobile2,loanStatus,product,bucket,dpd,tenureStartDate,tenureEndDate,tenureRemaining,disbursalDate,rateOfInterest,installmentNo,chequeBounceNo,reasonForLastBounce,reasonForSecondLastBounce,cycleDate,ebnb,bank,lastMonthPaymentMode,lastMonthPaymentAmount,lastMonthPaymentDate,delinquencyString,specialCode,centralECS,emi,pos,bounceCharge,penalMTD,penalLTD,overdueAmount,installmentAmountOverdue,altphone1,altphone2,altphone3,altphone4,altphone5,altphone6,altphone7,altphone8,altphone9,altphone10,priority,dialer_substatus,dialer_callback');
?>
<div class="row">
<div class="col-sm-12">
<div class="panel panel-info">
<div class="panel-heading"><strong>Query</strong></div>
<div class="panel-body">
<div class="form-group" style="margin-bottom: 8px;">
<label>SELECT</label>
<input type='text' value='*' id='allvalues'disabled/>
<!--<select id="querySelect" multiple="" data-rel="chosen" style='width:100%' class=select2multi>
<option value="currentstatus" selected="selected">currentstatus</option>
<option value="legalstatus" selected="selected">legalstatus</option>
<option value="mobile" selected="selected">mobile</option>
<option value="status" selected="selected">status</option>
<option value="dialer_status" selected="selected">dialer_status</option>
<option value="dialer_substatus" selected="selected">dialer_substatus</option>
@foreach($queryFields as $fields)
<option value="{{$fields}}">{{$fields}}</option>
@endforeach
</select>-->
<label style="margin-top: 5px;">FROM 'records' WHERE</label>
<input type="text" class="form-control" id="queryConditions" placeholder="1" value="1"/>
</div>
<div class="form-inline">
<div>
<button type="submit" class="btn btn-success pull-right" id='savequery' onclick="runSqlQuery();return false;">Save</button>
<!--- <button type="submit" class="btn btn-success pull-right" onclick="runSqlQuery();return false;"><i class="glyphicon glyphicon-ok"></i> Run Query</button>--->
</div>
</div>
</div>
</div>
<div class="panel-group">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
Show Filters
</h4>
</div>
<div id="collapse1" >
<ul class="list-group">
@foreach($queryLogs as $queryLog)
<li class="list-group-item"><a onclick="runFSqlQuery({{$queryLog->id}});return false;" style="cursor:pointer">{{$queryLog->query}} </a></li>
@endforeach
</ul>
<div class="panel-footer">*Please Refresh Current Campaign To See Updated Saved Queries</div>
</div>
</div>
</div>
<br><br>
<div class="panel panel-info">
<div class="panel-heading" id="appendButton"><strong>Output</strong><button type="submit" class="btn btn-default btn-sm" onclick="downloadOutput();return false;" style="margin: 0 0 0.1% 84%;display: none" id="downloadButton"><i class="glyphicon glyphicon-download"></i> Download</button></div>
<div class="panel-body" id="sqlQueryOutput">
<p><i class="fa fa-exclamation-circle"></i> Press Run Query button to see output!</p>
</div>
</div>
</div>
</div>
<script>
function runSqlQuery(){
//var checkedValue = $('#savequery').val();
//var data = 'campaign={{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}&querySelect='+$("#querySelect").val()+'&queryConditions='+$("#queryConditions").val()+'&queryLimit='+$("#queryLimit").val()+'&queryOffset='+$("#queryOffset").val()+'&checkedValue='+checkedValue;
var data = 'campaign={{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}&allvalues='+$("#allvalues").val()+'&queryConditions='+$("#queryConditions").val()+'&queryLimit='+$("#queryLimit").val()+'&queryOffset='+$("#queryOffset").val();
doAjax("campaign/query",data,"sqlQueryOutput","","","GET");
document.getElementById("downloadButton").style = "margin: 0% 0% 0.1% 84%;display: block";
}
function runFSqlQuery(id){
var data = 'campaign={{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}&id='+id+'&querySelect='+$("#querySelect").val();
doAjax("campaign/fquery",data,"sqlQueryOutput","","","GET");
document.getElementById("downloadButton").style = "margin: 0% 0% 0.1% 84%;display: block";
}
function delSqlQuery(id){
var data = 'id='+id;
var value = '{{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}';
doAjax("campaign/delete",data,"sqlQueryOutput","","","GET");
doAjax("campaign/show","campaign="+value,"campaignDetailsArea","","","GET",function(response){
$("#campaignRefresh").html('<div class="form-group"><button onclick="campaignDetailsShow($(\'#selectCampaignField option:selected\').val());return false;" class="btn btn-xs btn-info">Refresh Campaign</button></div>');
});
}
function enablelogic(id){
console.log(id);
var data='id='+id;
var value = '{{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}';
//doAjax("campaign/enable",data,"sqlQueryOutput","","","GET");
doAjax("campaign/show","campaign="+value,"campaignDetailsArea","","","GET",function(response){
$("#campaignRefresh").html('<div class="form-group"><button onclick="campaignDetailsShow($(\'#selectCampaignField option:selected\').val());return false;" class="btn btn-xs btn-info">Refresh Campaign</button></div>');
});
}
function downloadOutput()
{
//window.open('campaign/download?campaign={{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}&querySelect='+$("#querySelect").val()+'&queryConditions='+$("#queryConditions").val()+'&queryLimit='+$("#queryLimit").val()+'&queryOffset='+$("#queryOffset").val());return false;
window.open('campaign/download?campaign={{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}&querySelect='+$("#querySelect").val()+'&queryConditions='+$("#queryConditions").val()+'&queryInCondition='+$("#queryInCondition").val()+'&queryLimit='+$("#queryLimit").val()+'&queryOffset='+$("#queryOffset").val());return false;
}
</script>
<div class="row">
<div class="col-sm-12">
<div class="panel panel-info">
<div class="panel-heading"><strong>Query List</strong></div>
<div class="panel-body" id="">
<ul class="list-group">
<li class="list-group-item"><input type="radio" name="query" id="currQuery" value="" checked>Default</li>
@foreach($queryLogs as $queryLog)
<li class="list-group-item"><input type="radio" name="query" id="currQuery" value="{{$queryLog->id}}" {{$queryLog->current_queue?"checked":""}}>{{$queryLog->query}}</li>
@endforeach
</ul>
<div class="form-inline">
<div class="form-group" style="display: block;">
<button type="submit" class="btn btn-success pull-right" onclick="addInQueue();return false;"><i class="glyphicon glyphicon-plus"></i> Filter Apply</button>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
function addInQueue(){
var data = 'radioValue='+$("input[name='query']:checked").val();
// var checkedValue = $('.saveQryChck:checked').val();
// var data = 'campaign={{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}&querySelect='+$("#querySelect").val()+'&queryConditions='+$("#queryConditions").val()+'&queryLimit='+$("#queryLimit").val()+'&queryOffset='+$("#queryOffset").val()+'&checkedValue='+checkedValue;
doAjax("campaign/addCurrQueue",data,"","","","GET");
}
</script>
<?php
include_once(app_path().'/lib/phpexcel/PHPExcel.php');
$inputFileType = "Excel5";
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel = $objReader->load("assets/extras/blank.xls");
$baseRow = 2;
$tcol=0;$extrahdrarr=array();
$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;
foreach ($fieldsarr as $key) {
$objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit(trim($aline->$key));
}
}
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="Output.xls"');
header('Cache-Control: max-age=0');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $inputFileType);
$objWriter->save('php://output');
return ;
?>
\ No newline at end of file
<script>
function addDatePicker(selector){
$('#'+selector).datepicker({dateFormat:'yy-mm-dd',inline:true,changeYear:true,changeMonth:true,selectOtherMonths:true,yearRange:'1947:2022'});
$('#'+selector).datepicker("show");
}
function fbAddField(type,area){
var output = '';
if(type == 'layout'){
}
$('#fbAddFieldFormContent').append(type);
$('#fbAddFieldForm').modal('show');
$('#'+area).append(type);
}
</script>
\ No newline at end of file
<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>Campaign</h4>
<hr style="margin-bottom: 10px;" />
<div class="row">
<div class="col-lg-4">
<div class="form-inline">
<div class="form-group">
<label>Select Campaign</label>
</div>
<div class="form-group">
<select class="form-control" id="selectCampaignField" onchange="campaignDetailsShow(this.value);return false;">
<option value="">Select Campaign</option>
<option value="all">All</option>
@foreach($campaignList as $campaign)
<option value="{{ $campaign->mkey }}">{{ $campaign->mkey }}</option>
@endforeach
</select>
</div>
<span id="campaignRefresh"></span>
</div>
</div>
<!-- <div class="col-lg-6">
<form class="form-inline text-right">
<div class="form-group">
<label>Create Campaign</label>
</div>
<div class="form-group">
<input type="text" class="form-control" id="campaignName" placeholder="Campaign Name">
</div>
<button type="button" class="btn btn-success" onclick="createCampaign();"><i class="glyphicon glyphicon-plus"></i> ADD</button>
</form>
</div> -->
</div>
<div id="campaignDetailsArea"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
function campaignDetailsShow(value){
if(value){
doAjax("campaign/show","campaign="+value,"campaignDetailsArea","","","GET",function(response){
$("#campaignRefresh").html('<div class="form-group"><button onclick="campaignDetailsShow($(\'#selectCampaignField option:selected\').val());return false;" class="btn btn-xs btn-info">Refresh Campaign</button></div>');
});
}else{
$("#campaignDetailsArea").html('<br/><p class="text-danger text-center">Please select the campaign.</p>');
}
}
// function createCampaign(){
// var campaignName = $('#campaignName').val();
// if(campaignName){
// if( /[^a-zA-Z0-9]/.test(campaignName)){
// simpleNotification('error','topRight','Campaign name is not alphanumeric.');
// }else{
// var dataStr = "action=createCampaign&campaignName="+campaignName;
// doAjax("campaign",dataStr,"campaignDetailsArea","","","POST",function(response){
// // console.log(response.responseText);
// });
// }
// }else{
// simpleNotification('error','topRight','Campaign name should not be blank.');
// }
// }
</script>
\ No newline at end of file
<?php
include_once(app_path().'/lib/phpexcel/PHPExcel.php');
$inputFileType = "Excel5";
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel = $objReader->load("assets/extras/blank.xls");
$baseRow = 2;
$objPHPExcel->getActiveSheet()->setCellValue('A1', "12");
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="Output.xls"');
header('Cache-Control: max-age=0');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $inputFileType);
$objWriter->save('php://output');
return ;
?>
\ No newline at end of file
......@@ -58,8 +58,20 @@ width:100%
<?php foreach($dispositionList as $key => $val) { if(!empty($val)){ ?>
<li class="list-group-item list-group">
<div class="col-sm-12">
<div class="col-sm-3"><?php echo $key; ?></div>
<div class="col-sm-6"><?php echo $val; ?></div>
<div class="col-sm-3"><label><?php echo $key; ?></label></div>
<div class="col-sm-6">
<?php $count = 0;
$subDisposition = explode(",", $val);
if(count($subDisposition) > 0){
foreach ($subDisposition as $key => $value) {
if(!empty($value)){
$count++;
echo "$count. ".$value. "<br>";
}
}
}
?>
</div>
<div class="col-sm-2"><a class="innerAll" href="#" onclick="deleteDesposition('<?php echo $key; ?>');">
<span class="btn btn-primary btn-xs"><i class="fa fa-trash-o"></i></span>
</a></div>
......@@ -90,18 +102,24 @@ width:100%
function deleteDesposition(key)
{
var selectCampaignField = $('#selectCampaignField').val();
var postdata='disposition='+key;
postdata+='&selectCampaignField='+selectCampaignField;
doAjax("campaign/deleteAssignDisposition",postdata,"campaignDetailsArea","","","GET",function(retrstr){
simpleNotification('Success','topRight',"Campaign assign suceesfully!");
doAjax("campaign/show","campaign="+selectCampaignField,"campaignDetailsArea","","","GET",function(retrstr){
$("#subDisposition").select2("val", "Select");
$('.nav-tabs a[href="#disposition"]').tab('show');
});
if (window.confirm('Are sure you want to delete disposition?'))
{
});
var selectCampaignField = $('#selectCampaignField').val();
var postdata='disposition='+key;
postdata+='&selectCampaignField='+selectCampaignField;
doAjax("campaign/deleteAssignDisposition",postdata,"campaignDetailsArea","","","GET",function(retrstr){
simpleNotification('Success','topRight',"Campaign assign suceesfully!");
doAjax("campaign/show","campaign="+selectCampaignField,"campaignDetailsArea","","","GET",function(retrstr){
$("#subDisposition").select2("val", "Select");
$('.nav-tabs a[href="#disposition"]').tab('show');
});
});
}else{
return false;
}
}
$('#assigndesposition').click(function()
......@@ -135,9 +153,6 @@ width:100%
$("#error").html('<p class="text-danger text-center">Please select the campaign and disposition.</p>');
return false;
}
});
</script>
......
......@@ -8,8 +8,9 @@
<div class="col-md-12">
<div class="panel panel-info">
<div class="panel-body">
<p><label class='label-small_new' style='width:15%'>Campaign Start Date :</label><input type=text class='form_new form_new_amend datetimepicker' name=campaignstartdate id=campaignstartdate value="{{ isset($campaignDetails->campaignstartdate)?$campaignDetails->campaignstartdate:'0000-00-00 00:00:00' }}"></p>
<p><label class='label-small_new' style='width:15%'>Campaign End Date :</label><input type=text class='form_new form_new_amend datetimepicker' name=campaignenddate id=campaignenddate value="{{ isset($campaignDetails->campaignenddate)?$campaignDetails->campaignenddate:'0000-00-00 00:00:00' }}" ></p>
<p><label class='label-small_new' style='width:15%'>Campaign Start Time :</label><input type=text class='form_new form_new_amend datetimepicker' name=campaignstartdate id=campaignstartdate value="{{ isset($campaignDetails->campaignstartdate)?$campaignDetails->campaignstartdate:'00:00:00' }}"></p>
<p><label class='label-small_new' style='width:15%'>Campaign End Time :</label><input type=text class='form_new form_new_amend datetimepicker' name=campaignenddate id=campaignenddate value="{{ isset($campaignDetails->campaignenddate)?$campaignDetails->campaignenddate:'00:00:00' }}" >
<span id="error" style="color:red" hidden>End time must be greater than Start time</span></p>
<div class="col-md-2">
<button id="scheduleCampaign" class="btn btn-xs btn-info">Schedule
</button>
......@@ -23,6 +24,10 @@
var selectCampaignField = $('#selectCampaignField').val();
var starttime = $('#campaignstartdate').val();
var endtime = $('#campaignenddate').val();
if (starttime>endtime){
$('span').show();
return false;
}
console.log(endtime);
if(endtime != "0"){
var postdata='selectCampaignField='+selectCampaignField+'&starttime='+starttime+'&endtime='+endtime;
......@@ -39,6 +44,6 @@
});
$('body').on('focus',".datetimepicker", function(){
$(this).datetimepicker({format: 'YYYY-MM-DD HH:mm'});
$(this).datetimepicker({format: 'HH:mm'});
});
</script>
......
<?php
//$queryFields = explode(",", 'usr_id,branchCode,organizationName,designation,dob,location,state,residenceAddress,residenceAddressZipCode,officeAddress,officeAddressZipCode,alternateMobile,officeNumber,referenceName,referenceMobile,referenceName2,referenceMobile2,loanStatus,product,bucket,dpd,tenureStartDate,tenureEndDate,tenureRemaining,disbursalDate,rateOfInterest,installmentNo,chequeBounceNo,reasonForLastBounce,reasonForSecondLastBounce,cycleDate,ebnb,bank,lastMonthPaymentMode,lastMonthPaymentAmount,lastMonthPaymentDate,delinquencyString,specialCode,centralECS,emi,pos,bounceCharge,penalMTD,penalLTD,overdueAmount,installmentAmountOverdue,altphone1,altphone2,altphone3,altphone4,altphone5,altphone6,altphone7,altphone8,altphone9,altphone10,priority,dialer_substatus,dialer_callback');
$queryFields = explode(",", 'usr_id,branchCode,organizationName,designation,dob,location,state,residenceAddress,residenceAddressZipCode,officeAddress,officeAddressZipCode,alternateMobile,officeNumber,referenceName,referenceMobile,referenceName2,referenceMobile2,loanStatus,product,bucket,dpd,tenureStartDate,tenureEndDate,tenureRemaining,disbursalDate,rateOfInterest,installmentNo,chequeBounceNo,reasonForLastBounce,reasonForSecondLastBounce,cycleDate,ebnb,bank,lastMonthPaymentMode,lastMonthPaymentAmount,lastMonthPaymentDate,delinquencyString,specialCode,centralECS,emi,pos,bounceCharge,penalMTD,penalLTD,overdueAmount,installmentAmountOverdue,altphone1,altphone2,altphone3,altphone4,altphone5,altphone6,altphone7,altphone8,altphone9,altphone10,priority,dialer_substatus,dialer_callback');
$queryFields = explode(",", 'id,created,modified,currentstatus,legalstatus,firstname,lastname,mobile,emailid,client,status,clientinternalid,clientcode,priority,dialer_status,dialer_substatus,dialer_callback,dialer_remarks,dialer_flag,dialer_lastcall,crmlist_id,group,dbc_activation,digital_initiative,original_created_file,original_uploaded_date,partial_uploaded_date,dialer_last_user_id,dialer_lastcall_did,dialer_lastcall_number,bttc,service_vs_product,resolution,satisfaction,final_call_assessment,old_status,old_dialer_status,old_dialer_substatus,question,trigger_details,mf_isa,DOB,other_information,filter_condition,agreementid,applied_amount,city,comp_code,company,completeddate,cust_id,cust_name,customer_name,disb_date,emi_hl,eqty_amt,foir,ins_amt,int_rate,irr,loan_amount,location,mf_amt,nth,offer_amt,outstanding,pf,ph_mob,ph_off,ph_res,pl_offer,proc_fee,product_flag,profile_new,rank,segment,tenure,tu_application_id,ucic_id,filler1,filler2,filler3,filler4,filler5,filler6,filler7,filler8,filler9,filler10,filler11,filler12,filler13,filler14,filler15');
?>
<div class="row">
<div class="col-sm-12">
......@@ -8,8 +8,8 @@ $queryFields = explode(",", 'usr_id,branchCode,organizationName,designation,dob,
<div class="panel-heading"><strong>Query</strong></div>
<div class="panel-body">
<div class="form-group" style="margin-bottom: 8px;">
<label>SELECT</label>
<input type='text' value='*' id='allvalues'disabled/>
<!--<label>SELECT</label>-->
<input type='text' value='*' id='allvalues'disabled hidden />
<!--<select id="querySelect" multiple="" data-rel="chosen" style='width:100%' class=select2multi>
<option value="currentstatus" selected="selected">currentstatus</option>
<option value="legalstatus" selected="selected">legalstatus</option>
......@@ -21,17 +21,27 @@ $queryFields = explode(",", 'usr_id,branchCode,organizationName,designation,dob,
<option value="{{$fields}}">{{$fields}}</option>
@endforeach
</select>-->
<label style="margin-top: 5px;">FROM 'records' WHERE</label>
<input type="text" class="form-control" id="queryConditions" placeholder="1" value="1"/>
<!--<label style="margin-top: 5px;">FROM 'records' WHERE</label>-->
<input type="text" class="form-control" id="queryConditions" placeholder="Add Filter Condition Here"/>
</div>
<div class="form-inline">
<div >
<div>
<button type="submit" class="btn btn-success pull-right" id='savequery' onclick="runSqlQuery();return false;">Save</button>
<!--- <button type="submit" class="btn btn-success pull-right" onclick="runSqlQuery();return false;"><i class="glyphicon glyphicon-ok"></i> Run Query</button>--->
<button type="submit" class="btn btn-success pull-left" id='savequery' onclick="saveSqlQuery();return false;">Save</button>
</div>
<div >&nbsp;
<button type="submit" class="btn btn-success pull-right" onclick="runSqlQuery();return false;"><i class="glyphicon glyphicon-ok"></i> Run </button>
</div>
</div>
</div>
</div>
<div class="panel panel-info">
<div class="panel-body" id="sqlQueryOutput">
<p><i class="fa fa-exclamation-circle"></i> Press Run button to see output!</p>
</div>
</div>
<div class="panel-group">
<div class="panel panel-default">
......@@ -53,7 +63,7 @@ $queryFields = explode(",", 'usr_id,branchCode,organizationName,designation,dob,
<br><br>
<div class="panel panel-info">
<div class="panel-heading" id="appendButton"><strong>Output</strong><button type="submit" class="btn btn-default btn-sm" onclick="downloadOutput();return false;" style="margin: 0 0 0.1% 84%;display: none" id="downloadButton"><i class="glyphicon glyphicon-download"></i> Download</button></div>
<div class="panel-body" id="sqlQueryOutput">
<p><i class="fa fa-exclamation-circle"></i> Press Run Query button to see output!</p>
</div>
......@@ -62,13 +72,23 @@ $queryFields = explode(",", 'usr_id,branchCode,organizationName,designation,dob,
</div>
<script>
function runSqlQuery(){
function runSqlQuery(){
var data = 'campaign={{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}&allvalues='+$("#allvalues").val()+'&queryConditions='+$("#queryConditions").val()+'&queryLimit='+$("#queryLimit").val()+'&queryOffset='+$("#queryOffset").val();
doAjax("campaign/runquery",data,"sqlQueryOutput","","","GET");
}
function saveSqlQuery(){
//var checkedValue = $('#savequery').val();
//var data = 'campaign={{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}&querySelect='+$("#querySelect").val()+'&queryConditions='+$("#queryConditions").val()+'&queryLimit='+$("#queryLimit").val()+'&queryOffset='+$("#queryOffset").val()+'&checkedValue='+checkedValue;
var data = 'campaign={{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}&allvalues='+$("#allvalues").val()+'&queryConditions='+$("#queryConditions").val()+'&queryLimit='+$("#queryLimit").val()+'&queryOffset='+$("#queryOffset").val();
doAjax("campaign/query",data,"sqlQueryOutput","","","GET");
document.getElementById("downloadButton").style = "margin: 0% 0% 0.1% 84%;display: block";
if (window.confirm('Are sure you want to save filter condition?'))
{
var data = 'campaign={{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}&allvalues='+$("#allvalues").val()+'&queryConditions='+$("#queryConditions").val()+'&queryLimit='+$("#queryLimit").val()+'&queryOffset='+$("#queryOffset").val();
doAjax("campaign/savequery",data,"sqlQueryOutput","","","GET");
document.getElementById("downloadButton").style = "margin: 0% 0% 0.1% 84%;display: block";
}else{
return false;
}
}
function runFSqlQuery(id){
......
......@@ -6,14 +6,17 @@
<ul class="list-group">
<li class="list-group-item"><input type="radio" name="query" id="currQuery" value="" checked>Default</li>
@foreach($queryLogs as $queryLog)
<li class="list-group-item"><input type="radio" name="query" id="currQuery" value="{{$queryLog->id}}" {{$queryLog->current_queue?"checked":""}}>{{$queryLog->query}}</li>
<li class="list-group-item"><input type="radio" name="query" id="currQuery" value="{{$queryLog->id}}" {{$queryLog->current_queue?"checked":""}}>{{$queryLog->query}}
<div><button class="btn btn-success pull-right" style=" margin-top: -26px;" onclick="queryCount({{$queryLog->id}});return false;" type="submit" ">Run</button></div>
<span id="sqlQueryOutput-{{$queryLog->id}}" class="countText"></span></li>
@endforeach
</ul>
<div class="form-inline">
<div class="form-group" style="display: block;">
<button type="submit" class="btn btn-success pull-right" onclick="addInQueue();return false;"><i class="glyphicon glyphicon-plus"></i> Filter Apply</button>
<button type="submit" class="btn btn-success pull-right" onclick="addInQueue1();"><!-- <i class="glyphicon glyphicon"></i> --> Apply Filter</button>
</div>
<!--<div id="success" style="align:right color:green"></div>--->
</div>
</div>
</div>
......@@ -21,10 +24,30 @@
</div>
<script>
function addInQueue(){
function addInQueue1(){
var selectCampaignField = $('#selectCampaignField').val();
var data = 'radioValue='+$("input[name='query']:checked").val();
// var checkedValue = $('.saveQryChck:checked').val();
data+='&campaign='+selectCampaignField;
//var checkedValue = $('.saveQryChck:checked').val();
// var data = 'campaign={{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}&querySelect='+$("#querySelect").val()+'&queryConditions='+$("#queryConditions").val()+'&queryLimit='+$("#queryLimit").val()+'&queryOffset='+$("#queryOffset").val()+'&checkedValue='+checkedValue;
doAjax("campaign/addCurrQueue",data,"","","","GET");
doAjax("campaign/addCurrQueue",data,"","","","GET",function(retrstr){
simpleNotification('Success','topRight',"Filter assign suceesfully!");
//$("#success").html("Filter assign suceesfully!");
});
}
function queryCount(id){
/*var data = 'campaign={{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}&id='+id;
doAjax("campaign/runcount",data,"querycountoutput-"+id,"","","GET");*/
$("#sqlQueryOutput-"+id).html('');
var data = 'campaign={{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}&id='+id+'&querySelect='+$("#querySelect").val();
doAjax("campaign/fquery",data,"sqlQueryOutput-"+id,"","","GET");
}
</script>
<style type="text/css">
.countText {
float: right;
margin-top: -15px;
margin-right: 10px;
}
</style>
......
<!-- Heading -->
<h5 class="innerAll margin-none bg-primary">
<i class="fa fa-fw fa-pencil"></i> Add Disposition
<a href="#" class="btn btn-sm btn-inverse pull-right btn-xs" style="margin-top: -5px;" onclick="return false">
<i class="fa fa-user fa-fw"></i>
</a>
</h5>
<form class="innerAll">
<fieldset>
<div class="control-group">
<label class="col-md-4 control-label" for="code">Code</label>
<div class="col-md-8 controls">
<input class="form-control" id="code" type="text" value="" />
</div>
</div>
<div class="control-group">
<label class="col-md-4 control-label" for="disposition">Disposition</label>
<div class="col-md-8 controls">
<input class="form-control" id="disposition" type="text" value="" />
</div>
</div>
<div class="control-group">
<label class="col-md-4 control-label" for="subDisposition">Sub Disposition</label>
<div class="col-md-8 controls">
<input class="form-control" id="subDisposition" type="text" value="" />
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary" onclick='createGroupForm();return false;'>Save changes</button>
</div>
</fieldset>
</form>
<script>
function createGroupForm()
{
var putdata="csrftoken={!!Session::token()!!}";
putdata+="&code="+$("#code").val();
putdata+="&disposition="+$("#disposition").val();
putdata+="&subDisposition="+$("#subDisposition").val();
/*
doAjax('campaign?action=createCampaign',putdata,'campaignformdiv','ajax_group_create','singlethis','POST');*/
doAjax('campaign?action=createCampaign',putdata,'campaignformdiv','ajax_group_create','singlethis','POST',function(retrstr){
doAjax("campaign/masters","" ,"campaignDetailsArea","","","GET",function(retrstr){
simpleNotification('Success','topRight',"Disposition created suceesfully!");
});
});
}
</script>
<style>
.heading-buttons h4{
line-height:20px;
}
</style>
<div class="layout-app"><!-- row-app -->
<div class="row row-app">
<!-- col -->
<div class="col-md-12">
<!-- col-separator.box -->
<div class="col-separator col-separator-first col-unscrollable box">
<!-- col-table -->
<div class="col-table" id=authorworkspacediv>
<!-- Search Bar -->
<div class="input-group">
<input type="text" class="form-control" placeholder="Search for Disposition...">
<span class="input-group-btn">
<button class="btn btn-primary rounded-none" type="button"><i class="fa fa-search"></i></button>
</span>
</div>
<div class="col-separator-h"></div>
<!-- End Search Bar -->
<div class="col-table-row">
<div class="col-app col-unscrollable">
<div class="col-app">
<div class="row-app">
<div class="col-md-6">
<div class="col-separator">
<!-- Category Heading -->
<div class="heading-buttons bg-gray border-bottom innerR half">
<a href="#" class="btn btn-sm btn-inverse pull-right" onclick="doAjax('campaign/create','','campaignformdiv','ajax_group_create','singlethis','GET');return false"><i class="fa fa-plus fa-fw"></i>New Disposition</a>
<h4 class="innerTB margin-bottom-none">Dispositions</h4>
<div class="clearfix"></div>
</div>
<!-- End Category Heading -->
<?php //echo $grouplist->render(); ?>
<?php foreach ($dispositionList as $dispo)
{ //print_r($dispo);exit();
$tphoto="assets/images/people/avatar.jpg";
?>
<!-- Category Listing -->
<div class="row innerAll half border-bottom bg-gray- hover">
<div class="col-sm-8 col-xs-10">
<ul class="media-list margin-none">
<li class="media">
<a class="pull-left innerAll" href="#" onclick="editCampaign(' <?php echo $dispo['code']; ?>' , '<?php echo $dispo['disposition']; ?>', '<?php echo $dispo['disposition']; ?>');">
<span class="btn btn-primary btn-xs"><i class="fa fa-pencil"></i></span>
</a>
<a class="pull-left innerAll" href="#" onclick="doAjax('group/{!!$tgroup->id!!}','','campaignformdiv','ajax_group_delete','singlethis','DELETE');return false;">
<span class="btn btn-primary btn-xs"><i class="fa fa-trash-o"></i></span>
</a>
<div class="media-body">
<div class="innerAll">
<h5 class=""><a href="#" class="media-heading text-primary">{!!$dispo['code']!!} : {{$dispo['disposition']}}</a></h5>
<div class="clearfix"></div>
</div>
</div>
</li>
</ul>
</div>
<div class="col-sm-3 col-xs-2">
<div class="text-center">
<p class="strong">Sub Disposition</p>
<span class="badge badge-primary badge-stroke" data-toggle="tooltip" data-title="Subscribed" data-placement ="right" data-container="body">{{$dispo['totalSubdisposition']}}</span>
</div>
</div>
</div>
<!-- // END Category Listing -->
<?php } ?>
<?php //echo $grouplist->render(); ?>
</div>
<!-- // END col-separator -->
</div>
<!-- // END col -->
<!-- col -->
<div class="col-md-6">
<!-- col-separator -->
<div class="col-separator col-separator-last" id=campaignformdiv>
</div>
<!-- // END col-separator -->
</div>
<!-- // END col-table -->
</div>
<!-- // END col-separator.box -->
</div>
<!-- // END col -->
</div>
<!-- // END row-app -->
</div>
<script>
$(".pagination a").click(function(e){
e.preventDefault();
var url=$(this).attr("href");
var res = url.split("page=");
menuAction("group?page="+res[1]);
return false;
});
function editCampaign(){
doAjax('campaign/edit','','campaignformdiv','ajax_group_create','singlethis','GET');return false;
}
</script>
\ No newline at end of file
<?php
use App\Jobs\KHRMSLib;
use App\Models\CRMCall;
$client=Input::get("client");
/*$prevData=Input::get("prev");
$currentStatus = Input::get("currentStatus");
$legalStatus = Input::get("legalStatus");
if($currentStatus==""||$legalStatus==""|| $prevData==""){
$currentStatus="ACTIVE";
$legalStatus="PRIMARY";
$prevData="MTD";
}*/
$wakka=new KHRMSLib();
$dispoclassarr=array('NC'=>array(0,array()),'CC'=>array(0,array()),'CB'=>array(0,array()),'NA'=>array(0,array()));
$dataSelect = array('0'=>'MTD','1'=>'YTD');
$owclientstr=array();
$oclientlst=$wakka->clientsOwnerRWAccess();
if(!empty($oclientlst))foreach($oclientlst as $tclnt)if($tclnt!="")
{
$owclientstr[]="'$tclnt'";
if($client=="")$client=$tclnt;
}
if(!empty($owclientstr))$owclientstr="and client in (".implode(",",$owclientstr).")";else $owclientstr="";
if($client!="")$owclientstr="and client='$client'";
$roclientstr=array();$didlinesstr=array();if(Auth::user()->exten!="")$didlinesstr[]=Auth::user()->exten;
$roclientlst=$wakka->clientsReadAccess();
if(!empty($roclientlst))foreach($roclientlst as $tclnt)if($tclnt!="")
{
$roclientstr[]="'$tclnt'";
if($client=="")$client=$tclnt;
$mastersdata=$wakka->getCompanyMaster($tclnt);
if(!empty($mastersdata["DialerDID"]))$didlinesstr[]=$mastersdata["DialerDID"];
if(empty($mastersdata['dialerDispoList']))$mastersdata['dialerDispoList']=$wakka->HRCoreVars['dialerDispoList'];
$dispoarr=explode("~",$mastersdata['dialerDispoList']);
foreach($dispoarr as $dispo)
{
if(!empty($dispo))
{
$dispoprts=explode("|",$dispo);
if(sizeof($dispoprts)>=3)
{
if(isset($dispoclassarr[$dispoprts[0]]))
{
$dispoclassarr[$dispoprts[0]][1][]=$dispoprts[1];
}
}
}
}
}
foreach($didlinesstr as $k=>$dids)
{
$didarr=explode(":",$dids);
$didlinesstr[$k]=$didarr[0];
}
if(!empty($roclientstr))$roclientstr="and client in (".implode(",",$roclientstr).")";else $roclientstr="";
if($client!="")$roclientstr="and client='$client'";
//$currentstatuses=$wakka->LoadAll("select distinct currentstatus from records where currentstatus!='' $owclientstr");
//$legalstatuses=$wakka->LoadAll("select distinct legalstatus from records where legalstatus!='' $owclientstr");
/*$dispoarr=$wakka->LoadAll("select count(*) as cnt,currentstatus,legalstatus,dialer_status from records where 1=1 $owclientstr group by currentstatus,legalstatus,dialer_status");
$countStatuses = array('New', 'Called');
foreach ($countStatuses as $status) {
$$status = 0;
}
$counts= DB::table('records')
->select(DB::raw("count(*) as cnt,status"))
->whereIn('status', $countStatuses)
->where('client', '=', $client)
->groupBy('status')->get();
foreach ($counts as $key => $count)
{
$status = $count->status;
$$status = $count->cnt;
}
$TotalData=$New + $Called;
$NotCalled=$New;
$TotalCalled=$Called;
$birthdate=date('m-d');
$Priority=$wakka->getCount("records","priority in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) $owclientstr");
$Flagged=$wakka->getCount("records","dialer_flag='VIP' $owclientstr");
//$NotCalledFlagged=$wakka->getCount("records"," priority='VIP' $owclientstr");
$NotCalledFlagged=$wakka->getCount("records"," mf_isa='VIP' $owclientstr");
$todaybirthday=$wakka->getCount("records"," DATE_FORMAT(DOB,'%m-%d')='$birthdate' and priority='11' $owclientstr");
if($prevData=='MTD'&&$legalStatus!='SECONDARY')
{
$dispoarr=$wakka->LoadAll("select count(*) as cnt,currentstatus,legalstatus,dialer_status from records where 1=1 $owclientstr group by currentstatus,legalstatus,dialer_status having legalstatus='$legalStatus' and currentstatus='$currentStatus'");
$TotalData=$wakka->getCount("records","status IN ('New', 'Called','Noqueue') and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr");
$NotCalled=$wakka->getCount("records","status='New' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
$TotalCalled=$wakka->getCount("records","status='Called' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
$Priority=$wakka->getCount("records","priority in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
$Flagged=$wakka->getCount("records","dialer_flag='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
/*$NotCalledFlagged=$wakka->getCount("records"," priority='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");*/
/*$NotCalledFlagged=$wakka->getCount("records"," mf_isa='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
}
if($prevData=='YTD'&&$legalStatus!='SECONDARY')
{
$ydispoarr=$wakka->LoadAll("select count(*) as cnt,currentstatus,legalstatus,old_dialer_status from records where 1=1 $owclientstr group by currentstatus,legalstatus,old_dialer_status");
$TotalData=$wakka->getCount("records","old_status IN ('New', 'Called','Noqueue') and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr");
$NotCalled=$wakka->getCount("records","old_status='New' and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr");
$TotalCalled=$wakka->getCount("records","old_status='Called' and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr");
$Priority=$wakka->getCount("records","priority in (1,2,3,4,5,6,7,8,9,10) and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr");
$Flagged=$wakka->getCount("records","dialer_flag='VIP' and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr");*/
/*$NotCalledFlagged=$wakka->getCount("records"," priority='VIP' and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr");*/
/*$NotCalledFlagged=$wakka->getCount("records"," mf_isa='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
}*/
/*if($prevData=='MTD'&&$legalStatus=='SECONDARY')
{
$dispoarr=$wakka->LoadAll("select count(*) as cnt,currentstatus,legalstatus,dialer_status from records where 1=1 $owclientstr group by currentstatus,legalstatus,dialer_status having legalstatus='$legalStatus' and currentstatus='$currentStatus'");
$TotalData=$wakka->getCount("records","status IN ('New', 'Called','Noqueue') and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
$NotCalled=$wakka->getCount("records","status='New' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
$TotalCalled=$wakka->getCount("records","status='Called' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
$Priority=$wakka->getCount("records","priority in (1,2,3,4,5,6,7,8,9,10) and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
$Flagged=$wakka->getCount("records","dialer_flag='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
/*$NotCalledFlagged=$wakka->getCount("records"," priority='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");*/
/*$NotCalledFlagged=$wakka->getCount("records"," mf_isa='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
}*/
/*if($prevData=='YTD'&&$legalStatus=='SECONDARY')
{
$ydispoarr=$wakka->LoadAll("select count(*) as cnt,currentstatus,legalstatus,old_dialer_status from records where 1=1 $owclientstr group by currentstatus,legalstatus,old_dialer_status having legalstatus='$legalStatus' and currentstatus='$currentStatus'");
$TotalData=$wakka->getCount("records","old_status IN ('New', 'Called','Noqueue') and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr");
$NotCalled=$wakka->getCount("records","old_status='New' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
$TotalCalled=$wakka->getCount("records","old_status='Called' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
$Priority=$wakka->getCount("records","priority in (1,2,3,4,5,6,7,8,9,10) and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
$Flagged=$wakka->getCount("records","dialer_flag='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
/*$NotCalledFlagged=$wakka->getCount("records"," priority='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");*/
/*$NotCalledFlagged=$wakka->getCount("records"," mf_isa='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
}
$MissedCalls=0;
$udidlinesstr = array();
foreach($didlinesstr as $didlinestr){
$didlinestrArr=explode(":",$didlinestr);
$udidlinesstr[] = substr($didlinestrArr[0], env('didnumber'));
}
$mc=CRMCall::where('userstatus','=','InboundDROP')->where('created_at','>','2018-09-11 00:00:00')->where('created_at','>',date('Y-m-d H:i:s',time()-(7*24*60*60)));
$mc=$mc->where(function ($query) use($roclientlst,$udidlinesstr){
$query->orWhereIn('client',$roclientlst)->orWhereIn('did',$udidlinesstr);
});
$mc=$mc->get();
$number_list=array();
foreach($mc as $key=>$tcall)
{
$tccal=substr($tcall->number,-10);
$mc_number=CRMCall::where('userstatus','!=','InboundDROP')
->where('created_at','>',$tcall->created_at)
->where('number','like',"%".$tccal."%")
->orderBy("id","DESC")
->first();
$mccount=count($mc_number);
if($mccount==0)
{
$number_list[] = $tcall->number;
}
}
if(count($number_list) > 0) {
$lcalls=DB::select("SELECT * FROM crmcalls where id in (SELECT max(id) FROM crmcalls WHERE number IN ('" . implode("','", $number_list). "') GROUP BY number )");
foreach($lcalls as $lcall)
{
if($lcall->userstatus=="InboundDROP")
{
$MissedCalls++;
}
}
}
$callstoday=CRMCall::where("created_at",">=",date("Y-m-d 00:00:00"))->where("user_id","=",Auth::user()->id)->count();
$callsmonth=CRMCall::where("created_at",">=",date("Y-m-01 00:00:00"))->where("user_id","=",Auth::user()->id)->count();
$recstoday=$wakka->getCount("records","dialer_lastcall>='".date("Y-m-d 00:00:00")."' $owclientstr");
$recsmonth=$wakka->getCount("records","dialer_lastcall>='".date("Y-m-01 00:00:00")."' $owclientstr");*/
?>
<div class=col-md-3>
<div class=col-md-11>
<?php if(sizeof($roclientlst)>0){ ?>
<h5>
Campaign
<select class='form-control pull-right' id=tcampaign_select onchange='campaignSelect();' style='width:50%'>
<?php foreach($roclientlst as $c){$s="";if($c==$client)$s='selected';echo "<option value='$c' $s>$c</option>";} ?>
</select>
</h5>
<br>
<!---<div class=col-md-6>
<select class=form-control id=data_select onchange='dataSelect();'>
<?php //foreach($dataSelect as $d){$s="";if($d==$prevData)$s='selected';echo "<option value='$d' $s>$d</option>";} ?>
</select>
</div>
<div style='clear:both'></div>
<br>
<?php } ?>
<h5>
Buckets
<span class='label label-small label-default pull-right'>
<a href=# onclick="dialerLoadData('CallsMonth','','',1,'','');return false;" style='color:#fff;font-size:12px'>
Month:&nbsp;&nbsp; {!!$recsmonth!!} / {!!$callsmonth!!}
</a>
</span>
<span class='label label-small label-default pull-right' style='margin-right:5px'>
<a href=# onclick="dialerLoadData('CallsToday','','',1,'','');return false;" style='color:#fff;font-size:12px'>
Today:&nbsp;&nbsp; {!!$recstoday!!} / {!!$callstoday!!}
</a>
</span>
</h5>
<div style='clear:both'></div>
<hr><br>
<?php
//print_r($legalstatuses);
//print_r($currentstatuses);
?>
<div class=col-md-6>
<select class=form-control id=legalstatus_select onchange='bucketSelect();'>
<option value='PRIMARY'>PRIMARY</option>
<option value='SECONDARY'>SECONDARY</option>
</select>
</div>
<div class=col-md-6>
<select class=form-control id=currentstatus_select onchange='bucketSelect();'>
<option value='ACTIVE'>ACTIVE</option>
<option value='PASSIVE'>PASSIVE</option>
</select>
</div>
<div style='clear:both'></div>
<ul style="list-style:none">
<li class="notify_alert">
<span><a href=# onclick="dialerLoadData('CurrentQueue','','',1,'','');return false;">CurrentQueue</a></span>--->
<!--<span class="label label-small pull-right" >
0
</span>-->
<!---</li>
<li class="notify_alert">
<span><a href=# onclick="dialerLoadData('MissedCalls','','',1,'','');return false;">MissedCalls</a></span>
<span class="label label-small label-primary pull-right" >
{!!$MissedCalls!!}
</span>
</li>
<li class="notify_alert">
<span><a href=# onclick="dialerLoadData('Priority','','',1,'','');return false;">Priority</a></span>
<span class="label label-small label-info pull-right" >
{!!$Priority!!}
</span>
</li>
<li class="notify_alert">
<span><a href=# onclick="dialerLoadData('TotalData','{!!$currentStatus!!}','{!!$legalStatus!!}',1,'','');return false;">TotalData</a></span>
<span class="label label-small label-default pull-right" >
{!!$TotalData!!}
</span>
</li>
<li class="notify_alert">
<span><a href=# onclick="dialerLoadData('NotCalled','{!!$currentStatus!!}','{!!$legalStatus!!}',1,'','');return false;">NotCalled</a></span>
<span class="label label-small label-default pull-right" >
{!!$NotCalled!!}
</span>
</li>
<li class="notify_alert">
<span><a href=# onclick="dialerLoadData('Called','','',1,'','');return false;">Called</a></span>
<span class="label label-small label-success pull-right" >
{!!$TotalCalled!!}
</span>
</li>
<li class="notify_alert">
<span><a href=# onclick="return false;">Contacted</a></span>
<span class="label label-small label-success pull-right" id=contactedcnt_span>
0
</span>
</li>
<li class="notify_alert">
<span><a href=# onclick="dialerLoadData('Flagged-Called','{!!$currentStatus!!}','{!!$legalStatus!!}',1,'','');return false;">Flagged-Called</a></span>
<span class="label label-small label-success pull-right" >
{!!$Flagged!!}
</span>
</li>
<li class="notify_alert">
<span><a href=# onclick="dialerLoadData('Flagged-Notcalled','{!!$currentStatus!!}','{!!$legalStatus!!}',1,'','');return false;">Flagged-NotCalled</a></span>
<span class="label label-small label-warning pull-right" >
{!!$NotCalledFlagged!!}
</span>
</li>
<li class="notify_alert">
<span><a href=# onclick="dialerLoadData('today-birthday','{!!$currentStatus!!}','{!!$legalStatus!!}',1,'','');return false;">Today Birthday</a></span>
<span class="label label-small label-warning pull-right" >
{!!$todaybirthday!!}
</span>
</li>
<hr><br>--->
<?php
/*if($prevData=='' ||$prevData=='MTD')
{
foreach($dispoarr as $disp) {
foreach($dispoclassarr as $dclass=>$darr)
{
if(in_array($disp['dialer_status'],$darr[1]))
{
$dispoclassarr[$dclass][0]+=$disp['cnt'];
}
}
$class=str_replace(" ","_","CLS_".$disp['currentstatus'].$disp['legalstatus']);
if($disp['dialer_status'])
{
?>
<li class="notify_alert bucketliitem {!!$class!!}">
<span><a href=# onclick="dialerLoadData('{!!$disp['dialer_status']!!}','{!!$disp['currentstatus']!!}','{!!$disp['legalstatus']!!}',1,'','');return false;">{!!$disp['dialer_status']!!}</a></span>
<span class="label label-small label-success pull-right" >
{!!$disp['cnt']!!}
</span>
</li>
<?php }
}
}
if($prevData=='YTD')
{
foreach($ydispoarr as $disp) {
foreach($dispoclassarr as $dclass=>$darr)
{
if(in_array($disp['old_dialer_status'],$darr[1]))
{
$dispoclassarr[$dclass][0]+=$disp['cnt'];
}
}
$class=str_replace(" ","_","CLS_".$disp['currentstatus'].$disp['legalstatus']);
if($disp['old_dialer_status'])
{
?>
<li class="notify_alert bucketliitem {!!$class!!}">
<span><a href=# onclick="dialerLoadData('{!!$disp['old_dialer_status']!!}','{!!$disp['currentstatus']!!}','{!!$disp['legalstatus']!!}',1,'','');return false;">{!!$disp['old_dialer_status']!!}</a></span>
<span class="label label-small label-success pull-right" >
{!!$disp['cnt']!!}
</span>
</li>
<?php
}
}
}
$contacted=$dispoclassarr['CC'][0]+$dispoclassarr['CB'][0]+$dispoclassarr['NC'][0];
echo "<script>$('#contactedcnt_span').html('$contacted');</script>";*/
?>
<!-- </ul>
</div>
</div>
<div class=col-md-9 id=bucketlistdiv>--- -->
</div>
<div style='clear:both'></div>
<script>
<?php if($client){?>
$("#tcampaign_select").val('<?=$client?>');
<?php }?>
<?php //if($prevData){ ?>
//$("#data_select").val('<?=$prevData?>');
<?php //}?>
<?php //if($legalStatus){ ?>
//$("#legalstatus_select").val('<?=$legalStatus?>');
<?php //}?>
<?php if($currentStatus){ ?>
$("#currentstatus_select").val('<?=$currentStatus?>');
<?php }?>
function campaignSelect()
{
var dashlet="Dialer";
doAjax("dashboard/dashlet?module="+dashlet+"&client="+$("#tcampaign_select").val(),"","DashletT-"+dashlet,"ajax_dashlet_"+dashlet,"singlefail","GET");
}
/*function dataSelect()
{
var currentStatus = $('#currentstatus_select').val();
var legalStatus = $('#legalstatus_select').val();
var prev = $("#data_select").val();
var client = $("#tcampaign_select").val();
var dashlet="Dialer";
doAjax("dashboard/dashlet?module="+dashlet+"&client="+client+"&prev="+prev+"&currentStatus="+currentStatus+"&legalStatus="+legalStatus,"","DashletT-"+dashlet,"ajax_dashlet_"+dashlet,"singlefail","GET");
}
*/
function bucketSelect()
{
/*var activeclass='CLS_'+$('#currentstatus_select').val()+$('#legalstatus_select').val();
$('.bucketliitem').hide();
$('.'+activeclass).show();*/
/*var currentStatus = $('#currentstatus_select').val();
var legalStatus = $('#legalstatus_select').val();
var prev = $("#data_select").val();
var client = $("#tcampaign_select").val();
var dashlet="Dialer";
doAjax("dashboard/status?module="+dashlet+"&client="+client+"&prev="+prev+"&currentStatus="+currentStatus+"&legalStatus="+legalStatus,"","DashletT-"+dashlet,"ajax_dashlet_"+dashlet,"singlefail","GET");
}*/
}
//bucketSelect();
function dialerLoadData(listname,currentstatus,legalstatus,page,skey,stxt)
{
//doAjax("dialer/bucketdata","client={!!$client!!}&bucket="+listname+"&currentstatus="+currentstatus+"&legalstatus="+legalstatus+'&page='+page+'&skey='+skey+'&stxt='+stxt,"bucketlistdiv","ajax_dialer_list","singlefail","GET");
}
dialerLoadData('CurrentQueue','','',1,'','');
</script>
<div class="container">
<div class="row">
<div class="col-sm-4 bot">
<a href="javascript:;" onclick="menuAction('campaign');return false;" style="color:white;">
<div class="new1">
<div class="icon"> <i class="fa fa-cog"></i></div>
Campaign Management
</div>
</a>
</div>
<div class="col-sm-4 bot">
<a href="javascript:;" onclick="menuAction(&quot;admin&quot;);return false;" style="color:white;">
<div class="new1">
<div class="icon"> <i class="fa fa-lock f4"></i></div>
Flexydial Admin
</div>
</a>
</div>
<div class="col-sm-4 bot">
<a href="javascript:;" onclick="menuAction(&quot;user&quot;);return false;" style="color:white;">
<div class="new1">
<div class="icon"> <i class="fa fa-user"></i></div>
Users
</div>
</a>
</div>
<div class="col-sm-4 bot">
<a href="javascript:;" onclick="menuAction(&quot;group&quot;);return false;" style="color:white;">
<div class="new1">
<div class="icon"> <i class="fa fa-users"></i></div>
Groups
</div>
</a>
</div>
<div class="col-sm-4 bot">
<a href="javascript:;" onclick="menuAction(&quot;role&quot;);return false;" style="color:white;">
<div class="new1">
<div class="icon"> <i class="fa fa-star"></i></div>
Role
</div>
</a>
</div>
<div class="col-sm-4 bot">
<a href="javascript:;" onclick="menuAction(&quot;dialmode&quot;);return false;" style="color:white;">
<div class="new1">
<div class="icon"> <i class="fa fa-phone"></i></div>
Manage Dial Mode
</div>
</a>
</div>
</div>
</div>
<!-- <div class="container">
<div class="row">
<div class="col-sm-4 ">
<div class="hero-widget well well-sm">
<div class="icon">
<i class="fa fa-cog"></i>
</div>
<div class="text">
<!-- <var>75%</var>
<label class="text-muted">Campaign Management</label>
</div>
<div class="options">
<a href="javascript:;" class="btn btn-default btn-lg acolor" onclick="menuAction('campaign');return false;"><i class="glyphicon glyphicon-search"></i> Campaign Management</a>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="hero-widget well well-sm">
<div class="icon">
<i class="fa fa-lock f4"></i>
</div>
<div class="text">
<!-- <var>3</var>
<label class="text-muted">Admin</label>
</div>
<div class="options">
<a href="javascript:;" class="btn btn-default btn-lg acolor" onclick="menuAction(&quot;admin&quot;);return false;"><i class="glyphicon glyphicon-search"></i> Flexydial Admin</a>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="hero-widget well well-sm">
<div class="icon">
<i class="fa fa-user"></i>
</div>
<div class="text"><!--
<var>614</var>
<label class="text-muted">Users</label>
</div>
<div class="options">
<a href="javascript:;" class="btn btn-default btn-lg acolor" onclick="menuAction(&quot;user&quot;);return false;"><i class="glyphicon glyphicon-search"></i> Manage Users</a>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="hero-widget well well-sm">
<div class="icon">
<i class="fa fa-users"></i>
</div>
<div class="text">
<!-- <var>73</var>
<label class="text-muted">Groups</label>
</div>
<div class="options">
<a href="javascript:;" class="btn btn-default btn-lg acolor" onclick="menuAction(&quot;group&quot;);return false;"><i class="glyphicon glyphicon-search"></i> Manage Groups</a>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="hero-widget well well-sm">
<div class="icon">
<i class="fa fa-star"></i>
</div>
<div class="text">
<!-- <var>3</var>
<label class="text-muted">Role</label>
</div>
<div class="options">
<a href="javascript:;" class="btn btn-default btn-lg acolor" onclick="menuAction(&quot;role&quot;);return false;"><i class="glyphicon glyphicon-search"></i> Manage Roles</a>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="hero-widget well well-sm">
<div class="icon">
<i class="fa fa-phone"></i>
</div>
<div class="text">
<!-- <var>614</var>
<label class="text-muted">Dial Mode</label>
</div>
<div class="options">
<a href="javascript:;" class="btn btn-default btn-lg acolor" onclick="menuAction(&quot;dialmode&quot;);return false;"><i class="glyphicon glyphicon-search"></i> Manage Dial Mode</a>
</div>
</div>
</div>
</div>
</div> -->
\ No newline at end of file
<style>
.hero-widget { text-align: center; padding-top: 20px; padding-bottom: 20px; }
.hero-widget .icon { display: block; font-size: 96px; line-height: 96px; margin-bottom: 10px; text-align: center; }
.hero-widget var { display: block; height: 64px; font-size: 64px; line-height: 64px; font-style: normal; }
.hero-widget label { font-size: 17px; }
.hero-widget .options { margin-top: 10px; }
.well { background-color : #040404 }
.acolor { color: #000000;}
</style>
<div class="container">
<div class="row">
<div class="col-sm-4">
<div class="hero-widget well well-sm">
<div class="icon">
<i class="fa fa-cog"></i>
</div>
<div class="text">
<!-- <var>75%</var> -->
<label class="text-muted">Campaign Management</label>
</div>
<div class="options">
<a href="javascript:;" class="btn btn-default btn-lg acolor" onclick="menuAction('campaign');return false;"><i class="glyphicon glyphicon-search"></i> Campaign Management</a>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="hero-widget well well-sm">
<div class="icon">
<i class="fa fa-lock f4"></i>
</div>
<div class="text">
<!-- <var>3</var> -->
<label class="text-muted">Admin</label>
</div>
<div class="options">
<a href="javascript:;" class="btn btn-default btn-lg acolor" onclick="menuAction(&quot;admin&quot;);return false;"><i class="glyphicon glyphicon-search"></i> Flexydial Admin</a>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="hero-widget well well-sm">
<div class="icon">
<i class="fa fa-user"></i>
</div>
<div class="text"><!--
<var>614</var> -->
<label class="text-muted">Users</label>
</div>
<div class="options">
<a href="javascript:;" class="btn btn-default btn-lg acolor" onclick="menuAction(&quot;user&quot;);return false;"><i class="glyphicon glyphicon-search"></i> Manage Users</a>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="hero-widget well well-sm">
<div class="icon">
<i class="fa fa-users"></i>
</div>
<div class="text">
<!-- <var>73</var> -->
<label class="text-muted">Groups</label>
</div>
<div class="options">
<a href="javascript:;" class="btn btn-default btn-lg acolor" onclick="menuAction(&quot;group&quot;);return false;"><i class="glyphicon glyphicon-search"></i> Manage Groups</a>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="hero-widget well well-sm">
<div class="icon">
<i class="fa fa-star"></i>
</div>
<div class="text">
<!-- <var>3</var> -->
<label class="text-muted">Role</label>
</div>
<div class="options">
<a href="javascript:;" class="btn btn-default btn-lg acolor" onclick="menuAction(&quot;role&quot;);return false;"><i class="glyphicon glyphicon-search"></i> Manage Roles</a>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="hero-widget well well-sm">
<div class="icon">
<i class="fa fa-phone"></i>
</div>
<div class="text">
<!-- <var>614</var> -->
<label class="text-muted">Dial Mode</label>
</div>
<div class="options">
<a href="javascript:;" class="btn btn-default btn-lg acolor" onclick="menuAction(&quot;dialmode&quot;);return false;"><i class="glyphicon glyphicon-search"></i> Manage Dial Mode</a>
</div>
</div>
</div>
</div>
</div>
<?php
use App\Jobs\KHRMSLib;
use App\Models\CRMCall;
$client=Input::get("client");
$prevData=Input::get("prev");
$currentStatus = Input::get("currentStatus");
$legalStatus = Input::get("legalStatus");
if($currentStatus==""||$legalStatus==""|| $prevData==""){
$currentStatus="ACTIVE";
$legalStatus="PRIMARY";
$prevData="MTD";
}
$wakka=new KHRMSLib();
$dispoclassarr=array('NC'=>array(0,array()),'CC'=>array(0,array()),'CB'=>array(0,array()),'NA'=>array(0,array()));
$dataSelect = array('0'=>'MTD','1'=>'YTD');
$owclientstr=array();
$oclientlst=$wakka->clientsOwnerRWAccess();
if(!empty($oclientlst))foreach($oclientlst as $tclnt)if($tclnt!="")
{
$owclientstr[]="'$tclnt'";
if($client=="")$client=$tclnt;
}
if(!empty($owclientstr))$owclientstr="and client in (".implode(",",$owclientstr).")";else $owclientstr="";
if($client!="")$owclientstr="and client='$client'";
$roclientstr=array();$didlinesstr=array();if(Auth::user()->exten!="")$didlinesstr[]=Auth::user()->exten;
$roclientlst=$wakka->clientsReadAccess();
//print_r($roclientlst);
if(!empty($roclientlst))foreach($roclientlst as $tclnt)if($tclnt!="")
{
$roclientstr[]="'$tclnt'";
if($client=="")$client=$tclnt;
$mastersdata=$wakka->getCompanyMaster($tclnt);
if(!empty($mastersdata["DialerDID"]))$didlinesstr[]=$mastersdata["DialerDID"];
if(empty($mastersdata['dialerDispoList']))$mastersdata['dialerDispoList']=$wakka->HRCoreVars['dialerDispoList'];
$dispoarr=explode("~",$mastersdata['dialerDispoList']);
foreach($dispoarr as $dispo)
{
if(!empty($dispo))
{
$dispoprts=explode("|",$dispo);
if(sizeof($dispoprts)>=3)
{
if(isset($dispoclassarr[$dispoprts[0]]))
{
$dispoclassarr[$dispoprts[0]][1][]=$dispoprts[1];
}
}
}
}
}
foreach($didlinesstr as $k=>$dids)
{
$didarr=explode(":",$dids);
$didlinesstr[$k]=$didarr[0];
}
if(!empty($roclientstr))$roclientstr="and client in (".implode(",",$roclientstr).")";else $roclientstr="";
if($client!="")$roclientstr="and client='$client'";
//$currentstatuses=$wakka->LoadAll("select distinct currentstatus from records where currentstatus!='' $owclientstr");
//$legalstatuses=$wakka->LoadAll("select distinct legalstatus from records where legalstatus!='' $owclientstr");
$dispoarr=$wakka->LoadAll("select count(*) as cnt,currentstatus,legalstatus,dialer_status from records where 1=1 $owclientstr group by currentstatus,legalstatus,dialer_status");
$countStatuses = array('New', 'Called');
foreach ($countStatuses as $status) {
$$status = 0;
}
$counts= DB::table('records')
->select(DB::raw("count(*) as cnt,status"))
->whereIn('status', $countStatuses)
->where('client', '=', $client)
->groupBy('status')->get();
foreach ($counts as $key => $count)
{
$status = $count->status;
$$status = $count->cnt;
}
$TotalData=$New + $Called;
$NotCalled=$New;
$TotalCalled=$Called;
$birthdate=date('m-d');
$Priority=$wakka->getCount("records","priority in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) $owclientstr");
$Flagged=$wakka->getCount("records","dialer_flag='VIP' $owclientstr");
//$NotCalledFlagged=$wakka->getCount("records"," priority='VIP' $owclientstr");
$NotCalledFlagged=$wakka->getCount("records"," mf_isa='VIP' $owclientstr");
$todaybirthday=$wakka->getCount("records"," DATE_FORMAT(DOB,'%m-%d')='$birthdate' and priority='11' $owclientstr");
if($prevData=='MTD'&&$legalStatus!='SECONDARY')
{
$dispoarr=$wakka->LoadAll("select count(*) as cnt,currentstatus,legalstatus,dialer_status from records where 1=1 $owclientstr group by currentstatus,legalstatus,dialer_status having legalstatus='$legalStatus' and currentstatus='$currentStatus'");
$TotalData=$wakka->getCount("records","status IN ('New', 'Called','Noqueue') and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr");
$NotCalled=$wakka->getCount("records","status='New' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
$TotalCalled=$wakka->getCount("records","status='Called' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
$Priority=$wakka->getCount("records","priority in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
$Flagged=$wakka->getCount("records","dialer_flag='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
/*$NotCalledFlagged=$wakka->getCount("records"," priority='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");*/
$NotCalledFlagged=$wakka->getCount("records"," mf_isa='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
}
if($prevData=='YTD'&&$legalStatus!='SECONDARY')
{
$ydispoarr=$wakka->LoadAll("select count(*) as cnt,currentstatus,legalstatus,old_dialer_status from records where 1=1 $owclientstr group by currentstatus,legalstatus,old_dialer_status");
$TotalData=$wakka->getCount("records","old_status IN ('New', 'Called','Noqueue') and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr");
$NotCalled=$wakka->getCount("records","old_status='New' and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr");
$TotalCalled=$wakka->getCount("records","old_status='Called' and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr");
$Priority=$wakka->getCount("records","priority in (1,2,3,4,5,6,7,8,9,10) and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr");
$Flagged=$wakka->getCount("records","dialer_flag='VIP' and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr");
/*$NotCalledFlagged=$wakka->getCount("records"," priority='VIP' and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr");*/
$NotCalledFlagged=$wakka->getCount("records"," mf_isa='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
}
if($prevData=='MTD'&&$legalStatus=='SECONDARY')
{
$dispoarr=$wakka->LoadAll("select count(*) as cnt,currentstatus,legalstatus,dialer_status from records where 1=1 $owclientstr group by currentstatus,legalstatus,dialer_status having legalstatus='$legalStatus' and currentstatus='$currentStatus'");
$TotalData=$wakka->getCount("records","status IN ('New', 'Called','Noqueue') and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
$NotCalled=$wakka->getCount("records","status='New' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
$TotalCalled=$wakka->getCount("records","status='Called' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
$Priority=$wakka->getCount("records","priority in (1,2,3,4,5,6,7,8,9,10) and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
$Flagged=$wakka->getCount("records","dialer_flag='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
/*$NotCalledFlagged=$wakka->getCount("records"," priority='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");*/
$NotCalledFlagged=$wakka->getCount("records"," mf_isa='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
}
if($prevData=='YTD'&&$legalStatus=='SECONDARY')
{
$ydispoarr=$wakka->LoadAll("select count(*) as cnt,currentstatus,legalstatus,old_dialer_status from records where 1=1 $owclientstr group by currentstatus,legalstatus,old_dialer_status having legalstatus='$legalStatus' and currentstatus='$currentStatus'");
$TotalData=$wakka->getCount("records","old_status IN ('New', 'Called','Noqueue') and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr");
$NotCalled=$wakka->getCount("records","old_status='New' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
$TotalCalled=$wakka->getCount("records","old_status='Called' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
$Priority=$wakka->getCount("records","priority in (1,2,3,4,5,6,7,8,9,10) and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
$Flagged=$wakka->getCount("records","dialer_flag='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
/*$NotCalledFlagged=$wakka->getCount("records"," priority='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");*/
$NotCalledFlagged=$wakka->getCount("records"," mf_isa='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");
}
$MissedCalls=0;
$udidlinesstr = array();
foreach($didlinesstr as $didlinestr){
$didlinestrArr=explode(":",$didlinestr);
$udidlinesstr[] = substr($didlinestrArr[0], env('didnumber'));
}
$mc=CRMCall::where('userstatus','=','InboundDROP')->where('created_at','>','2018-09-11 00:00:00')->where('created_at','>',date('Y-m-d H:i:s',time()-(7*24*60*60)));
$mc=$mc->where(function ($query) use($roclientlst,$udidlinesstr){
$query->orWhereIn('client',$roclientlst)->orWhereIn('did',$udidlinesstr);
});
$mc=$mc->get();
$number_list=array();
foreach($mc as $key=>$tcall)
{
$tccal=substr($tcall->number,-10);
$mc_number=CRMCall::where('userstatus','!=','InboundDROP')
->where('created_at','>',$tcall->created_at)
->where('number','like',"%".$tccal."%")
->orderBy("id","DESC")
->first();
$mccount=count($mc_number);
if($mccount==0)
{
$number_list[] = $tcall->number;
}
}
if(count($number_list) > 0) {
$lcalls=DB::select("SELECT * FROM crmcalls where id in (SELECT max(id) FROM crmcalls WHERE number IN ('" . implode("','", $number_list). "') GROUP BY number )");
foreach($lcalls as $lcall)
{
if($lcall->userstatus=="InboundDROP")
{
$MissedCalls++;
}
}
}
$callstoday=CRMCall::where("created_at",">=",date("Y-m-d 00:00:00"))->where("user_id","=",Auth::user()->id)->count();
$callsmonth=CRMCall::where("created_at",">=",date("Y-m-01 00:00:00"))->where("user_id","=",Auth::user()->id)->count();
$recstoday=$wakka->getCount("records","dialer_lastcall>='".date("Y-m-d 00:00:00")."' $owclientstr");
$recsmonth=$wakka->getCount("records","dialer_lastcall>='".date("Y-m-01 00:00:00")."' $owclientstr");
$user=Auth::user()->id;
$role = Auth::user()->usertype;// TODO with role
$calllog = $calllog = DB::table('records')
->join('crmcalls', 'records.dialer_callback', '=', 'crmcalls.usercallback')
->select('records.firstname', 'records.cust_id', 'records.mobile', 'records.dialer_callback', 'records.status','records.dialer_lastcall','records.id','records.dialer_status')
->where("crmcalls.user_id",$user)
//->where("records.dialer_substatus","Follow Up")
->where("records.dialer_callback", "!=","0000-00-00 00:00:00")
//->where("crmcalls.usercallback", "!=","0000-00-00 00:00:00")
//->where("crmcalls.created_at", ">",date("Y-m-d 08:00:00"))
//->where("crmcalls_archive.usercallback", "=","records.dialer_callback")
//->where("records.dialer_lastcall", "<=","crmcalls_archive.usercallback")
->get();
$campaignFollowupCount = $calllog = DB::table('records')
->join('crmcalls', 'records.dialer_callback', '=', 'crmcalls.usercallback')
->select('records.firstname', 'records.cust_id', 'records.mobile', 'records.dialer_callback', 'records.status','records.dialer_lastcall','records.id','records.dialer_status')
->where("crmcalls.user_id",$user)
//->where("records.dialer_substatus","Follow Up")
->where("records.dialer_callback", "!=","0000-00-00 00:00:00")
//->where("crmcalls.usercallback", "!=","0000-00-00 00:00:00")
//->where("crmcalls.created_at", ">",date("Y-m-d 08:00:00"))
//->where("crmcalls_archive.usercallback", "=","records.dialer_callback")
//->where("records.dialer_lastcall", "<=","crmcalls_archive.usercallback")
->where('records.client', '=', $client)
->get();
$userId = Auth::user()->id;
$TotalCalled=$wakka->getCount("crmcalls","user_id = $userId and created_at > '".date("Y-m-d 03:00:00")."'");
$contactedTotalCalled=$wakka->getCount("crmcalls","userstatus='Contacted' and user_id = $userId and created_at > '".date("Y-m-d 03:00:00")."'");
$campaignTotalCalled=$wakka->getCount("crmcalls","user_id = $userId and client = '$client' and created_at > '".date("Y-m-d 03:00:00")."'");
$campaignContactedTotalCalled=$wakka->getCount("crmcalls","userstatus='Contacted' and user_id = $userId and client = '$client' and created_at > '".date("Y-m-d 03:00:00")."'");
?>
<?php if($role != 'Admin'){ ?>
<div class="container">
<div class="row">
<?php //echo "1ii".sizeof($roclientlst);?>
<?php if(sizeof($roclientlst)>0){ ?>
<div class="col-md-1" style="padding: 0px;margin: 6px;">
<h4>Campaign</h4>
</div>
<div class=col-md-5>
<select class='form-control selcls' id=tcampaign_select onchange='campaignSelect();'>
<?php $s=""; $i = 0;
foreach($roclientlst as $c){
$c=trim($c);
if(!empty($c)){
//if($c==$client)$s='selected';
if($i == 0)$s='selected';
echo "<option value='$c' $s>$c</option>";
}
} ?>
</select>
</div>
<div class=col-md-5>
<select class=form-control id=data_select onchange='dataSelect();' style='display:none'>
<?php foreach($dataSelect as $d){$s="";if($d==$prevData)$s='selected';echo "<option value='$d' $s>$d</option>";} ?>
</select>
</div>
<div style='clear:both'></div>
<br>
<?php } ?>
</div>
<div class="row"><div class="col-sm-4"><h4>Total</h4></div></div>
<div class="row">
<div class="col-sm-4 bot">
<div class="new1" style="color:white;">
<div class="text">
<var><?php echo $TotalCalled; ?></var>
</div>
Called
</div>
</div>
<div class="col-sm-4 bot">
<div class="new1" style="color:white;">
<div class="text">
<var><?php echo $contactedTotalCalled; ?></var>
</div>
Contacted
</div>
</div>
<div class="col-sm-4 bot">
<a href="javascript:;" onclick="loadFollowupData('all');" style="color:white;">
<div class="new1" style="color:white;">
<div class="text">
<var><?php echo count($calllog); ?></var>
</div>
Follow Up
</div>
</a>
</div>
</div>
<div class="row"><div class="col-sm-4"><h4>Campaign Wise</h4></div></div>
<div class="row">
<div class="col-sm-4 bot">
<div class="new1" style="color:white;">
<div class="text">
<var><?php echo $campaignTotalCalled; ?></var>
</div>
Called
</div>
</div>
<div class="col-sm-4 bot">
<div class="new1" style="color:white;">
<div class="text">
<var><?php echo $campaignContactedTotalCalled; ?></var>
</div>
Contacted
</div>
</div>
<div class="col-sm-4 bot">
<a href="javascript:;" onclick="loadFollowupData('campaign');" style="color:white;">
<div class="new1" style="color:white;">
<div class="text">
<var><?php echo count($campaignFollowupCount); ?></var>
</div>
Follow Up
</div>
</a>
</div>
</div>
<!-- <div class="row"><div class="col-sm-4"><h4>Total</h4></div></div>
<div class="row">
<div class="col-sm-4">
<div class="hero-widget well well-sm">
<div class="text">
<var><?php echo $TotalCalled; ?></var>
<label class="text-muted">Called</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="hero-widget well well-sm">
<div class="text">
<var ><?php echo $contactedTotalCalled; ?></var>
<label class="text-muted">Contacted</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="hero-widget well well-sm">
<div class="text">
<var><?php echo count($calllog); ?></var>
<label class="text-muted">
<!-- <a href="#" onclick="menuAction('dialer/loadFollowupData');return false;">Follow Up</a>Follow Up
</label>
</div>
</div>
</div>
</div>
<div class="row"><div class="col-sm-4"><h4>Campaign Wise</h4></div></div>
<div class="row">
<div class="col-sm-4">
<div class="hero-widget well well-sm">
<div class="text">
<var><?php echo $campaignTotalCalled; ?></var>
<label class="text-muted">Called</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="hero-widget well well-sm">
<div class="text">
<var ><?php echo $campaignContactedTotalCalled; ?></var>
<label class="text-muted">Contacted</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="hero-widget well well-sm">
<div class="text">
<var><?php echo count($campaignFollowupCount); ?></var>
<label class="text-muted"><!-- <a href="#" onclick="menuAction('dialer/loadFollowupData');return false;">Follow Up</a>Follow Up</label>
</div>
</div>
</div>
</div> -->
</div>
<div class=col-md-3 style="display: none" >
<div class=col-md-11>
<!-- <h5>
Buckets
<span class='label label-small label-default pull-right'>
<a href=# onclick="dialerLoadData('CallsMonth','','',1,'','');return false;" style='color:#fff;font-size:12px'>
Month:&nbsp;&nbsp; {!!$recsmonth!!} / {!!$callsmonth!!}
</a>
</span>
<span class='label label-small label-default pull-right' style='margin-right:5px'>
<a href=# onclick="dialerLoadData('CallsToday','','',1,'','');return false;" style='color:#fff;font-size:12px'>
Today:&nbsp;&nbsp; {!!$recstoday!!} / {!!$callstoday!!}
</a>
</span>
</h5>
<div style='clear:both'></div>
<hr><br>-->
<?php
//print_r($legalstatuses);
//print_r($currentstatuses);
?>
<!-- <div class=col-md-6>
<select class=form-control id=legalstatus_select onchange='bucketSelect();'>
<option value='PRIMARY'>PRIMARY</option>
<option value='SECONDARY'>SECONDARY</option>
</select>
</div>
<div class=col-md-6>
<select class=form-control id=currentstatus_select onchange='bucketSelect();'>
<option value='ACTIVE'>ACTIVE</option>
<option value='PASSIVE'>PASSIVE</option>
</select>
</div> -->
<div style='clear:both'></div>
<ul style="list-style:none">
<!-- <li class="notify_alert">
<span><a href=# onclick="dialerLoadData('CurrentQueue','','',1,'','');return false;">CurrentQueue</a></span>
<span class="label label-small pull-right" >
0
</span>
</li> -->
<!-- <li class="notify_alert">
<span><a href=# onclick="dialerLoadData('MissedCalls','','',1,'','');return false;">MissedCalls</a></span>
<span class="label label-small label-primary pull-right" >
{!!$MissedCalls!!}
</span>
</li> -->
<!-- <li class="notify_alert">
<span><a href=# onclick="dialerLoadData('Priority','','',1,'','');return false;">Priority</a></span>
<span class="label label-small label-info pull-right" >
{!!$Priority!!}
</span>
</li> -->
<li class="notify_alert">
<span><a href=# onclick="dialerLoadData('FollowUp,','','',1,'','');return false;">FollowUp</a></span>
<span class="label label-small label-default pull-right" >
{!!$FollowUp!!}
</span>
</li>
<li class="notify_alert">
<!-- <span><a href=# onclick="dialerLoadData('TotalData','{!!$currentStatus!!}','{!!$legalStatus!!}',1,'','');return false;">TotalData</a></span> -->
<span>TotalData</span>
<span class="label label-small label-default pull-right" >
{!!$TotalData!!}
</span>
</li>
<!-- <li class="notify_alert">
<span><a href=# onclick="dialerLoadData('NotCalled','{!!$currentStatus!!}','{!!$legalStatus!!}',1,'','');return false;">NotCalled</a></span>
<span class="label label-small label-default pull-right" >
{!!$NotCalled!!}
</span>
</li> -->
<li class="notify_alert">
<!-- <span><a href=# onclick="dialerLoadData('Called','','',1,'','');return false;">Called</a></span> -->
<span>Called</span>
<span class="label label-small label-success pull-right" >
{!!$TotalCalled!!}
</span>
</li>
<li class="notify_alert">
<!-- <span><a href=# onclick="return false;">Contacted</a></span> -->
<span>Contacted</span>
<span class="label label-small label-success pull-right" id=contactedcnt_span>
0
</span>
</li>
<!-- <li class="notify_alert">
<span><a href=# onclick="dialerLoadData('Flagged-Called','{!!$currentStatus!!}','{!!$legalStatus!!}',1,'','');return false;">Flagged-Called</a></span>
<span class="label label-small label-success pull-right" >
{!!$Flagged!!}
</span>
</li> -->
<!-- <li class="notify_alert">
<span><a href=# onclick="dialerLoadData('Flagged-Notcalled','{!!$currentStatus!!}','{!!$legalStatus!!}',1,'','');return false;">Flagged-NotCalled</a></span>
<span class="label label-small label-warning pull-right" >
{!!$NotCalledFlagged!!}
</span>
</li> -->
<!-- <li class="notify_alert">
<span><a href=# onclick="dialerLoadData('today-birthday','{!!$currentStatus!!}','{!!$legalStatus!!}',1,'','');return false;">Today Birthday</a></span>
<span class="label label-small label-warning pull-right" >
{!!$todaybirthday!!}
</span>
</li> -->
<hr><br>
<?php
if($prevData=='' ||$prevData=='MTD')
{
foreach($dispoarr as $disp) {
foreach($dispoclassarr as $dclass=>$darr)
{
if(in_array($disp['dialer_status'],$darr[1]))
{
$dispoclassarr[$dclass][0]+=$disp['cnt'];
}
}
$class=str_replace(" ","_","CLS_".$disp['currentstatus'].$disp['legalstatus']);
if($disp['dialer_status'])
{
?>
<li class="notify_alert bucketliitem sdfsdf {!!$class!!}">
<span><a href=# onclick="dialerLoadData('{!!$disp['dialer_status']!!}','{!!$disp['currentstatus']!!}','{!!$disp['legalstatus']!!}',1,'','');return false;">{!!$disp['dialer_status']!!}</a></span>
<span class="label label-small label-success pull-right" >
{!!$disp['cnt']!!}
</span>
</li>
<?php }
}
}
if($prevData=='YTD')
{
foreach($ydispoarr as $disp) {
foreach($dispoclassarr as $dclass=>$darr)
{
if(in_array($disp['old_dialer_status'],$darr[1]))
{
$dispoclassarr[$dclass][0]+=$disp['cnt'];
}
}
$class=str_replace(" ","_","CLS_".$disp['currentstatus'].$disp['legalstatus']);
if($disp['old_dialer_status'])
{
?>
<li class="notify_alert bucketliitem test {!!$class!!}">
<span><a href=# onclick="dialerLoadData('{!!$disp['old_dialer_status']!!}','{!!$disp['currentstatus']!!}','{!!$disp['legalstatus']!!}',1,'','');return false;">{!!$disp['old_dialer_status']!!}</a></span>
<span class="label label-small label-success pull-right" >
{!!$disp['cnt']!!}
</span>
</li>
<?php
}
}
}
$contacted=$dispoclassarr['CC'][0]+$dispoclassarr['CB'][0]+$dispoclassarr['NC'][0];
echo "<script>$('#contactedcnt_span').html('$contacted');</script>";
?>
</ul>
</div>
</div>
<!-- <div class=col-md-9 id=bucketlistdiv></div>
--><div style='clear:both'></div>
<?php }else{ ?>
@include("layout/module/dashboard/adminHomePage")
<?php } ?>
<script>
<?php if($client){?>
$("#tcampaign_select").val('<?=$client?>');
<?php }?>
<?php if($prevData){ ?>
$("#data_select").val('<?=$prevData?>');
<?php }?>
<?php if($legalStatus){ ?>
$("#legalstatus_select").val('<?=$legalStatus?>');
<?php }?>
<?php if($currentStatus){ ?>
$("#currentstatus_select").val('<?=$currentStatus?>');
<?php }?>
function loadFollowupData(val)
{
var menu = "dialer/loadFollowupData";
doAjax(menu+"?client="+$("#tcampaign_select").val()+"&selection="+val,'','content','ajax_'+menu,'singlethis','GET');
}
function campaignSelect()
{
var dashlet="Dialer";
doAjax("dashboard/dashlet?module="+dashlet+"&client="+$("#tcampaign_select").val(),"","DashletT-"+dashlet,"ajax_dashlet_"+dashlet,"singlefail","GET");
}
function dataSelect()
{
var currentStatus = $('#currentstatus_select').val();
var legalStatus = $('#legalstatus_select').val();
var prev = $("#data_select").val();
var client = $("#tcampaign_select").val();
var dashlet="Dialer";
doAjax("dashboard/dashlet?module="+dashlet+"&client="+client+"&prev="+prev+"&currentStatus="+currentStatus+"&legalStatus="+legalStatus,"","DashletT-"+dashlet,"ajax_dashlet_"+dashlet,"singlefail","GET");
}
function bucketSelect()
{
/*var activeclass='CLS_'+$('#currentstatus_select').val()+$('#legalstatus_select').val();
$('.bucketliitem').hide();
$('.'+activeclass).show();*/
var currentStatus = $('#currentstatus_select').val();
var legalStatus = $('#legalstatus_select').val();
var prev = $("#data_select").val();
var client = $("#tcampaign_select").val();
var dashlet="Dialer";
doAjax("dashboard/status?module="+dashlet+"&client="+client+"&prev="+prev+"&currentStatus="+currentStatus+"&legalStatus="+legalStatus,"","DashletT-"+dashlet,"ajax_dashlet_"+dashlet,"singlefail","GET");
}
//bucketSelect();
function dialerLoadData(listname,currentstatus,legalstatus,page,skey,stxt)
{
doAjax("dialer/bucketdata","client={!!$client!!}&bucket="+listname+"&currentstatus="+currentstatus+"&legalstatus="+legalstatus+'&page='+page+'&skey='+skey+'&stxt='+stxt,"bucketlistdiv","ajax_dialer_list","singlefail","GET");
}
dialerLoadData('CurrentQueue','','',1,'','');
</script>
<style>
.hero-widget { text-align: center; padding-top: 20px; padding-bottom: 20px; text-shadow: 1px 1px 2px blue, 0 0 25px blue, 0 0 5px darkblue; }
.hero-widget .icon { display: block; font-size: 96px; line-height: 96px; margin-bottom: 10px; text-align: center; }
.hero-widget var { display: block; height: 64px; font-size: 64px; line-height: 64px; font-style: normal; }
.hero-widget label { font-size: 17px; }
.hero-widget .options { margin-top: 10px; }
.well { background-color : #040404 }
.acolor { color: #000000;}
.new1 .icon { display: block; font-size: 96px; line-height: 96px; margin-bottom: 10px; text-align: center; }
.bot { padding-bottom: 20px !important; }
.new1 var { display: block; height: 96px; font-size: 96px; line-height: 96px; font-style: normal; }
</style>
<style>
.new1 {
/*width: 200px;
height: auto;*/
padding: 15px;
background-color: #f6f7fb;
box-shadow: 10px 10px 5px grey;
font-size:30px;
border: 2px solid red;
border-radius: 50px 20px;
text-align: center;
/* text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;*/
text-shadow: 1px 1px 2px blue, 0 0 25px blue, 0 0 5px darkblue;
}
.selcls {
/* padding: 9px; */
border: solid 1px #517B97;
outline: 0;
background: -webkit-gradient(linear, left top, left 25, from(#FFFFFF), color-stop(4%, #CAD9E3), to(#FFFFFF));
background: -moz-linear-gradient(top, #FFFFFF, #CAD9E3 1px, #FFFFFF 25px);
box-shadow: rgba(0,0,0, 0.1) 0px 0px 8px;
-moz-box-shadow: rgba(0,0,0, 0.1) 0px 0px 8px;
-webkit-box-shadow: rgba(0,0,0, 0.1) 0px 0px 8px;
}
</style>
......@@ -31,7 +31,7 @@ use App\Models\CRMCall;
$roclientstr=array();$didlinesstr=array();if(Auth::user()->exten!="")$didlinesstr[]=Auth::user()->exten;
$roclientlst=$wakka->clientsReadAccess();
//print_r($roclientlst);
if(!empty($roclientlst))foreach($roclientlst as $tclnt)if($tclnt!="")
{
$roclientstr[]="'$tclnt'";
......@@ -203,30 +203,277 @@ use App\Models\CRMCall;
$recstoday=$wakka->getCount("records","dialer_lastcall>='".date("Y-m-d 00:00:00")."' $owclientstr");
$recsmonth=$wakka->getCount("records","dialer_lastcall>='".date("Y-m-01 00:00:00")."' $owclientstr");
?>
$user=Auth::user()->id;
$role = Auth::user()->usertype;
$userId = Auth::user()->id;
// role== user
// all
if($role == 'User'){
$TotalCalled=$wakka->getCount("crmcalls","user_id = $userId and created_at > '".date("Y-m-d 03:00:00")."'");
$contactedTotalCalled=$wakka->getCount("crmcalls","userstatus='Contacted' and user_id = $userId and created_at > '".date("Y-m-d 03:00:00")."'");
$calllog = DB::table('records')
//->join('crmcalls', 'records.dialer_callback', '=', 'crmcalls.usercallback')
->select('records.customer_name', 'records.cust_id', 'records.mobile', 'records.dialer_callback', 'records.status','records.dialer_lastcall','records.id','records.dialer_status','records.client')
->where("records.usr_id",$userId)
//->where("records.dialer_substatus","Follow Up")
->where("records.dialer_callback", "!=","0000-00-00 00:00:00")
//->where("crmcalls.usercallback", "!=","0000-00-00 00:00:00")
//->where("crmcalls.created_at", ">",date("Y-m-d 08:00:00"))
//->where("crmcalls_archive.usercallback", "=","records.dialer_callback")
//->where("records.dialer_lastcall", "<=","crmcalls_archive.usercallback")
->get();
// campaign
$campaignTotalCalled=$wakka->getCount("crmcalls","user_id = $userId and client = '$client' and created_at > '".date("Y-m-d 03:00:00")."'");
$campaignContactedTotalCalled=$wakka->getCount("crmcalls","userstatus='Contacted' and user_id = $userId and client = '$client' and created_at > '".date("Y-m-d 03:00:00")."'");
$campaignFollowupCount = DB::table('records')
//->join('crmcalls', 'records.dialer_callback', '=', 'crmcalls.usercallback')
->select('records.customer_name', 'records.cust_id', 'records.mobile', 'records.dialer_callback', 'records.status','records.dialer_lastcall','records.id','records.dialer_status','records.client')
->where("records.usr_id",$userId)
//->where("records.dialer_substatus","Follow Up")
->where("records.dialer_callback", "!=","0000-00-00 00:00:00")
//->where("crmcalls.usercallback", "!=","0000-00-00 00:00:00")
//->where("crmcalls.created_at", ">",date("Y-m-d 08:00:00"))
//->where("crmcalls_archive.usercallback", "=","records.dialer_callback")
//->where("records.dialer_lastcall", "<=","crmcalls_archive.usercallback")
->where('records.client', '=', $client)
->get();
}else if($role == 'Supervisor'){
//supervisor
$userName = Auth::user()->username;
$supervisorUsers=$wakka->LoadAll("select id from users where supervisor='$userName';");
$userIds = [];
foreach ($supervisorUsers as $key => $value) $userIds[] = "'".$value['id']."'";
$supervisorUsers = implode(",",$userIds);
$supervisorTotalCalled = 0;
$supervisorContacted = 0;
$supervisorCallLog = 0;
$supervisorCampaignTotalCalled = 0;
$supervisorCampaignContacted = 0;
$supervisorCampaignCallLog = 0;
if(!empty($supervisorUsers)){
// all
$supervisorTotalCalled=$wakka->getCount("crmcalls","user_id IN ($supervisorUsers) and created_at > '".date("Y-m-d 03:00:00")."'");
$supervisorContacted=$wakka->getCount("crmcalls","userstatus='Contacted' and user_id IN ($supervisorUsers) and created_at > '".date("Y-m-d 03:00:00")."'");
$supervisorCallLog = $calllog = DB::table('records')
//->join('crmcalls', 'records.dialer_callback', '=', 'crmcalls.usercallback')
->select('records.customer_name', 'records.cust_id', 'records.mobile', 'records.dialer_callback', 'records.status','records.dialer_lastcall','records.id','records.dialer_status','records.client')
->whereIn("records.usr_id",[$supervisorUsers])
//->where("records.dialer_substatus","Follow Up")
->where("records.dialer_callback", "!=","0000-00-00 00:00:00")
//->where("crmcalls.usercallback", "!=","0000-00-00 00:00:00")
//->where("crmcalls.created_at", ">",date("Y-m-d 08:00:00"))
//->where("crmcalls_archive.usercallback", "=","records.dialer_callback")
//->where("records.dialer_lastcall", "<=","crmcalls_archive.usercallback")
->get();
$supervisorCallLog = count($supervisorCallLog);
// campaign
$supervisorCampaignTotalCalled=$wakka->getCount("crmcalls","user_id IN ($supervisorUsers) and client = '$client' and created_at > '".date("Y-m-d 03:00:00")."'");
$supervisorCampaignContacted=$wakka->getCount("crmcalls","userstatus='Contacted' and user_id IN ($supervisorUsers) and client = '$client' and created_at > '".date("Y-m-d 03:00:00")."'");
$supervisorCampaignCallLog = $calllog = DB::table('records')
//->join('crmcalls', 'records.dialer_callback', '=', 'crmcalls.usercallback')
->select('records.customer_name', 'records.cust_id', 'records.mobile', 'records.dialer_callback', 'records.status','records.dialer_lastcall','records.id','records.dialer_status','records.client')
->whereIn("records.usr_id",[$supervisorUsers])
//->where("records.dialer_substatus","Follow Up")
->where("records.dialer_callback", "!=","0000-00-00 00:00:00")
//->where("crmcalls.usercallback", "!=","0000-00-00 00:00:00")
//->where("crmcalls.created_at", ">",date("Y-m-d 08:00:00"))
//->where("crmcalls_archive.usercallback", "=","records.dialer_callback")
//->where("records.dialer_lastcall", "<=","crmcalls_archive.usercallback")
->where('records.client', '=', $client)
->get();
$supervisorCampaignCallLog = count($supervisorCampaignCallLog);
}
}
<div class=col-md-3>
<div class=col-md-11>
<?php if(sizeof($roclientlst)>0){ ?>
<h5>
Campaign
<select class='form-control pull-right' id=tcampaign_select onchange='campaignSelect();' style='width:50%'>
<?php foreach($roclientlst as $c){$s="";if($c==$client)$s='selected';echo "<option value='$c' $s>$c</option>";} ?>
</select>
</h5>
<br>
<div class=col-md-6>
<select class=form-control id=data_select onchange='dataSelect();'>
<?php foreach($dataSelect as $d){$s="";if($d==$prevData)$s='selected';echo "<option value='$d' $s>$d</option>";} ?>
</select>
?>
<?php if($role == 'User'){ ?>
<div class="container">
<div class="row">
<?php if(sizeof($roclientlst)>0){ ?>
<div class="col-md-1" style="padding: 0px;margin: 6px;">
<h4>Campaign</h4>
</div>
<div class=col-md-5>
<select class='form-control selcls' id=tcampaign_select onchange='campaignSelect();'>
<?php $s=""; $i = 0;
foreach($roclientlst as $c){
$c=trim($c);
if(!empty($c)){
//if($c==$client)$s='selected';
if($i == 0)$s='selected';
echo "<option value='$c' $s>$c</option>";
}
} ?>
</select>
</div>
<div class=col-md-5>
<select class=form-control id=data_select onchange='dataSelect();' style='display:none'>
<?php foreach($dataSelect as $d){$s="";if($d==$prevData)$s='selected';echo "<option value='$d' $s>$d</option>";} ?>
</select>
</div>
<div style='clear:both'></div>
<br>
<?php } ?>
</div>
<div class="row"><div class="col-sm-4"><h4>Total</h4></div></div>
<div class="row">
<div class="col-sm-4 bot">
<div class="new1" style="color:white;">
<div class="text">
<var><?php echo $TotalCalled; ?></var>
</div>
Called
</div>
</div>
<div class="col-sm-4 bot">
<div class="new1" style="color:white;">
<div class="text">
<var><?php echo $contactedTotalCalled; ?></var>
</div>
Contacted
</div>
</div>
<div class="col-sm-4 bot">
<a href="javascript:;" onclick="loadFollowupData('all');" style="color:white;">
<div class="new1" style="color:white;">
<div class="text">
<var><?php echo count($calllog); ?></var>
</div>
Follow Up
</div>
<div style='clear:both'></div>
<br>
<?php } ?>
</a>
</div>
</div>
<div class="row"><div class="col-sm-4"><h4>Campaign Wise</h4></div></div>
<div class="row">
<div class="col-sm-4 bot">
<div class="new1" style="color:white;">
<div class="text">
<var><?php echo $campaignTotalCalled; ?></var>
</div>
Called
</div>
</div>
<div class="col-sm-4 bot">
<div class="new1" style="color:white;">
<div class="text">
<var><?php echo $campaignContactedTotalCalled; ?></var>
</div>
Contacted
</div>
</div>
<div class="col-sm-4 bot">
<a href="javascript:;" onclick="loadFollowupData('campaign');" style="color:white;">
<div class="new1" style="color:white;">
<div class="text">
<var><?php echo count($campaignFollowupCount); ?></var>
</div>
Follow Up
</div>
</a>
</div>
</div>
<!-- <div class="row"><div class="col-sm-4"><h4>Total</h4></div></div>
<div class="row">
<div class="col-sm-4">
<div class="hero-widget well well-sm">
<div class="text">
<var><?php echo $TotalCalled; ?></var>
<label class="text-muted">Called</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="hero-widget well well-sm">
<div class="text">
<var ><?php echo $contactedTotalCalled; ?></var>
<label class="text-muted">Contacted</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="hero-widget well well-sm">
<div class="text">
<var><?php echo count($calllog); ?></var>
<label class="text-muted">
<!-- <a href="#" onclick="menuAction('dialer/loadFollowupData');return false;">Follow Up</a>Follow Up
</label>
</div>
</div>
</div>
</div>
<div class="row"><div class="col-sm-4"><h4>Campaign Wise</h4></div></div>
<div class="row">
<div class="col-sm-4">
<div class="hero-widget well well-sm">
<div class="text">
<var><?php echo $campaignTotalCalled; ?></var>
<label class="text-muted">Called</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="hero-widget well well-sm">
<div class="text">
<var ><?php echo $campaignContactedTotalCalled; ?></var>
<label class="text-muted">Contacted</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="hero-widget well well-sm">
<div class="text">
<var><?php echo count($campaignFollowupCount); ?></var>
<label class="text-muted"><!-- <a href="#" onclick="menuAction('dialer/loadFollowupData');return false;">Follow Up</a>Follow Up</label>
</div>
</div>
</div>
<h5>
</div> -->
</div>
<div class=col-md-3 style="display: none" >
<div class=col-md-11>
<!-- <h5>
Buckets
<span class='label label-small label-default pull-right'>
<a href=# onclick="dialerLoadData('CallsMonth','','',1,'','');return false;" style='color:#fff;font-size:12px'>
......@@ -239,15 +486,15 @@ use App\Models\CRMCall;
</a>
</span>
</h5>
</h5>
<div style='clear:both'></div>
<hr><br>
<hr><br>-->
<?php
//print_r($legalstatuses);
//print_r($currentstatuses);
?>
<div class=col-md-6>
<!-- <div class=col-md-6>
<select class=form-control id=legalstatus_select onchange='bucketSelect();'>
<option value='PRIMARY'>PRIMARY</option>
<option value='SECONDARY'>SECONDARY</option>
......@@ -258,70 +505,78 @@ use App\Models\CRMCall;
<option value='ACTIVE'>ACTIVE</option>
<option value='PASSIVE'>PASSIVE</option>
</select>
</div>
</div> -->
<div style='clear:both'></div>
<ul style="list-style:none">
<li class="notify_alert">
<!-- <li class="notify_alert">
<span><a href=# onclick="dialerLoadData('CurrentQueue','','',1,'','');return false;">CurrentQueue</a></span>
<!--<span class="label label-small pull-right" >
<span class="label label-small pull-right" >
0
</span>-->
</li>
<li class="notify_alert">
</span>
</li> -->
<!-- <li class="notify_alert">
<span><a href=# onclick="dialerLoadData('MissedCalls','','',1,'','');return false;">MissedCalls</a></span>
<span class="label label-small label-primary pull-right" >
{!!$MissedCalls!!}
</span>
</li>
<li class="notify_alert">
</li> -->
<!-- <li class="notify_alert">
<span><a href=# onclick="dialerLoadData('Priority','','',1,'','');return false;">Priority</a></span>
<span class="label label-small label-info pull-right" >
{!!$Priority!!}
</span>
</li>
</li> -->
<li class="notify_alert">
<span><a href=# onclick="dialerLoadData('FollowUp,','','',1,'','');return false;">FollowUp</a></span>
<span class="label label-small label-default pull-right" >
{!!$FollowUp!!}
</span>
</li>
<li class="notify_alert">
<span><a href=# onclick="dialerLoadData('TotalData','{!!$currentStatus!!}','{!!$legalStatus!!}',1,'','');return false;">TotalData</a></span>
<!-- <span><a href=# onclick="dialerLoadData('TotalData','{!!$currentStatus!!}','{!!$legalStatus!!}',1,'','');return false;">TotalData</a></span> -->
<span>TotalData</span>
<span class="label label-small label-default pull-right" >
{!!$TotalData!!}
</span>
</li>
<li class="notify_alert">
<!-- <li class="notify_alert">
<span><a href=# onclick="dialerLoadData('NotCalled','{!!$currentStatus!!}','{!!$legalStatus!!}',1,'','');return false;">NotCalled</a></span>
<span class="label label-small label-default pull-right" >
{!!$NotCalled!!}
</span>
</li>
</li> -->
<li class="notify_alert">
<span><a href=# onclick="dialerLoadData('Called','','',1,'','');return false;">Called</a></span>
<!-- <span><a href=# onclick="dialerLoadData('Called','','',1,'','');return false;">Called</a></span> -->
<span>Called</span>
<span class="label label-small label-success pull-right" >
{!!$TotalCalled!!}
</span>
</li>
<li class="notify_alert">
<span><a href=# onclick="return false;">Contacted</a></span>
<!-- <span><a href=# onclick="return false;">Contacted</a></span> -->
<span>Contacted</span>
<span class="label label-small label-success pull-right" id=contactedcnt_span>
0
</span>
</li>
<li class="notify_alert">
<!-- <li class="notify_alert">
<span><a href=# onclick="dialerLoadData('Flagged-Called','{!!$currentStatus!!}','{!!$legalStatus!!}',1,'','');return false;">Flagged-Called</a></span>
<span class="label label-small label-success pull-right" >
{!!$Flagged!!}
</span>
</li>
<li class="notify_alert">
</li> -->
<!-- <li class="notify_alert">
<span><a href=# onclick="dialerLoadData('Flagged-Notcalled','{!!$currentStatus!!}','{!!$legalStatus!!}',1,'','');return false;">Flagged-NotCalled</a></span>
<span class="label label-small label-warning pull-right" >
{!!$NotCalledFlagged!!}
</span>
</li>
<li class="notify_alert">
</li> -->
<!-- <li class="notify_alert">
<span><a href=# onclick="dialerLoadData('today-birthday','{!!$currentStatus!!}','{!!$legalStatus!!}',1,'','');return false;">Today Birthday</a></span>
<span class="label label-small label-warning pull-right" >
{!!$todaybirthday!!}
</span>
</li>
</li> -->
<hr><br>
......@@ -343,7 +598,7 @@ use App\Models\CRMCall;
if($disp['dialer_status'])
{
?>
<li class="notify_alert bucketliitem {!!$class!!}">
<li class="notify_alert bucketliitem sdfsdf {!!$class!!}">
<span><a href=# onclick="dialerLoadData('{!!$disp['dialer_status']!!}','{!!$disp['currentstatus']!!}','{!!$disp['legalstatus']!!}',1,'','');return false;">{!!$disp['dialer_status']!!}</a></span>
<span class="label label-small label-success pull-right" >
{!!$disp['cnt']!!}
......@@ -370,7 +625,7 @@ use App\Models\CRMCall;
if($disp['old_dialer_status'])
{
?>
<li class="notify_alert bucketliitem {!!$class!!}">
<li class="notify_alert bucketliitem test {!!$class!!}">
<span><a href=# onclick="dialerLoadData('{!!$disp['old_dialer_status']!!}','{!!$disp['currentstatus']!!}','{!!$disp['legalstatus']!!}',1,'','');return false;">{!!$disp['old_dialer_status']!!}</a></span>
<span class="label label-small label-success pull-right" >
{!!$disp['cnt']!!}
......@@ -386,13 +641,19 @@ use App\Models\CRMCall;
echo "<script>$('#contactedcnt_span').html('$contacted');</script>";
?>
</ul>
</div>
</div>
<div class=col-md-9 id=bucketlistdiv>
</div>
<div style='clear:both'></div>
</div>
</div>
<!-- <div class=col-md-9 id=bucketlistdiv></div>
--><div style='clear:both'></div>
<?php }else if($role == 'Admin'){ ?>
@include("layout/module/dashboard/adminHomePage")
<?php }else if($role == 'Supervisor'){ ?>
@include("layout/module/dashboard/supervisorHomePage")
<?php } ?>
<script>
......@@ -412,6 +673,13 @@ $("#legalstatus_select").val('<?=$legalStatus?>');
$("#currentstatus_select").val('<?=$currentStatus?>');
<?php }?>
function loadFollowupData(val)
{
var menu = "dialer/loadFollowupData";
doAjax(menu+"?client="+$("#tcampaign_select").val()+"&selection="+val,'','content','ajax_'+menu,'singlethis','GET');
}
function campaignSelect()
{
var dashlet="Dialer";
......@@ -452,3 +720,48 @@ function dialerLoadData(listname,currentstatus,legalstatus,page,skey,stxt)
}
dialerLoadData('CurrentQueue','','',1,'','');
</script>
<style>
.hero-widget { text-align: center; padding-top: 20px; padding-bottom: 20px; text-shadow: 1px 1px 2px blue, 0 0 25px blue, 0 0 5px darkblue; }
.hero-widget .icon { display: block; font-size: 96px; line-height: 96px; margin-bottom: 10px; text-align: center; }
.hero-widget var { display: block; height: 64px; font-size: 64px; line-height: 64px; font-style: normal; }
.hero-widget label { font-size: 17px; }
.hero-widget .options { margin-top: 10px; }
.well { background-color : #040404 }
.acolor { color: #000000;}
.new1 .icon { display: block; font-size: 96px; line-height: 96px; margin-bottom: 10px; text-align: center; }
.bot { padding-bottom: 20px !important; }
.new1 var { display: block; height: 96px; font-size: 96px; line-height: 96px; font-style: normal; }
</style>
<style>
.new1 {
/*width: 200px;
height: auto;*/
padding: 15px;
background-color: #f6f7fb;
box-shadow: 10px 10px 5px grey;
font-size:30px;
border: 2px solid red;
border-radius: 50px 20px;
text-align: center;
/* text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;*/
text-shadow: 1px 1px 2px blue, 0 0 25px blue, 0 0 5px darkblue;
}
.selcls {
/* padding: 9px; */
border: solid 1px #517B97;
outline: 0;
background: -webkit-gradient(linear, left top, left 25, from(#FFFFFF), color-stop(4%, #CAD9E3), to(#FFFFFF));
background: -moz-linear-gradient(top, #FFFFFF, #CAD9E3 1px, #FFFFFF 25px);
box-shadow: rgba(0,0,0, 0.1) 0px 0px 8px;
-moz-box-shadow: rgba(0,0,0, 0.1) 0px 0px 8px;
-webkit-box-shadow: rgba(0,0,0, 0.1) 0px 0px 8px;
}
</style>
\ No newline at end of file
......
......@@ -142,7 +142,7 @@ $user=Auth::user();
}
</style>
<input type="hidden" id="userLoginRole" value="{{Auth::user()->usertype}}">
<div class="layout-app"><!-- row-app -->
<div class="row row-app">
......
<div class="container">
<div class="row">
<?php if(sizeof($roclientlst)>0){ ?>
<div class="col-md-1" style="padding: 0px;margin: 6px;">
<h4>Campaign</h4>
</div>
<div class=col-md-5>
<select class='form-control selcls' id=tcampaign_select onchange='campaignSelect();'>
<?php $s=""; $i = 0;
foreach($roclientlst as $c){
$c=trim($c);
if(!empty($c)){
//if($c==$client)$s='selected';
if($i == 0)$s='selected';
echo "<option value='$c' $s>$c</option>";
}
} ?>
</select>
</div>
<div class=col-md-5>
<select class=form-control id=data_select onchange='dataSelect();' style='display:none'>
<?php foreach($dataSelect as $d){$s="";if($d==$prevData)$s='selected';echo "<option value='$d' $s>$d</option>";} ?>
</select>
</div>
<div style='clear:both'></div>
<br>
<?php } ?>
</div>
<div class="row"><div class="col-sm-4"><h4>Total</h4></div></div>
<div class="row">
<div class="col-sm-4 bot">
<div class="new1" style="color:white;">
<div class="text">
<var><?php echo $supervisorTotalCalled; ?></var>
</div>
Called
</div>
</div>
<div class="col-sm-4 bot">
<div class="new1" style="color:white;">
<div class="text">
<var><?php echo $supervisorContacted; ?></var>
</div>
Contacted
</div>
</div>
<div class="col-sm-4 bot">
<a href="javascript:;" onclick="loadFollowupData('all');" style="color:white;">
<div class="new1" style="color:white;">
<div class="text">
<var><?php echo $supervisorCallLog; ?></var>
</div>
Follow Up
</div>
</a>
</div>
</div>
<div class="row"><div class="col-sm-4"><h4>Campaign Wise</h4></div></div>
<div class="row">
<div class="col-sm-4 bot">
<div class="new1" style="color:white;">
<div class="text">
<var><?php echo $supervisorCampaignTotalCalled; ?></var>
</div>
Called
</div>
</div>
<div class="col-sm-4 bot">
<div class="new1" style="color:white;">
<div class="text">
<var><?php echo $supervisorCampaignContacted; ?></var>
</div>
Contacted
</div>
</div>
<div class="col-sm-4 bot">
<a href="javascript:;" onclick="loadFollowupData('campaign');" style="color:white;">
<div class="new1" style="color:white;">
<div class="text">
<var><?php echo $supervisorCampaignCallLog; ?></var>
</div>
Follow Up
</div>
</a>
</div>
</div>
</div>
......@@ -99,8 +99,8 @@ $prev_close = 0;
foreach($alist as $aline)
{
// if($prev_user != $aline->user_id || $prev_close <= $aline->ts_Wait)
// {
if($prev_user != $aline->user_id || $prev_close <= $aline->ts_Wait)
{
$userid=$aline->user_id;
$talktime=$aline->talkSec+$aline->recstartSec+$aline->recendSec;
......@@ -135,7 +135,7 @@ foreach($alist as $aline)
$reportarray[$userid]["I-Dispo"]+=$aline->dispoSec/1000;
$reportarray[$userid]["IncomingTotal"]+=($aline->callSec/1000)+($talktime/1000)+($aline->dispoSec/1000);
}
// }
}
$reportarray[$userid]["CallCount"]++;
$prev_close = $aline->ts_Close;//-ts_Wait
$prev_user = $aline->user_id;//-ts_Wait
......@@ -351,7 +351,9 @@ function secToDuration($sec) {
<div class=innerAll>
<h4 style="float:left;width:50%;margin:10px 0;">Login Report <small>(Agent Time Report)</small></h4>
<div style="float:right;width:50%">
<button class="pull-right btn btn-sm btn-default" onclick='dlAgentlogXls();return false;' title='Download'><i class='fa fa-download'></i> Download</button>
<?php 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>
<?php } ?>
</div>
<div style="clear:both"></div>
<hr style="margin-bottom: 5px;">
......
......@@ -354,7 +354,7 @@ function secToDuration($sec) {
<div class=innerAll>
<h4 style="float:left;width:50%;margin:10px 0;">Login Report <small>(Agent Time Average Report)</small></h4>
<div style="float:right;width:50%">
<button class="pull-right btn btn-sm btn-default" onclick='dlAgentlogXls();return false;' title='Download'><i class='fa fa-download'></i> Download</button>
<!-- <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;">
......
......@@ -18,7 +18,7 @@ $value =(isset($_GET['value'])) ? $_GET['value'] : "";
$logdate =(isset($_GET['logdate'])) ? strtotime($_GET['logdate']." ".$logtime.":00:00") : strtotime(date("Y-m-d")." 07:00:00");
//echo $logdate;
$logdateto =(isset($_GET['logdateto']))? strtotime($_GET['logdateto']." ".$logtimeto.":00:00") : strtotime(date("Y-m-d")." 22:00:00");
$logdateto =(isset($_GET['logdate']))? strtotime($_GET['logdate']." ".$logtimeto.":00:00") : strtotime(date("Y-m-d")." 22:00:00");
//echo $logdateto;
......@@ -132,7 +132,7 @@ if($dashboarduser->usertype != 'Admin')
$roclientstr[]="$tclnt";
$mastersdata=$wakka->getCompanyMaster($tclnt);
if(!empty($mastersdata["DialerDID"]))$didlinesstr[]=substr($mastersdata["DialerDID"],0,-2);
if(!empty($mastersdata["DialerDID"]))$didlinesstr[]=$mastersdata["DialerDID"];
}
$alist=$alist->where(function ($query) use($roclientstr,$uidlist,$didlinesstr){
......@@ -197,9 +197,8 @@ if(Input::has("dllogxls"))
$fieldsarr[$tcol++]='#';
$fieldsarr[$tcol++]='Start';
$fieldsarr[$tcol++]='Length';
$fieldsarr[$tcol++]='RM code';
$fieldsarr[$tcol++]='RM Name';
$fieldsarr[$tcol++]='Team Manager';
$fieldsarr[$tcol++]='User';
$fieldsarr[$tcol++]='Name';
$fieldsarr[$tcol++]='Dispo';
$fieldsarr[$tcol++]='SubDispo';
$fieldsarr[$tcol++]='CB';
......@@ -267,14 +266,6 @@ if(Input::has("dllogxls"))
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;
$supervisorId="";if(isset($userarr[$aline->user_id]))$supervisorId=$userarr[$aline->user_id]->supervisor;
$supervisorName="";
if(isset($supervisorId)){
$superName=User::where('username','=',$supervisorId)->get();
foreach ($superName as $supervisorname) {
$supervisorName=$supervisorname->fullname;
}
}
$recstr='';
if($dashboarduser->moduleACL("Dialer",false,false,true))
......@@ -289,7 +280,6 @@ if(Input::has("dllogxls"))
$objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($length);
$objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($username);
$objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($dispname);
$objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($supervisorName);
$objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($aline->userstatus);
$objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($aline->usersubstatus);
$objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit(($aline->usercallback!="0000-00-00 00:00:00"?date("Y-m-d H:i:s",strtotime($aline->usercallback)-($timeoffset)):""));
......@@ -328,7 +318,7 @@ if(Input::has("dllogxls"))
$extrahdrarr[$key]="";
$extravals[$key]="";
$colstr=PHPExcel_Cell::stringFromColumnIndex(sizeof($fieldsarr)+sizeof($extrahdrarr)-1);
$colstr=PHPExcel_Cell::stringFromColumnIndex(sizeof($fieldsarr)+sizeof($extrahdrarr));
$objPHPExcel->getActiveSheet()->setCellValue($colstr."1", $key);
}
$extravals[$key]=$val;
......@@ -372,22 +362,9 @@ foreach($alist as $aline)
$length=gmdate("H:i:s",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);
//print_r($userarr[$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;
$supervisorId="";if(isset($userarr[$aline->user_id]))$supervisorId=$userarr[$aline->user_id]->supervisor;
$supervisorName="";
if(isset($supervisorId)){
$superName=User::where('username','=',$supervisorId)->get();
foreach ($superName as $supervisorname) {
$supervisorName=$supervisorname->fullname;
}
}
$recstr='';
if($dashboarduser->moduleACL("Dialer",false,false,true))
{
......@@ -399,7 +376,6 @@ foreach($alist as $aline)
<td>".$length."</td>
<td>".$username."</td>
<td>".$dispname."</td>
<td>".$supervisorName."</td>
<td title='".str_replace("'"," ",$aline->userremarks)."'>".$aline->userstatus."</td>
<td>".$aline->usersubstatus."</td>
<td>".($aline->usercallback!="0000-00-00 00:00:00"?date("Y-m-d H:i:s",strtotime($aline->usercallback)+($dashboarduser->timezone*60)):"")."</td>";
......@@ -408,7 +384,8 @@ foreach($alist as $aline)
if(in_array('Manual',$userdialmode))
{
$outstr.="<td><a href=# class='' onclick='dialerQuickOpen(\"$aline->crm_id\",\"$aline->number\",\"Manual\",\"\",0);return false;'>".$aline->number."</a></td>";
/*$outstr.="<td><a href=# class='' onclick='dialerQuickOpen(\"$aline->crm_id\",\"$aline->number\",\"Manual\",\"\",0);return false;'>".$aline->number."</a></td>";*/
$outstr.="<td>$aline->number</td>";
}
else
{
......@@ -510,15 +487,14 @@ if(!empty($_GET['sort']))$i++;else $i--;
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>
<select id="crmCol" style="border:1px solid #efefef;">
<option>All</option>
<option value="userstatus">Disposition</option>
<option value="usersubstatus">Sub-Disposition</option>
<option>All</option>
<option value="userstatus">Disposition</option>
<option value="usersubstatus">Sub-Disposition</option>
<option value="number">Number</option>
<option value="client">Campaign</option>
<option value="did">DID</option>
......@@ -533,8 +509,8 @@ if(!empty($_GET['sort']))$i++;else $i--;
document.getElementById('filter').value = "<?php echo $value;?>";
</script>
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;">
Date : <input size=10 id='modfrom' name='modfrom' type='text' value='<?php echo date("Y-m-d",$logdate); ?>' />
Time From:<select id="modtime" style="border:1px solid #efefef;">
<?php
foreach (range(0,23) as $hour) {
$selected = ($hour == $logtime) ? "selected" : "";
......@@ -542,8 +518,7 @@ if(!empty($_GET['sort']))$i++;else $i--;
}
?>
</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;">
To: <select id="modtimeto" style="border:1px solid #efefef;">
<?php
foreach (range(0,23) as $hour) {
$selected = ($hour == $logtimeto) ? "selected" : "";
......@@ -556,9 +531,9 @@ if(!empty($_GET['sort']))$i++;else $i--;
</div>
<div style="float:right;width:30%">
<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>
<?php if(Auth::user()->username=='admin'){ ?>
<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>
<?php } ?>
</div>
<div style="clear:both"></div>
<hr>
......@@ -734,7 +709,7 @@ series: [{
<script>
function dataString()
{
return 'logdate='+$("#modfrom").val()+'&logtime='+$("#modtime").val()+'&logdateto='+$("#modto").val()+'&logtimeto='+$("#modtimeto").val()+'&key='+$("#crmCol").val()+'&value='+$("#filter").val();
return 'logdate='+$("#modfrom").val()+'&logtime='+$("#modtime").val()+'&logtimeto='+$("#modtimeto").val()+'&key='+$("#crmCol").val()+'&value='+$("#filter").val();
}
function callLogReloadFun(sortby)
......@@ -885,9 +860,8 @@ series: [{
<th>#</th>
<th>Start</th>
<th onclick='callLogReloadFun("");return false;'>Length</th>
<th>RM code</th>
<th>RM Name</th>
<th>Team Manager</th>
<th>User</th>
<th>Name</th>
<th>Dispo</th>
<th>SubDispo</th>
<th>CB</th>
......
<?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>
......@@ -23,7 +23,9 @@
<ul class="list-group list-group-1 margin-none borders-none" style='padding-right: 26px;'>
<?php if(Auth::user()->moduleACL("Dialer",true,true,true)){ ?>
<?php if(Auth::user()->moduleACL("Dialer",true,true,true)){
if(Auth::user()->usertype=="Supervisor" || Auth::user()->usertype=="Admin"){
?>
<li class="list-group-item">
<a href="#" onclick="doAjax('dialer/liveusers','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Live</a>
</li>
......@@ -45,12 +47,12 @@
<li class="list-group-item">
<a href="#" onclick="doAjax('dialer/statusreport','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Status</a>
</li>
<li class="list-group-item">
<!-- <li class="list-group-item">
<a href="#" onclick="doAjax('dialer/questionnaire','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> CLP</a>
</li>
</li> -->
<?php if(Auth::user()->usertype=="Supervisor" || Auth::user()->usertype=="Admin"){ ?>
<li class="list-group-item">
<!-- <li class="list-group-item">
<a href="#" onclick="doAjax('dialer/callmanagement','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> CallManagement</a>
</li>
<li class="list-group-item">
......@@ -61,7 +63,7 @@
</li>
<li class="list-group-item">
<a href="#" onclick="doAjax('dialer/raicingcustomerreport','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i>Racing Customer</a>
</li>
</li> -->
<li class="list-group-item">
<a href="#" onclick="doAjax('dialer/relationshipreport','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i>Relationship</a>
</li>
......@@ -125,7 +127,7 @@
doAjax('dialer/liveusers','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');
<?php }else { ?>
doAjax('dialer/calllog','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');
<?php } ?>
<?php }} ?>
</script>
</div>
......
......@@ -42,7 +42,7 @@ foreach($allusers as $user){
<div class='container'>
<select id='dialmodeassign' class=select2multi multiple="" style="width: 30%;">
<option value="Progressive">Progressive</option>
<option value="Progressive">Ready</option>
<option value="Manual">Manual</option>
<option value="Incoming">Incoming</option>
</select>
......
......@@ -340,7 +340,6 @@ else if(isset($_POST['useruploadform'])&&$wakka->GetUser())
$createdlog[$updatetime]=$username."::";
$createdlog["updated"]=$updatetime;
$excelarray[$i]["DOB"]= date('Y-m-d', PHPExcel_Shared_Date::ExcelToPHP($excelarray[$i]["DOB"]));
$newdata=$ppldata;
foreach($excelarray[$i] as $key => $value)
......
......@@ -107,7 +107,7 @@ if($varid!=""||$isuser)
//no edit access and read other data..
//check if we have owner access = read access
$oclientlst=$wakka->clientsReadAccess();
foreach($oclientlst as $tclnt)if($tclnt==$recruitdata["peopledata"]['client']&&$tclnt!=""){$noreaduser=0;break;}
foreach($oclientlst as $tclnt)if(strtolower($tclnt)==strtolower($recruitdata["peopledata"]['client'])&&$tclnt!=""){$noreaduser=0;break;}
}
}
}
......

5.66 KB | W: | H:

33 KB | W: | H:

custom/public/favicon.png
custom/public/favicon.png
custom/public/favicon.png
custom/public/favicon.png
  • 2-up
  • Swipe
  • Onion skin

5.66 KB | W: | H:

33 KB | W: | H:

custom/public/logo_s.png
custom/public/logo_s.png
custom/public/logo_s.png
custom/public/logo_s.png
  • 2-up
  • Swipe
  • Onion skin
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!