d3588fc8 by Manish Mihsra

Completed Implementing Predictive Dialing with SQL table attached and changed PA…

…USE mode value from Manual to Paused
1 parent baaad793
......@@ -303,7 +303,6 @@ class CreateCall extends Command {
$crmcall->user_id=0;
$crmcall->sipid_id=0;
$crmcall->crm_id=$users[0]['id'];
$crmcall->lan=$users[0]['lan'];
$crmcall->client=$users[0]['client'];
$crmcall->department=$users[0]['department'];
$crmcall->state='New';
......
......@@ -62,7 +62,8 @@ protected $commands = [
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('KstychDaily')->daily()->withoutOverlapping();
$schedule->command('KstychDaily')->daily()->withoutOverlapping();
$schedule->command('UpdateAvgRingSec')->daily()->withoutOverlapping();
//$schedule->command('bulkServerUpload')->everyFiveMinutes()->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping();
//$schedule->command('bulkserverupload_data')->everyMinute()->appendOutputTo(storage_path()."/reason/bulkserverupload_data.txt")->withoutOverlapping();
$schedule->command('bulkserverupload_data')->dailyAt('14:17')->appendOutputTo(storage_path()."/reason/bulkserverupload_data.txt")->withoutOverlapping();
......
......@@ -77,6 +77,7 @@ class DialModeController extends Controller {
$data['client'] = $client;
$data['username'] = $username;
$data['callingmodeArr'] = array("Progressive", "Manual", "Incoming", "Predictive");
return view('layout.module.dialmode.index',$data);
......
......@@ -12,6 +12,7 @@ use App\Models\CRMCallArchive;
use App\Models\CRM;
use App\Models\CRMCampaign;
use App\Models\CRMList;
use App\Models\Cutoff;
use App\Jobs\KHRMSLib;
use App\Models\Sipid;
use App\Models\Dialline;
......@@ -483,6 +484,35 @@ if($action=="addconfcall")
if($action=="hangupall")
{
$res=0;
$aUser = Auth::user();
If($aUser->current_dialmode == "Predictive"){
$avgTimeArr = array();
$user_id = $aUser->id;
$campaign = $aUser->sel_campaign;
$avgTimeArr = $this->getAvgTimeArray($campaign, $user_id);
$cutOffUsrArr = Cutoff::where('user_id', '=', $user_id)->where('c_name', '=', $campaign)->get();
if(count($cutOffUsrArr)){
Cutoff::where('user_id', '=', $user_id)->where('c_name', '=', $campaign)->update(
['hangup_time' => date('Y-m-d H:i:s'),
'avg_dispo' => $avgTimeArr['avgdisposec']
]);
}
else
{
$cutoff = new Cutoff();
$cutoff->user_id = $user_id;
$cutoff->c_name = $campaign;
$cutoff->hangup_time = date('Y-m-d H:i:s');
$cutoff->avg_dispo = $avgTimeArr['avgdisposec'];
$cutoff->avg_ring = 0;
$cutoff->save();
}
}
$callid=intval($kstychCall['callid'])+0;
$crmcall=CRMCall::find($callid);
if($crmcall&&$crmcall->user_id==Auth::user()->id)
......@@ -836,13 +866,24 @@ if($action=="kCallAction")
if($action=="dialerstate")
{
$ready=0;if($kstychDialer['mDialerState']=="Ready"&&$kstychCall['mCallState']=="Wait")$ready=1;
$ready=0;$perpareCall=0;
if($kstychDialer['mDialerState']=="Ready"&&$kstychCall['mCallState']=="Wait")
{
$ready=1;
}
if($kstychDialer['mDialerSubState']=="Predictive"&&$kstychCall['mCallState']=="Wait")
{
$perpareCall=1;
}
$nowts=microtime(true)*1000;
$sipid=Sipid::find($kstychDialer['phone']);
if($sipid&&$sipid->user==Auth::user()->id&&$sipid->status==1)
{
$sipid->ready=$ready;
$sipid->prepare_call=$perpareCall;
$sipid->save();
$userlog=UserLog::where('user_id','=',Auth::user()->id)->orderBy("id","DESC")->first();
......@@ -852,6 +893,61 @@ if($action=="dialerstate")
return Response::make("");
}
if($action=="usersel")
{
$user = Auth::user();
$currDialerState = $kstychDialer['mDialerState'];
if($kstychDialer['mDialerSubState'] != "")
$currDialerState = $kstychDialer['mDialerSubState'];
DB::table('users')->where('id', Auth::user()->id)->update([
'sel_campaign'=>$client,
'current_dialmode'=>$currDialerState
]);
$campaigndata = Sipid::select("clients")->where("user", $user->id)->where("status", "=", 1)->first();
if($campaigndata)
{
$campdata= json_decode($campaigndata->clients);
$campdata->sel_campaign=$client;
Sipid::where("user",$user->id)->update(["clients"=>json_encode($campdata)]);
}
return Response::make("");
}
if($action=="sipcleanup")
{
$user = Auth::user();
$sipid = Sipid::where("user", $user->id)->select('id')->first();
Sipid::where("user", $user->id)->update([
"user" => 0,
"status" => 0,
"ready" => 0,
"patched" => 0,
"prepare_call" => 0,
"confup" => 0,
"clients" => ""
]);
$diallines = Dialline::where('status', '!=', 'Free')->where('conf', '=', "1000".$sipid->id)->get();
foreach ($diallines as $dialline) {
$newqueue=new Kqueue();
$newqueue->hangupChannelS($dialline->channel,$dialline->server);
}
if(count($sipid)){
exec('/usr/sbin/asterisk -rx "channel request hangup '.$sipid->id.'"');
exec('/usr/sbin/asterisk -rx "confbridge kick 1000'.$sipid->id.' all"');
}
}
if($action=="spychannel")
{
$sipid=Sipid::find($kstychDialer['phone']);
......@@ -1661,4 +1757,16 @@ public function show($id)
$tusers=array();foreach($users as $tuser)$tusers[]=$tuser;
return $tusers;
}
public function getAvgTimeArray($campaign, $user)
{
$avgdisposecObj = CRMCall::select(DB::Raw('(avg(disposec))/1000 as avgdisposec'))->where("client", "=", $campaign)->where("user_id", "=", $user)->orderby("id","desc")->limit(50)->where("type","!=","Inbound")->first();
$avgcallsecObj = CRMCall::select(DB::Raw('(avg(callsec))/1000 as avgcallsec'))->where("client", "=", $campaign)->where("user_id", "=", $user)->orderby("id","desc")->limit(50)->where("type","!=","Inbound")->first();
$returnArray['avgdisposec'] = round($avgdisposecObj->avgdisposec);
$returnArray['avgcallsec'] = round($avgdisposecObj->avgcallsec);
return $returnArray;
}
}
......
......@@ -261,7 +261,7 @@ class KPAMIListen implements IEventListener
//echo "$accountcode:NewextenEvent : $context:$eventname $channelstate:$channelstatedesc $uniqueid $phonenumber $exten:$priority $channel\n";
if($context=="kstychDialerINB"&&$exten!="s"&&$priority=="1")
{
if(strtolower(substr($channel,0,4))=="sip/")
if(strtolower(substr($channel,0,4))=="sip1/")
{
$dahdispan='';
$dahdichannel='';
......@@ -310,10 +310,20 @@ class KPAMIListen implements IEventListener
if($userStatus=="[]")
{
$newqueue=new Kqueue();
$newqueue->playbusyfile($dialline->channel,$dialline->server);
if( $this->isHoliday() ) {
//play holiday file
// $newqueue->playholidayfile($dialline->channel,$dialline->server);
} elseif( $this->isNonWorkingTime() ) {
// play non working hours file
$newqueue->playnonworkingfile($dialline->channel,$dialline->server);
} else {
// play absense file
$newqueue->playabsencefile($dialline->channel,$dialline->server);
}
return;
}
$callStat=CRMCall::where("did","like","%".substr($exten,-4)."%")->where("updated_at",">",date("Y-m-d"))->whereIn('state',['DialBegin', 'DialEnd'])->get();
......@@ -328,6 +338,24 @@ class KPAMIListen implements IEventListener
}
}
}
function isHoliday() {
return false;
}
function isNonWorkingTime() {
return ( $this->isSunday() || $this->isNonWorkingHours() );
}
function isSunday() {
return (date('N') == 7);
}
function isNonWorkingHours() {
return (time() < strtotime('03:30:00') || time() > strtotime('14:30:00'));
}
private function VarSetEvent(EventMessage $event)
{
$eventname=$event->getKey("Event");
......@@ -480,6 +508,88 @@ class KPAMIListen implements IEventListener
$crmcall->save();
}
}
else if($accountcodearr[1]=="a") // Code Added by AmolG: AutoDial
{
$crmcall=CRMCall::find($accountcodearr[2]);
if($crmcall)
{
$nowts=microtime(true)*1000;
$crmcall->setTs('ts_Recend',$nowts);
$crmcall->state=$eventname;
$crmcall->statuscode=$cause;
$crmcall->substatus=$causetxt;
if($crmcall->type=="Auto"&&$crmcall->user_id==0)
{
$crmcall->userstatus="AutoDROP";
$crmcall->usersubstatus="AutoDROP";
$crmcall->setTs('ts_Talk',$nowts);
$crmcall->setTs('ts_Recstart',$nowts);
if($crmcall->crm_id>0)
{
$wakka = new KHRMSLib();
$record=$wakka->getPerson($crmcall->crm_id);
if($record)
{
$record["peopledata"]["status"]="Called";
$record["peopledata"]["dialer_status"]="AutoDROP";
$record["peopledata"]["dialer_substatus"]="AutoDROP";
$wakka->setPerson($crmcall->crm_id,$record);
}
}
}
if($crmcall->type=="AutoCall")
{
$crmcall->userstatus="AutoCall";
$crmcall->usersubstatus="AutoCall";
$crmcall->setTs('ts_Talk',$nowts);
$crmcall->setTs('ts_Recstart',$nowts);
if($crmcall->crm_id>0)
{
$wakka = new KHRMSLib();
$record=$wakka->getPerson($crmcall->crm_id);
if($record)
{
$record["peopledata"]["status"]="Called";
$record["peopledata"]["dialer_status"]="AutoCall";
$record["peopledata"]["dialer_substatus"]="AutoCall";
$wakka->setPerson($crmcall->crm_id,$record);
}
}
}
$dialline=Dialline::find($crmcall->dialline_id);
if($dialline && ($dialline->channel==$channel || $dialline->status== "AutoCall"))
{
$dialline->status="Free";
$dialline->conf="";
$dialline->number="";
$dialline->uniqueid="";
$dialline->channel="";
$dialline->regexstr="";
$dialline->save();
$tsip=Sipid::find($crmcall->sipid_id);
if(!empty($tsip))
{
$tsip->patched=0;
$tsip->save();
}
$newqueue=new Kqueue();
$newqueue->sipNotify($tsip,"dialerUI","hangup","c",$crmcall->id."~".$crmcall->number."~".base64_encode($channel));
}
$crmcall->addEventLog($nowts,"$accountcode:HangupEvent : $eventname $channelstate:$channelstatedesc $uniqueid $exten:$priority $channel $cause:$causetxt");
$crmcall->save();
}
}
}
}
else
......@@ -765,6 +875,35 @@ class KPAMIListen implements IEventListener
$crmcall->save();
}
}
else if($accountcodearr[1]=="a") // Code Added by AmolG: AutoDial
{
$crmcall=CRMCall::find($accountcodearr[2]);
if($crmcall)
{
$nowts=microtime(true)*1000;
$crmcall->setTs('ts_Talk',$nowts);
$crmcall->state=$eventname;
$crmcall->status=$dialstatus;
$crmcall->uniqueid=$uniqueid;
$dialline=Dialline::find($crmcall->dialline_id);
if($dialline && $dialstatus=="ANSWER")
{
$dialline->channel=$dchannel;
$dialline->uniqueid=$uniqueid;
$dialline->status="Auto";
$dialline->save();
}
$crmcall->addEventLog($nowts,"$accountcode:Unknown : $eventname $dchannelstate:$dchannelstatedesc $duniqueid $dexten:$dpriority $dchannel $dialstatus");
$crmcall->type="Auto";
$crmcall->save();
}
}
}
}
}
......@@ -1031,8 +1170,7 @@ if($crmcall->did=='46130234'){
private function redirectIncoming()
{
$diallines=Dialline::where('server','=',$this->sipip)->where("status","=","Inbound")->where("conf","=","")->get();
$diallines=Dialline::where('server','=',$this->sipip)->whereIn("status",["Inbound","Auto"])->where("conf","=","")->get();
if($diallines)
{
foreach($diallines as $dialline)
......@@ -1090,15 +1228,15 @@ if($crmcall->did=='46130234'){
$sipids=array();
if($crmcall->client!="")
{
$sipids=Sipid::where('server','=',$this->sipip)->where("status","=","1")->where("clients","like","%".$crmcall->client."%")->where("clients","like","%".$crmcall->did."%")->get();
$sipids=Sipid::where('server','=',$this->sipip)->where("status","=","1")->where("clients","like","%".$crmcall->client."%")->where("clients","like","%".$crmcall->did."%")->orderBy("updated_at","desc")->get();
}
else if($crmcall->did!="")
{
$sipids=Sipid::where('server','=',$this->sipip)->where("status","=","1")->where("clients","like","%".$crmcall->did."%")->get();
$sipids=Sipid::where('server','=',$this->sipip)->where("status","=","1")->where("clients","like","%".$crmcall->did."%")->orderBy("updated_at","desc")->get();
}
else
{
$sipids=Sipid::where('server','=',$this->sipip)->where("status","=","1")->get();//send to all?
$sipids=Sipid::where('server','=',$this->sipip)->where("status","=","1")->orderBy("updated_at","desc")->get();//send to all?
}
if(!empty($sipids))
......@@ -1109,7 +1247,29 @@ if($crmcall->did=='46130234'){
$first_r=0;$first_w=0;$first_a=0;$allsipids=array();
foreach($sipids as $sipid)
{
if($sipid->ready==1)
if($sipid->ready==1&&$sipid->prepare_call==0&&$dialline->status=="Inbound")
{
$clientsarr=json_decode($sipid->clients,true);
if($crmcall->client=="")$first_a=$sipid;
else
{
if($clientsarr['a']!="")$clientaarr = explode(",", $clientsarr['a']);
if(isset($clientsarr['a'])&&in_array($crmcall->client, $clientaarr))$first_a=$sipid;
if($clientsarr['w']!="")$clientwarr = explode(",", $clientsarr['w']);
if(isset($clientsarr['w'])&&in_array($crmcall->client, $clientwarr))$first_w=$sipid;
if($clientsarr['r']!="")$clientrarr = explode(",", $clientsarr['r']);
if(isset($clientsarr['r'])&&in_array($crmcall->client, $clientrarr))$first_r=$sipid;
}
}
else
{
$allsipids[]=$sipid;
}
}
foreach($sipids as $sipid)
{
if($sipid->ready==1&&$sipid->prepare_call==1&&$dialline->status=="Auto")
{
$clientsarr=json_decode($sipid->clients,true);
if($crmcall->client=="")$first_a=$sipid;
......@@ -1175,6 +1335,8 @@ if($crmcall->did=='46130234'){
$dialline->save();
$found->ready=0;
$found->prepare_call=0;
$found->patched=1;
$found->save();
$recfile=$crmcall->newRecFilePath();
......@@ -1205,8 +1367,11 @@ if($crmcall->did=='46130234'){
{
foreach($allsipids as $tsip)
{
$newqueue=new Kqueue();
$newqueue->sipNotify($tsip,"popupalert"," Incoming Calls",$crmcall->number."|".$crmcall->client,$crmcall->did);
if($dialline->status!="Auto")
{
$newqueue=new Kqueue();
$newqueue->sipNotify($tsip,"popupalert"," Incoming Calls",$crmcall->number."|".$crmcall->client,"");
}
}
}
else
......
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Cutoff extends Model
{
protected $table = 'cut_off_time';
}
......@@ -45,6 +45,30 @@ class Kqueue extends Model{
$this->data=json_encode($odata);
$this->save();
}
public function autoCallOut($callnumber,$callerid,$crmcall,$dialline)
{
$dialstr = $dialline->dialstr;
$server = $dialline->server;
if($server != '')
{
$odata=array();$odata['VARS']=array();
$odata['fromext']="Local/$callnumber@kstychDialerINB";
$odata['context']="kstychDialer";
$odata['callerid']=$callerid;
$odata['toext']="1002".$callnumber;
$odata['account']='m|a|'.$crmcall->id;
$odata['VARS']['dialstr']=$dialstr;
//originate conf
$this->type="SIP_".$server;
$this->key="originate";
$this->status="New";
$this->data=json_encode($odata);
$this->save();
}
}
public function sipOriginate($sipid,$to,$context)
{
$odata=array();$odata['VARS']=array();
......@@ -197,6 +221,24 @@ class Kqueue extends Model{
$this->data=json_encode($odata);
$this->save();
}
public function playnonworkingfile($fromext,$server)
{
$odata=array();$odata['VARS']=array();
$odata['fromext']=$fromext;
$odata['context']="kstychPlayNonWorkingFile";
$odata['callerid']="";
$odata['toext']="2001";
$odata['account']="";
//originate conf
$this->type="SIP_".$server;
$this->key="Redirect";
$this->status="New";
$this->data=json_encode($odata);
$this->save();
}
public function playbusyfile($fromext,$server)
{
$odata=array();$odata['VARS']=array();
......
......@@ -352,6 +352,32 @@ function astPAMICheck
fi
done
}
function createCall
{
echo "create"
AsteriskServers=$(echo $asterisk_slaves | tr "," "\n")
for server in $AsteriskServers
do
IFS=':' read -r -a ServerArr <<< "$server"
if ! screen -list | grep -q "CreateCall_$app_domain${ServerArr[0]}"; then
/usr/bin/screen -d -m -S CreateCall_$app_domain${ServerArr[0]} bash -c "cd $app_path/application/;php $app_path/application/artisan CreateCall"
fi
done
}
function hangUpCall
{
echo "hang"
AsteriskServers=$(echo $asterisk_slaves | tr "," "\n")
for server in $AsteriskServers
do
IFS=':' read -r -a ServerArr <<< "$server"
if ! screen -list | grep -q "HangUpCall_$app_domain${ServerArr[0]}"; then
/usr/bin/screen -d -m -S HangUpCall_$app_domain${ServerArr[0]} bash -c "cd $app_path/application/;php $app_path/application/artisan PredictiveCallHangUp"
fi
done
}
function waitForLock
{
if [ ! -f /tmp/cronsh-$app_domain.lock ]; then
......@@ -412,6 +438,8 @@ if [ "$OSNAME" == "Fedora" ] && [ $OSVER -gt 21 ] ; then
sshdCheck
dailyTasks
astPAMICheck
createCall
hangUpCall
fi
clearLock
cd $app_path/application;php artisan schedule:run
......
......@@ -831,8 +831,10 @@ function resetDialer()
var dialerResetForceState=kstychDialer['mDialerState'];
var dialerResetForceSubState=kstychDialer['mDialerSubState'];
dialerResetForceState="Progressive";//Hardcoded TODO change to config
dialerResetForceSubState="";
if(dialerResetForceSubState != "Predictive"){
dialerResetForceState="Progressive";//Hardcoded TODO change to config
dialerResetForceSubState="";
}
if(kstychCall['userstatus']=="AUTOWRAPUP")
{
......
......@@ -678,7 +678,12 @@ $(document).click(function(e){
});
window.onbeforeunload = function(){
if(kstychAppObject['user']['id']==0)return ;
if(kstychAppObject['user']['id']==0) {
return ;
}
else {
doAjax("dialer?action=sipcleanup");
}
if(lastvarUrl.indexOf("author")<0)return ;
else return 'Are you sure you want to leave?';
};
......
......@@ -417,6 +417,7 @@ $("#currentstatus_select").val('<?=$currentStatus?>');
function campaignSelect()
{
var dashlet="Dialer";
client = $('#tcampaign_select').val();
doAjax("dashboard/dashlet?module="+dashlet+"&client="+$("#tcampaign_select").val(),"","DashletT-"+dashlet,"ajax_dashlet_"+dashlet,"singlefail","GET");
savedialermode();
......
......@@ -42,9 +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="Manual">Manual</option>
<option value="Incoming">Incoming</option>
<?php foreach($callingmodeArr as $callingmode){;echo "<option value='$callingmode'>$callingmode</option>";} ?>
</select>
<select id='username' class=select2multi multiple="" style="width: 30%;">
......
......@@ -35,6 +35,10 @@ $yemaxcarryleaves=base64_encode(Input::get("yemaxcarryleaves"));
$trackerfields=base64_encode(Input::get("trackerfields"));
if(Input::get("autodial_pacing")){
$autodial=base64_encode(Input::get("autodial_pacing"));
}
$developerparam=base64_encode(str_replace('\n',"\n",Input::get("developerparam")));
......@@ -70,6 +74,7 @@ $mvalue.="yrsickleaves~$yrsickleaves|";
$mvalue.="yrannualleaves~$yrannualleaves|";
$mvalue.="yemaxcarryleaves~$yemaxcarryleaves|";
$mvalue.="developerparam~$developerparam|";
$mvalue.="autodialercampaign~$autodial|";
$mvalue.="trackerfields~$trackerfields|";
......
......@@ -96,6 +96,8 @@ if($client!="")
echo "<p><label class='label-small_new' style='width:15%'>AnnualMaxCarryLeaves :</label><input type=text class='form_new form_new_amend' name=yemaxcarryleaves id=yemaxcarryleaves value='".($mastersdata["yemaxcarryleaves"])."'></p>";
echo "<p><label class='label-small_new' style='width:15%'>Parameters</label><textarea rows=8 id='developerparam' style='font-size:12px;width:85%'>".($mastersdata["developerparam"])."</textarea></p>";
echo "<p><label class='label-small_new' style='width:15%'>Autodial Ratio</label><input type=text class='form_new form_new_amend' name='autodial_pacing' id='autodial_pacing' style='font-size:12px;width:15%' value='".($mastersdata["autodialercampaign"])."'></p>";
......
......@@ -73,14 +73,14 @@ if(Input::has("reportsubmit"))
// $finputarr=Input::get("fieldsarr");
$finputarr=$_POST["fieldsarr"];
array_unshift($finputarr,'id');
$selectedfields=$_POST["selectedfields"];
array_unshift($selectedfields,'EmpID');
if(is_array($finputarr))foreach($finputarr as $eachfield)$fieldsarr[]=$eachfield;
if(is_array($finputarr)){foreach($finputarr as $eachfield)
$fieldsarr[]=$eachfield;
array_unshift($finputarr,'id');
array_unshift($selectedfields,'EmpID');
}
else {echo "Please Select List of fields In report.";return;}
$reporttype=Input::get("reporttype");
......@@ -134,6 +134,7 @@ if($savereportname!="")
$userreports[$savereportname]=base64_encode(json_encode(Input::all()));
$wakka->SetBBBUserData("UserSavedReports",$userreports);
}
$usersarr=$wakka->getPersonsdownloadreport($filterstr);
foreach($usersarr as $r => $userdata)
......@@ -141,26 +142,26 @@ foreach($usersarr as $r => $userdata)
$ppldata[]=unserialize($userdata['peopledata']);
}
// dd($ppldata);
if (is_array($ppldata)){
for ($i=0; $i <count($ppldata) ; $i++) {
for ($j=0; $j <count($finputarr) ; $j++) {
if ($ppldata[$i] != false){
if (array_key_exists ($finputarr[$j], $ppldata[$i])) {
if ($ppldata[$i] != false){
if (array_key_exists ($finputarr[$j], $ppldata[$i])) {
$usersdata[$i][$finputarr[$j]]=$ppldata[$i][$finputarr[$j]];
}else if (! array_key_exists ($finputarr[$j], $ppldata[$i]))
{
$usersdata[$i][$finputarr[$j]] = "";
}
}
}
}
}
}
}
$headerexcel = [];
foreach($finputarr as $cachekey)
......@@ -171,7 +172,6 @@ if ($ppldata[$i] != false){
$headerexcel[$cachekey] = 'string'; //$headerexcel2[] = $cachekey => 'string';
}
}
// dd($headerexcel2);
$filename = "MainReport.xlsx";
header('Content-disposition: attachment; filename="'.XLSXWriter::sanitize_filename($filename).'"');
header("Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
......@@ -182,12 +182,15 @@ if ($ppldata[$i] != false){
$writer = new XLSXWriter();
$styles1 = array( 'font'=>'Arial','font-size'=>10,'font-style'=>'bold', 'fill'=>'#eee', 'halign'=>'center', 'border'=>'left,right,top,bottom');
$writer->writeSheetHeader('Sheet1', $headerexcel,$styles1,['freeze_rows'=>1, 'freeze_columns'=>1]);
$writer->writeSheetRow('Sheet1', $selectedfields,$styles1 );
$writer->writeSheetRow('Sheet1', $selectedfields,$styles1 );
if($usersdata){
foreach($usersdata as $row)
{
$writer->writeSheetRow('Sheet1', $row, $row_options = ['height'=>15]);
}
foreach($usersdata as $row)
{
$writer->writeSheetRow('Sheet1', $row, $row_options = ['height'=>15]);
}
}
$writer->writeToStdOut();
return;
......
......@@ -453,6 +453,7 @@ function saveCompanies()
vardata+="&developerparam="+encodeURIComponent($("#developerparam").val());
vardata+="&autodial_pacing="+encodeURIComponent($("#autodial_pacing").val());
doAjax("hr?action=CompanyMaster", vardata, "searchresults");
}
......
......@@ -215,12 +215,12 @@ function createSearchRecordDiv(divid)
<li style='background:#36bc9b'><a href="#" onclick='updateDialerState("dialer","mDialerState","Ready","mDialerSubState","Incoming");savedialermode();return false;'><b>Incoming</b></a></li>
<?php } if(in_array('Predictive',$userdialmode)){?>
<li style='background:#36bc9b'><a href="#" onclick='updateDialerState("dialer","mDialerState","Ready","mDialerSubState","Predictive");savedialermode();return false;'><b>Incoming</b></a></li>
<li style='background:#68cc9e'><a href="#" onclick='updateDialerState("dialer","mDialerState","Ready","mDialerSubState","Predictive");savedialermode();return false;'><b>Predictive</b></a></li>
<?php } ?>
<!--<li><a href="#" onclick='updateDialerState("dialer","mDialerState","DialNext");return false;'><b>DialNext</b></a></li>-->
<li><a href="#" onclick='updateDialerState("dialer","mDialerState","Paused","mDialerSubState","Manual");savedialermode();return false;'><b>Paused</b></a></li>
<li><a href="#" onclick='updateDialerState("dialer","mDialerState","Paused","mDialerSubState","Paused");savedialermode();return false;'><b>Paused</b></a></li>
<li style='background:#ccc'><a href="#" onclick='updateDialerState("dialer","mDialerState","Paused","mDialerSubState","AgentBriefing");savedialermode();return false;'><b>AgentBriefing</b></a></li>
......
CREATE TABLE `cut_off_time` (
`id` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`user_id` int(11) NOT NULL,
`hangup_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`avg_dispo` int(11) NOT NULL,
`avg_ring` int(11) NOT NULL,
`c_id` int(11) NOT NULL,
`c_name` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE `cut_off_time`
ADD PRIMARY KEY (`id`);
ALTER TABLE `cut_off_time`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
ALTER TABLE `diallines` ADD `user_id` INT NOT NULL AFTER `server`;
ALTER TABLE `sipids` ADD `patched` TINYINT(1) NOT NULL AFTER `ready`, ADD `prepare_call` TINYINT(1) NOT NULL AFTER `patched`;
ALTER TABLE `users` ADD `sel_campaign` VARCHAR(50) NOT NULL AFTER `dialmode_assign`, ADD `current_dialmode` VARCHAR(20) NOT NULL AFTER `sel_campaign`, CHANGE `dialmode_assign` `dialmode_assign` VARCHAR(200) NOT NULL;
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!