13d4c618 by Manish Mihsra

Updated Latest changes

1 parent ca191993
Showing 144 changed files with 1529 additions and 1664 deletions
......@@ -2,3 +2,4 @@ application/storage/reason
custom/.env
application/storage/framework
custom/db/
application/vendor
......
Version No. 1.19v
Changes:made changes by Jadhav in getPersonshome function,KHRMSLib.php
Date: 12/09/2018
Version No. 1.18v
Changes: Missed calls to changed will reflect after 11th sept.,Changes DialerController.php and dialer.blade.php
Date: 10/09/2018
Version No. 1.17v
Changes: DAP implementation, Changes KFormLib has been Changed,
Date: 10/09/2018
Version No. 1.16v
Changes: missed call bucket in order Changes KHRMSLib.php added one function for asc
Date: 10/09/2018
Version No. 1.15v
Changes: progressive new logic like COP, Changes dialerController.php
Date: 08/09/2018
Version No. 1.14v
Changes: agent time report updated, commented if condition.
Date: 03/09/2018
Version No. 1.13v
Changes: hangup beep, footer.blade.php, dialer.js changed and hangup beep added to assets/sounds/
Date: 11/08/2018 Only on Mumbai servers
Version No. 1.12v
Changes: followup for new disposition, DialerController.php and dialer.js is changed.
Date: 11/08/2018
Version No. 1.11v
Changes: Master report download, Changes main.blade.php, Added two libraries lib, php, KHRMS.php, XLSX library.
Date: 08/08/2018
Version No. 1.10v
Changes: Username for inbounddrop and Userbusy for SIP/GATEWAY , Changes KPAMIListen.php
Date: 02/08/2018
Version No. 1.9v
Changes: Call log report supervisor, and Date range in call report.
Date: 30/07/2018
Version No. 1.8v
Changes: HDFC Mogo, Changes 1.extension.conf, 2.DialerController.php, 3.mogo tune in moh location.
Date 20/07/2018
Version No. 1.7V
Changes: Live report reload button issue, commented one line of code in Livereport.blade.php
Date: 19/07/2018
Versio No. 1.6V
Changes: call forward, KPAMIListen, .env and extension.conf file updated
Date: 14/07/2018
Version No. 1.5V
Changes: Birthday calls for progressive mode, DialerController.php is updated
Date: 13/07/2018
Version No. 1.4V
Changes: To Blank diallines, DailyLogout.php is updated.
Date: 6/07/2018
Version No. 1.3v
Changes: Bulkupload
Date: 5/07/2018
Version NO. 1.2v
Changes: To remove multiple circles in dialer, dialer.js is updated.
Date: 4/07/2018
Version No. 1.1v
Changes: To remove Inbound Portfolio issue, KPAMIListen updated.
Date: 18/06/2018
Version No. 1.14v
Changes: agent time report updated, commented if condition.
Date: 03/09/2018
Version No. 1.13v
Changes: hangup beep, footer.blade.php, dialer.js changed and hangup beep added to assets/sounds/
Date: 11/08/2018 Only on Mumbai servers
Version No. 1.12v
Changes: followup for new disposition, DialerController.php and dialer.js is changed.
Date: 11/08/2018
Version No. 1.11v
Changes: Master report download, Changes main.blade.php, Added two libraries lib, php, KHRMS.php, XLSX library.
Date: 08/08/2018
Version No. 1.10v
Changes: Username for inbounddrop and Userbusy for SIP/GATEWAY , Changes KPAMIListen.php
Date: 02/08/2018
Version No. 1.9v
Changes: Call log report supervisor, and Date range in call report.
Date: 30/07/2018
Version No. 1.8v
Changes: HDFC Mogo, Changes 1.extension.conf, 2.DialerController.php, 3.mogo tune in moh location.
Date 20/07/2018
Version No. 1.7V
Changes: Live report reload button issue, commented one line of code in Livereport.blade.php
Date: 19/07/2018
Versio No. 1.6V
Changes: call forward, KPAMIListen, .env and extension.conf file updated
Date: 14/07/2018
Version No. 1.5V
Changes: Birthday calls for progressive mode, DialerController.php is updated
Date: 13/07/2018
Version No. 1.4V
Changes: To Blank diallines, DailyLogout.php is updated.
Date: 6/07/2018
Version No. 1.3v
Changes: Bulkupload
Date: 5/07/2018
Version NO. 1.2v
Changes: To remove multiple circles in dialer, dialer.js is updated.
Date: 4/07/2018
Version No. 1.1v
Changes: To remove Inbound Portfolio issue, KPAMIListen updated.
Date: 18/06/2018
Version No. 1.20v
Changes:Dialer Controller for Diallines blocked, KPAMIListen for Log comment, show.blade.php casesensitivity campaign error: No Access
Date: 02/11/2018
Version No. 1.19v
Changes:made changes by Jadhav in getPersonshome function,KHRMSLib.php
Date: 12/09/2018
Version No. 1.18v
Changes: Missed calls to changed will reflect after 11th sept.,Changes DialerController.php and dialer.blade.php
Date: 10/09/2018
Version No. 1.17v
Changes: DAP implementation, Changes KFormLib has been Changed,
Date: 10/09/2018
Version No. 1.16v
Changes: missed call bucket in order Changes KHRMSLib.php added one function for asc
Date: 10/09/2018
Version No. 1.15v
Changes: progressive new logic like COP, Changes dialerController.php
Date: 08/09/2018
Version No. 1.14v
Changes: agent time report updated, commented if condition.
Date: 03/09/2018
Version No. 1.13v
Changes: hangup beep, footer.blade.php, dialer.js changed and hangup beep added to assets/sounds/
Date: 11/08/2018 Only on Mumbai servers
Version No. 1.12v
Changes: followup for new disposition, DialerController.php and dialer.js is changed.
Date: 11/08/2018
Version No. 1.11v
Changes: Master report download, Changes main.blade.php, Added two libraries lib, php, KHRMS.php, XLSX library.
Date: 08/08/2018
Version No. 1.10v
Changes: Username for inbounddrop and Userbusy for SIP/GATEWAY , Changes KPAMIListen.php
Date: 02/08/2018
Version No. 1.9v
Changes: Call log report supervisor, and Date range in call report.
Date: 30/07/2018
Version No. 1.8v
Changes: HDFC Mogo, Changes 1.extension.conf, 2.DialerController.php, 3.mogo tune in moh location.
Date 20/07/2018
Version No. 1.7V
Changes: Live report reload button issue, commented one line of code in Livereport.blade.php
Date: 19/07/2018
Versio No. 1.6V
Changes: call forward, KPAMIListen, .env and extension.conf file updated
Date: 14/07/2018
Version No. 1.5V
Changes: Birthday calls for progressive mode, DialerController.php is updated
Date: 13/07/2018
Version No. 1.4V
Changes: To Blank diallines, DailyLogout.php is updated.
Date: 6/07/2018
Version No. 1.3v
Changes: Bulkupload
Date: 5/07/2018
Version NO. 1.2v
Changes: To remove multiple circles in dialer, dialer.js is updated.
Date: 4/07/2018
Version No. 1.1v
Changes: To remove Inbound Portfolio issue, KPAMIListen updated.
Date: 18/06/2018
The difference between this server and other servers is KPAMIListen.php Please make sure updating this file.
Version No.1.21v
Changes: DialerController for the after New calls based on Subdispo Not contacted call will come in the queue.
Date: 12/11/2018
Version No. 1.20v
Changes:Dialer Controller for Diallines blocked, KPAMIListen for Log comment, show.blade.php casesensitivity campaign error: No Access
Date: 02/11/2018
Version No. 1.19v
Changes:made changes by Jadhav in getPersonshome function,KHRMSLib.php
Date: 12/09/2018
Version No. 1.18v
Changes: Missed calls to changed will reflect after 11th sept.,Changes DialerController.php and dialer.blade.php
Date: 10/09/2018
Version No. 1.17v
Changes: DAP implementation, Changes KFormLib has been Changed,
Date: 10/09/2018
Version No. 1.16v
Changes: missed call bucket in order Changes KHRMSLib.php added one function for asc
Date: 10/09/2018
Version No. 1.15v
Changes: progressive new logic like COP, Changes dialerController.php
Date: 08/09/2018
Version No. 1.14v
Changes: agent time report updated, commented if condition.
......
<?php namespace App\Console\Commands;
use Illuminate\Console\Command;
//use Mail;
use DB;
use Config;
use App\Models\User;
use App\Models\Accesslog;
use App\Models\CRMCall;
use Schema;
use PDO;
use App\Models\Notification;
use App\Jobs\KHRMSLib;
use Input;
use Illuminate\Database\Schema\Blueprint;
class bulkserverupload_data extends Command {
/**
* The console command name.
*
* @var string
*/
protected $signature = 'bulkserverupload_data';
/**
* The console command description.
*
* @var string
*/
protected $description = 'bulkserverupload_data';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
//echo "\n".date('Y-m-d')."\n";
echo "2";
echo "\n".date('Y-m-d H:i:s')."\n";
$server_ip=env('app_ip');
$central_ip=env('central_ip');
$wakka = new KHRMSLib();
$kformlib=new \App\Jobs\KFormLib($wakka->HRCoreVars["HRFiledsStr"]);
$kformlib->gthis=$wakka;
$themehome=$wakka->GetThemePath('/');
$updatetime=time();
$clientlst=$wakka->GetBBBUserData("clientslist");
$isadmin=$wakka->IsAdmin();
$username=$wakka->GetUserName();
$triggers=Input::get("triggers");
$tmpstr=explode(",",$kformlib->HRFiledsStr);
$success="";$message="";$successcnt=0;$duplicatecount=0;
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', 'yb9738z'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'options' => array(
PDO::ATTR_TIMEOUT => 5,
),
);
Config::set("database.connections.conn", $conn);
DB::connection("conn")->getDatabaseName();
$serverclist=DB::connection("conn")->select(DB::raw("select location from server_details where server_ip='$server_ip'"));
$location=$serverclist[0]->location;
$excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat_150918 where SERVER_IP='$server_ip'"));
$conn='';
$tcol=0;$fieldsarr=array();$extrahdrarr=array();
foreach($excelarray as $key => $array){
$excelarray[$key] = (array)$array;
}
$highestColumn = DB::connection("conn")->select(DB::raw("select count(*) as cnt from information_schema.columns where table_name='bz_record_upload_uat_150918'"));
$highestColumn = $highestColumn[0]->cnt;
$highestrow = count($excelarray);
$flag = 0;
$editflag=0;
for($i=0;$i<$highestrow;$i++)
{
if($excelarray[$i]["clientcode"]!="")
{
/*if($excelarray[$i]["id"]=="CREATE")
{
$excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s')));
}
else*/
$excelarray[$i]["clientcode"]=intval($excelarray[$i]["clientcode"]);
//$excelarray[$i]["client"]=$excelarray[$i]["rm_code"];
if($wakka->getCount("records","clientcode='".$excelarray[$i]["clientcode"]."'")==1)
{
//$empdata=$wakka->getPerson($excelarray[$i]["id"]);
$empdata=$wakka->getPersonServer($excelarray[$i]["clientcode"]);
$ppldata=$empdata["peopledata"];
$createdlog=$empdata['modifylog'];
$fdirty=$empdata['dirty'];
$createdlog[$updatetime]=$username."::";
$createdlog["updated"]=$updatetime;
$newdata=$ppldata;
foreach($excelarray[$i] as $key => $value)
{
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;
$newdata[$key]=$value;
}
}
}
/*Start - Changes need to be done*/
if($excelarray[$i]["status"]==null)
{
$empdata['status'] = "rom";
}
if($excelarray[$i]["dialer_status"]==null)
{
$empdata['dialer_status'] = "rom";
}
if($excelarray[$i]["dialer_substatus"]==null)
{
$empdata['dialer_substatus'] = "rom";
}
/*End - Changes need to be done*/
$empdata["peopledata"]=$newdata;
$empdata['modifylog']=$createdlog;
$empdata['dirty']=$fdirty;
//$wakka->setPerson($excelarray[$i]["id"],$empdata);
$wakka->setPersonServer($excelarray[$i]["clientcode"],$empdata);
$excelarray[$i]['modified']=date('Y-m-d H:i:s');
$successArr[] = $excelarray[$i];
}
else
{
$excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s')));
$empdata=$wakka->getPerson($excelarray[$i]["id"]);
$ppldata=$empdata["peopledata"];
$createdlog=$empdata['modifylog'];
$fdirty=$empdata['dirty'];
$createdlog[$updatetime]=$username."::";
$createdlog["updated"]=$updatetime;
$newdata=$ppldata;
foreach($excelarray[$i] as $key => $value)
{
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;
$newdata[$key]=$value;
}
}
}
$empdata["peopledata"]=$newdata;
$empdata['modifylog']=$createdlog;
$empdata['dirty']=$fdirty;
//$wakka->setPerson($excelarray[$i]["id"],$empdata);
$wakka->setPerson($excelarray[$i]["id"],$empdata);
$reason = "";
$reason .= "Record ID is not on local server,";
$excelarray[$i]['server_ip'] =$server_ip;
$excelarray[$i]['location'] =$location;
if($excelarray[$i]["clientcode"]!="")
$excelarray[$i]['cust_id'] =$excelarray[$i]["clientcode"];
$excelarray[$i]['record_id'] = $excelarray[$i]["id"];
$excelarray[$i]['Reason'] = $reason;
$failureArr[] = $excelarray[$i];
}
}
else
{
$reason = "";
if($excelarray[$i]["id"]=="")
$reason .= "Column ID is blank,";
$excelarray[$i]['server_ip'] =$server_ip;
$excelarray[$i]['location'] =$location;
if($excelarray[$i]["clientcode"]!="")
$excelarray[$i]['cust_id'] =$excelarray[$i]["clientcode"];
$excelarray[$i]['Reason'] = $reason;
$failureArr[] = $excelarray[$i];
}
}
/*if(!empty($successArr)){
foreach($successArr as $succes)
{
$setSuccess=array();
$setSuccess[] = "server_ip='$server_ip'";
$setSuccess[] = "location='$location'";
$setSuccess[] = "record_id='".$succes['id']."'";
$setSuccess[] = "cust_id='".$succes['clientcode']."'";
$setSuccess[] = "modified='".$succes['modified']."'";
$setSuccess = implode(",",$setSuccess);
DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success set $setSuccess"));
}
}
if(!empty($failureArr)){
foreach($failureArr as $failur)
{
$setFailure=array();
$setFailure[] = "server_ip='$server_ip'";
$setFailure[] = "location='$location'";
$setFailure[] = "cust_id='".$failur['clientcode']."'";
$setFailure[] = "record_id='".$failur['record_id']."'";
$setFailure[] = "reason='".$failur['Reason']."'";
$setFailure = implode(",",$setFailure);
DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_failure set $setFailure"));
}
}*/
DB::connection("conn")->disconnect();
}
}
<?php namespace App\Console\Commands;
use Illuminate\Console\Command;
//use Mail;
use DB;
use Config;
use App\Models\User;
use App\Models\Accesslog;
use App\Models\CRMCall;
use Schema;
use PDO;
use App\Models\Notification;
use App\Jobs\KHRMSLib;
use Input;
use Illuminate\Database\Schema\Blueprint;
class bulkServerUpload extends Command {
/**
* The console command name.
*
* @var string
*/
protected $signature = 'bulkServerUpload';
/**
* The console command description.
*
* @var string
*/
protected $description = 'bulkServerUpload';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
//echo "\n".date('Y-m-d')."\n";
echo "2";
echo "\n".date('Y-m-d H:i:s')."\n";
$server_ip=env('app_ip');
$central_ip=env('central_ip');
$wakka = new KHRMSLib();
$kformlib=new \App\Jobs\KFormLib($wakka->HRCoreVars["HRFiledsStr"]);
$kformlib->gthis=$wakka;
$themehome=$wakka->GetThemePath('/');
$updatetime=time();
$clientlst=$wakka->GetBBBUserData("clientslist");
$isadmin=$wakka->IsAdmin();
$username=$wakka->GetUserName();
$triggers=Input::get("triggers");
$tmpstr=explode(",",$kformlib->HRFiledsStr);
$success="";$message="";$successcnt=0;$duplicatecount=0;
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', 'yb9738z'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'options' => array(
PDO::ATTR_TIMEOUT => 5,
),
);
Config::set("database.connections.conn", $conn);
DB::connection("conn")->getDatabaseName();
$serverclist=DB::connection("conn")->select(DB::raw("select location from server_details where server_ip='$server_ip'"));
$location=$serverclist[0]->location;
$excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat_09102018_1 where SERVER_IP='$server_ip'"));
$conn='';
$tcol=0;$fieldsarr=array();$extrahdrarr=array();
foreach($excelarray as $key => $array){
$excelarray[$key] = (array)$array;
}
$highestColumn = DB::connection("conn")->select(DB::raw("select count(*) as cnt from information_schema.columns where table_name='bz_record_upload_uat_09102018_1'"));
$highestColumn = $highestColumn[0]->cnt;
$highestrow = count($excelarray);
$flag = 0;
$editflag=0;
for($i=0;$i<$highestrow;$i++)
{
if($excelarray[$i]["clientcode"]!="")
{
/*if($excelarray[$i]["id"]=="CREATE")
{
$excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s')));
}
else*/
$excelarray[$i]["clientcode"]=intval($excelarray[$i]["clientcode"]);
//$excelarray[$i]["client"]=$excelarray[$i]["rm_code"];
if($wakka->getCount("records","clientcode='".$excelarray[$i]["clientcode"]."'")==1)
{
//$empdata=$wakka->getPerson($excelarray[$i]["id"]);
$empdata=$wakka->getPersonServer($excelarray[$i]["clientcode"]);
$excelarray[$i]["other_information"]='2018-10-09_1';
$ppldata=$empdata["peopledata"];
$createdlog=$empdata['modifylog'];
$fdirty=$empdata['dirty'];
$createdlog[$updatetime]=$username."::";
$createdlog["updated"]=$updatetime;
$newdata=$ppldata;
foreach($excelarray[$i] as $key => $value)
{
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;
$newdata[$key]=$value;
}
}
}
/*Start - Changes need to be done*/
if($excelarray[$i]["status"]==null)
{
$empdata['status'] = "rom";
}
if($excelarray[$i]["dialer_status"]==null)
{
$empdata['dialer_status'] = "rom";
}
if($excelarray[$i]["dialer_substatus"]==null)
{
$empdata['dialer_substatus'] = "rom";
}
/*End - Changes need to be done*/
$empdata["peopledata"]=$newdata;
$empdata['modifylog']=$createdlog;
$empdata['dirty']=$fdirty;
//$wakka->setPerson($excelarray[$i]["id"],$empdata);
$wakka->setPersonServer($excelarray[$i]["clientcode"],$empdata);
$excelarray[$i]['modified']=date('Y-m-d H:i:s');
$successArr[] = $excelarray[$i];
}
else
{
$excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s')));
$empdata=$wakka->getPerson($excelarray[$i]["id"]);
$ppldata=$empdata["peopledata"];
$createdlog=$empdata['modifylog'];
$fdirty=$empdata['dirty'];
$createdlog[$updatetime]=$username."::";
$createdlog["updated"]=$updatetime;
$newdata=$ppldata;
foreach($excelarray[$i] as $key => $value)
{
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;
$newdata[$key]=$value;
}
}
}
$empdata["peopledata"]=$newdata;
$empdata['modifylog']=$createdlog;
$empdata['dirty']=$fdirty;
//$wakka->setPerson($excelarray[$i]["id"],$empdata);
$wakka->setPerson($excelarray[$i]["id"],$empdata);
$reason = "";
$reason .= "Record ID is not on local server,";
$excelarray[$i]['server_ip'] =$server_ip;
$excelarray[$i]['location'] =$location;
if($excelarray[$i]["clientcode"]!="")
$excelarray[$i]['cust_id'] =$excelarray[$i]["clientcode"];
$excelarray[$i]['record_id'] = $excelarray[$i]["id"];
$excelarray[$i]['Reason'] = $reason;
$failureArr[] = $excelarray[$i];
}
}
else
{
$reason = "";
if($excelarray[$i]["id"]=="")
$reason .= "Column ID is blank,";
$excelarray[$i]['server_ip'] =$server_ip;
$excelarray[$i]['location'] =$location;
if($excelarray[$i]["clientcode"]!="")
$excelarray[$i]['cust_id'] =$excelarray[$i]["clientcode"];
$excelarray[$i]['Reason'] = $reason;
$failureArr[] = $excelarray[$i];
}
}
echo "\n"."Updated data partial upload end"."\n";
/*if(!empty($successArr)){
foreach($successArr as $succes)
{
$setSuccess=array();
$setSuccess[] = "server_ip='$server_ip'";
$setSuccess[] = "location='$location'";
$setSuccess[] = "record_id='".$succes['id']."'";
$setSuccess[] = "cust_id='".$succes['clientcode']."'";
$setSuccess[] = "modified='".$succes['modified']."'";
$setSuccess = implode(",",$setSuccess);
DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_09102018_1_success set $setSuccess"));
}
}
if(!empty($failureArr)){
foreach($failureArr as $failur)
{
$setFailure=array();
$setFailure[] = "server_ip='$server_ip'";
$setFailure[] = "location='$location'";
$setFailure[] = "cust_id='".$failur['clientcode']."'";
$setFailure[] = "record_id='".$failur['record_id']."'";
$setFailure[] = "reason='".$failur['Reason']."'";
$setFailure = implode(",",$setFailure);
DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_failure set $setFailure"));
}
}*/
DB::connection("conn")->disconnect();
}
}
......@@ -50,9 +50,9 @@ class Calllogupdate extends Command {
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
<?php namespace App\Console\Commands;
use Illuminate\Console\Command;
//use Mail;
use DB;
use Config;
use App\Models\User;
use App\Models\Accesslog;
use App\Models\CRMCall;
use Schema;
use PDO;
use App\Models\Notification;
use App\Jobs\KHRMSLib;
use App\Http\Controllers\DialerController;
use Input;
use Log;
use App\Models\Sipid;
use App\Models\Kqueue;
use App\Models\Dialline;
use App\Models\Session;
use App\Models\Cutoff;
use Illuminate\Database\Schema\Blueprint;
class CreateCall extends Command {
/**
* The console command name.
*
* @var string
*/
protected $signature = 'CreateCall';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Create Pedictive Call If any User is Free';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
while(true)
{
usleep(2000000);
$this->runPredictive();
}
}
public function runPredictive()
{
try {
$this->updatePrepareColumn();
$usrArrs = $this->getActiveUsersCampaignWise("with");
$cntAndStrArr = $this->getActualAvailChannelCount();
$availChannel = $cntAndStrArr['cnt'];
$availDialStr = $cntAndStrArr['dialstr'];
if(count($usrArrs)){
//Log::useFiles(storage_path()."/logs/predictive_".date("Y_m_d").".log");
//Log::info($usrArrs);
//Log::useFiles(storage_path()."/logs/predictive_".date("Y_m_d").".log");
//Log::info("Channel=".$availChannel);
foreach ($usrArrs as $client => $usrArr) {
//Log::useFiles(storage_path()."/logs/predictive_".date("Y_m_d").".log");
//Log::info("campaign=".$client);
$acalls = $this->getCreateCallCount($client, count($usrArr));
$acalls = min($acalls, $availChannel);
//Log::useFiles(storage_path()."/logs/predictive_".date("Y_m_d").".log");
//Log::info("CallCount=".$acalls);
$this->CreateCall($client, $acalls, $availDialStr);
}
}
} catch (Exception $e) {
Log::useFiles(storage_path()."/logs/predictive_".date("Y_m_d").".log");
Log::error($e);
}
}
public function updatePrepareColumn()
{
$allClientUsrIdArr = array();
$updatedUserIdArr = array();
$currentTime = strtotime(date("Y-m-d H:i:s"));
$clientWiseUserIdArr = $this->getActiveUsersCampaignWise("without");
if(count($clientWiseUserIdArr)) {
//Log::useFiles(storage_path()."/logs/predictive_".date("Y_m_d").".log");
//Log::info("updatePrepareColumn");Log::info($clientWiseUserIdArr);
foreach ($clientWiseUserIdArr as $client => $usrIdArr) {
$allClientUsrIdArr = array_merge($allClientUsrIdArr, $usrIdArr);
}
$usersTimeArr = Cutoff::whereIn('user_id', $allClientUsrIdArr)->get();
foreach ($usersTimeArr as $userTimeArr) {
$cutOffTime = strtotime($userTimeArr->hangup_time) + ($userTimeArr->avg_dispo - $userTimeArr->avg_ring);
if($cutOffTime < $currentTime)
{
$updatedUserIdArr[] = $userTimeArr->user_id;
}
}
if(count($updatedUserIdArr)) {
//Log::useFiles(storage_path()."/logs/predictive_".date("Y_m_d").".log");
//Log::info("updatedUserIdArr");Log::info($updatedUserIdArr);
}
DB::table('sipids')->whereIn('user', $updatedUserIdArr)->update(['prepare_call'=>1]);
}
}
public function getActiveUsersCampaignWise($checkPrepareCol)
{
$campaignWiseUsrs = array();
$prepareUsrIds = array();
$loggedInSips = Sipid::where('server','=',env('app_ip'))->where("user", "!=", 0)->where("status","=","1");
if($checkPrepareCol=="with"){
$loggedInSips = $loggedInSips->where("prepare_call","=","1");
}
elseif($checkPrepareCol=="without"){
$loggedInSips = $loggedInSips->where("patched","=","0");
}
$loggedInSips = $loggedInSips->groupBy('user')->get();
if(count($loggedInSips)){
foreach ($loggedInSips as $loggedInSip) {
$prepareUsrIds[] = $loggedInSip->user;
}
//TODO: Change Dialmode Value in the column Of User Table (Ready to Predictive)
$usersLoggedIn = User::whereIn('id', $prepareUsrIds);
if($checkPrepareCol=="without")$usersLoggedIn = $usersLoggedIn->where('current_dialmode', '=', 'Predictive');
$usersLoggedIn = $usersLoggedIn->select('id','sel_campaign')->get();
foreach ($usersLoggedIn as $userLoggedIn) {
$campaignWiseUsrs[$userLoggedIn->sel_campaign][] = $userLoggedIn->id;
}
}
return $campaignWiseUsrs;
}
public function getActualAvailChannelCount()
{
$data = array();
$cnt = 0;
$allChanlCnt = $this->getSpanCount();
$dialstr = "";
$diallineVal = Dialline::where('server','=', env('app_ip'))->where("status","=","Free")->where("dialstr","!=","")->where("enabled","=","1")->select('dialstr')->first();
//TODO: When SIP and Dahdi both are active
if(count($diallineVal)){
if(stristr($diallineVal->dialstr,"Dahdi")){
$dialedCnt = $this->getActualDahdiDialedCallCount();
$cnt = $allChanlCnt - $dialedCnt;
}
elseif(stristr($diallineVal->dialstr,"GATEWAY")){
$dialedCnt = $this->getActualSipDialedCallCount();
$cnt = $allChanlCnt - $dialedCnt;
}
$dialstr = $diallineVal->dialstr;
}
$data['cnt'] = $cnt;
$data['dialstr'] = $dialstr;
return $data;
}
public function getActualSipDialedCallCount()
{
$allChnnlArr = array();
$dialstr = "Dial(SIP/GATEWAY/";
$chnlCnt = 0;
exec("/usr/sbin/asterisk -rx 'core show channels'",$allChnnls);
foreach($allChnnls as $allChnnl){
//$allChnnlArr[] = explode(" ", preg_replace('!\s+!', ' ', $allChnnl) );
if(stristr($allChnnl, $dialstr)){
$chnlCnt++;
}
}
return $chnlCnt;
}
public function getActualDahdiDialedCallCount()
{
$allChnnlArr = array();
$dialstr = "- ACTIVE";
$status = "RED";
$chnlCnt = 0;
//exec("/usr/sbin/asterisk -rx 'service dahdi status'",$allChnnls);
exec("service dahdi status",$allChnnls);
foreach($allChnnls as $allChnnl){
//$allChnnlArr[] = explode(" ", preg_replace('!\s+!', ' ', $allChnnl) );
if(stristr($allChnnl, $status)){
Break;
}
if(stristr($allChnnl, $dialstr)){
$chnlCnt++;
}
}
return $chnlCnt;
}
//TODO: Generate Client File To Take All Parameteres Of Campaigns
public function getCreateCallCount($client, $usrCnt)
{
$wakka = new KHRMSLib();
$mastersdata=$wakka->getCompanyMaster($client);
$ratio = $mastersdata["autodialercampaign"];
$dialedCallCnt = $this->getDialedCallCount($client);
return ($usrCnt*$ratio) - $dialedCallCnt;
}
public function getDialedCallCount($client)
{
$cnt = Dialline::whereIn("status", ["Auto","AutoCall"])->where("conf","=","")->where("regexstr","=",$client)->count();
return $cnt;
}
public function CreateCall($client, $acalls, $availDialStr)
{
if($acalls>0)
{
for($i=0;$i<$acalls;$i++)
{
$this->useChannelToDial($client, $availDialStr);
}
}
}
public function useChannelToDial($client, $availDialStr)
{
$dialline=Dialline::where('server','=', env('app_ip'))->where("status","=","Free")->where("enabled","=","1")->where("dialstr", "=", $availDialStr)->orderBy('updated_at','ASC')->first();
//TODO::Need To Code Dspan Logic as per discussion
//if($dspan!="")$dialline=$dialline->where('dspan','=',$dspan)->where('id','<=','30');
//$dialline=$dialline->orderBy('id','ASC')->first();
if(!empty($dialline))
{
$this->createCrmCall($client, $dialline);
}
return;
}
public function createCrmCall($client, $dialline)
{
//TODO: Need to check whether callerid is required or not (in case of GSM Gateway)
$callerid="";
$wakka = new KHRMSLib();
$gz = new DialerController();
$users= $gz->getCallSequencing(1,$client);
if(sizeof($users)>=1)
{
$record=$wakka->getPerson($users[0]['id'],$client);
if($record)
{
$record["peopledata"]["status"]="AutoCall";
$wakka->setPerson($users[0]['id'],$record,$client);
DB::table('records_'.$client)->where('id',$users[0]['id'])->update(['filter_condition'=>'2','modified'=>date("Y-m-d H:i:s")]);
}
$dialline->user_id=$user_id;
$dialline->status="AutoCall";
$dialline->regexstr=$users[0]['client'];
$dialline->number=$users[0]["mobile"];
$dialline->save();
$nowts=microtime(true)*1000;
//start the call log
$crmcall=new CRMCall();
$crmcall->number=$users[0]["mobile"];
$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';
$crmcall->type="AutoCall";
$crmcall->dialline_id=$dialline->id;
$crmcall->setTs('ts_Wait',$nowts);
$crmcall->setTs('ts_Call',$nowts);
$crmcall->did=$callerid;
$tdata=array();
$crmcall->data=json_encode($tdata);
$crmcall->save();
//start actual calls
$newqueue=new Kqueue();
$newqueue->autoCallOut($users[0]["mobile"],$callerid,$crmcall,$dialline);
}
return;
}
public function getSpanCount()
{
$spanArr = array("span1" => 30, "span2" => 30, "span3" => 30, "span4" => 30);
$cnt = array_sum($spanArr);
return $cnt;
}
}
......@@ -45,14 +45,14 @@ class CreportEight extends Command {
$tcol=0;$fieldsarr=array();$extrahdrarr=array();
$central_ip=env('central_ip');
$server_ip=env('app_ip');
$server_ip=env('DB_HOST');
$calllog_report = "calllog_report_".$date;
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -53,9 +53,9 @@ class CreportNine extends Command {
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
<?php namespace App\Console\Commands;
use Illuminate\Console\Command;
//use Mail;
use DB;
use Config;
use App\Models\User;
use App\Models\Accesslog;
use App\Models\CRMCall;
use Schema;
use PDO;
use Illuminate\Database\Schema\Blueprint;
class CreportTen extends Command {
/**
* The console command name.
*
* @var string
*/
protected $signature = 'CreportTen';
/**
* The console command description.
*
* @var string
*/
protected $description = 'App Main Daily Task for CreportTen';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$nowts=time();
$date=date('F_Y');
echo "\n".date('Y-m-d H:i:s')."\n";
$logdate=strtotime('0 day');
$tcol=0;$fieldsarr=array();$extrahdrarr=array();
$central_ip=env('central_ip');
$server_ip=env('app_ip');
//$calllog_report = "calllog_report_".date("d_m_Y");
$calllog_report = "calllog_report_test";
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'options' => array(
PDO::ATTR_TIMEOUT => 5,
),
);
Config::set("database.connections.conn", $conn);
DB::connection("conn")->getDatabaseName();
$serverclist=DB::connection("conn")->select(DB::raw("select id from server_details where server_ip='$server_ip'"));
$server_id=$serverclist[0]->id;
if($server_id<10){
$server_id="0".$server_id;
}
$maxid=DB::connection("conn")->select(DB::raw("SELECT max(crmcall_id) as maxid from $calllog_report where server='$server_id'"));
$maxids=$maxid[0]->maxid;
echo "Maxid".$maxids;
//$alist=DB::select(DB::raw("SELECT * from crmcalls_archive where created_at>'2018-06-01' and created_at<'2018-07-01'"));
//$alist=DB::select(DB::raw("SELECT * from crmcalls where id>'$maxids' and created_at>'".date("Y-m-d")."' and created_at<'".date("Y-m-d H:i:s",$logdate-(60*60))."'"));
$alist=DB::select(DB::raw("SELECT * from crmcalls where id>'$maxids' and created_at<'".date("Y-m-d H:i:s",$logdate-(60*60))."'"));
$userarr=array();
foreach($alist as $aline)
{
$setstrarr=array();
$clientcode="";$currentstatus="";$legalstatus="";$record_id="";
if($aline->crm_id>0)
{
$user=DB::select(DB::raw("select id,clientcode,currentstatus,legalstatus from records where id='".$aline->crm_id."' limit 1;"));
if(isset($user[0]))
{
$record_id=$user[0]->id;
$clientcode=$user[0]->clientcode;
$currentstatus=$user[0]->currentstatus;
$legalstatus=$user[0]->legalstatus;
}
}
$tpostdata=json_decode($aline->data,true);
$fulldate=date("Y-m-d H:i:s",strtotime($aline->created_at)+330*60);
$talktime=$aline->talkSec+$aline->recstartSec+$aline->recendSec;
$length=round(($aline->waitSec+$aline->callSec+$talktime+$aline->dispoSec)/1000,2);
if(!isset($userarr[$aline->user_id])&&$aline->user_id>0)$userarr[$aline->user_id]=User::find($aline->user_id);
$dispname="";if(isset($userarr[$aline->user_id]))$dispname=$userarr[$aline->user_id]->dispname();
$username="";if(isset($userarr[$aline->user_id]))$username=$userarr[$aline->user_id]->username;
$globalid=$server_id.$record_id;
$setstrarr[]="server='$server_id'";
$setstrarr[]="record_id='$record_id'";
$setstrarr[]="crmcall_id='$aline->id'";
$setstrarr[]="globalid='$globalid'";
$setstrarr[]="created_at='$aline->created_at'";
$setstrarr[]="start='$fulldate'";
$setstrarr[]="length='$length'";
$setstrarr[]="user='$username'";
$setstrarr[]="name='$dispname'";
$setstrarr[]="dispo='$aline->userstatus'";
$setstrarr[]="subdispo='$aline->usersubstatus'";
$setstrarr[]="callback='$aline->usercallback'";
$setstrarr[]="number='$aline->number'";
$setstrarr[]="clientcode='$clientcode'";
$setstrarr[]="currentstatus='$currentstatus'";
$setstrarr[]="legalstatus='$legalstatus'";
$setstrarr[]="client='$aline->client'";
$setstrarr[]="department='$aline->department'";
$setstrarr[]="state='$aline->state'";
$setstrarr[]="hsource='$aline->hsource'";
$setstrarr[]="type='$aline->type'";
$setstrarr[]="status='$aline->status'";
$setstrarr[]="statuscode='$aline->statuscode'";
$setstrarr[]="statusstr='$aline->substatus'";
$setstrarr[]="dialline='$aline->dialline_id'";
$setstrarr[]="did='$aline->did'";
$setstrarr[]="waitsec='".round($aline->waitSec/1000,2)."'";
$setstrarr[]="callsec='".round($aline->callSec/1000,2)."'";
$setstrarr[]="talksec='".round($talktime/1000,2)."'";
$setstrarr[]="disposec='".round($aline->dispoSec/1000,2)."'";
$setstrarr[]="remarks='".str_replace("'","",$aline->userremarks)."'";
$setstrarr[]="userdata='$aline->userdata'";
$setstrarr[]="attempt='$aline->attempt'";
$setstrarr[]="priority='$aline->priority'";
$setstrarr[]="question='$aline->question'";
$setstr=implode(",",$setstrarr);
DB::connection("conn")->insert(DB::raw("insert into ".$calllog_report." set $setstr"));
//DB::connection("conn")->update(DB::raw("UPDATE ".$calllog_report." as ca INNER JOIN crmcalls as c on ca.crmcall_id = c.id set ca.state = c.state,ca.statuscode = c.statuscode,ca.status = c.status,ca.substatus = c.substatus,ca.callSec = c.callSec,ca.ts_Talk = c.ts_Talk,ca.ts_Recstart = c.ts_Recstart,ca.ts_Recend = c.ts_Recend,ca.ts_Dispo = c.ts_Dispo,ca.ts_Close = c.ts_Close,ca.dispoSec = c.dispoSec,ca.recstartSec=c.recstartSec,ca.data = c.data,ca.recsize = c.recsize,ca.userstatus = c.userstatus,ca.usersubstatus = c.usersubstatus,ca.usercallback = c.usercallback ,ca.userremarks = c.userremarks,ca.attempt = c.attempt,ca.priority = c.priority,ca.question = c.question"));
}
echo "AfterUploadingData=".date('Y-m-d H:i:s');
}
}
......@@ -98,9 +98,9 @@ class KstychDaily extends Command {
$conn = array(
'driver' => 'mysql',
'host' => $server,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
<?php namespace App\Console\Commands;
use Illuminate\Console\Command;
//use Mail;
use DB;
use Config;
use App\Models\User;
use App\Models\Accesslog;
use App\Models\CRMCall;
use Schema;
use PDO;
use App\Models\Notification;
use App\Jobs\KHRMSLib;
use Input;
use App\Models\Sipid;
use App\Models\Kqueue;
use App\Models\Dialline;
use App\Models\Session;
use App\Models\Cutoff;
use Log;
use Illuminate\Database\Schema\Blueprint;
class PredictiveCallHangUp extends Command {
/**
* The console command name.
*
* @var string
*/
protected $signature = 'PredictiveCallHangUp';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Hang Up Extra Calls If Agents Are Not Free';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
while(true)
{
usleep(1000000);
$this->runHangUp();
}
}
public function runHangUp()
{
try {
$breathingTime = 30;
$avgringsec = 30;
$avgringsec = Cutoff::select(DB::Raw('avg(avg_ring) as avgringsec'))->first();
if($avgringsec)$avgringsec= intval($avgringsec->avgringsec);
$diallines = Dialline::whereIn("status", ["Auto","AutoCall"])->where("conf","=","")->select('src_channel','status','updated_at','channel','server')->get();
foreach ($diallines as $dialline) {
$newqueue=new Kqueue();
$lastUpdatedTime = strtotime(date("Y-m-d H:i:s")) - strtotime($dialline->updated_at);
if ($dialline->status == 'Auto' && $lastUpdatedTime > $breathingTime) {
$newqueue->hangupChannelS($dialline->channel,$dialline->server);
}
elseif($dialline->status == 'AutoCall' && $lastUpdatedTime > ($avgringsec+$breathingTime)) {
$newqueue->hangupChannelS($dialline->src_channel,$dialline->server);
}
}
} catch (Exception $e) {
Log::useFiles(storage_path()."/logs/predictive_".date("Y_m_d").".log");
Log::error($e);
}
}
}
<?php namespace App\Console\Commands;
use Illuminate\Console\Command;
//use Mail;
use DB;
use Config;
use App\Models\User;
use App\Models\Accesslog;
use App\Models\CRMCall;
use Schema;
use PDO;
use Illuminate\Database\Schema\Blueprint;
class Smsreport extends Command {
/**
* The console command name.
*
* @var string
*/
protected $signature = 'Smsreport';
/**
* The console command description.
*
* @var string
*/
protected $description = 'App Main Daily Task for Smsreport';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$nowts=time();
$date=date('F_Y');
echo "\n".date('Y-m-d H:i:s')."\n";
$logdate=strtotime('0 day');
$tcol=0;$fieldsarr=array();$extrahdrarr=array();
$central_ip=env('central_ip');
$server_ip=env('app_ip');
$calllog_report = "calllog_report_".$date;
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'options' => array(
PDO::ATTR_TIMEOUT => 5,
),
);
Config::set("database.connections.conn", $conn);
DB::connection("conn")->getDatabaseName();
$serverclist=DB::connection("conn")->select(DB::raw("select id from server_details where server_ip='$server_ip'"));
$server_id=str_pad($serverclist[0]->id, 2, '0', STR_PAD_LEFT);
$maxid=DB::connection("conn")->select(DB::raw("SELECT max(sms_id) as maxid from sms_report where server='$server_id'"));
$maxids=$maxid[0]->maxid;
$alist=DB::select(DB::raw("SELECT * from sms_log where id>'$maxids'"));
$iii=0;
$shortinsert="";
foreach($alist as $aline)
{
$iii++;
$server = $server_id;
$sms_id = $aline->id;
$created_at = $aline->created_at;
$message_time = date("Y-m-d H:i:s",strtotime($aline->created_at)+330*60);
$server_ip = $aline->server_ip;
$call_id = $aline->call_id;
$agent_name = $aline->agent_name;
$subdispo = $aline->subdispo;
$number = $aline->number;
$message = $aline->message;
$response = $aline->response;
$shortinsert.="('$server', '$sms_id','$created_at', '$message_time', '$server_ip', '$call_id', '$agent_name', '$subdispo', '$number', '$message', '$response'),";
if($iii%50==0 || $iii == count($alist)){
$shortinsert=substr($shortinsert,0,-1);
DB::connection("conn")->insert(DB::raw("INSERT INTO sms_report (`server`, `sms_id`, `created_at`, `message_time`, `server_ip`, `call_id`, `agent_name`, `subdispo`, `number`, `message`, `response`) VALUES $shortinsert"));
$shortinsert="";
}
}
echo "\n".date('Y-m-d H:i:s')."\n";
DB::connection("conn")->disconnect();
}
}
\ No newline at end of file
<?php namespace App\Console\Commands;
use Illuminate\Console\Command;
//use Mail;
use DB;
use Config;
use App\Models\User;
use App\Models\Accesslog;
use App\Models\CRMCall;
use Schema;
use PDO;
use App\Models\Notification;
use App\Jobs\KHRMSLib;
use Input;
use App\Models\Sipid;
use App\Models\Kqueue;
use App\Models\Dialline;
use App\Models\Session;
use App\Models\Cutoff;
use Log;
use Illuminate\Database\Schema\Blueprint;
class UpdateAvgRingSec extends Command {
/**
* The console command name.
*
* @var string
*/
protected $signature = 'UpdateAvgRingSec';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Update Avg Call Ring Sec Of Last 50 Calls';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$avgcallsecObj = CRMCall::select(DB::Raw('ROUND((avg(callsec))/1000) as avgcallsec'))->limit(50)->where("type","!=","Inbound")->first();
if(count($avgcallsecObj))
{
Cutoff::where('user_id', '!=', "")->update(
['avg_ring' => $avgcallsecObj->avgcallsec
]);
}
}
}
\ No newline at end of file
<?php namespace App\Console\Commands;
use Illuminate\Console\Command;
use DB;
use Config;
use App\Models\User;
use App\Models\Accesslog;
use App\Models\CRMCall;
use Schema;
use PDO;
use Illuminate\Database\Schema\Blueprint;
class Userlog_datavalidation extends Command {
/**
* The console command name.
*
* @var string
*/
protected $signature = 'Userlog_datavalidation';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Userlog_datavalidation';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$nowts=time();
echo "\n".date('Y-m-d')."\n";
$logdate=strtotime('-1 day');
$tcol=0;$fieldsarr=array();$extrahdrarr=array();
$server_ip=env('app_ip');
$central_ip=env('central_ip');
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'options' => array(
PDO::ATTR_TIMEOUT => 5,
),
);
Config::set("database.connections.conn", $conn);
if(DB::connection("conn")->getDatabaseName())
{
$serverclist=DB::connection("conn")->select(DB::raw("select id from server_details where server_ip='$server_ip'"));
$server_id=$serverclist[0]->id;
if($server_id<10){
$server_id="0".$server_id;
}
$i=0;
$ulist=DB::select(DB::raw("select * from users WHERE 1"));
foreach($ulist as $uline) {
$users[$uline->id] = $uline->username;
}
if($alist=DB::select(DB::raw("select * from userlogs WHERE created_at>'".date("Y-m-d",$logdate)."' and created_at<'".date("Y-m-d",$logdate+24*60*60)."'"))){
foreach($alist as $aline) {
$i++;
$global_id = $server_id . $i;
if($aline->enddate=='0000-00-00'|| $aline->endtime=='00:00:00' || $aline->durationsec=='0')
{
$enddatetime=date("Y-m-d H:i:s",strtotime($aline->updated_at));
$enddate=explode(" ",$enddatetime)[0];
$endtime=explode(" ",$enddatetime)[1];
$durationsec=date("Y-m-d H:i:s",strtotime($endtime-$aline->starttime));
}
else
{
$enddate=$aline->enddate;
$endtime=$aline->endtime;
$durationsec=$aline->durationsec;
}
$rowdata = array('server'=>$server_id,'server_ip'=>$server_ip,'global_id'=>$global_id,'id'=>$aline->id,
'created_at'=>$aline->created_at,'updated_at'=>$aline->updated_at,'user_id'=>$aline->user_id,'user'=>$users[$aline->user_id],
'startdate'=>$aline->startdate,'starttime'=>$aline->starttime,'enddate'=>$enddate,'endtime'=>$endtime,
'durationsec'=>$durationsec,'data'=>$aline->data,'group'=>$aline->group,'login'=>'','dialnext'=>'','dialnext-agentbriefing'=>'','dialnext-downtime'=>'','dialnext-floorannouncements'=>'','dialnext-incoming'=>'','dialnext-lunchbreak'=>'','dialnext-manual'=>'','dialnext-notready'=>'','dialnext-qualityfeedback'=>'','dialnext-teabreak'=>'','dialnext-teammeeting'=>'','dialnext-utilitybreak'=>'','manual'=>'','manual-agentbriefing'=>'','manual-agentbriefing'=>'','manual-downtime'=>'','manual-floorannouncements'=>'','manual-incoming'=>'','manual-lunchbreak'=>'','manual-manual'=>'','manual-notready'=>'','manual-qualityfeedback'=>'','manual-teabreak'=>'','manual-teammeeting'=>'','manual-utilitybreak'=>'','paused'=>'','paused-agentbriefing'=>'','paused-downtime'=>'','paused-floorannouncements'=>'','paused-incoming'=>'','paused-lunchbreak'=>'','paused-manual'=>'','paused-notready'=>'','paused-qualityfeedback'=>'','paused-teabreak'=>'','paused-teammeeting'=>'','paused-utilitybreak'=>'','paused-autowrapup'=>'','paused-wrapup'=>'','progressive'=>'','progressive-agentbriefing'=>'','progressive-agentbriefing'=>'','progressive-downtime'=>'','progressive-floorannouncements'=>'','progressive-incoming'=>'','progressive-lunchbreak'=>'','progressive-manual'=>'','progressive-notready'=>'','progressive-qualityfeedback'=>'','progressive-teabreak'=>'','progressive-teammeeting'=>'','progressive-utilitybreak'=>'','ready-incoming'=>''
);
$data=json_decode($aline->data,true);
foreach($data as $sipid=>$sdata)
{
$prets= isset($sdata[1]) ? $sdata[1] : (strtotime($aline->startdate . " " . $aline->starttime)+19600)*1000;
if(isset($sdata['states']))
{
$previous="login";
foreach($sdata['states'] as $fts=>$states)
{
if($states[0] != 1)
{
$rowdata[$previous] +=round(($fts-$prets)/1000,2);
$previous = (trim($states[1]) != '') ? strtolower($states[0]."-".$states[1]) : strtolower($states[0]);
$prets=$fts;
}
}
$rowdata[$previous] += round(($sdata['ts']-$prets)/1000,2);
}
}
$rowdata["login"] = $aline->durationsec;
$rowdata['not-ready']=$rowdata['paused-agentbriefing']+$rowdata['paused-autowrapup']+$rowdata['paused-downtime']+$rowdata['paused-floorannouncements']+$rowdata['paused-lunchbreak']+$rowdata['paused-notready']+$rowdata['paused-qualityfeedback']+$rowdata['paused-teammeeting']+$rowdata['paused-teabreak']+$rowdata['paused-utilitybreak'];
$key_value = '';
$startTime=$aline->startdate." ".$aline->starttime;
$endTime=$aline->enddate." ".$aline->endtime;
$crmCalls=DB::select(DB::raw("select user_id,type,ts_Wait,ts_Call,ts_Talk,ts_Recstart,ts_Recend,ts_Dispo,ts_Close from crmcalls WHERE updated_at>='".$startTime."' and updated_at<'".$endTime."' and user_id='".$aline->user_id."'"));
$ts_Wait=0;$ts_Call=0;$ts_Talk=0;$ts_Dispo=0;
$progTs_Wait=0;$progTs_Call=0;$progTs_Talk=0;$progTs_Dispo=0;
$manTs_Wait=0;$manTs_Call=0;$manTs_Talk=0;$manTs_Dispo=0;
$inbTs_Wait=0;$inbTs_Call=0;$inbTs_Talk=0;$inbTs_Dispo=0;
$tt_prog=0;$tt_man=0;$tt_inb=0;
if($crmCalls!=null){
foreach($crmCalls as $crmCall){
$ts_Wait += round(($crmCall->ts_Call - $crmCall->ts_Wait)/1000,2);
$ts_Call += round(($crmCall->ts_Talk - $crmCall->ts_Call)/1000,2);
$ts_Talk += round(($crmCall->ts_Dispo - $crmCall->ts_Talk)/1000,2);
$ts_Dispo += round(($crmCall->ts_Close - $crmCall->ts_Dispo)/1000,2);
if($crmCall->type == 'Progressive')
{
$progTs_Wait += round(($crmCall->ts_Call - $crmCall->ts_Wait)/1000,2);
$progTs_Call += round(($crmCall->ts_Talk - $crmCall->ts_Call)/1000,2);
$progTs_Talk += round(($crmCall->ts_Dispo - $crmCall->ts_Talk)/1000,2);
$progTs_Dispo += round(($crmCall->ts_Close - $crmCall->ts_Dispo)/1000,2);
}
if($crmCall->type == 'Manual')
{
$manTs_Wait += round(($crmCall->ts_Call - $crmCall->ts_Wait)/1000,2);
$manTs_Call += round(($crmCall->ts_Talk - $crmCall->ts_Call)/1000,2);
$manTs_Talk += round(($crmCall->ts_Dispo - $crmCall->ts_Talk)/1000,2);
$manTs_Dispo += round(($crmCall->ts_Close - $crmCall->ts_Dispo)/1000,2);
}
if($crmCall->type == 'Inbound')
{
$inbTs_Wait += round(($crmCall->ts_Call - $crmCall->ts_Wait)/1000,2);
$inbTs_Call += round(($crmCall->ts_Talk - $crmCall->ts_Call)/1000,2);
$inbTs_Talk += round(($crmCall->ts_Dispo - $crmCall->ts_Talk)/1000,2);
$inbTs_Dispo += round(($crmCall->ts_Close - $crmCall->ts_Dispo)/1000,2);
}
}
}
$tt_prog = $progTs_Wait + $progTs_Call + $progTs_Talk + $progTs_Dispo;
$tt_man = $manTs_Wait + $manTs_Call + $manTs_Talk + $manTs_Dispo;
$tt_inb = $inbTs_Wait + $inbTs_Call + $inbTs_Talk + $inbTs_Dispo;
$total_idealtime=$rowdata["login"]-($rowdata['not-ready']+$tt_prog+$tt_man+$tt_inb);
echo "notready time-----idle----".$total_idealtime;
foreach($rowdata AS $key=>$value) {
if($key != 1)
$key_value .= "`$key` = '$value', ";
}
$prod_TOS = $ts_Wait + $ts_Call + $ts_Talk + $ts_Dispo;
$key_value .= "`tt_prog` = '$tt_prog', ";
$key_value .= "`tt_man` = '$tt_man', ";
$key_value .= "`tt_inb` = '$tt_inb', ";
$key_value .= "`ts_Wait` = '$ts_Wait', ";
$key_value .= "`ts_Call` = '$ts_Call', ";
$key_value .= "`ts_Talk` = '$ts_Talk', ";
$key_value .= "`ts_Dispo` = '$ts_Dispo', ";
$key_value .= "`progts_Wait` = '$progTs_Wait', ";
$key_value .= "`progts_Call` = '$progTs_Call', ";
$key_value .= "`progts_Talk` = '$progTs_Talk', ";
$key_value .= "`progts_Dispo` = '$progTs_Dispo', ";
$key_value .= "`mants_Wait` = '$manTs_Wait', ";
$key_value .= "`mants_Call` = '$manTs_Call', ";
$key_value .= "`mants_Talk` = '$manTs_Talk', ";
$key_value .= "`mants_Dispo` = '$manTs_Dispo', ";
$key_value .= "`incts_Wait` = '$inbTs_Wait', ";
$key_value .= "`incts_Call` = '$inbTs_Call', ";
$key_value .= "`incts_Talk` = '$inbTs_Talk', ";
$key_value .= "`incts_Dispo` = '$inbTs_Dispo', ";
$key_value .= "`prod_tos` = '$prod_TOS', ";
$key_value .= "`totalidealtime` = '$total_idealtime', ";
$key_value = substr($key_value, 0, -2);
//$userlogsTable = "userlogs_".date("d_m_Y",$logdate);
$userlogsTable = "userlogs_datavalid";
DB::connection("conn")->insert(DB::raw("INSERT INTO ".$userlogsTable." SET $key_value"));
}
}
}
}
}
<?php namespace App\Console\Commands;
use Illuminate\Console\Command;
use DB;
use Config;
use App\Models\User;
use App\Models\Accesslog;
use App\Models\CRMCall;
use Schema;
use PDO;
use Illuminate\Database\Schema\Blueprint;
class dailyupload_calllog extends Command {
/**
* The console command name.
*
* @var string
*/
protected $signature = 'dailyupload_calllog';
/**
* The console command description.
*
* @var string
*/
protected $description = 'dailyupload_calllog';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$nowts=time();
echo "\n".date('Y-m-d H:i:s')."\n";
$logdate=strtotime('0 day');
$tcol=0;$fieldsarr=array();$extrahdrarr=array();
$server_ip=env('app_ip');
$central_ip=env('central_ip');
$calllog_report = "calllog_report_".date("d_m_Y",$logdate);
$created_at=date("Y-m-d H:i:s");
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'options' => array(
PDO::ATTR_TIMEOUT => 5,
),
);
Config::set("database.connections.conn", $conn);
if(DB::connection("conn")->getDatabaseName())
{
$serverclist=DB::connection("conn")->select(DB::raw("select id from server_details where server_ip='$server_ip'"));
$server_id=$serverclist[0]->id;
if($server_id<10){
$server_id="0".$server_id;
}
$clist=DB::connection("conn")->select(DB::raw("select count(*) as cnt,server from $calllog_report group by server"));
$caar=[];
foreach($clist as $cline)
{
$caar[$cline->server]= $cline->cnt;
}
$mlist=DB::select(DB::raw("select count(*) as countrecord from crmcalls where created_at>'".date("Y-m-d",$logdate)."' and created_at<'".date("Y-m-d",$logdate+24*60*60)."'"));
$location_cont='0';
$central_cont='0';
$location_cont=$mlist[0]->countrecord;
if(array_key_exists($server_id,$caar)){
$central_cont=$caar[$server_id];
}else{
$central_cont=0;
}
$dif=($central_cont)-($mlist[0]->countrecord);
if($dif==0){
$result="Y";
DB::connection("conn")->insert(DB::raw("insert into dailyupload_calllog_records set created_at='$created_at',server_id='$server_id',server_ip='$server_ip',central_count='$central_cont',location_count='$location_cont',difference='$dif',result='$result'"));
}else{
$result="N";
DB::connection("conn")->insert(DB::raw("insert into dailyupload_calllog_records set created_at='$created_at',server_id='$server_id',server_ip='$server_ip',central_count='$central_cont',location_count='$location_cont',difference='$dif',result='$result'"));
}
DB::connection("conn")->disconnect();
}
}
}
......@@ -71,9 +71,9 @@ class bulkServerUpload extends Command {
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', 'yb9738z'),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......@@ -88,8 +88,7 @@ class bulkServerUpload extends Command {
$serverclist=DB::connection("conn")->select(DB::raw("select location from server_details where server_ip='$server_ip'"));
$location=$serverclist[0]->location;
$excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='$server_ip' order by auto_id asc limit 0,20000"));
$excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='$server_ip' order by auto_id asc limit 0,50000"));
$conn='';
......@@ -211,7 +210,7 @@ class bulkServerUpload extends Command {
}
}
if(!empty($successArr)){
/*if(!empty($successArr)){
foreach($successArr as $succes)
{
$setSuccess=array();
......@@ -242,7 +241,7 @@ class bulkServerUpload extends Command {
DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_failure set $setFailure"));
}
}
}*/
DB::connection("conn")->disconnect();
}
......
......@@ -71,9 +71,9 @@ class bulkServerUpload_1 extends Command {
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', 'yb9738z'),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......@@ -89,7 +89,7 @@ class bulkServerUpload_1 extends Command {
$location=$serverclist[0]->location;
$excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='$server_ip' order by auto_id asc limit 20001,40000"));
$excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='$server_ip' order by auto_id asc limit 50000,50000"));
$conn='';
......@@ -211,6 +211,7 @@ class bulkServerUpload_1 extends Command {
}
}
/*
if(!empty($successArr)){
foreach($successArr as $succes)
{
......@@ -243,6 +244,7 @@ class bulkServerUpload_1 extends Command {
DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_failure set $setFailure"));
}
}
*/
DB::connection("conn")->disconnect();
}
......
......@@ -71,9 +71,9 @@ class bulkServerUpload_2 extends Command {
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', 'yb9738z'),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......@@ -89,7 +89,7 @@ class bulkServerUpload_2 extends Command {
$location=$serverclist[0]->location;
$excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='$server_ip' order by auto_id asc limit 40001,60000"));
$excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='$server_ip' order by auto_id asc limit 100000,50000"));
$conn='';
......@@ -211,6 +211,7 @@ class bulkServerUpload_2 extends Command {
}
}
/*
if(!empty($successArr)){
foreach($successArr as $succes)
{
......@@ -243,7 +244,7 @@ class bulkServerUpload_2 extends Command {
DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_failure set $setFailure"));
}
}
*/
DB::connection("conn")->disconnect();
}
}
......
......@@ -71,9 +71,9 @@ class bulkServerUpload_3 extends Command {
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', 'yb9738z'),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......@@ -89,7 +89,7 @@ class bulkServerUpload_3 extends Command {
$location=$serverclist[0]->location;
$excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='$server_ip' order by auto_id asc limit 60001,80000"));
$excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='$server_ip' order by auto_id asc limit 150000,50000"));
$conn='';
......@@ -211,6 +211,7 @@ class bulkServerUpload_3 extends Command {
}
}
/*
if(!empty($successArr)){
foreach($successArr as $succes)
{
......@@ -243,7 +244,7 @@ class bulkServerUpload_3 extends Command {
DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_failure set $setFailure"));
}
}
*/
DB::connection("conn")->disconnect();
}
}
......
......@@ -71,9 +71,9 @@ class bulkServerUpload_4 extends Command {
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', 'yb9738z'),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -71,9 +71,9 @@ class bulkServerUpload_5 extends Command {
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', 'yb9738z'),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -71,9 +71,9 @@ class bulkServerUpload_6 extends Command {
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', 'yb9738z'),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -71,9 +71,9 @@ class bulkServerUpload_daily extends Command {
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', 'yb9738z'),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......@@ -91,7 +91,7 @@ echo $central_ip;
echo $location;
$excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat_daily where SERVER_IP='$server_ip'"));
$excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat_daily where SERVER_IP='$server_ip' order by auto_id asc limit 0,200"));
$conn='';
......
......@@ -71,9 +71,9 @@ class bulkServerUpload_data3 extends Command {
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', 'yb9738z'),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -71,9 +71,9 @@ class bulkserverupload_data extends Command {
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', 'yb9738z'),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -51,9 +51,9 @@ class calllog extends Command {
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -47,9 +47,9 @@ class complaint_data extends Command {
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -50,9 +50,9 @@ public function handle()
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -50,9 +50,9 @@ public function handle()
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -50,9 +50,9 @@ class dailyupload_calllog extends Command {
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -51,9 +51,9 @@ class dailyupload_questionaire extends Command {
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -44,15 +44,15 @@ class full_remark_details extends Command {
$tcol=0;$fieldsarr=array();$extrahdrarr=array();
$server_ip=env('app_ip');
$full_remark = "full_remark_details";
$central_ip=env('central_ip');
$full_remark = "full_remark_details";
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......@@ -76,8 +76,8 @@ class full_remark_details extends Command {
$maxids=$maxid[0]->maxid;
//$qlist=DB::select(DB::raw("SELECT * from full_remark"));
$qlist=DB::select(DB::raw("SELECT * from full_remark where id>'$maxids' and created_at>'".date("Y-m-d")."' and created_at<'".date("Y-m-d H:i:s",$logdate-(60*60))."'"));
$qlist=DB::select(DB::raw("SELECT * from full_remark where id>'$maxids' and fullremark!=''"));
echo count($qlist);
$userarr=array();
foreach($qlist as $qline)
{
......@@ -94,6 +94,7 @@ class full_remark_details extends Command {
DB::connection("conn")->insert(DB::raw("insert into ".$full_remark." set $setstr"));
}
echo "\n".date('Y-m-d H:i:s')."\n";
DB::connection("conn")->disconnect();
}
......
......@@ -50,9 +50,9 @@ public function handle()
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -50,9 +50,9 @@ public function handle()
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -50,9 +50,9 @@ public function handle()
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -47,9 +47,9 @@ class relationship_tag extends Command {
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -47,9 +47,9 @@ public function handle()
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -54,9 +54,9 @@ public function handle()
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -60,9 +60,9 @@ use Illuminate\Database\Schema\Blueprint;
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -51,9 +51,9 @@ class recording_reconcilation_metadata extends Command
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -46,9 +46,9 @@ class records_details extends Command {
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......@@ -73,7 +73,7 @@ echo ",".$server_ip;
$maxids=$maxid[0]->maxid;
$qlist=DB::select(DB::raw("SELECT id,clientcode,client,status,clientinternalid,mobile,priority,modified,question,firstname FROM `records` where id>'$maxids'"));
$qlist=DB::select(DB::raw("SELECT id,created,clientcode,client,status,clientinternalid,mobile,priority,modified,question,firstname FROM `records` where id>'$maxids' and client != 'Inactive'"));
$countnumber=count($qlist);
$finalnumber=$countnumber/50;
......@@ -86,6 +86,7 @@ echo ",".$server_ip;
foreach($qlist as $qline)
{
$record_id=$qline->id;
$created=$qline->created;
$clientcode=$qline->clientcode;
$client=$qline->client;
$status=$qline->status;
......@@ -96,19 +97,19 @@ echo ",".$server_ip;
$question=$qline->question;
$firstname=$qline->firstname;
$shortinsert.="('$client', '$server_ip', '$record_id', '$clientcode', '$status', '$clientinternalid', '$location', '$mobile', '$question', '$firstname', '$priority', '$modified'),";
$shortinsert.="('$client', '$server_ip', '$record_id', '$clientcode', '$status', '$clientinternalid', '$location', '$mobile', '$question', '$firstname', '$priority', '$modified', '$created'),";
if($kkk<=$finalnumber){
if($iii%50==0){
$shortinsert=substr($shortinsert,0,-1);
DB::connection("conn")->insert(DB::raw("INSERT INTO `records_details` (`client`, `server_ip`, `record_id`, `cust_id`, `records_status`, `group_id`, `location`, `mobile`, `question`,`firstname`, `priority`, `modified`) VALUES $shortinsert"));
DB::connection("conn")->insert(DB::raw("INSERT INTO `records_details` (`client`, `server_ip`, `record_id`, `cust_id`, `records_status`, `group_id`, `location`, `mobile`, `question`,`firstname`, `priority`, `modified`, `created`) VALUES $shortinsert"));
$kkk++;
}
}else{
DB::connection("conn")->insert(DB::raw("insert into records_details set client='$client', server_ip='$server_ip', record_id='$record_id', cust_id='$clientcode', records_status='$status', group_id='$clientinternalid', location='$location',mobile='$mobile',question='$question',firstname='$firstname',priority='$priority',modified='$modified'"));
DB::connection("conn")->insert(DB::raw("insert into records_details set client='$client', server_ip='$server_ip', record_id='$record_id', cust_id='$clientcode', records_status='$status', group_id='$clientinternalid', location='$location',mobile='$mobile',question='$question',firstname='$firstname',priority='$priority',modified='$modified',created='$created'"));
}
if($iii%50==0){
$shortinsert="";
......
......@@ -47,9 +47,9 @@ class relationship_tag extends Command {
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -46,9 +46,9 @@ public function handle()
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -46,9 +46,9 @@ public function handle()
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -50,9 +50,9 @@ public function handle()
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -50,9 +50,9 @@ public function handle()
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -50,9 +50,9 @@ public function handle()
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -50,9 +50,9 @@ public function handle()
$conn = array(
'driver' => 'mysql',
'host' => $central_ip,
'database' => env('DB_DATABASE', 'kstych_flexydial'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'database' => env('CENTRAL_DB'),
'username' => env('CENTRAL_USERNAME'),
'password' => env('CENTRAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
......
......@@ -47,8 +47,10 @@ protected $commands = [
'App\Console\Commands\BirthdayDate',
'App\Console\Commands\bulkserverupload_data',
'App\Console\Commands\bulkServerUpload_data3',
'App\Console\Commands\Userlog_datavalidation',
'App\Console\Commands\Calllogupdate',
'App\Console\Commands\CreateCall',
'App\Console\Commands\PredictiveCallHangUp',
'App\Console\Commands\UpdateAvgRingSec',
];
/**
......@@ -59,12 +61,13 @@ 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();
$schedule->command('bulkServerUpload')->dailyAt('14:15')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping();
$schedule->command('bulkServerUpload_data3')->dailyAt('14:20')->appendOutputTo(storage_path()."/reason/bulkServerUpload_data3.txt")->withoutOverlapping();
//$schedule->command('bulkserverupload_data')->dailyAt('14:17')->appendOutputTo(storage_path()."/reason/bulkserverupload_data.txt")->withoutOverlapping();
//$schedule->command('bulkServerUpload')->dailyAt('14:15')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping();
//$schedule->command('bulkServerUpload_data3')->dailyAt('14:20')->appendOutputTo(storage_path()."/reason/bulkServerUpload_data3.txt")->withoutOverlapping();
//$schedule->command('relationship_tag')->everyMinute()->appendOutputTo(storage_path()."/reason/relationship_tag.txt")->withoutOverlapping();
//$schedule->command('calllog')->everyMinute()->appendOutputTo(storage_path()."/reason/calllog.txt")->withoutOverlapping();
......@@ -73,19 +76,18 @@ protected function schedule(Schedule $schedule)
//$schedule->command('supervisor_agent_rec')->everyMinute()->appendOutputTo(storage_path()."/reason/supervisor_agent_rec.txt")->withoutOverlapping();
//$schedule->command('supervisor_recommendation')->everyMinute()->appendOutputTo(storage_path()."/reason/supervisor_recommendation.txt")->withoutOverlapping();
//$schedule->command('question_tree')->everyMinute()->appendOutputTo(storage_path()."/reason/question_tree.txt")->withoutOverlapping();
//$schedule->command('bulkServerUpload')->dailyAt('10:08')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping();
$schedule->command('Userlog_data')->dailyAt('01:10')->appendOutputTo(storage_path()."/reason/Userlog_data.txt")->withoutOverlapping();
//$schedule->command('Userlog_data')->everyMinute()->appendOutputTo(storage_path()."/reason/Userlog_data.txt")->withoutOverlapping();
//$schedule->command('Userlog_data')->dailyAt('01:10')->appendOutputTo(storage_path()."/reason/Userlog_data.txt")->withoutOverlapping();
$schedule->command('bulkServerUpload')->dailyAt('14:45')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping();
$schedule->command('bulkServerUpload_1')->dailyAt('16:18')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping();
$schedule->command('bulkServerUpload_2')->dailyAt('17:45')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping();
$schedule->command('bulkServerUpload_3')->dailyAt('19:15')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping();
$schedule->command('bulkServerUpload_4')->dailyAt('20:45')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping();
$schedule->command('bulkServerUpload_1')->dailyAt('16:12')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping();
$schedule->command('bulkServerUpload_2')->dailyAt('16:45')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping();
$schedule->command('bulkServerUpload_3')->dailyAt('21:15')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping();
$schedule->command('bulkServerUpload_4')->dailyAt('23:45')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping();
//$schedule->command('bulkServerUpload_daily')->everyMinute()->appendOutputTo(storage_path()."/reason/bulkServerUpload_daily.txt")->withoutOverlapping();
//$schedule->command('bulkServerUpload_daily')->everyMinute()->appendOutputTo(storage_path()."/reason/bulkserver_daily.txt")->withoutOverlapping();
$schedule->command('BirthdayDate')->dailyAt('01:45')->appendOutputTo(storage_path()."/reason/BirthdayDate.txt")->withoutOverlapping();
/*$schedule->command('BirthdayDate')->dailyAt('01:45')->appendOutputTo(storage_path()."/reason/BirthdayDate.txt")->withoutOverlapping();
$schedule->command('bulkServerUpload_daily')->dailyAt('05:05')->appendOutputTo(storage_path()."/reason/bulkserver_daily.txt")->withoutOverlapping();
$schedule->command('bulkServerUpload_daily')->dailyAt('07:05')->appendOutputTo(storage_path()."/reason/bulkserver_daily.txt")->withoutOverlapping();
$schedule->command('bulkServerUpload_daily')->dailyAt('09:05')->appendOutputTo(storage_path()."/reason/bulkserver_daily.txt")->withoutOverlapping();
......@@ -98,7 +100,7 @@ protected function schedule(Schedule $schedule)
$schedule->command('CreportNine')->dailyAt('14:44')->appendOutputTo(storage_path()."/reason/CreportNine.txt")->withoutOverlapping();
$schedule->command('CreportNine')->dailyAt('01:14')->appendOutputTo(storage_path()."/reason/CreportNine.txt")->withoutOverlapping();
$schedule->command('Calllogupdate')->dailyAt('09:55')->appendOutputTo(storage_path()."/reason/calllog_update.txt")->withoutOverlapping();
//$schedule->command('CreportNine')->everyMinute()->appendOutputTo(storage_path()."/reason/CreportNine.txt")->withoutOverlapping();
//$schedule->command('CreportEight')->everyMinute()->appendOutputTo(storage_path()."/reason/CreportEight.txt")->withoutOverlapping();
$schedule->command('questionnaire_details')->hourly()->appendOutputTo(storage_path()."/reason/questionnaire_details.txt")->withoutOverlapping();
......@@ -126,8 +128,7 @@ protected function schedule(Schedule $schedule)
//$schedule->command('relationship_data')->everyMinute()->appendOutputTo(storage_path()."/reason/relationship_data.txt")->withoutOverlapping();
//$schedule->command('table_create')->everyMinute()->appendOutputTo(storage_path()."/reason/table_create.txt")->withoutOverlapping();
//$schedule->command('Userlog_datavalidation')->everyMinute()->appendOutputTo(storage_path()."/reason/Userlog_datavalid.txt")->withoutOverlapping();
*/
}
}
......
<?php namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
'App\Console\Commands\KstychDaily',
'App\Console\Commands\KstychPAMI',
'App\Console\Commands\KstychPAGI',
'App\Console\Commands\DailyLogout',
'App\Console\Commands\bulkServerUpload',
'App\Console\Commands\bulkServerUpload_1',
'App\Console\Commands\bulkServerUpload_2',
'App\Console\Commands\bulkServerUpload_3',
'App\Console\Commands\bulkServerUpload_4',
//'App\Console\Commands\bulkServerUpload_5',
'App\Console\Commands\bulkServerUpload_daily',
'App\Console\Commands\InsertCrmArchive',
'App\Console\Commands\DeleteCrmcalls',
'App\Console\Commands\records_details',
'App\Console\Commands\CreportEight',
'App\Console\Commands\questionnaire_details',
'App\Console\Commands\Userlog_data',
'App\Console\Commands\lead_form_details',
'App\Console\Commands\full_remark_details',
'App\Console\Commands\recording_reconcilation',
'App\Console\Commands\recording_reconcilation_metadata',
'App\Console\Commands\dailyupload_calllog',
'App\Console\Commands\dailyupload_questionaire',
'App\Console\Commands\relationship_data',
'App\Console\Commands\relationship_tag',
'App\Console\Commands\supervisor_agent_rec',
'App\Console\Commands\supervisor_recommendation',
'App\Console\Commands\rlppb_details',
'App\Console\Commands\question_tree',
//'App\Console\Commands\table_create',
//'App\Console\Commands\calllog',
//'App\Console\Commands\CreportNine',
//'App\Console\Commands\CreportTen',
'App\Console\Commands\BirthdayDate',
'App\Console\Commands\bulkserverupload_data',
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('KstychDaily')->daily()->withoutOverlapping();
//$schedule->command('bulkServerUpload')->everyFiveMinutes()->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping();
$schedule->command('bulkserverupload_data')->dailyAt('01:45')->appendOutputTo(storage_path()."/reason/bulkserverupload_data.txt")->withoutOverlapping();
//$schedule->command('relationship_tag')->everyMinute()->appendOutputTo(storage_path()."/reason/relationship_tag.txt")->withoutOverlapping();
//$schedule->command('calllog')->everyMinute()->appendOutputTo(storage_path()."/reason/calllog.txt")->withoutOverlapping();
//$schedule->command('rlppb_details')->everyMinute()->appendOutputTo(storage_path()."/reason/rlppb_details.txt")->withoutOverlapping();
$schedule->command('BirthdayDate')->dailyAt('01:45')->appendOutputTo(storage_path()."/reason/BirthdayDate.txt")->withoutOverlapping();
//$schedule->command('supervisor_agent_rec')->everyMinute()->appendOutputTo(storage_path()."/reason/supervisor_agent_rec.txt")->withoutOverlapping();
//$schedule->command('supervisor_recommendation')->everyMinute()->appendOutputTo(storage_path()."/reason/supervisor_recommendation.txt")->withoutOverlapping();
//$schedule->command('question_tree')->everyMinute()->appendOutputTo(storage_path()."/reason/question_tree.txt")->withoutOverlapping();
$schedule->command('Userlog_data')->dailyAt('01:10')->appendOutputTo(storage_path()."/reason/Userlog_data.txt")->withoutOverlapping();
$schedule->command('bulkServerUpload')->dailyAt('14:45')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping();
$schedule->command('bulkServerUpload_1')->dailyAt('16:18')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping();
$schedule->command('bulkServerUpload_2')->dailyAt('17:45')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping();
$schedule->command('bulkServerUpload_3')->dailyAt('19:15')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping();
$schedule->command('bulkServerUpload_4')->dailyAt('20:45')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping();
//$schedule->command('bulkServerUpload_daily')->everyMinute()->appendOutputTo(storage_path()."/reason/bulkServerUpload_daily.txt")->withoutOverlapping();
//$schedule->command('bulkServerUpload_daily')->everyMinute()->appendOutputTo(storage_path()."/reason/bulkserver_daily.txt")->withoutOverlapping();
$schedule->command('bulkServerUpload_daily')->dailyAt('05:05')->appendOutputTo(storage_path()."/reason/bulkserver_daily.txt")->withoutOverlapping();
$schedule->command('bulkServerUpload_daily')->dailyAt('07:05')->appendOutputTo(storage_path()."/reason/bulkserver_daily.txt")->withoutOverlapping();
$schedule->command('bulkServerUpload_daily')->dailyAt('09:05')->appendOutputTo(storage_path()."/reason/bulkserver_daily.txt")->withoutOverlapping();
$schedule->command('bulkServerUpload_daily')->dailyAt('11:05')->appendOutputTo(storage_path()."/reason/bulkserver_daily.txt")->withoutOverlapping();
$schedule->command('bulkServerUpload_daily')->dailyAt('13:05')->appendOutputTo(storage_path()."/reason/bulkserver_daily.txt")->withoutOverlapping();
$schedule->command('dailyupload_questionaire')->dailyAt('19:30')->appendOutputTo(storage_path()."/reason/dailyupload_questionaire.txt")->withoutOverlapping();
//$schedule->command('CreportEight')->everyFiveMinutes()->appendOutputTo(storage_path()."/reason/CreportEight.txt")->withoutOverlapping();
$schedule->command('CreportEight')->everyTenMinutes()->appendOutputTo(storage_path()."/reason/CreportEight.txt")->withoutOverlapping();
//$schedule->command('CreportNine')->everyMinute()->appendOutputTo(storage_path()."/reason/CreportNine.txt")->withoutOverlapping();
//$schedule->command('CreportTen')->everyMinute()->appendOutputTo(storage_path()."/reason/CreportTen.txt")->withoutOverlapping();
//$schedule->command('CreportEight')->everyMinute()->appendOutputTo(storage_path()."/reason/CreportEight.txt")->withoutOverlapping();
$schedule->command('questionnaire_details')->hourly()->appendOutputTo(storage_path()."/reason/questionnaire_details.txt")->withoutOverlapping();
$schedule->command('InsertCrmArchive')->hourly()->appendOutputTo(storage_path()."/reason/InsertCrmArchive.txt")->withoutOverlapping();
//$schedule->command('InsertCrmArchive')->everyMinute()->appendOutputTo(storage_path()."/reason/InsertCrmArchive.txt")->withoutOverlapping();
$schedule->command('DeleteCrmcalls')->hourly()->withoutOverlapping();
$schedule->command('DailyLogout')->dailyAt('14:30')->withoutOverlapping();
$schedule->command('lead_form_details')->everyTenMinutes()->appendOutputTo(storage_path()."/reason/lead_form_details.txt")->withoutOverlapping();
$schedule->command('records_details')->dailyAt('17:45')->appendOutputTo(storage_path()."/reason/records_details.txt")->withoutOverlapping();
//$schedule->command('recording_reconcilation')->everyMinute()->appendOutputTo(storage_path()."/reason/recording_reconcilation.txt")->withoutOverlapping();
//$schedule->command('recording_reconcilation_metadata')->everyMinute()->appendOutputTo(storage_path()."/reason/recording_reconcilation_metadata.txt")->withoutOverlapping();
//$schedule->command('lead_form_details')->everyMinute()->appendOutputTo(storage_path()."/reason/lead_form_details.txt")->withoutOverlapping();
$schedule->command('dailyupload_calllog')->dailyAt('19:30')->appendOutputTo(storage_path()."/reason/dailycalllog_records.txt")->withoutOverlapping();
//$schedule->command('records_details')->everyMinute()->appendOutputTo(storage_path()."/reason/records_details.txt")->withoutOverlapping();
$schedule->command('full_remark_details')->hourly()->appendOutputTo(storage_path()."/reason/full_remark_details.txt")->withoutOverlapping();
//$schedule->command('questionnaire_details')->everyMinute()->appendOutputTo(storage_path()."/reason/questionnaire_details.txt")->withoutOverlapping();
//$schedule->command('relationship_data')->everyMinute()->appendOutputTo(storage_path()."/reason/relationship_data.txt")->withoutOverlapping();
//$schedule->command('table_create')->everyMinute()->appendOutputTo(storage_path()."/reason/table_create.txt")->withoutOverlapping();
}
}
<?php
define('SMS_NOTCONTACTED',1);
define('SMS_THANKYOU',2);
$smsContactedSubdispositionsArr = array ('Contacted','Feedback');
$smsNotContactedSubdispositionsArr = array (
'NC - Customer Traveling / Abroad',
'NC - Customer in Meeting',
'NC - Ringing / No response',
'NC - Not Reachable',
'NC - Switched off',
'NC - Third Party'
);
$smsTemplatesArr = array(
//SMS_NOTCONTACTED => "Dear Customer,Your Virtual Relationship Manager #name# from HDFC Bank tried reaching you. Kindly call #number# for all your banking and financial needs",
//SMS_NOTCONTACTED =>"Dear Customer, Your Virtual RM #name# from HDFC Bank tried reaching you. Kindly call #number# for all your banking and financial needs.",
SMS_NOTCONTACTED =>"Your RM is unable to contact you!
Call #name# @ #number# for any banking need.
Check & invest in our FD/RD @best rate.
Click here: bit.ly/2TqCdKA",
//SMS_THANKYOU =>"Thank you for speaking to your VirtualRM on #date# . Now also access your account 24/7 via NetBanking/MobileBanking. Download MobileBanking App: bit.ly/2ajTksK"
//SMS_THANKYOU =>"Thank you for speaking to your Virtual RM on #date#. Now also access your account 24/7 via Net / Mobile Banking. Download Mobile App: bit.ly/2ajTksK"
SMS_THANKYOU =>"Your opinion matters!
Thanks for talking & sharing your feedback on #number# with RM #name#
Check & invest in our FD/RD @best rate
Click: bit.ly/2TqCdKA"
);
?>
<?php
$gatewaydispoArry=Array('19'=>'NC-BUSY','17'=>'NC-BUSY','0'=>'NC-BUSY','16'=>'NC-Ringing');
?>
<?php
$DisableNumbersArray = Array('2250910057','2653321205','2656702205','2657145889','2268231057');
$BlockedNumbersArray = Array('8074030875');
?>
......@@ -77,7 +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);
}
......
<?php namespace App\Http\Controllers;
use Auth;
use Input;
use Config;
use Session;
use DB;
use App\Services\FormBuilder;
use Illuminate\Http\Request;
use Response;
use App\Models\Disposition;
use App\Models\SubDisposition;
class DispositionController extends Controller {
public function __construct()
{
$this->middleware('auth');
$this->middleware('module_access');
}
public function index()
{
$data['dispositions']= Disposition::join('sub_disposition', 'disposition.id', '=', 'sub_disposition.dispo_id')
->select('disposition.id as dispoId', 'disposition.name as disposition','disposition.code as code','disposition.status AS status',
DB::raw('count(*) as totalSubDispo, sub_disposition.id'),
DB::raw('GROUP_CONCAT(sub_disposition.name) as sunDispoName, sub_disposition.name'))
->groupBy('sub_disposition.dispo_id')
->get();
return view("layout.module.disposition.index", $data);
}
public function create()
{
return view('layout.module.disposition.create');
}
public function store(Request $request)
{
$action = Input::get("action");
if($action == 'isExists'){
$disposition = Input::get("disposition");
$code = Input::get("code");
$exists=Disposition::where("name","=",$disposition)->orwhere("code","=",$code)->first();
if($exists){
$dispositionId = Input::get("dispoId");
if($dispositionId == $exists->id){
return "false";
}
return "true";
}else{
return "false";
}
}
if($action == 'createDisposition'){
$code = Input::get("code");
$disposition = Input::get("disposition");
$subDisposition = Input::get("subDisposition");
$status = Input::get("status");
$disposition = Disposition::create([
'code' => $code,
'name' => $disposition,
'status' => $status,
'created_at' => date("Y-m-d H:i:s"),
'updated_at' => date("Y-m-d H:i:s")
]);
$dispoId = $disposition->id;
foreach ($subDisposition as $key => $value) {
$subDisposition = SubDisposition::create([
'dispo_id' => $dispoId,
'name' => $value,
'created_at' => date("Y-m-d H:i:s"),
'updated_at' => date("Y-m-d H:i:s")
]);
}
return;
}
if($action == 'updateDisposition'){
$dispoId = Input::get("dispoId");
$code = Input::get("code");
$disposition = Input::get("disposition");
$subDisposition = Input::get("subDisposition");
$status = Input::get("status");
Disposition::where('id', $dispoId)
->update([
'code' => $code,
'name' => $disposition,
'status' => $status]);
SubDisposition::where('dispo_id', $dispoId)->delete();
foreach ($subDisposition as $key => $value) {
$subDisposition = SubDisposition::create([
'dispo_id' => $dispoId,
'name' => $value,
'created_at' => date("Y-m-d H:i:s"),
'updated_at' => date("Y-m-d H:i:s")
]);
}
return;
}
}
public function show($id)
{
}
public function edit($id)
{
$data['disposition']= Disposition::join('sub_disposition', 'disposition.id', '=', 'sub_disposition.dispo_id')
->select('disposition.id AS dispoId', 'disposition.name as disposition','disposition.code as code','disposition.status AS status',
DB::raw('count(*) as totalSubDispo, sub_disposition.id'),
DB::raw('GROUP_CONCAT(sub_disposition.name) as sunDispoName, sub_disposition.name'))
->groupBy('sub_disposition.dispo_id')
->where('disposition.id','=',$id)
->get()->first();
return view('layout.module.disposition.edit',$data);
}
public function update($id)
{
}
public function destroy($id)
{
}
public function dashboard()
{
}
}
<?php namespace App\Http\Controllers;
use Auth;
use Input;
use Config;
use Session;
use DB;
use App\Services\FormBuilder;
use Illuminate\Http\Request;
use Response;
use App\Models\Disposition;
use App\Models\SubDisposition;
use App\Models\DispositionPlan;
use App\Models\DispositionPlanConfig;
class DispositionPlanController extends Controller {
public function __construct()
{
$this->middleware('auth');
$this->middleware('module_access');
}
public function index()
{
$data['dispositionPlan']= DispositionPlan::leftjoin('disposition_plan_config', 'disposition_plan.id', '=', 'disposition_plan_config.dispo_plan_id')
->select('disposition_plan.id as dispositionPlanId', 'disposition_plan.name as name','disposition_plan.status AS status',
DB::raw('count(*) as totalDisposition, disposition_plan_config.id'),
DB::raw('GROUP_CONCAT(disposition_plan_config.disposition) as disposition, disposition_plan_config.disposition'))
->groupBy('disposition_plan_config.dispo_plan_id')
//->where('status','active')
->get();
return view("layout.module.dispositionplan.index", $data);
}
public function create()
{
$data['dispositionEntities'] = Disposition::join('sub_disposition', 'disposition.id', '=', 'sub_disposition.dispo_id')
->select('disposition.id as dispoId', 'disposition.name as disposition','disposition.code as code','disposition.status AS status',
DB::raw('count(*) as totalSubDispo, sub_disposition.id'),
DB::raw('GROUP_CONCAT(sub_disposition.name) as sunDispoName, sub_disposition.name'))
->groupBy('sub_disposition.dispo_id')
->where('status','active')
->get();
return view('layout.module.dispositionplan.create', $data);
}
public function store(Request $request)
{
$action = Input::get("action");
if($action == 'isExists'){
$plan = Input::get("plan");
$exists=DispositionPlan::where("name","=",$plan)->first();
if($exists){
$planId = Input::get("dispositionPlanId");
if($planId == $exists->id){
return "false";
}
return "true";
}else{
return "false";
}
}
if($action == 'createDispositionPlan'){
$plan = Input::get("plan");
$dispositionList = Input::get("disposition");
$subDisposition = Input::get("subDisposition");
$status = Input::get("status");
$dispositionPlan = DispositionPlan::create([
'name' => $plan,
'status' => $status,
'created_at' => date("Y-m-d H:i:s"),
'updated_at' => date("Y-m-d H:i:s")
]);
foreach ($dispositionList as $key => $disposition) {
$dispositionPlanConfig = DispositionPlanConfig::create([
'dispo_plan_id' => $dispositionPlan->id,
'disposition' => $disposition,
'sub_disposition' => implode(",", $subDisposition[$key]),
'created_at' => date("Y-m-d H:i:s"),
'updated_at' => date("Y-m-d H:i:s")
]);
}
return;
}
if($action == 'updateDispositionPlan'){
$dispositionPlanId = Input::get("dispositionPlanId");
$plan = Input::get("plan");
$dispositionList = Input::get("disposition");
$subDisposition = Input::get("subDisposition");
$status = Input::get("status");
DispositionPlan::where('id', $dispositionPlanId)
->update(['name' => $plan,
'status' => $status,
'updated_at' => date("Y-m-d H:i:s")
]);
DispositionPlanConfig::where('dispo_plan_id', $dispositionPlanId)->delete();
foreach ($dispositionList as $key => $disposition) {
$dispositionPlanConfig = DispositionPlanConfig::create([
'dispo_plan_id' => $dispositionPlanId,
'disposition' => $disposition,
'sub_disposition' => implode(",", $subDisposition[$key]),
'created_at' => date("Y-m-d H:i:s"),
'updated_at' => date("Y-m-d H:i:s")
]);
}
return;
}
}
public function show($id)
{
}
public function edit($id)
{
$data['dispositionEntities'] = Disposition::join('sub_disposition', 'disposition.id', '=', 'sub_disposition.dispo_id')
->select('disposition.id as dispoId', 'disposition.name as disposition','disposition.code as code','disposition.status AS status',
DB::raw('count(*) as totalSubDispo, sub_disposition.id'),
DB::raw('GROUP_CONCAT(sub_disposition.name) as sunDispoName, sub_disposition.name'))
->groupBy('sub_disposition.dispo_id')
->where('status','active')
->get();
$data['dispositionPlan']= DispositionPlan::join('disposition_plan_config', 'disposition_plan.id', '=', 'disposition_plan_config.dispo_plan_id')
->select('disposition_plan.id as dispositionPlanId', 'disposition_plan.name as name','disposition_plan.status AS status','disposition_plan_config.disposition as disposition','disposition_plan_config.sub_disposition as sub_disposition')
->where('disposition_plan.id','=',$id)
->get();
return view('layout.module.dispositionplan.edit',$data);
}
public function update($id)
{
}
public function destroy($id)
{
}
public function dashboard()
{
}
}
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Models\Pri;
use Validator;
class PriController extends Controller
{
public function pri(Request $request)
{
// $ab =escapeshellarg(`ls -al`);
// echo "<pre>$ab</pre>";
$output = `ls -al`;
echo "<pre>$output</pre>";
}
}
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use Auth;
use Log;
use DB;
class SmsController extends Controller
{
public $smsUrl = 'https://10.2.55.165:443/servlet/com.aclwireless.pushconnectivity.listeners.TextListener?';
//public $userarray = array("A21568","admin");
public function sendSmsBasedOnSubDisposition($kstychCall)
{
//public $userarray = array("A21568","admin");
//$users = $this->userarray;
//Log::info(Auth::user()->username." ^ ".$users[0]);
//Log::info(in_array(Auth::user()->username , $users));
//if(in_array(Auth::user()->username , $users)){
$msgText = $this->getSmsTemplate($kstychCall);
if( !empty($msgText) ) {
$msgText = $this->fillValuesInTemplate($msgText);
//Log::info($msgText);
$this->sendSmsRequest($kstychCall, $msgText);
}
//}
return;
}
public function sendSmsRequest($kstychCall, $msgText)
{
$url = $this->smsUrl;
//Log::info($kstychCall['callnumber']);
$inputArray = [
'userId'=>'hdfcbalrt',
"pass"=>'hdfcbalrt25',
"appid"=>"hdfcbalrt",
"subappid"=>"hdfcbalrt",
"contenttype"=>"1",
"to"=>$kstychCall['callnumber'],
"from"=>"HDFCBK",
"text"=>$msgText,
"selfid"=>"true",
"alert"=>"1",
"dlrreq"=>"true",
"intflag"=>"false"
];
$query = http_build_query($inputArray);
$url .= $query;
try{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$number=$kstychCall['callnumber'];
$callid=intval($kstychCall['callid'])+0;
$serverip=env(app_ip);
$rmname=Auth::user()->fullname;
$subdispo=$kstychCall["usersubstatus"];
DB::insert(DB::raw("insert into sms_log set server_ip='$serverip',call_id='$callid',rm_name='$rmname',subdispo='$subdispo',number='$number',message='$msgText',response='$response'"));
Log::useFiles(storage_path().'/logs/SMS_Messages_'.date("Y-m-d").'.log');
Log::info('|'.env(app_ip).'|'.date('Y-m-d H:i:s', strtotime('+5 hours 30 minutes')).'|'.Auth::user()->fullname.'|'.$kstychCall['callnumber'].'|"'.$msgText.'"|'.$response.'|');
//Log::info($response);
curl_close($ch);
} catch(Exception $e) {
Log::info($e->getMessage());
}
}
public function getSmsTemplate($kstychCall)
{
$msgText = "";
include( app_path() . '/Constants/SmsTemplate.php');
if( in_array( $kstychCall["usersubstatus"] , $smsContactedSubdispositionsArr) ) {
$msgText = $smsTemplatesArr[SMS_THANKYOU];
} else if( in_array( $kstychCall["usersubstatus"] , $smsNotContactedSubdispositionsArr) ) {
$msgText = $smsTemplatesArr[SMS_NOTCONTACTED];
}
return $msgText;
}
public function fillValuesInTemplate($msgText)
{
if( !empty($msgText) )
{
$msgText = str_replace("#name#", Auth::user()->fullname, $msgText);
//$msgText = str_replace("#number#", explode(":", Auth::user()->exten)[0], $msgText);
$exten = '';
$extension = Auth::user()->exten;
if(!empty($extension))
{
$extenArr = explode(":", $extension);
$exten = $extenArr[0];
}
//Log::info($exten);
$msgText = str_replace("#number#", $exten, $msgText);
$msgText = str_replace("#date#", date('d-m-Y'), $msgText);
}
return $msgText;
}
}
......@@ -252,7 +252,7 @@ class UserController extends Controller {
if(isset($userdata["usergroup"]))$user->group=$userdata["usergroup"];
$user->presence=0;
if(isset($userdata["clientsownerlist"]))$user->clients=$userdata["clientsownerlist"];
if(isset($userdata["lteam"]))$user->lteam=$userdata["lteam"];
if(isset($userdata["lteam2"]))$user->lteam2=$userdata["lteam2"];
if(isset($userdata["supervisor"]))$user->supervisor=$userdata["supervisor"];
......@@ -290,7 +290,7 @@ class UserController extends Controller {
if(isset($userdata["recclientsownerlist"]))$bbb['recclientsownerlist']=$userdata["recclientsownerlist"];
if(isset($userdata["bdmclientsownerlist"]))$bbb['bdmclientsownerlist']=$userdata["bdmclientsownerlist"];
$data['hrmsdata']=serialize($bbb);
//$user->clients=$userdata["clientsownerlist"];
$user->data=json_encode($data);
$meta=$user->meta();
......
......@@ -41,6 +41,8 @@ Route::group(['middleware' => ['web']], function () {
Route::resource('user','UserController');
Route::resource('group','GroupController');
Route::resource('role','RoleController');
Route::resource('dispositionPlan','DispositionPlanController');
Route::resource('disposition','DispositionController');
Route::resource('master','MasterController');
Route::resource('admin','AdminController');
......
This diff could not be displayed because it is too large.
......@@ -575,6 +575,13 @@ $data.="</div><div style='width:49%;float:left'>
<label class=label-small_new style='width:25%;' title=''>Callback: </label>
<input class='form_new form_new_amend datetimepicker_dthr' id='dialer_usercallback' name='dialer_usercallback'>
</p>";
//if(Auth::user()->id==266){
$data.="<p style='clear:both'>
<label class=label-small_new style='width:25%;' title=''>Appointmet Date: </label>
<input class='form_new form_new_amend datetimepicker_dthr' id='dialer_appointment' name='dialer_appointment'>
</p>";
//}
/*$data.="<p style='clear:both'>
<label class=label-small_new style='width:25%;' title=''>Call Remarks: </label>
<textarea id='dialer_userremarks' name='dialer_userremarks' style='width:70%' maxlength=250></textarea>
......@@ -818,20 +825,69 @@ $data.="</fieldset></div>
var dialerdispoarray={};var dispoClassArray={};
dialerdispoarray['']='';\n";
$mastersdata=$gthis->getDispocampaignData($dataarr[client]);
//$dispoarr=explode("~",$mastersdata['mvalue']);
// to get client corconfig
/*$mastersdata= $gthis->getDispocampaignData($dataarr['client']);
$dispoarr = [];
if(empty($mastersdata))
{
// if client company is empty get data from campaign company
$mastersdata=$gthis->getCompanyMaster($client);
if(empty($mastersdata['dialerDispoList']))$mastersdata['dialerDispoList']=$gthis->HRCoreVars['dialerDispoList'];
/* commented above code : now get data from dispostion table
if(empty($mastersdata['dialerDispoList'])){
$mastersdata['dialerDispoList']=$gthis->HRCoreVars['dialerDispoList'];
}*
if(!empty($mastersdata['dialerDispoList'])){
$dispoarr=explode("~",$mastersdata['dialerDispoList']);
}
}else{
$dispoarr=explode("~",$mastersdata['mvalue']);
}
if(count($dispoarr) > 0){
foreach($dispoarr as $dispo)
{
if(!empty($dispo))
{
$dispoprts=explode("|",$dispo);
if(sizeof($dispoprts)>=3)
{
$data.="dialerdispoarray['$dispoprts[1]']='$dispoprts[2]';dispoClassArray['$dispoprts[0]']='$dispoprts[1]';";
}
}
}
}else{
// get disposition from disposition table
$dispositionPlan = $gthis->getDispositionList();
foreach ($dispositionPlan as $key => $value) {
$disposition = $value->disposition;
$subDisposition = $value->sunDispoName;
$data.="dialerdispoarray['$disposition']='$subDisposition';";
}
}*/
$mastersdata = DB::table('campaign_disposition_plan')
->join('disposition_plan_config', 'campaign_disposition_plan.dispo_plan_id', '=', 'disposition_plan_config.dispo_plan_id')
->join('disposition_plan', 'disposition_plan.id', '=', 'disposition_plan_config.dispo_plan_id')
->select('disposition_plan_config.disposition as disposition ', 'disposition_plan_config.sub_disposition as subDisposition')
->where("disposition_plan.status","active")
->where("campaign","=",$dataarr['client'])
->get();
if(count($mastersdata) > 0){
foreach ($mastersdata as $key => $value) {
$disposition = $value->disposition;
$subDisposition = $value->subDisposition;
$data.="dialerdispoarray['$disposition']='$subDisposition';";
}
}else{
// if client company is empty get data from campaign company
$mastersdata=$gthis->getCompanyMaster($client);
if(!empty($mastersdata['dialerDispoList'])){
$dispoarr=explode("~",$mastersdata['dialerDispoList']);
foreach($dispoarr as $dispo)
{
if(!empty($dispo))
......@@ -843,6 +899,16 @@ $data.="</fieldset></div>
}
}
}
}else{
// get disposition from disposition table
$dispositionPlan = $gthis->getDispositionList();
foreach ($dispositionPlan as $key => $value) {
$disposition = $value->disposition;
$subDisposition = $value->sunDispoName;
$data.="dialerdispoarray['$disposition']='$subDisposition';";
}
}
}
$data.="
......@@ -4033,8 +4099,8 @@ function validatePostData()
}
//client cannot be changed unless Admin
if(!$wakka->IsAdmin())if(trim($ppldata["client"])!=""&&$ppldata["client"]!=Input::get("client"))$message=" Client Cannot be changed, use Renew-Record";
//if(!$wakka->IsAdmin())if(trim($ppldata["client"])!=""&&$ppldata["client"]!=Input::get("client"))$message=" Client Cannot be changed, use Renew-Record";
if(!$wakka->IsAdmin())if(trim($ppldata["client"])=="")$message=" Client Cannot be changed, use Renew-Record";
if(Input::get('currentstatus')==$wakka->HRCoreVars['hrTriggerHoldStatus'])
{
$message="";//bypass checks for candidates
......@@ -4187,7 +4253,7 @@ function validatePostData()
$recruitdata["dirty"][$taskline['completecheck']]=1;
}
$this->recruitdata=$recruitdata;
$res=$wakka->setPerson($varid,$this->recruitdata);
$res=$wakka->setPerson($varid,$this->recruitdata,'');
}
}
......
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Cutoff extends Model
{
protected $table = 'cut_off_time';
}
<?php namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Auth;
class Disposition extends Model{
protected $table = 'disposition';
protected $fillable = ['plan','code','name','status','created_at','updated_at'];
}
<?php namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Auth;
class DispositionPlan extends Model{
protected $table = 'disposition_plan';
protected $fillable = ['name','status','created_at','updated_at'];
}
<?php namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Auth;
class DispositionPlanConfig extends Model{
protected $table = 'disposition_plan_config';
protected $fillable = ['dispo_plan_id','disposition','sub_disposition','created_at','updated_at'];
}
......@@ -45,6 +45,59 @@ 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 transferCall($sipid,$callnumber,$callerid,$crmcall,$dialline)
{
$dialstr = $dialline->dialstr;
$server = $dialline->server;
$channel = $dialline->channel;
if($server != '')
{
$odata=array();$odata['VARS']=array();
/*$odata['fromext']="Local/1000".$sipid->id."@kstychDialer";
$odata['context']="initiateTransfer";
$odata['callerid']=$channel;
$odata['toext']="1003".$callnumber;
$odata['account']='m|t|'.$crmcall->id;
$odata['VARS']['dialstr']=$dialstr;
$odata['VARS']['chnl']=$channel;
$odata['VARS']['callnumber']=$callnumber;*/
$odata['channel']=$channel;
$odata['exten']="1003".$callnumber;
$odata['context']="initiateTransfer";
$odata['priority']=1;
//originate conf
$this->type="SIP_".$server;
$this->key="transfer";
$this->status="New";
$this->data=json_encode($odata);
$this->save();
}
}
public function sipOriginate($sipid,$to,$context)
{
$odata=array();$odata['VARS']=array();
......
<?php namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Auth;
class SubDisposition extends Model{
protected $table = 'sub_disposition';
protected $fillable = ['dispo_id','name','created_at','updated_at'];
}
......@@ -15,6 +15,8 @@ return [
'log' => 'daily',
'log_max_files' => 30,
'providers' => [
......@@ -113,6 +115,8 @@ return [
"submenu"=>["Campaign Management"=>["menuAction('campaign');"],
"Bulk Upload"=>["menuAction('campaign/bulkupload');"],
]],
"dispositionPlan" => ["disp"=>"Disposition Plan","icon"=>"globe","dash"=>"","onclick"=>"menuAction('dispositionPlan');"],
"disposition" => ["disp"=>"Disposition List","icon"=>"globe","dash"=>"","onclick"=>"menuAction('disposition');"],
"Admin" => ["disp"=>"Admin","icon"=>"gear","dash"=>"",
"submenu"=>["Masters"=>["showBlock('Masters');"],
"Delete Record"=>["showBlock('DeletePerson');"],
......@@ -150,7 +154,7 @@ return [
'sipssldomain' => env('app_sipssldomain',env('app_domain','localhost')),
'webdomain' => env('web_domain',env('app_domain','localhost')),
'email' => env("app_emailid","[email protected]"),
'app_version' => "4.2.12",
'app_version' => "4.2.14",
'mytheme' => 'layout',
'app_admin' => env('app_admin', 'admin'),
'app_support_ids' => [1],
......
......@@ -323,7 +323,7 @@ function dailyTasks
if [ $nowtime -eq "000" ]
then
rm -f $app_path/application/storage/logs/laravel-*.log
##rm -f $app_path/application/storage/logs/laravel-*.log
touch $app_path/application/storage/logs/laravel-$(date +%Y-%m-%d).log
chmod -R 777 $app_path/application/storage
chmod -R 777 $app_path/custom/app
......@@ -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
......
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -12,7 +12,7 @@ astlogdir => /var/log/asterisk
astsbindir => /usr/sbin
[options]
;verbose = 3
verbose = 9
;debug = 3
;alwaysfork = yes ; Same as -F at startup.
;nofork = yes ; Same as -f at startup.
......
......@@ -35,7 +35,7 @@ exten => _1001XXX!,1,Dial(SIP/${EXTEN:4})
exten => _1001XXX!,n,Hangup
exten => _1002XXX!,1,MixMonitor(/var/spool/asterisk/astrec/${STRFTIME(${EPOCH},,%Y/%m/%d)}/out/outbound_${STRFTIME(${EPOCH},Asia/Kolkata,%Y%m%d-%H%M%S)}_${CALLERID(num)}_${EXTEN:4}_${UNIQUEID}.gsm,av(0)V(0))
exten => _1002XXX!,2,Dial(${dialstr}${EXTEN:4},55,tTo)
exten => _1002XXX!,2,Dial(${dialstr}0${EXTEN:4},55,tTo)
exten => _1002XXX!,n,Hangup
[kstychDialerINB]
......@@ -45,19 +45,20 @@ exten => _X!,n,MixMonitor(/var/spool/asterisk/astrec/${STRFTIME(${EPOCH},,%Y/%m/
exten => _X!,n,ConfBridge(${CHANNEL})
exten => _X!,n,Hangup
[initiateTransfer]
exten => _1003XXXXXXXXXX!,1,Dial(SIP/GATEWAY/${EXTEN:4},30,tT)
exten => _1003XXXXXXXXXX!,n,Hangup
[confTransfer]
exten => _1004XXX!,1,ConfBridge(${CHANNEL})
exten => _1004XXX!,n,Hangup
[kstychPlayFile]
exten => 1001,1,Answer
exten => 1001,n,Playback(silence/1)
exten => 1001,n,Playback(/var/lib/asterisk/sounds/RM_not_available_unreachabl)
exten => 1001,n,Hangup
[kstychPlayHangFile]
exten => 3001,1,Answer
exten => 3001,n,Playback(silence/1)
exten => 3001,n,Playback(/var/lib/asterisk/sounds/hangup_beep)
exten => 3001,n,Hangup
;[kstychAbsFile]
;exten => 2001,1,Answer
;exten => 2001,n,Playback(silence/1)
......
......@@ -6,7 +6,7 @@ tcpenable=no ; Enable server for incoming TCP connections (de
tcpbindaddr=0.0.0.0 ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces)
transport=udp,ws,wss ; Set the default transports. The order determines the primary default transport.
srvlookup=yes ; Enable DNS SRV lookups on outbound calls
realm=192.168.3.131
realm=REPLACESERVERIP
allow = !all,ulaw,alaw,gsm,g723,g726,g729,h264,h263,ilbc,g726aal2,mpeg4,vp8
......@@ -16,7 +16,7 @@ rtpkeepalive=60 ; Send keepalives in the RTP stream to keep NAT open
notifyringing = yes ; Notify subscriptions on RINGING state (default: no)
notifyhold = yes ; Notify subscriptions on HOLD state (default: no)
limitonpeers = yes ; Apply call limits on peers only. This will improve
externip=192.168.3.131
externip=REPLACESERVERIP
localnet=192.168.0.0/255.255.0.0; All RFC 1918 addresses are local networks
localnet=10.0.0.0/255.0.0.0 ; Also RFC1918
localnet=172.16.0.0/12 ; Another RFC1918 with CIDR notation
......@@ -25,11 +25,22 @@ nat=force_rport,comedia ; Global NAT settings (Affects all
qualify=yes ; By default, qualify all peers at 2000ms
limitonpeer = yes ; enable call limit on a per peer basis, different from limitonpeers
icesupport = yes
stunaddr = 192.168.3.131:3478
stunaddr = REPLACESERVERIP:3478
alwaysauthreject = yes
rtcp_mux=yes
turnaddr=192.168.3.131
turnaddr=REPLACESERVERIP
turnusername=test
turnpassword=1234
[GATEWAY]
type=peer
host=10.3.180.33
dtmfmode=inband ; the possibilities are inband , rfc2833, or info
disallow=all
allow=ulaw; because we have chosen inband for dtmf we need alaw or ulaw (G.711)
allow=alaw
context=SIPDialerINB
......
......@@ -61,7 +61,7 @@ kstychCall['supcomntid']='';
kstychCall['userdata']={};
kstychCall['previewcrmid']='';
kstychCall['callWrapupTime']=180;
kstychCall['prograssiveDelay']=10;
kstychCall['prograssiveDelay']=20;
kstychCall['ts_now']=0;
kstychCall['bttc_day']='';
......@@ -560,6 +560,7 @@ function saveCloseDialerCall(flag)
kstychCall['userstatus']=$('#dialer_userstatus').val();
kstychCall['usersubstatus']=$('#dialer_usersubstatus').val();
kstychCall['usercallback']=$('#dialer_usercallback').val();
kstychCall['userappointment']=$('#dialer_appointment').val();
kstychCall["attempt"]=$('#attempt').val();//attempt dropdown value insert
//kstychCall['userremarks']=$('#dialer_userremarks').val();
......@@ -595,8 +596,12 @@ console.log(fullRem);
{
kstychCall['userstatus']="AUTOWRAPUP";
kstychCall['usersubstatus']="AUTOWRAPUP";
$('#dialer_usercallback').val("");
kstychCall['usercallback']="";
$('#dialer_appointment').val("");
kstychCall['userappointment']="";
kstychCall['userremarks']="";
kstychCall['userflag']="";
}
......@@ -606,6 +611,8 @@ console.log(fullRem);
kstychCall['usersubstatus']="REDIAL";
$('#dialer_usercallback').val("");
kstychCall['usercallback']="";
$('#dialer_appointment').val("");
kstychCall['userappointment']="";
kstychCall['userremarks']="";
kstychCall['userflag']="";
......@@ -616,11 +623,13 @@ console.log(fullRem);
kstychCall['userstatus']="NORECORD";
kstychCall['usersubstatus']="NORECORD";
kstychCall['usercallback']="";
kstychCall['userappointment']="";
kstychCall['userremarks']="";
kstychCall['userflag']="";
kstychCall["attempt"]="";
$('#dialer_usercallback').val("");
$('#dialer_appointment').val("");
}
else
{
......@@ -678,6 +687,40 @@ console.log(fullRem);
return;
}
if(kstychCall['usersubstatus'].toLowerCase().indexOf("appointment")>-1||kstychCall['userstatus'].toLowerCase().indexOf("appointment")>-1)
{
if($('#dialer_appointment').val()=="")
{
//console.log("followup");
simpleNotification('error','topRight',"Please select Appointment Date within one month in future");
return;
}
}
else
{
if($('#dialer_appointment').val()!="")
{
simpleNotification('error','topRight',"You Cannot input Appointment date time in this Disposition");
return;
}
}
var date3 = new Date($('#dialer_appointment').val());
var diff = date3.getTime() - date1.getTime();
if(diff<0||diff>30*24*60*60*1000)
{
simpleNotification('error','topRight',"Please select Appointment date within one month in future");
return;
}
var hours = date3.getHours();
var mins = date3.getMinutes();
var fullhour=hours+(mins/60);
if(fullhour<9||fullhour>19)
{
simpleNotification('error','topRight',"Please select Appointment Time date within 9AM and 7PM");
return;
}
}
if($("#recruitsavedata").length)$("#recruitsavedata").click();//TODO hold div in reset, or any error will be lost
......@@ -780,6 +823,8 @@ function showWrapUp()
kstychCall['usersubstatus']="WRAPUP";
$('#dialer_usercallback').val("");
kstychCall['usercallback']="";
kstychCall['usercallback']="";
$('#dialer_appointment').val("");
kstychCall['userremarks']="";
kstychCall['userflag']="";
......@@ -812,9 +857,12 @@ function resetDialer()
var dialerResetForceState=kstychDialer['mDialerState'];
var dialerResetForceSubState=kstychDialer['mDialerSubState'];
if(dialerResetForceSubState != "Predictive"){
dialerResetForceState="Progressive";//Hardcoded TODO change to config
dialerResetForceSubState="";
}
//dialerResetForceState="Progressive";//Hardcoded TODO change to config
//dialerResetForceSubState="";
if(kstychCall['userstatus']=="AUTOWRAPUP")
{
......@@ -876,9 +924,19 @@ function resetCallArray()
kSetDData('C','previewcrmid',"");
kSetDData('C','callWrapupTime',180);
kSetDData('C','prograssiveDelay',10);
kSetDData('C','prograssiveDelay',20);
}
function savedialermode(client)
{
var datastr="kstychCall="+JSON.stringify(kstychCall);
datastr+="&kstychDialer="+JSON.stringify(kstychDialer);
doAjax("dialer?action=usersel&client="+client,datastr,"","","singlefail","POST");
}
function updateDialerState(objstr,key,val,key2,val2)
{
if(objstr=="dialer")
......@@ -889,6 +947,9 @@ function updateDialerState(objstr,key,val,key2,val2)
{
if(!key2||key2=="")kSetDData("D","mDialerSubState","");
$("#transferCallBtn").removeClass("show").addClass("hide");
$("#transferHangBtn").removeClass("hide").addClass("show");
if(val=="Paused")
{
resetCallArray();
......@@ -934,6 +995,8 @@ function updateDialerState(objstr,key,val,key2,val2)
updateDialerState();
});
//if(val2=="Predictive")
savedialermode(client);
}
}
if(objstr=="call")
......@@ -1637,6 +1700,14 @@ recursiveDTMF();
charLen=0;
}
function sendTHDTMFs(){
dtmfVal = "*2";
if(validateDTMF(dtmfVal) == false){simpleNotification("error","topRight", "Invalid DTMF");return;}
recursiveDTMF();
charLen=0;
}
function recursiveDTMF() {
setTimeout(function(){
var dtmfKey = dtmfVal.charAt(charLen);
......
......@@ -678,7 +678,13 @@ $(document).click(function(e){
});
window.onbeforeunload = function(){
if(kstychAppObject['user']['id']==0)return ;
//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?';
};
......
== Info: Could not resolve host: push3.maccesssmspush.com
== Info: Closing connection 0
<?php
$url = 'https://10.2.55.165:443/servlet/com.aclwireless.pushconnectivity.listeners.TextListener?';
//$url = 'https://push3.maccesssmspush.com/servlet/com.aclwireless.pushconnectivity.listeners.TextListener?userId=hdfcbalrt&pass=hdfcbalrt25&appid=hdfcbalrt&subappid=hdfcbalrt&contenttype=1&to=8074030875&from=HDFCBK&text=manoj&selfid=true&alert=1&dlrreq=true&intflag=false';
$inputArray = ["userId"=>"hdfcbalrt","pass"=>"hdfcbalrt25","appid"=>"hdfcbalrt","subappid"=>"hdfcbalrt","contenttype"=>"1","to"=>"8074030875","from"=>"HDFCBK","text"=>"This%20is%20test%20SMS","selfid"=>"true","alert"=>"1","dlrreq"=>"true","intflag"=>"false"];
$payload = json_encode($inputArray);
//$payload = json_encode($jsonBody);
$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIE, "");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json',
'AUTHORIZATIONKEY:' . $X_AUTH_T,
'X-EMAIL:' . $X_EMAIL_T, 'Cache-Control:no-cache'
));
$result=curl_exec($ch);
$errors=curl_error($ch);
$response = curl_getinfo($ch, CURLINFO_HTTP_CODE);
var_dump($result);
curl_close($ch);
echo $errors."<br/>";
echo $response;
?>
<?php
//$url = 'https://10.2.55.165:443/servlet/com.aclwireless.pushconnectivity.listeners.TextListener?';
//$url = 'https://push3.maccesssmspush.com/servlet/com.aclwireless.pushconnectivity.listeners.TextListener?userId=hdfcbalrt&pass=hdfcbalrt25&appid=hdfcbalrt&subappid=hdfcbalrt&contenttype=1&to=8074030875&from=HDFCBK&text=manoj&selfid=true&alert=1&dlrreq=true&intflag=false';
$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"=>"8074030875","from"=>"HDFCBK","text"=>"This is test 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";
echo $response;
curl_close($ch);
} catch(Exception $e) {
//echo "Manoj";
var_dump($e->getMessage());
}
?>
This diff is collapsed. Click to expand it.
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!