Merge branch 'master' of https://git.buzzworks.com/flexydial/hdfc-beu-v2
Showing
26 changed files
with
1397 additions
and
99 deletions
| 1 | <?php namespace App\Console\Commands; | ||
| 2 | |||
| 3 | use Illuminate\Console\Command; | ||
| 4 | use DB; | ||
| 5 | use Config; | ||
| 6 | |||
| 7 | use App\Models\User; | ||
| 8 | use App\Models\Accesslog; | ||
| 9 | |||
| 10 | use App\Models\CRMCall; | ||
| 11 | use Schema; | ||
| 12 | use PDO; | ||
| 13 | |||
| 14 | use Illuminate\Database\Schema\Blueprint; | ||
| 15 | |||
| 16 | class UserlogOne extends Command { | ||
| 17 | |||
| 18 | /** | ||
| 19 | * The console command name. | ||
| 20 | * | ||
| 21 | * @var string | ||
| 22 | */ | ||
| 23 | protected $signature = 'UserlogOne'; | ||
| 24 | |||
| 25 | /** | ||
| 26 | * The console command description. | ||
| 27 | * | ||
| 28 | * @var string | ||
| 29 | */ | ||
| 30 | protected $description = 'UserlogOne'; | ||
| 31 | |||
| 32 | /** | ||
| 33 | * Execute the console command. | ||
| 34 | * | ||
| 35 | * @return mixed | ||
| 36 | */ | ||
| 37 | public function handle() | ||
| 38 | { | ||
| 39 | $nowts=time(); | ||
| 40 | echo "\n".date('Y-m-d')."\n"; | ||
| 41 | |||
| 42 | if(env('app_ip')=="10.125.14.127") | ||
| 43 | { | ||
| 44 | |||
| 45 | |||
| 46 | $offline=array(); | ||
| 47 | $arr=Config::get("app.hdfcnodes"); | ||
| 48 | $logdate=strtotime('-1 day'); | ||
| 49 | $userlogsTable = "userlogs_".date("d_m_Y",$logdate); | ||
| 50 | //echo "\n".$userlogsTable."\n"; | ||
| 51 | |||
| 52 | //$slist=DB::select(DB::raw("select * from server_details where type='COP' and id!='32'")); | ||
| 53 | $slist=DB::select(DB::raw("select * from server_details where id>11")); | ||
| 54 | $server_ip=''; | ||
| 55 | $std_code=''; | ||
| 56 | $conn=''; | ||
| 57 | foreach($slist as $sline) | ||
| 58 | { | ||
| 59 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | ||
| 60 | $server_ip=$sline->server_ip; | ||
| 61 | $server_id=$sline->id; | ||
| 62 | $std_code=$sline->std_code; | ||
| 63 | |||
| 64 | $conn = array( | ||
| 65 | 'driver' => 'mysql', | ||
| 66 | 'host' => $server_ip, | ||
| 67 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | ||
| 68 | 'username' => env('DB_USERNAME', 'root'), | ||
| 69 | 'password' => env('DB_PASSWORD', ''), | ||
| 70 | 'charset' => 'utf8', | ||
| 71 | 'collation' => 'utf8_unicode_ci', | ||
| 72 | 'prefix' => '', | ||
| 73 | 'options' => array( | ||
| 74 | PDO::ATTR_TIMEOUT => 5, | ||
| 75 | ), | ||
| 76 | ); | ||
| 77 | Config::set("database.connections.conn", $conn); | ||
| 78 | |||
| 79 | |||
| 80 | if(DB::connection("conn")->getDatabaseName()) | ||
| 81 | { | ||
| 82 | |||
| 83 | echo ",".$server_ip; | ||
| 84 | |||
| 85 | $i=0; | ||
| 86 | |||
| 87 | $ulist=DB::connection("conn")->select(DB::raw("select * from users WHERE 1")); | ||
| 88 | foreach($ulist as $uline) { | ||
| 89 | $users[$uline->id] = $uline->username; | ||
| 90 | } | ||
| 91 | |||
| 92 | if($alist=DB::connection("conn")->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)."'"))){ | ||
| 93 | |||
| 94 | //if($alist=DB::connection("conn")->select(DB::raw("select * from userlogs WHERE created_at>'2017-09-01' and created_at<'2017-10-01'"))){ | ||
| 95 | |||
| 96 | foreach($alist as $aline) { | ||
| 97 | |||
| 98 | $i++; | ||
| 99 | $global_id = $server_id . $i; | ||
| 100 | |||
| 101 | $rowdata = array('server'=>$server_id,'server_ip'=>$server_ip,'global_id'=>$global_id,'id'=>$aline->id, | ||
| 102 | 'created_at'=>$aline->created_at,'updated_at'=>$aline->updated_at,'user_id'=>$aline->user_id,'user'=>$users[$aline->user_id], | ||
| 103 | 'startdate'=>$aline->startdate,'starttime'=>$aline->starttime,'enddate'=>$aline->enddate,'endtime'=>$aline->endtime, | ||
| 104 | 'durationsec'=>$aline->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'=>'' | ||
| 105 | ); | ||
| 106 | |||
| 107 | $data=json_decode($aline->data,true); | ||
| 108 | |||
| 109 | foreach($data as $sipid=>$sdata) | ||
| 110 | { | ||
| 111 | $prets= isset($sdata[1]) ? $sdata[1] : (strtotime($aline->startdate . " " . $aline->starttime)+19600)*1000; | ||
| 112 | if(isset($sdata['states'])) | ||
| 113 | { | ||
| 114 | $previous="login"; | ||
| 115 | foreach($sdata['states'] as $fts=>$states) | ||
| 116 | { | ||
| 117 | if($states[0] != 1) | ||
| 118 | { | ||
| 119 | $rowdata[$previous] +=round(($fts-$prets)/1000,2); | ||
| 120 | |||
| 121 | $previous = (trim($states[1]) != '') ? strtolower($states[0]."-".$states[1]) : strtolower($states[0]); | ||
| 122 | $prets=$fts; | ||
| 123 | } | ||
| 124 | |||
| 125 | } | ||
| 126 | $rowdata[$previous] += round(($sdata['ts']-$prets)/1000,2); | ||
| 127 | } | ||
| 128 | } | ||
| 129 | $rowdata["login"] = $aline->durationsec; | ||
| 130 | |||
| 131 | $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']; | ||
| 132 | |||
| 133 | |||
| 134 | $key_value = ''; | ||
| 135 | foreach($rowdata AS $key=>$value) { | ||
| 136 | if($key != 1) | ||
| 137 | $key_value .= "`$key` = '$value', "; | ||
| 138 | } | ||
| 139 | |||
| 140 | $startTime=$aline->startdate." ".$aline->starttime; | ||
| 141 | $endTime=$aline->enddate." ".$aline->endtime; | ||
| 142 | |||
| 143 | $crmCalls=DB::connection("conn")->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."'")); | ||
| 144 | |||
| 145 | $ts_Wait=0;$ts_Call=0;$ts_Talk=0;$ts_Dispo=0; | ||
| 146 | $progTs_Wait=0;$progTs_Call=0;$progTs_Talk=0;$progTs_Dispo=0; | ||
| 147 | $manTs_Wait=0;$manTs_Call=0;$manTs_Talk=0;$manTs_Dispo=0; | ||
| 148 | $inbTs_Wait=0;$inbTs_Call=0;$inbTs_Talk=0;$inbTs_Dispo=0; | ||
| 149 | $tt_prog=0;$tt_man=0;$tt_inb=0; | ||
| 150 | |||
| 151 | if($crmCalls!=null){ | ||
| 152 | foreach($crmCalls as $crmCall){ | ||
| 153 | $ts_Wait += round(($crmCall->ts_Call - $crmCall->ts_Wait)/1000,2); | ||
| 154 | $ts_Call += round(($crmCall->ts_Talk - $crmCall->ts_Call)/1000,2); | ||
| 155 | $ts_Talk += round(($crmCall->ts_Dispo - $crmCall->ts_Talk)/1000,2); | ||
| 156 | $ts_Dispo += round(($crmCall->ts_Close - $crmCall->ts_Dispo)/1000,2); | ||
| 157 | |||
| 158 | if($crmCall->type == 'Progressive') | ||
| 159 | { | ||
| 160 | $progTs_Wait += round(($crmCall->ts_Call - $crmCall->ts_Wait)/1000,2); | ||
| 161 | $progTs_Call += round(($crmCall->ts_Talk - $crmCall->ts_Call)/1000,2); | ||
| 162 | $progTs_Talk += round(($crmCall->ts_Dispo - $crmCall->ts_Talk)/1000,2); | ||
| 163 | $progTs_Dispo += round(($crmCall->ts_Close - $crmCall->ts_Dispo)/1000,2); | ||
| 164 | } | ||
| 165 | |||
| 166 | if($crmCall->type == 'Manual') | ||
| 167 | { | ||
| 168 | $manTs_Wait += round(($crmCall->ts_Call - $crmCall->ts_Wait)/1000,2); | ||
| 169 | $manTs_Call += round(($crmCall->ts_Talk - $crmCall->ts_Call)/1000,2); | ||
| 170 | $manTs_Talk += round(($crmCall->ts_Dispo - $crmCall->ts_Talk)/1000,2); | ||
| 171 | $manTs_Dispo += round(($crmCall->ts_Close - $crmCall->ts_Dispo)/1000,2); | ||
| 172 | } | ||
| 173 | |||
| 174 | if($crmCall->type == 'Inbound') | ||
| 175 | { | ||
| 176 | $inbTs_Wait += round(($crmCall->ts_Call - $crmCall->ts_Wait)/1000,2); | ||
| 177 | $inbTs_Call += round(($crmCall->ts_Talk - $crmCall->ts_Call)/1000,2); | ||
| 178 | $inbTs_Talk += round(($crmCall->ts_Dispo - $crmCall->ts_Talk)/1000,2); | ||
| 179 | $inbTs_Dispo += round(($crmCall->ts_Close - $crmCall->ts_Dispo)/1000,2); | ||
| 180 | } | ||
| 181 | } | ||
| 182 | } | ||
| 183 | $tt_prog = $progTs_Wait + $progTs_Call + $progTs_Talk + $progTs_Dispo; | ||
| 184 | $tt_man = $manTs_Wait + $manTs_Call + $manTs_Talk + $manTs_Dispo; | ||
| 185 | $tt_inb = $inbTs_Wait + $inbTs_Call + $inbTs_Talk + $inbTs_Dispo; | ||
| 186 | $prod_TOS = $ts_Wait + $ts_Call + $ts_Talk + $ts_Dispo; | ||
| 187 | |||
| 188 | $key_value .= "`tt_prog` = '$tt_prog', "; | ||
| 189 | $key_value .= "`tt_man` = '$tt_man', "; | ||
| 190 | $key_value .= "`tt_inb` = '$tt_inb', "; | ||
| 191 | $key_value .= "`ts_Wait` = '$ts_Wait', "; | ||
| 192 | $key_value .= "`ts_Call` = '$ts_Call', "; | ||
| 193 | $key_value .= "`ts_Talk` = '$ts_Talk', "; | ||
| 194 | $key_value .= "`ts_Dispo` = '$ts_Dispo', "; | ||
| 195 | $key_value .= "`progts_Wait` = '$progTs_Wait', "; | ||
| 196 | $key_value .= "`progts_Call` = '$progTs_Call', "; | ||
| 197 | $key_value .= "`progts_Talk` = '$progTs_Talk', "; | ||
| 198 | $key_value .= "`progts_Dispo` = '$progTs_Dispo', "; | ||
| 199 | $key_value .= "`mants_Wait` = '$manTs_Wait', "; | ||
| 200 | $key_value .= "`mants_Call` = '$manTs_Call', "; | ||
| 201 | $key_value .= "`mants_Talk` = '$manTs_Talk', "; | ||
| 202 | $key_value .= "`mants_Dispo` = '$manTs_Dispo', "; | ||
| 203 | $key_value .= "`incts_Wait` = '$inbTs_Wait', "; | ||
| 204 | $key_value .= "`incts_Call` = '$inbTs_Call', "; | ||
| 205 | $key_value .= "`incts_Talk` = '$inbTs_Talk', "; | ||
| 206 | $key_value .= "`incts_Dispo` = '$inbTs_Dispo', "; | ||
| 207 | $key_value .= "`prod_tos` = '$prod_TOS', "; | ||
| 208 | |||
| 209 | $key_value = substr($key_value, 0, -2); | ||
| 210 | $userlogsTable = "userlogs_".date("d_m_Y",$logdate); | ||
| 211 | DB::insert(DB::raw("INSERT INTO ".$userlogsTable." SET $key_value")); | ||
| 212 | //DB::insert(DB::raw("INSERT INTO userlogs_050218 SET $key_value")); | ||
| 213 | } | ||
| 214 | DB::connection("conn")->disconnect(); | ||
| 215 | }else{ | ||
| 216 | DB::connection("conn")->disconnect(); | ||
| 217 | } | ||
| 218 | |||
| 219 | } | ||
| 220 | } | ||
| 221 | } | ||
| 222 | } | ||
| 223 | } |
| ... | @@ -155,7 +155,10 @@ class DialerController extends Controller { | ... | @@ -155,7 +155,10 @@ class DialerController extends Controller { |
| 155 | $users=array();$searchresult=""; | 155 | $users=array();$searchresult=""; |
| 156 | if(!empty($kstychCall["previewcrmid"]))$users=$wakka->getPersons("id='".$kstychCall["previewcrmid"]."' $roclientstr limit 1"); | 156 | if(!empty($kstychCall["previewcrmid"]))$users=$wakka->getPersons("id='".$kstychCall["previewcrmid"]."' $roclientstr limit 1"); |
| 157 | else $users=$this->getCallSequencing(1); | 157 | else $users=$this->getCallSequencing(1); |
| 158 | 158 | if(Auth::user()->username=='R14306'){ | |
| 159 | Log::useFiles(storage_path().'/logs/recordid_log_'.date("Y-m-d").'.log'); | ||
| 160 | Log::info($kstychCall["previewcrmid"]."~".$users[0]['clientinternalid']."~".$users[0]['mobile']."~".$users[0]['id']); | ||
| 161 | } | ||
| 159 | if(!empty($users)) | 162 | if(!empty($users)) |
| 160 | { | 163 | { |
| 161 | $searchresult.="<div id=divworking></div><div style='clear:both'></div><script>kSetDData('C','previewcrmid','".$users[0]['id']."');showRecruit(\"".$users[0]['id']."\");</script>"; | 164 | $searchresult.="<div id=divworking></div><div style='clear:both'></div><script>kSetDData('C','previewcrmid','".$users[0]['id']."');showRecruit(\"".$users[0]['id']."\");</script>"; |
| ... | @@ -186,13 +189,13 @@ class DialerController extends Controller { | ... | @@ -186,13 +189,13 @@ class DialerController extends Controller { |
| 186 | 189 | ||
| 187 | $users=array();$callnumber=$kstychCall['callnumber']; | 190 | $users=array();$callnumber=$kstychCall['callnumber']; |
| 188 | 191 | ||
| 189 | $callnumber = trim($callnumber); | 192 | //$callnumber = trim($callnumber); |
| 190 | 193 | ||
| 191 | if($kstychDialer['mDialerState']=="Manual"){ | 194 | /*if($kstychDialer['mDialerState']=="Manual"){ |
| 192 | if((!preg_match('/^[0-9]*$/',$callnumber)) || strlen($callnumber)<6){ | 195 | if((!preg_match('/^[0-9]*$/',$callnumber)) || strlen($callnumber)<6){ |
| 193 | return Response::make("<script>simpleNotification('error','topRight','Please enter a valid phone number');</script>"); | 196 | return Response::make("<script>simpleNotification('error','topRight','Please enter a valid phone number');</script>"); |
| 194 | } | 197 | } |
| 195 | } | 198 | }*/ |
| 196 | 199 | ||
| 197 | if($kstychCall['crmid']) | 200 | if($kstychCall['crmid']) |
| 198 | { | 201 | { |
| ... | @@ -205,13 +208,14 @@ class DialerController extends Controller { | ... | @@ -205,13 +208,14 @@ class DialerController extends Controller { |
| 205 | } | 208 | } |
| 206 | if($kstychDialer['mDialerState']=="Manual") | 209 | if($kstychDialer['mDialerState']=="Manual") |
| 207 | { | 210 | { |
| 208 | $callnumber=trim($callnumber); | 211 | /* $callnumber=trim($callnumber); |
| 209 | if(!preg_match('/^[1-9][0-9]*$/',$callnumber)){ | 212 | if(!preg_match('/^[1-9][0-9]*$/',$callnumber)){ |
| 210 | return Response::make("<script>simpleNotification('error','topRight','Only Digits are allowed');</script>"); | 213 | return Response::make("<script>simpleNotification('error','topRight','Only Digits are allowed');</script>"); |
| 211 | } | 214 | } |
| 212 | if(strlen($callnumber)<6){ | 215 | if(strlen($callnumber)<6){ |
| 213 | return Response::make("<script>simpleNotification('error','topRight','Enter a valid Number');</script>"); | 216 | return Response::make("<script>simpleNotification('error','topRight','Enter a valid Number');</script>"); |
| 214 | } | 217 | } |
| 218 | */ | ||
| 215 | if($crmid!="") | 219 | if($crmid!="") |
| 216 | { | 220 | { |
| 217 | $tusers=$wakka->getPersonIDs("(mobile like '%".substr($callnumber,-10)."' OR | 221 | $tusers=$wakka->getPersonIDs("(mobile like '%".substr($callnumber,-10)."' OR |
| ... | @@ -770,6 +774,7 @@ if($action=="closecall") | ... | @@ -770,6 +774,7 @@ if($action=="closecall") |
| 770 | 774 | ||
| 771 | 775 | ||
| 772 | $user=$wakka->getPerson($crmcall->crm_id); | 776 | $user=$wakka->getPerson($crmcall->crm_id); |
| 777 | $kstychCall["clientcode"]=$user['peopledata']['clientcode']; | ||
| 773 | if($user['peopledata']['id']==$crmcall->crm_id) | 778 | if($user['peopledata']['id']==$crmcall->crm_id) |
| 774 | { | 779 | { |
| 775 | $user['peopledata']["dialer_status"]=$kstychCall["userstatus"]; | 780 | $user['peopledata']["dialer_status"]=$kstychCall["userstatus"]; |
| ... | @@ -835,14 +840,14 @@ if($action=="closecall") | ... | @@ -835,14 +840,14 @@ if($action=="closecall") |
| 835 | $userlog=UserLog::where('user_id','=',Auth::user()->id)->orderBy("id","DESC")->first(); | 840 | $userlog=UserLog::where('user_id','=',Auth::user()->id)->orderBy("id","DESC")->first(); |
| 836 | $userlog->getLastTs($crmcall->sipid_id,$nowts); | 841 | $userlog->getLastTs($crmcall->sipid_id,$nowts); |
| 837 | $userlog->save(); | 842 | $userlog->save(); |
| 838 | if(Auth::user()->username=='S32732' && $kstychCall['callnumber']=='9324046534'){ | 843 | //if(Auth::user()->username=='A21568' || Auth::user()->username=='admin'){ |
| 839 | try{ | 844 | try{ |
| 840 | $smscontroller = new SmsController(); | 845 | $smscontroller = new SmsController(); |
| 841 | $smscontroller->sendSmsBasedOnSubDisposition($kstychCall); | 846 | $smscontroller->sendSmsBasedOnSubDisposition($kstychCall); |
| 842 | } catch(Exception $e) { | 847 | } catch(Exception $e) { |
| 843 | Log::info($e->getMessage()); | 848 | Log::info($e->getMessage()); |
| 844 | } | 849 | } |
| 845 | } | 850 | //} |
| 846 | } | 851 | } |
| 847 | 852 | ||
| 848 | return Response::make(""); | 853 | return Response::make(""); |
| ... | @@ -1146,6 +1151,11 @@ public function show($id) | ... | @@ -1146,6 +1151,11 @@ public function show($id) |
| 1146 | 1151 | ||
| 1147 | foreach($mc as $key=>$tcall){ | 1152 | foreach($mc as $key=>$tcall){ |
| 1148 | //Log::info($tcall); | 1153 | //Log::info($tcall); |
| 1154 | include_once( app_path() . '/Hacks/DisabledDIDs.php'); | ||
| 1155 | if( in_array(substr($tcall->number,-10),$DisableNumbersArray) ){ | ||
| 1156 | //Log::info("Disabled Number".$tcall->number); | ||
| 1157 | continue; | ||
| 1158 | } | ||
| 1149 | $tccal=substr($tcall->number,-10); | 1159 | $tccal=substr($tcall->number,-10); |
| 1150 | $mc_number=CRMCall::where('userstatus','!=','InboundDROP')->where ('created_at','>',$tcall->created_at)->where('number','like',"%".$tccal."%")->orderBy("id","DESC")->first(); | 1160 | $mc_number=CRMCall::where('userstatus','!=','InboundDROP')->where ('created_at','>',$tcall->created_at)->where('number','like',"%".$tccal."%")->orderBy("id","DESC")->first(); |
| 1151 | 1161 | ||
| ... | @@ -1782,7 +1792,7 @@ public function show($id) | ... | @@ -1782,7 +1792,7 @@ public function show($id) |
| 1782 | if($limit>0) | 1792 | if($limit>0) |
| 1783 | { | 1793 | { |
| 1784 | $tusers = array_filter($clientDetails, function($var){ | 1794 | $tusers = array_filter($clientDetails, function($var){ |
| 1785 | return ($var['status']=='Called'&&$var['dialer_status']=='Not Contacted'); | 1795 | return ($var['status']=='Called'&&($var['dialer_substatus']=='NC - Customer in Meeting' || $var['dialer_substatus']=='NC - Ringing / No response' || $var['dialer_substatus']=='NC - Not Reachable' || $var['dialer_substatus']=='NC - Switched off' || $var['dialer_substatus']=='NC - Third Party')); |
| 1786 | //return ($var['status']=='Called'&&$var['dialer_status']=='Not Contacted'); | 1796 | //return ($var['status']=='Called'&&$var['dialer_status']=='Not Contacted'); |
| 1787 | }); | 1797 | }); |
| 1788 | 1798 | ||
| ... | @@ -1800,7 +1810,7 @@ public function show($id) | ... | @@ -1800,7 +1810,7 @@ public function show($id) |
| 1800 | $limit=$limit-sizeof($tusers); | 1810 | $limit=$limit-sizeof($tusers); |
| 1801 | } | 1811 | } |
| 1802 | 1812 | ||
| 1803 | if($limit>0) | 1813 | /*if($limit>0) |
| 1804 | { | 1814 | { |
| 1805 | $tusers = array_filter($clientDetails, function($var){ | 1815 | $tusers = array_filter($clientDetails, function($var){ |
| 1806 | return ($var['status']=='Called'&&$var['dialer_status']=='Contacted - Follow-Up - Generic'); | 1816 | return ($var['status']=='Called'&&$var['dialer_status']=='Contacted - Follow-Up - Generic'); |
| ... | @@ -1817,7 +1827,7 @@ public function show($id) | ... | @@ -1817,7 +1827,7 @@ public function show($id) |
| 1817 | } | 1827 | } |
| 1818 | 1828 | ||
| 1819 | $limit=$limit-sizeof($tusers); | 1829 | $limit=$limit-sizeof($tusers); |
| 1820 | } | 1830 | }*/ |
| 1821 | 1831 | ||
| 1822 | if($limit>0) | 1832 | if($limit>0) |
| 1823 | { | 1833 | { | ... | ... |
| 1 | <?php | ||
| 2 | |||
| 3 | namespace App\Http\Controllers; | ||
| 4 | |||
| 5 | |||
| 6 | use Auth; | ||
| 7 | use Input; | ||
| 8 | use Response; | ||
| 9 | use Config; | ||
| 10 | use App\Models\OutputReport; | ||
| 11 | use App\Models\OutputProduct; | ||
| 12 | use App\Models\CRMCall; | ||
| 13 | use App\Models\User; | ||
| 14 | use Illuminate\Http\Request; | ||
| 15 | use Illuminate\Support\Facades\DB; | ||
| 16 | |||
| 17 | use App\Http\Requests; | ||
| 18 | |||
| 19 | class OutputReportController extends Controller | ||
| 20 | { | ||
| 21 | /** | ||
| 22 | * Display a listing of the resource. | ||
| 23 | * | ||
| 24 | * @return \Illuminate\Http\Response | ||
| 25 | */ | ||
| 26 | public function index() | ||
| 27 | { | ||
| 28 | |||
| 29 | } | ||
| 30 | |||
| 31 | /** | ||
| 32 | * Show the form for creating a new resource. | ||
| 33 | * | ||
| 34 | * @return \Illuminate\Http\Response | ||
| 35 | */ | ||
| 36 | public function createOutputReport() | ||
| 37 | { | ||
| 38 | |||
| 39 | } | ||
| 40 | |||
| 41 | /** | ||
| 42 | * Store a newly created resource in storage. | ||
| 43 | * | ||
| 44 | * @param \Illuminate\Http\Request $request | ||
| 45 | * @return \Illuminate\Http\Response | ||
| 46 | */ | ||
| 47 | public function store(Request $request) | ||
| 48 | { | ||
| 49 | $action=Input::get('action'); | ||
| 50 | //echo $action; | ||
| 51 | if($action=="createOutputReport"){ | ||
| 52 | |||
| 53 | $products = $request->input('products'); | ||
| 54 | //print_r($products); | ||
| 55 | //$totalIncome = 0; | ||
| 56 | foreach ($products as $key => $value) { | ||
| 57 | |||
| 58 | $outputReport = OutputReport::firstOrCreate( | ||
| 59 | array( | ||
| 60 | 'product_id' => $value['productId'], | ||
| 61 | 'user_id' => Auth::user()->id | ||
| 62 | ) | ||
| 63 | ); | ||
| 64 | //$outputReport->user_id = Auth::user()->id; | ||
| 65 | $outputReport->user_name = Auth::user()->username; | ||
| 66 | $outputReport->date = date("Y-m-d"); | ||
| 67 | $outputReport->call_attempts = $request->input('noOfAttempts'); | ||
| 68 | $outputReport->call_contacts = $request->input('noOfContacts'); | ||
| 69 | $outputReport->call_unique_contacts = $request->input('uniqueContacts'); | ||
| 70 | // $totalIncome = $totalIncome + ($value['lc'] * $value['lcAmt']); | ||
| 71 | |||
| 72 | if($value['lc'] != '' && $value['lcAmt'] != ''){ | ||
| 73 | $outputReport->income = $value['lc'] * $value['lcAmt']; | ||
| 74 | } | ||
| 75 | $outputReport->product_name = $value['product']; | ||
| 76 | $outputReport->lead_generated = $value['lg']; | ||
| 77 | $outputReport->lead_generated_amount = $value['lgAmt']; | ||
| 78 | $outputReport->lead_closed = $value['lc']; | ||
| 79 | $outputReport->lead_closed_amount = $value['lcAmt']; | ||
| 80 | $outputReport->created_at = date('Y-m-d H:i:s'); | ||
| 81 | $outputReport->updated_at =date('Y-m-d H:i:s'); | ||
| 82 | $outputReport->save(); | ||
| 83 | |||
| 84 | |||
| 85 | } | ||
| 86 | } | ||
| 87 | } | ||
| 88 | |||
| 89 | /** | ||
| 90 | * Display the specified resource. | ||
| 91 | * | ||
| 92 | * @param int $id | ||
| 93 | * @return \Illuminate\Http\Response | ||
| 94 | */ | ||
| 95 | public function show($id) | ||
| 96 | { | ||
| 97 | if($id=="reportdata") | ||
| 98 | { | ||
| 99 | //echo $id; | ||
| 100 | $data = array(); | ||
| 101 | $disabled = ""; | ||
| 102 | $dashboarduser=Auth::user(); | ||
| 103 | |||
| 104 | if($dashboarduser->usertype == "Supervisor"){ | ||
| 105 | $disabled = "disabled"; | ||
| 106 | } | ||
| 107 | //if($dashboarduser->usertype == "User"){ | ||
| 108 | // output reports | ||
| 109 | $products = DB::table('output_products') | ||
| 110 | ->select('id as productId','name','status') | ||
| 111 | ->where('status', '1') | ||
| 112 | ->orderBy('output_products.id') | ||
| 113 | ->get(); | ||
| 114 | $report = DB::table('output_report') | ||
| 115 | ->where('user_id',Auth::user()->id) | ||
| 116 | ->where('date',DATE("Y-m-d",time())) | ||
| 117 | ->get(); | ||
| 118 | |||
| 119 | |||
| 120 | $outputReport = array(); | ||
| 121 | foreach ($products as $pkey => $pvalue) { | ||
| 122 | |||
| 123 | $outputReport[$pvalue->productId] = array('name' => $pvalue->name, 'productId' => $pvalue->productId); | ||
| 124 | |||
| 125 | foreach ($report as $key => $value) { | ||
| 126 | |||
| 127 | if($value->product_id == $pvalue->productId){ | ||
| 128 | $outputReport[$value->product_id]['lead_generated'] = $value->lead_generated; | ||
| 129 | $outputReport[$value->product_id]['lead_generated_amount'] = $value->lead_generated_amount; | ||
| 130 | $outputReport[$value->product_id]['lead_closed'] = $value->lead_closed; | ||
| 131 | $outputReport[$value->product_id]['lead_closed_amount'] = $value->lead_closed_amount; | ||
| 132 | |||
| 133 | } | ||
| 134 | } | ||
| 135 | |||
| 136 | } | ||
| 137 | |||
| 138 | // total income | ||
| 139 | $totalIncome = DB::select("select sum(income) as income from output_report where user_id=".Auth::user()->id." and date='".date('Y-m-d',time())."'"); | ||
| 140 | |||
| 141 | // noOfAttempts | ||
| 142 | $noOfAttempts = CRMCall::where('userstatus','!=','InboundDROP')->where('created_at','>',date('Y-m-d',time())); | ||
| 143 | |||
| 144 | $noOfContacts = CRMCall::whereIn('usersubstatus',["Contacted","Feedback"])->where('created_at','>',date('Y-m-d',time())); | ||
| 145 | |||
| 146 | $uniqueContacts = DB::table('crmcalls')->select(DB::raw('count(distinct(number)) as total'))->whereIn('usersubstatus',["Contacted","Feedback"])->where('created_at','>',date('Y-m-d',time())); | ||
| 147 | //print_r($uniqueContacts); | ||
| 148 | $noOfAttempts = $noOfAttempts->where('user_id','=',$dashboarduser->id)->count(); | ||
| 149 | $noOfContacts = $noOfContacts->where('user_id','=',$dashboarduser->id)->count(); | ||
| 150 | $uniqueContacts =$uniqueContacts->where('user_id','=',$dashboarduser->id)->get(); | ||
| 151 | $data['disabled'] = $disabled; | ||
| 152 | $data['products'] = $outputReport; | ||
| 153 | $data['totalIncome'] = $totalIncome[0]->income; | ||
| 154 | $data['noOfAttempts'] = $noOfAttempts; | ||
| 155 | $data['noOfContacts'] = $noOfContacts; | ||
| 156 | $data['uniqueContacts'] = $uniqueContacts[0]->total; | ||
| 157 | |||
| 158 | return view("layout.module.outputreport.outputreport", $data); | ||
| 159 | // } | ||
| 160 | } | ||
| 161 | if($id == "supervisordata"){ | ||
| 162 | $users=Input::get("user"); | ||
| 163 | |||
| 164 | if($users == ""){ | ||
| 165 | $users = "ALL"; | ||
| 166 | } | ||
| 167 | $supervisor = User::where('supervisor','=',Auth::user()->username)->get(); | ||
| 168 | //if dropdown value is All then use the below foreach othewise just put the user_id in array based on dropdown | ||
| 169 | $usersarray= array(); | ||
| 170 | if($users=="ALL"){ | ||
| 171 | foreach($supervisor as $usersval){ | ||
| 172 | $usersarray[] = $usersval->id; | ||
| 173 | } | ||
| 174 | } else{ | ||
| 175 | $usersarray[] = $users; | ||
| 176 | } | ||
| 177 | $totalIncome = DB::select("select sum(income) as income from output_report where user_id IN (".implode(',',$usersarray).")"); | ||
| 178 | $Contacts = DB::select("Select Count(user_id), Sum(call_attempts) as call_attempts, | ||
| 179 | Sum(call_contacts) as call_contacts, | ||
| 180 | Sum(call_unique_contacts) as call_unique_contacts | ||
| 181 | From (Select Distinct user_id, call_attempts, call_contacts, call_unique_contacts From output_report) a | ||
| 182 | where user_id in (".implode(',',$usersarray).") | ||
| 183 | "); | ||
| 184 | $report = DB::select("SELECT product_id,product_name, SUM(lead_generated) as totallead, SUM(lead_generated_amount) as totalleadamt, SUM(lead_closed) as totalleadclosed, Sum(lead_closed_amount) as leadcloseamt FROM `output_report` where user_id in (".implode(',',$usersarray).") group by product_id"); | ||
| 185 | //print_r($report); | ||
| 186 | $data['supervisor'] = $supervisor; | ||
| 187 | $data['Contacts'] = $Contacts[0]; | ||
| 188 | $data['totalIncome'] = $totalIncome[0]->income; | ||
| 189 | $data['report'] = $report; | ||
| 190 | $data['users'] = $users; | ||
| 191 | |||
| 192 | return view("layout.module.outputreport.supervisorreport", $data); | ||
| 193 | |||
| 194 | } | ||
| 195 | |||
| 196 | return view("layout.module.outputreport.$id",array()); | ||
| 197 | |||
| 198 | } | ||
| 199 | |||
| 200 | /** | ||
| 201 | * Show the form for editing the specified resource. | ||
| 202 | * | ||
| 203 | * @param int $id | ||
| 204 | * @return \Illuminate\Http\Response | ||
| 205 | */ | ||
| 206 | public function edit($id) | ||
| 207 | { | ||
| 208 | // | ||
| 209 | } | ||
| 210 | |||
| 211 | /** | ||
| 212 | * Update the specified resource in storage. | ||
| 213 | * | ||
| 214 | * @param \Illuminate\Http\Request $request | ||
| 215 | * @param int $id | ||
| 216 | * @return \Illuminate\Http\Response | ||
| 217 | */ | ||
| 218 | public function update(Request $request, $id) | ||
| 219 | { | ||
| 220 | // | ||
| 221 | } | ||
| 222 | |||
| 223 | /** | ||
| 224 | * Remove the specified resource from storage. | ||
| 225 | * | ||
| 226 | * @param int $id | ||
| 227 | * @return \Illuminate\Http\Response | ||
| 228 | */ | ||
| 229 | public function destroy($id) | ||
| 230 | { | ||
| 231 | // | ||
| 232 | } | ||
| 233 | } |
| ... | @@ -9,26 +9,21 @@ class SmsController extends Controller | ... | @@ -9,26 +9,21 @@ class SmsController extends Controller |
| 9 | { | 9 | { |
| 10 | public $smsUrl = 'https://10.2.55.165:443/servlet/com.aclwireless.pushconnectivity.listeners.TextListener?'; | 10 | public $smsUrl = 'https://10.2.55.165:443/servlet/com.aclwireless.pushconnectivity.listeners.TextListener?'; |
| 11 | //public $userarray = array("A21568","admin"); | 11 | //public $userarray = array("A21568","admin"); |
| 12 | public function sendSmsBasedOnSubDisposition($kstychCall) | 12 | public function sendSmsBasedOnSubDisposition($kstychCall) |
| 13 | { | 13 | { |
| 14 | //public $userarray = array("A21568","admin"); | 14 | $msgText = $this->getSmsTemplate($kstychCall); |
| 15 | //$users = $this->userarray; | 15 | if( !empty($msgText) ) { |
| 16 | //Log::info(Auth::user()->username." ^ ".$users[0]); | 16 | $msgText = $this->fillValuesInTemplate($msgText); |
| 17 | //Log::info(in_array(Auth::user()->username , $users)); | ||
| 18 | //if(in_array(Auth::user()->username , $users)){ | ||
| 19 | $msgText = $this->getSmsTemplate($kstychCall); | ||
| 20 | if( !empty($msgText) ) { | ||
| 21 | $msgText = $this->fillValuesInTemplate($msgText); | ||
| 22 | //Log::info($msgText); | 17 | //Log::info($msgText); |
| 23 | $this->sendSmsRequest($kstychCall, $msgText); | 18 | $this->sendSmsRequest($kstychCall, $msgText); |
| 24 | } | 19 | } |
| 25 | //} | 20 | //} |
| 26 | return; | 21 | return; |
| 27 | } | 22 | } |
| 28 | public function sendSmsRequest($kstychCall, $msgText) | 23 | public function sendSmsRequest($kstychCall, $msgText) |
| 29 | { | 24 | { |
| 25 | //$wakka = new KHRMSLib(); | ||
| 30 | $url = $this->smsUrl; | 26 | $url = $this->smsUrl; |
| 31 | //Log::info($kstychCall['callnumber']); | ||
| 32 | $inputArray = [ | 27 | $inputArray = [ |
| 33 | 'userId'=>'hdfcbalrt', | 28 | 'userId'=>'hdfcbalrt', |
| 34 | "pass"=>'hdfcbalrt25', | 29 | "pass"=>'hdfcbalrt25', |
| ... | @@ -49,16 +44,21 @@ class SmsController extends Controller | ... | @@ -49,16 +44,21 @@ class SmsController extends Controller |
| 49 | $ch = curl_init(); | 44 | $ch = curl_init(); |
| 50 | curl_setopt($ch, CURLOPT_URL, $url); | 45 | curl_setopt($ch, CURLOPT_URL, $url); |
| 51 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); | 46 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); |
| 52 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | 47 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
| 48 | curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,3); | ||
| 53 | $response = curl_exec($ch); | 49 | $response = curl_exec($ch); |
| 54 | $number=$kstychCall['callnumber']; | 50 | $number=$kstychCall['callnumber']; |
| 55 | $callid=intval($kstychCall['callid'])+0; | 51 | $callid=intval($kstychCall['callid'])+0; |
| 56 | $serverip=env(app_ip); | 52 | $crmcall=CRMCall::find($callid); |
| 57 | $rmname=Auth::user()->fullname; | 53 | $serverip=env(app_ip); |
| 58 | $subdispo=$kstychCall["usersubstatus"]; | 54 | $agentid=Auth::user()->id; |
| 59 | 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'")); | 55 | $agentname=Auth::user()->fullname; |
| 60 | Log::useFiles(storage_path().'/logs/SMS_Messages_'.date("Y-m-d").'.log'); | 56 | $subdispo=$kstychCall["usersubstatus"]; |
| 61 | Log::info('|'.env(app_ip).'|'.date('Y-m-d H:i:s', strtotime('+5 hours 30 minutes')).'|'.Auth::user()->fullname.'|'.$kstychCall['callnumber'].'|"'.$msgText.'"|'.$response.'|'); | 57 | $clientcode=$kstychCall["clientcode"]; |
| 58 | |||
| 59 | DB::insert(DB::raw("insert into sms_log set server_ip='$serverip',call_id='$callid',call_date='$crmcall->created_at',agent_name='$agentname',agent_id='$agentid',subdispo='$subdispo',number='$number',message='$msgText',response='$response',clientcode='$clientcode'")); | ||
| 60 | Log::useFiles(storage_path().'/logs/SMS_Messages'.date("Y-m-d").'.log'); | ||
| 61 | Log::info("|".date('Y-m-d H:i:s', strtotime('+5 hours 30 minutes'))."|".Auth::user()->fullname."|".$kstychCall['callnumber']."|".$msgText."|".$response); | ||
| 62 | //Log::info($response); | 62 | //Log::info($response); |
| 63 | curl_close($ch); | 63 | curl_close($ch); |
| 64 | } catch(Exception $e) { | 64 | } catch(Exception $e) { | ... | ... |
| ... | @@ -51,6 +51,8 @@ Route::group(['middleware' => ['web']], function () { | ... | @@ -51,6 +51,8 @@ Route::group(['middleware' => ['web']], function () { |
| 51 | Route::resource('hr','HRController'); | 51 | Route::resource('hr','HRController'); |
| 52 | Route::resource('social','SocialController'); | 52 | Route::resource('social','SocialController'); |
| 53 | Route::resource('web','WebController'); | 53 | Route::resource('web','WebController'); |
| 54 | Route::resource('virtualchannel','VirtualController'); | ||
| 55 | Route::resource('outputreport','OutputReportController'); | ||
| 54 | 56 | ||
| 55 | Route::get('notes', array('uses' => 'NotesController@loadQuestions', 'as'=>'questionare.load_questions')); | 57 | Route::get('notes', array('uses' => 'NotesController@loadQuestions', 'as'=>'questionare.load_questions')); |
| 56 | Route::post('notes',array('uses' => 'NotesController@store', 'as'=>'notes.store')); | 58 | Route::post('notes',array('uses' => 'NotesController@store', 'as'=>'notes.store')); | ... | ... |
| ... | @@ -313,6 +313,11 @@ class KPAMIListen implements IEventListener | ... | @@ -313,6 +313,11 @@ class KPAMIListen implements IEventListener |
| 313 | 313 | ||
| 314 | $crmcall->data=json_encode($tdata); | 314 | $crmcall->data=json_encode($tdata); |
| 315 | $crmcall->save(); | 315 | $crmcall->save(); |
| 316 | $DisableNumbersArray = array(); | ||
| 317 | include( app_path() . '/Hacks/DisabledDIDs.php'); | ||
| 318 | if( in_array(substr($crmcall->number,-10),$DisableNumbersArray) ){ | ||
| 319 | Log::info("Disabled Number".$crmcall->number); }else{ | ||
| 320 | $newqueue=new Kqueue(); | ||
| 316 | 321 | ||
| 317 | // $userStatus=User::where("updated_at",">",date("Y-m-d"))->where("exten","like","%".substr($exten,-4)."%")->where("usertype","!=","Admin")->where('presence', '=', '1')->select('*')->get(); | 322 | // $userStatus=User::where("updated_at",">",date("Y-m-d"))->where("exten","like","%".substr($exten,-4)."%")->where("usertype","!=","Admin")->where('presence', '=', '1')->select('*')->get(); |
| 318 | 323 | ||
| ... | @@ -346,8 +351,6 @@ class KPAMIListen implements IEventListener | ... | @@ -346,8 +351,6 @@ class KPAMIListen implements IEventListener |
| 346 | } | 351 | } |
| 347 | } | 352 | } |
| 348 | } | 353 | } |
| 349 | |||
| 350 | |||
| 351 | function isHoliday() { | 354 | function isHoliday() { |
| 352 | return false; | 355 | return false; |
| 353 | } | 356 | } |
| ... | @@ -527,8 +530,8 @@ class KPAMIListen implements IEventListener | ... | @@ -527,8 +530,8 @@ class KPAMIListen implements IEventListener |
| 527 | 530 | ||
| 528 | $tsip=Sipid::find($crmcall->sipid_id); | 531 | $tsip=Sipid::find($crmcall->sipid_id); |
| 529 | 532 | ||
| 530 | $newqueue=new Kqueue(); | 533 | //$newqueue=new Kqueue(); |
| 531 | $newqueue->playhangupfile($dialline->channel,$dialline->server); | 534 | //$newqueue->playhangupfile($dialline->channel,$dialline->server); |
| 532 | 535 | ||
| 533 | $newqueue=new Kqueue(); | 536 | $newqueue=new Kqueue(); |
| 534 | $newqueue->sipNotify($tsip,"dialerUI","hangup","c",$crmcall->id."~".$crmcall->number."~".base64_encode($channel)); | 537 | $newqueue->sipNotify($tsip,"dialerUI","hangup","c",$crmcall->id."~".$crmcall->number."~".base64_encode($channel)); |
| ... | @@ -1399,39 +1402,48 @@ class KPAMIListen implements IEventListener | ... | @@ -1399,39 +1402,48 @@ class KPAMIListen implements IEventListener |
| 1399 | $tdata=array(); | 1402 | $tdata=array(); |
| 1400 | $tdata['uniqueid']=$uniqueid; | 1403 | $tdata['uniqueid']=$uniqueid; |
| 1401 | $tdata['inboundchannel']=$channel; | 1404 | $tdata['inboundchannel']=$channel; |
| 1402 | //Log::useFiles(storage_path().'inbound_log_'.date("Y-m-d").'.log'); | 1405 | |
| 1403 | // Log::info("inboundNumber ".$crmcall->number); | ||
| 1404 | $crmcall->data=json_encode($tdata); | 1406 | $crmcall->data=json_encode($tdata); |
| 1405 | $crmcall->save(); | 1407 | $crmcall->save(); |
| 1406 | if($crmcall->did=='46130234'){ | ||
| 1407 | // Log::useFiles(storage_path().'inbound_log_'.date("Y-m-d").'.log'); | ||
| 1408 | Log::info("inboundNumber ".$crmcall->number); | ||
| 1409 | } | ||
| 1410 | $userStatus=User::where("updated_at",">",date("Y-m-d"))->where("exten","like","%".substr($exten,-4)."%")->where("usertype","!=","Admin")->where('presence', '=', '1')->select('*')->get(); | ||
| 1411 | 1408 | ||
| 1412 | if($userStatus=="[]") | 1409 | $DisableNumbersArray = array(); |
| 1413 | { | 1410 | include( app_path() . '/Hacks/DisabledDIDs.php'); |
| 1414 | 1411 | if( in_array(substr($crmcall->number,-10),$DisableNumbersArray) ) | |
| 1415 | $newqueue=new Kqueue(); | 1412 | { |
| 1416 | $newqueue->playbusyfile($dialline->channel,$dialline->server); | 1413 | Log::info("Disabled Number".$crmcall->number); |
| 1417 | } | 1414 | } |
| 1418 | 1415 | else | |
| 1419 | $callStat=CRMCall::where("did","like","%".substr($exten,-4)."%")->where("updated_at",">",date("Y-m-d"))->whereIn('state',['DialBegin', 'DialEnd'])->get(); | 1416 | { |
| 1420 | 1417 | $newqueue=new Kqueue(); | |
| 1421 | if($callStat!="[]") | 1418 | |
| 1422 | { | 1419 | if( $this->isHoliday() ) { |
| 1423 | 1420 | // TODO: Handle Holidays here | |
| 1424 | $newqueue=new Kqueue(); | 1421 | } elseif( $this->isNonWorkingTime() ) { |
| 1425 | $newqueue->playbusyfile($dialline->channel,$dialline->server); | 1422 | $newqueue->playafterhrsfile($dialline->channel,$dialline->server); |
| 1426 | } | 1423 | } else { |
| 1427 | } | 1424 | $userStatus=User::where("updated_at",">",date("Y-m-d"))->where("exten","like","%".substr($exten,-4)."%")->where("usertype","!=","Admin")->where('presence', '=', '1')->select('*')->get(); |
| 1428 | } | 1425 | |
| 1429 | 1426 | if($userStatus=="[]") | |
| 1430 | } | 1427 | { |
| 1431 | 1428 | $newqueue->playabsencefile($dialline->channel,$dialline->server); | |
| 1429 | } | ||
| 1430 | else | ||
| 1431 | { | ||
| 1432 | $callStat=CRMCall::where("did","like","%".substr($exten,-4)."%")->where("updated_at",">",date("Y-m-d"))->whereIn('state',['DialBegin', 'DialEnd'])->get(); | ||
| 1433 | |||
| 1434 | if($callStat!="[]") | ||
| 1435 | { | ||
| 1436 | $newqueue->playbusyfile($dialline->channel,$dialline->server); | ||
| 1437 | } | ||
| 1438 | } | ||
| 1439 | } | ||
| 1440 | } | ||
| 1441 | } | ||
| 1442 | } | ||
| 1443 | } | ||
| 1432 | } | 1444 | } |
| 1433 | 1445 | ||
| 1434 | 1446 | ||
| 1435 | private function redirectIncoming() | 1447 | private function redirectIncoming() |
| 1436 | { | 1448 | { |
| 1437 | $diallines=Dialline::where('server','=',$this->sipip)->whereIn("status",["Inbound","Auto"])->where("conf","=","")->get(); | 1449 | $diallines=Dialline::where('server','=',$this->sipip)->whereIn("status",["Inbound","Auto"])->where("conf","=","")->get(); |
| ... | @@ -1462,7 +1474,7 @@ if($crmcall->did=='46130234'){ | ... | @@ -1462,7 +1474,7 @@ if($crmcall->did=='46130234'){ |
| 1462 | $users=$wakka->searchPhone("mobile",$crmcall->number); | 1474 | $users=$wakka->searchPhone("mobile",$crmcall->number); |
| 1463 | if(!empty($users)) | 1475 | if(!empty($users)) |
| 1464 | { | 1476 | { |
| 1465 | $ppldata=unserialize($users[0]['peopledata']); | 1477 | $ppldata=unserialize($users[0]['peopledata']); |
| 1466 | $crmcall->crm_id=$users[0]['id']; | 1478 | $crmcall->crm_id=$users[0]['id']; |
| 1467 | $crmcall->number=$users[0]['mobile']; | 1479 | $crmcall->number=$users[0]['mobile']; |
| 1468 | $crmcall->client=($ppldata['client']?$ppldata['client']:""); | 1480 | $crmcall->client=($ppldata['client']?$ppldata['client']:""); |
| ... | @@ -1778,4 +1790,4 @@ class KPAMIChannelAudio extends ActionMessage | ... | @@ -1778,4 +1790,4 @@ class KPAMIChannelAudio extends ActionMessage |
| 1778 | $this->setKey('Direction', $direction); | 1790 | $this->setKey('Direction', $direction); |
| 1779 | $this->setKey('State', $state); | 1791 | $this->setKey('State', $state); |
| 1780 | } | 1792 | } |
| 1781 | } | 1793 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -304,11 +304,11 @@ class Kqueue extends Model{ | ... | @@ -304,11 +304,11 @@ class Kqueue extends Model{ |
| 304 | $this->data=json_encode($odata); | 304 | $this->data=json_encode($odata); |
| 305 | $this->save(); | 305 | $this->save(); |
| 306 | } | 306 | } |
| 307 | public function playhangupfile($fromext,$server) | 307 | public function playafterhrsfile($fromext,$server) |
| 308 | { | 308 | { |
| 309 | $odata=array();$odata['VARS']=array(); | 309 | $odata=array();$odata['VARS']=array(); |
| 310 | $odata['fromext']=$fromext; | 310 | $odata['fromext']=$fromext; |
| 311 | $odata['context']="kstychPlayHangFile"; | 311 | $odata['context']="kstychAfterFile"; |
| 312 | $odata['callerid']=""; | 312 | $odata['callerid']=""; |
| 313 | $odata['toext']="3001"; | 313 | $odata['toext']="3001"; |
| 314 | $odata['account']=""; | 314 | $odata['account']=""; | ... | ... |
application/app/Models/OutputProduct.php
0 → 100644
application/app/Models/OutputReport.php
0 → 100644
| 1 | <?php | ||
| 2 | |||
| 3 | namespace App\Models; | ||
| 4 | use Illuminate\Database\Eloquent\Model; | ||
| 5 | |||
| 6 | class OutputReport extends Model{ | ||
| 7 | |||
| 8 | protected $table = 'output_report'; | ||
| 9 | |||
| 10 | protected $fillable = ['user_id', 'user_name', 'date', 'call_attempts', 'call_contacts', 'call_unique_contacts', 'income', 'product_id' , 'product_name', 'lead_generated', 'lead_generated_amount', 'lead_closed', 'lead_closed_amount', 'created_at', 'updated_at']; | ||
| 11 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -15,6 +15,7 @@ return [ | ... | @@ -15,6 +15,7 @@ return [ |
| 15 | 15 | ||
| 16 | 'log' => 'daily', | 16 | 'log' => 'daily', |
| 17 | 17 | ||
| 18 | 'log_max_files' => 30, | ||
| 18 | 19 | ||
| 19 | 'providers' => [ | 20 | 'providers' => [ |
| 20 | 21 | ||
| ... | @@ -97,6 +98,8 @@ return [ | ... | @@ -97,6 +98,8 @@ return [ |
| 97 | "Dialer" => ["disp"=>"Dialer","icon"=>"phone","dash"=>"Dialer", | 98 | "Dialer" => ["disp"=>"Dialer","icon"=>"phone","dash"=>"Dialer", |
| 98 | "submenu"=>["Dialer"=>["kDialerModel();"], | 99 | "submenu"=>["Dialer"=>["kDialerModel();"], |
| 99 | "Reports"=>["menuAction('dialer/reports');"], | 100 | "Reports"=>["menuAction('dialer/reports');"], |
| 101 | "Output Report"=>["menuAction('outputreport/reportdata');"], | ||
| 102 | "Supervisor Output Report"=>["menuAction('outputreport/supervisordata');"], | ||
| 100 | ]], | 103 | ]], |
| 101 | "DialerCampaign" => ["disp"=>"Dialer","icon"=>"phone","dash"=>"", | 104 | "DialerCampaign" => ["disp"=>"Dialer","icon"=>"phone","dash"=>"", |
| 102 | "submenu"=>[ | 105 | "submenu"=>[ | ... | ... |
| ... | @@ -65,25 +65,25 @@ exten => _1004XXX!,n,Hangup | ... | @@ -65,25 +65,25 @@ exten => _1004XXX!,n,Hangup |
| 65 | [kstychPlayFile] | 65 | [kstychPlayFile] |
| 66 | exten => 1001,1,Answer | 66 | exten => 1001,1,Answer |
| 67 | exten => 1001,n,Playback(silence/1) | 67 | exten => 1001,n,Playback(silence/1) |
| 68 | exten => 1001,n,Playback(/var/lib/asterisk/sounds/RM_not_available_unreachabl) | 68 | exten => 1001,n,Playback(/var/lib/asterisk/sounds/audio_busy_rm_V2) |
| 69 | exten => 1001,n,Hangup | 69 | exten => 1001,n,Hangup |
| 70 | 70 | ||
| 71 | [kstychPlayHangFile] | 71 | ;[kstychPlayHangFile] |
| 72 | exten => 3001,1,Answer | 72 | ;exten => 3001,1,Answer |
| 73 | exten => 3001,n,Playback(silence/1) | 73 | ;exten => 3001,n,Playback(silence/1) |
| 74 | exten => 3001,n,Playback(/var/lib/asterisk/sounds/hangup_beep) | 74 | ;exten => 3001,n,Playback(/var/lib/asterisk/sounds/hangup_beep) |
| 75 | exten => 3001,n,Hangup | 75 | ;exten => 3001,n,Hangup |
| 76 | 76 | ||
| 77 | 77 | ||
| 78 | ;[kstychAbsFile] | 78 | [kstychAbsFile] |
| 79 | ;exten => 2001,1,Answer | 79 | exten => 2001,1,Answer |
| 80 | ;exten => 2001,n,Playback(silence/1) | 80 | exten => 2001,n,Playback(silence/1) |
| 81 | ;exten => 2001,n,Playback(/var/lib/asterisk/sounds/RM_not_available_unreachabl) | 81 | exten => 2001,n,Playback(/var/lib/asterisk/sounds/audio_working_hours_vrm_V2) |
| 82 | ;exten => 2001,n,Hangup | 82 | exten => 2001,n,Hangup |
| 83 | 83 | ||
| 84 | [SIPDialerINB] | 84 | [SIPDialerINB] |
| 85 | exten => _X!,1,Goto(kstychDialerINB,${EXTEN},1) | 85 | exten => _X!,1,Goto(kstychDialerINB,${EXTEN},1) |
| 86 | exten => _X!,n,Hangup() | 86 | exten => _X!,n,Hangup() |
| 87 | 87 | ||
| 88 | [kstychDialerIVR] | 88 | [kstychDialerIVR] |
| 89 | #include kstych-*.conf | 89 | #include kstych-*.conf |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -144,7 +144,7 @@ function kcallHasConnection(number) | ... | @@ -144,7 +144,7 @@ function kcallHasConnection(number) |
| 144 | function dialerQuickOpen(varid,num,state,substate,autorun) | 144 | function dialerQuickOpen(varid,num,state,substate,autorun) |
| 145 | { | 145 | { |
| 146 | resetCallArray(); | 146 | resetCallArray(); |
| 147 | console.log("Manojquick"); | 147 | |
| 148 | if(kstychCall['mCallState']=="Wait") | 148 | if(kstychCall['mCallState']=="Wait") |
| 149 | { | 149 | { |
| 150 | var oldpreviewid=kstychCall['previewcrmid']; | 150 | var oldpreviewid=kstychCall['previewcrmid']; |
| ... | @@ -282,7 +282,6 @@ function kCallAction(num,action) | ... | @@ -282,7 +282,6 @@ function kCallAction(num,action) |
| 282 | function dialerDispNumberClick() | 282 | function dialerDispNumberClick() |
| 283 | { | 283 | { |
| 284 | var lastnumber=$("#spandialer_num").html(); | 284 | var lastnumber=$("#spandialer_num").html(); |
| 285 | console.log(lastnumber); | ||
| 286 | kstychCall['callWrapupTime']=300; | 285 | kstychCall['callWrapupTime']=300; |
| 287 | 286 | ||
| 288 | if(kstychCall['mCallState']=="Dispo") | 287 | if(kstychCall['mCallState']=="Dispo") |
| ... | @@ -329,8 +328,8 @@ function incomingCall(calllog,crmid,numnchn) | ... | @@ -329,8 +328,8 @@ function incomingCall(calllog,crmid,numnchn) |
| 329 | { | 328 | { |
| 330 | //document.getElementById("hangup").play(); | 329 | //document.getElementById("hangup").play(); |
| 331 | //stopRingTone(); | 330 | //stopRingTone(); |
| 332 | console.log("incoming 1"); | ||
| 333 | resetCallArray(); | 331 | resetCallArray(); |
| 332 | |||
| 334 | $("#dialersearchresults").html('<div id=divworking></div><div style="clear:both"></div>'); | 333 | $("#dialersearchresults").html('<div id=divworking></div><div style="clear:both"></div>'); |
| 335 | 334 | ||
| 336 | var number = numnchn.substring(0, numnchn.indexOf('@')); | 335 | var number = numnchn.substring(0, numnchn.indexOf('@')); |
| ... | @@ -342,11 +341,11 @@ function incomingCall(calllog,crmid,numnchn) | ... | @@ -342,11 +341,11 @@ function incomingCall(calllog,crmid,numnchn) |
| 342 | 341 | ||
| 343 | kSetDData('C','callid',calllog); | 342 | kSetDData('C','callid',calllog); |
| 344 | kSetDData('C','crmid',crmid); | 343 | kSetDData('C','crmid',crmid); |
| 345 | console.log(crmid); | 344 | |
| 346 | if(crmid>0)showRecruit(crmid); | 345 | if(crmid>0) |
| 346 | showRecruit(crmid); | ||
| 347 | else | 347 | else |
| 348 | { | 348 | { |
| 349 | console.log("incoming else"); | ||
| 350 | createSearchRecordDiv('dialersearchresults'); | 349 | createSearchRecordDiv('dialersearchresults'); |
| 351 | } | 350 | } |
| 352 | 351 | ||
| ... | @@ -362,7 +361,6 @@ function incomingCall(calllog,crmid,numnchn) | ... | @@ -362,7 +361,6 @@ function incomingCall(calllog,crmid,numnchn) |
| 362 | 361 | ||
| 363 | function dialerUIUpdate(var1,var2,var3) | 362 | function dialerUIUpdate(var1,var2,var3) |
| 364 | { | 363 | { |
| 365 | console.log("UIupdate"); | ||
| 366 | var3parts=var3.split("~"); | 364 | var3parts=var3.split("~"); |
| 367 | var3parts[2]=atob(var3parts[2]); | 365 | var3parts[2]=atob(var3parts[2]); |
| 368 | if(var1=="dialstart") | 366 | if(var1=="dialstart") |
| ... | @@ -433,15 +431,22 @@ function incomingPopupAlert(var1,var2,var3) | ... | @@ -433,15 +431,22 @@ function incomingPopupAlert(var1,var2,var3) |
| 433 | { | 431 | { |
| 434 | var loginRoleArray=["R14306"]; | 432 | var loginRoleArray=["R14306"]; |
| 435 | var fullexten = $('#userExtension').val(); | 433 | var fullexten = $('#userExtension').val(); |
| 436 | console.log(fullexten); | 434 | console.log("Full Extension : " + fullexten); |
| 437 | var exten =fullexten.split(':')[0]; | 435 | var exten =fullexten.split(':')[0]; |
| 438 | console.log("exten1 "+exten); | 436 | console.log("Exten : " + exten); |
| 437 | |||
| 439 | //var incomingnotify=growlSNotify(var1,var2,"top-right"); | 438 | //var incomingnotify=growlSNotify(var1,var2,"top-right"); |
| 440 | //setTimeout(function(){$.gritter.remove(incomingnotify, {fade: true,speed: 'slow'});incomingnotify=0;},1500); | 439 | //setTimeout(function(){$.gritter.remove(incomingnotify, {fade: true,speed: 'slow'});incomingnotify=0;},1500); |
| 441 | if((kstychCall['ts_Talk']===0 && kstychCall['ts_Call']===0)){ | 440 | |
| 442 | if($.inArray($('#userLoginRole').val(), loginRoleArray)>-1 && (var3===exten))startRingTone(); | 441 | if((kstychCall['ts_Talk']===0 && kstychCall['ts_Call']===0)) |
| 443 | } | 442 | { |
| 444 | console.log(var1+"Var 1"+"Var 2"+var2+"Var 3"+var3); | 443 | // if($('#userLoginRole').val()=="Unit_Head") |
| 444 | // startRingTone(); | ||
| 445 | if($.inArray($('#userLoginRole').val(), loginRoleArray)>-1 && (var3===exten)) | ||
| 446 | startRingTone(); | ||
| 447 | } | ||
| 448 | |||
| 449 | console.log("Var 1 : "+var1+"Var 2: "+var2+"Var 3 : "+var3); | ||
| 445 | $.titleAlert(var1+" "+var2, { | 450 | $.titleAlert(var1+" "+var2, { |
| 446 | requireBlur:true, | 451 | requireBlur:true, |
| 447 | stopOnFocus:true, | 452 | stopOnFocus:true, |
| ... | @@ -933,7 +938,7 @@ function updateDialerState(objstr,key,val,key2,val2) | ... | @@ -933,7 +938,7 @@ function updateDialerState(objstr,key,val,key2,val2) |
| 933 | if(val=="Manual"){ | 938 | if(val=="Manual"){ |
| 934 | console.log("Manoj"); | 939 | console.log("Manoj"); |
| 935 | resetCallArray(); | 940 | resetCallArray(); |
| 936 | 941 | ||
| 937 | } | 942 | } |
| 938 | if(val2=="Incoming"){ | 943 | if(val2=="Incoming"){ |
| 939 | console.log("Manoj Incoming"); | 944 | console.log("Manoj Incoming"); | ... | ... |
| ... | @@ -242,8 +242,9 @@ foreach($tmodules as $mname=>$marr) | ... | @@ -242,8 +242,9 @@ foreach($tmodules as $mname=>$marr) |
| 242 | <?php } ?> | 242 | <?php } ?> |
| 243 | <div><a href="#" class="btn btn-primary" onclick="menuAction('message');return false;"><i class="fa fa-list"></i> <span>View all messages <?php if($messagescount>0)echo "($messagescount)"; ?></span></a></div> | 243 | <div><a href="#" class="btn btn-primary" onclick="menuAction('message');return false;"><i class="fa fa-list"></i> <span>View all messages <?php if($messagescount>0)echo "($messagescount)"; ?></span></a></div> |
| 244 | </ul> | 244 | </ul> |
| 245 | <input type="hidden" id="userLoginRole" value="{{Auth::user()->username}}"> | 245 | {{--<input type="hidden" id="userLoginRole" value="{{Auth::user()->usertype}}">--}} |
| 246 | <input type="hidden" id="userExtension" value="{{isset(Auth::user()->exten)?(Auth::user()->exten):'0'}}"> | 246 | <input type="hidden" id="userLoginRole" value="{{Auth::user()->username}}"> |
| 247 | <input type="hidden" id="userExtension" value="{{isset(Auth::user()->exten)?(Auth::user()->exten):'0'}}"> | ||
| 247 | </li> | 248 | </li> |
| 248 | <li class="dropdown notif" style='height:35px'> | 249 | <li class="dropdown notif" style='height:35px'> |
| 249 | <a href="#" class="dropdown-toggle" data-toggle="dropdown" style='height:35px' onclick='$("#topmenunotifucount").html("");'><i class="notif-block fa fa-bell"></i><span class="badge badge-info" id=topmenunotifucount><?php if(isset($meta['ncnt'])&&$meta['ncnt']>0)echo $meta['ncnt']; ?></span></a> | 250 | <a href="#" class="dropdown-toggle" data-toggle="dropdown" style='height:35px' onclick='$("#topmenunotifucount").html("");'><i class="notif-block fa fa-bell"></i><span class="badge badge-info" id=topmenunotifucount><?php if(isset($meta['ncnt'])&&$meta['ncnt']>0)echo $meta['ncnt']; ?></span></a> | ... | ... |
| ... | @@ -170,6 +170,11 @@ use App\Models\CRMCall; | ... | @@ -170,6 +170,11 @@ use App\Models\CRMCall; |
| 170 | $number_list=array(); | 170 | $number_list=array(); |
| 171 | foreach($mc as $key=>$tcall) | 171 | foreach($mc as $key=>$tcall) |
| 172 | { | 172 | { |
| 173 | include( app_path() . '/Hacks/DisabledDIDs.php'); | ||
| 174 | if( in_array(substr($tcall->number,-10),$DisableNumbersArray) ){ | ||
| 175 | continue; | ||
| 176 | } | ||
| 177 | |||
| 173 | $tccal=substr($tcall->number,-10); | 178 | $tccal=substr($tcall->number,-10); |
| 174 | $mc_number=CRMCall::where('userstatus','!=','InboundDROP') | 179 | $mc_number=CRMCall::where('userstatus','!=','InboundDROP') |
| 175 | ->where('created_at','>',$tcall->created_at) | 180 | ->where('created_at','>',$tcall->created_at) | ... | ... |
| ... | @@ -142,7 +142,6 @@ $user=Auth::user(); | ... | @@ -142,7 +142,6 @@ $user=Auth::user(); |
| 142 | } | 142 | } |
| 143 | </style> | 143 | </style> |
| 144 | 144 | ||
| 145 | <input type="hidden" id="userLoginRole" value="{{Auth::user()->usertype}}"> | ||
| 146 | <div class="layout-app"><!-- row-app --> | 145 | <div class="layout-app"><!-- row-app --> |
| 147 | <div class="row row-app"> | 146 | <div class="row row-app"> |
| 148 | 147 | ... | ... |
| 1 | <?php | ||
| 2 | use App\Models\CRMCallArchive; | ||
| 3 | use App\Models\CRMCall; | ||
| 4 | use App\Models\User; | ||
| 5 | use App\Jobs\KHRMSLib; | ||
| 6 | |||
| 7 | $wakka = new KHRMSLib(); | ||
| 8 | $dashboarduser=Auth::user(); | ||
| 9 | $userdialmode=$dashboarduser->dialmode_assign; | ||
| 10 | $userdialmode=explode(",",$userdialmode); | ||
| 11 | $timeoffset=$dashboarduser->timezone*60; | ||
| 12 | |||
| 13 | $locationserverip=DB::select(DB::raw("SELECT location from server_details group by location")); | ||
| 14 | |||
| 15 | if(isset($_GET['logdate']))$logdate=strtotime($_GET['logdate']." 00:00:00"); | ||
| 16 | else $logdate=strtotime(date('Y-m-d')." 00:00:00"); | ||
| 17 | |||
| 18 | $location =(isset($_GET['location'])) ? $_GET['location'] : "Select Location"; | ||
| 19 | $i=1; | ||
| 20 | $locations=explode(",",$location); | ||
| 21 | //print_r($locations); | ||
| 22 | foreach ($locations as $location) { | ||
| 23 | $serverid=DB::select(DB::raw("SELECT server_ip,id,location from server_details where location='$location' ORDER BY id ASC")); | ||
| 24 | |||
| 25 | //echo "All"; | ||
| 26 | //print_r($serverid); | ||
| 27 | |||
| 28 | //$serverip->get(); | ||
| 29 | foreach ($serverid as $server_id) { | ||
| 30 | //$serverids=$server_id->id<10?"0".$server_id->id:$server_id->id; | ||
| 31 | $serverids=$server_id->id; | ||
| 32 | //print_r($server_id->server_ip); | ||
| 33 | |||
| 34 | $alist=DB::select(DB::raw("SELECT * from sms_report where created_at>='".date("Y-m-d H:i:s",$logdate+$timeoffset)."' and created_at <= '".date("Y-m-d H:i:s",$logdate+24*60*60)."' and server=$serverids ORDER BY id DESC ")); | ||
| 35 | |||
| 36 | //print_r($alist); | ||
| 37 | foreach ($alist as $aline) { | ||
| 38 | $outstr.="<tr><td>".$i."</td> | ||
| 39 | <td>".$server_id->server_ip."</td> | ||
| 40 | <td>".$server_id->location."</td> | ||
| 41 | <td>".$aline->message_time."</td> | ||
| 42 | <td>".$aline->agent_name."</td> | ||
| 43 | <td>".$aline->subdispo."</td> | ||
| 44 | <td>".$aline->number."</td> | ||
| 45 | <td>".$aline->message."</td> | ||
| 46 | <td>".$aline->response."</td> | ||
| 47 | </tr>"; | ||
| 48 | $i++; | ||
| 49 | } | ||
| 50 | } | ||
| 51 | } | ||
| 52 | |||
| 53 | if(Input::has("dllogxls")) | ||
| 54 | { | ||
| 55 | include_once(app_path().'/lib/phpexcel/PHPExcel.php'); | ||
| 56 | |||
| 57 | $inputFileType = "Excel5"; | ||
| 58 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); | ||
| 59 | $objPHPExcel = $objReader->load("assets/extras/blank.xls"); | ||
| 60 | $baseRow = 3; | ||
| 61 | |||
| 62 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | ||
| 63 | $fieldsarr[$tcol++]='#'; | ||
| 64 | $fieldsarr[$tcol++]='server_ip'; | ||
| 65 | $fieldsarr[$tcol++]='location'; | ||
| 66 | $fieldsarr[$tcol++]='message_time'; | ||
| 67 | $fieldsarr[$tcol++]='agent_name'; | ||
| 68 | $fieldsarr[$tcol++]='SubDispo'; | ||
| 69 | $fieldsarr[$tcol++]='Number'; | ||
| 70 | $fieldsarr[$tcol++]='Message'; | ||
| 71 | $fieldsarr[$tcol++]='response'; | ||
| 72 | |||
| 73 | $highestColumn = sizeof($fieldsarr); | ||
| 74 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 75 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 76 | $objPHPExcel->getActiveSheet()->setCellValue($colstr."1", $fieldsarr[$head]); | ||
| 77 | } | ||
| 78 | |||
| 79 | $ii=1; | ||
| 80 | foreach($alist as $aline) | ||
| 81 | { | ||
| 82 | $row = $baseRow++; | ||
| 83 | $col = 0; | ||
| 84 | |||
| 85 | |||
| 86 | |||
| 87 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($ii++); | ||
| 88 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($server_id->server_ip); | ||
| 89 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($server_id->location); | ||
| 90 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($aline->message_time); | ||
| 91 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($aline->agent_name); | ||
| 92 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($aline->subdispo); | ||
| 93 | |||
| 94 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($aline->number); | ||
| 95 | |||
| 96 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($aline->message); | ||
| 97 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($aline->response); | ||
| 98 | |||
| 99 | |||
| 100 | } | ||
| 101 | |||
| 102 | |||
| 103 | |||
| 104 | header('Content-Type: application/vnd.ms-excel'); | ||
| 105 | header('Content-Disposition: attachment;filename="CallLog.xls"'); | ||
| 106 | header('Cache-Control: max-age=0'); | ||
| 107 | |||
| 108 | $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $inputFileType); | ||
| 109 | $objWriter->save('php://output'); | ||
| 110 | |||
| 111 | return ; | ||
| 112 | } | ||
| 113 | |||
| 114 | ?> | ||
| 115 | |||
| 116 | <div class=innerAll> | ||
| 117 | |||
| 118 | |||
| 119 | |||
| 120 | |||
| 121 | <style>#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}</style> | ||
| 122 | <script> | ||
| 123 | function showExtraPost(varstr) | ||
| 124 | { | ||
| 125 | doAjax("hr?action=LiveUsers","getpostdata="+varstr,"dialoglog"); | ||
| 126 | |||
| 127 | $('#dialoglog').dialog('open'); | ||
| 128 | return false; | ||
| 129 | } | ||
| 130 | |||
| 131 | $(document).ready(function() | ||
| 132 | { | ||
| 133 | if(!$('#dialoglog').hasClass('ui-dialog-content')) | ||
| 134 | { | ||
| 135 | $('#dialoglog').dialog({ | ||
| 136 | autoOpen: false, | ||
| 137 | width: '70%', | ||
| 138 | buttons: { | ||
| 139 | "Ok": function() { | ||
| 140 | $(this).dialog("close"); | ||
| 141 | }, | ||
| 142 | "Cancel": function() { | ||
| 143 | $(this).dialog("close"); | ||
| 144 | } | ||
| 145 | } | ||
| 146 | }); | ||
| 147 | } | ||
| 148 | |||
| 149 | waitKeyUpRun("filter",function() { filter2(document.getElementById('filter'), 'logtable') },"2000"); | ||
| 150 | $('#modfrom').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | ||
| 151 | }); | ||
| 152 | </script> | ||
| 153 | <div> | ||
| 154 | |||
| 155 | |||
| 156 | Date : <input size=10 id='modfrom' name='modfrom' type='text' value='<?php echo date("Y-m-d",$logdate); ?>' /> | ||
| 157 | |||
| 158 | Location:<select id="location" style="border:1px solid #efefef;"> | ||
| 159 | <option value='Select Location' disabled selected>Select Location</option> | ||
| 160 | <option value='All'>All</option> | ||
| 161 | <?php foreach($locationserverip as $c){$s="";if($c->location==$location)$s='selected';echo "<option value='$c->location' $s>$c->location</option>";} ?> | ||
| 162 | </select> | ||
| 163 | |||
| 164 | <button id="load" onclick='callLogReloadFun("");return false;' value='Submit'>Submit</button> | ||
| 165 | |||
| 166 | </div> | ||
| 167 | <div style="float:right;width:30%"> | ||
| 168 | |||
| 169 | |||
| 170 | <button class="pull-right btn btn-sm btn-default" onclick='dlCalllogXls();return false;' title='Download' style='margin-top:-8px'><i class='fa fa-download'></i> Download</button> | ||
| 171 | |||
| 172 | </div> | ||
| 173 | |||
| 174 | <script> | ||
| 175 | function dataString() | ||
| 176 | { | ||
| 177 | return 'logdate='+$("#modfrom").val()+'&location='+$("#location").val(); | ||
| 178 | } | ||
| 179 | |||
| 180 | function callLogReloadFun(sortby) | ||
| 181 | { | ||
| 182 | var sortstr='';if(sortby!="")sortstr="&sort="+sortby | ||
| 183 | var searchStr = dataString(); | ||
| 184 | doAjax('dialer/smslog?'+searchStr+sortstr,'','rightmainreportdiv','ajax_dialer_reports','singlethis','GET'); | ||
| 185 | } | ||
| 186 | function dlCalllogXls() | ||
| 187 | { | ||
| 188 | var searchStr = dataString(); | ||
| 189 | window.open('dialer/smslog?dllogxls=1&'+searchStr); | ||
| 190 | return false; | ||
| 191 | |||
| 192 | } | ||
| 193 | |||
| 194 | </script> | ||
| 195 | |||
| 196 | <div style='clear:both'></div> | ||
| 197 | |||
| 198 | <div style='overflow:auto'> | ||
| 199 | <table id=logtable class='footable table table-striped table-bordered table-white table-primary footable-loaded' style='font-size:12px'> | ||
| 200 | <thead> | ||
| 201 | <tr> | ||
| 202 | <th>#</th> | ||
| 203 | <th>ServerIp</th> | ||
| 204 | <th>Location</th> | ||
| 205 | <th>Message Time</th> | ||
| 206 | <th>RM Name</th> | ||
| 207 | |||
| 208 | <th>SubDispo</th> | ||
| 209 | <th style='width:120px'>Number</th> | ||
| 210 | <th>Message</th> | ||
| 211 | <th>Response</th> | ||
| 212 | |||
| 213 | |||
| 214 | </tr> | ||
| 215 | </thead> | ||
| 216 | <?php echo $outstr; ?> | ||
| 217 | </table> | ||
| 218 | </div> | ||
| 219 | <?php | ||
| 220 | function convert($size) | ||
| 221 | { | ||
| 222 | $unit=array('b','kb','mb','gb','tb','pb'); | ||
| 223 | return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i]; | ||
| 224 | } | ||
| 225 | |||
| 226 | echo "<br>".convert(memory_get_peak_usage(true)); // 123 kb | ||
| 227 | |||
| 228 | |||
| 229 | ?> | ||
| 230 | <div id=dialoglog></div> | ||
| 231 | |||
| 232 | |||
| 233 | |||
| 234 | |||
| 235 | |||
| 236 | </div> |
| ... | @@ -447,4 +447,4 @@ function deletesavedreport(rname) | ... | @@ -447,4 +447,4 @@ function deletesavedreport(rname) |
| 447 | { | 447 | { |
| 448 | doAjax('hr?action=DeleteSavedReport&rname='+rname,'','searchresults'); | 448 | doAjax('hr?action=DeleteSavedReport&rname='+rname,'','searchresults'); |
| 449 | } | 449 | } |
| 450 | </script> | 450 | </script> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | <?php | ||
| 2 | use App\Models\User; | ||
| 3 | if(Auth::user()->id=="1" || Auth::user()->id == "199"){ ?> | ||
| 4 | <div class="container"> | ||
| 5 | <div style="text-align:center"> | ||
| 6 | <h2>Output Report</h2> | ||
| 7 | <p></p> | ||
| 8 | </div> | ||
| 9 | |||
| 10 | <div class="row"> | ||
| 11 | <div class="column"> | ||
| 12 | <form class="form-horizontal" id="output-report" name="output-report"> | ||
| 13 | <div class="table-responsive" style="background: #fff;"> | ||
| 14 | |||
| 15 | <table class="table"> | ||
| 16 | <thead> | ||
| 17 | <tr> | ||
| 18 | <th>No.of Attempts</th> | ||
| 19 | <th>{{$noOfAttempts}} | ||
| 20 | <input type="hidden" name="noOfAttempts" value="{{$noOfAttempts}}"> | ||
| 21 | </th> | ||
| 22 | </tr> | ||
| 23 | <tr> | ||
| 24 | <th>No.of Contacts</th> | ||
| 25 | <th>{{$noOfContacts}} | ||
| 26 | <input type="hidden" name="noOfContacts" value="{{$noOfContacts}}"> | ||
| 27 | </th> | ||
| 28 | </tr> | ||
| 29 | <tr> | ||
| 30 | <th>Unique Contacts</th> | ||
| 31 | |||
| 32 | <th>{{$uniqueContacts}} | ||
| 33 | <input type="hidden" name="uniqueContacts" value="{{$uniqueContacts}}"> | ||
| 34 | </th> | ||
| 35 | </tr> | ||
| 36 | <tr> | ||
| 37 | <th>Income Achievement</th> | ||
| 38 | <th><span id="showCalculatedAmt">{{$totalIncome}}</span></th> | ||
| 39 | </tr> | ||
| 40 | |||
| 41 | <tr> | ||
| 42 | <th>Product</th> | ||
| 43 | <th>LG</th> | ||
| 44 | <th>Expected Amount(If Applicable)</th> | ||
| 45 | <th>LC</th> | ||
| 46 | <th>Amount(If Applicable)</th> | ||
| 47 | </tr> | ||
| 48 | </thead> | ||
| 49 | <tbody> | ||
| 50 | <?php | ||
| 51 | $i=1; | ||
| 52 | foreach ($products as $key => $value) { | ||
| 53 | ?> | ||
| 54 | <tr> | ||
| 55 | <td> <input type="hidden" name="products[<?= $i ?>][productId]" value="{{$value['productId']}}"> | ||
| 56 | <input type="hidden" name="products[<?= $i ?>][product]" value="{{ $value['name'] }} " >{{ $value['name'] }}</td> | ||
| 57 | <td><input type="number" name="products[<?= $i ?>][lg]" min="0" value="{{isset($value['lead_generated'])?$value['lead_generated']:'0'}}" oninput="validity.valid||(value='');" $disabled></td> | ||
| 58 | <td><input type="number" min="0" step="0.01" name="products[<?= $i ?>][lgAmt]" value="{{isset($value['lead_generated_amount'])?$value['lead_generated_amount']:'0'}}" oninput="validity.valid||(value='');" $disabled></td> | ||
| 59 | <td><input type="number" min="0" name="products[<?= $i ?>][lc]" value="{{isset($value['lead_closed'])?$value['lead_closed']:'0'}}" class="calculateIncome" id="products<?= $i ?>Lc" oninput="validity.valid||(value='');" $disabled></td> | ||
| 60 | <td><input type="number" min="0" step="0.01" name="products[<?= $i ?>][lcAmt]" value="{{isset($value['lead_closed_amount'])?$value['lead_closed_amount']:'0'}}" oninput="validity.valid||(value='');" class="calculateIncome" id="products<?= $i ?>LcAmt" $disabled></td> | ||
| 61 | </tr> | ||
| 62 | <?php | ||
| 63 | $i++; | ||
| 64 | } ?> | ||
| 65 | |||
| 66 | @if($disabled == "") | ||
| 67 | <tr> | ||
| 68 | <td><button type="submit" class="btn btn-primary" onclick='createOutputReport();return false;'>Save</button></td> | ||
| 69 | </tr> | ||
| 70 | @endif | ||
| 71 | |||
| 72 | </tbody> | ||
| 73 | </table> | ||
| 74 | </div> | ||
| 75 | </form> | ||
| 76 | <script> | ||
| 77 | |||
| 78 | function createOutputReport() | ||
| 79 | { | ||
| 80 | |||
| 81 | var putdata = $('#output-report').serialize(); | ||
| 82 | //console.log("--->"+putdata); | ||
| 83 | doAjax('outputreport?action=createOutputReport',putdata,'__fake__div__','ajax_create_output_report','singlethis','POST',function(retstr) | ||
| 84 | { | ||
| 85 | if(retstr.responseText.indexOf('Error')<0) | ||
| 86 | { | ||
| 87 | simpleNotification("success","topRight","User Created Successfully"); | ||
| 88 | menuAction('outputreport/reportdata'); | ||
| 89 | } | ||
| 90 | else | ||
| 91 | { | ||
| 92 | simpleNotification("error","topRight",retstr.responseText); | ||
| 93 | } | ||
| 94 | }); | ||
| 95 | } | ||
| 96 | |||
| 97 | |||
| 98 | $( document ).ready(function() { | ||
| 99 | $( ".calculateIncome" ).change(function() { | ||
| 100 | |||
| 101 | var numItems = $('.calculateIncome').length; | ||
| 102 | var lc = 0; | ||
| 103 | var lcAmt = 0; | ||
| 104 | var totalIncome = 0; | ||
| 105 | for (var i = 1; i <= (numItems/2); i++) { | ||
| 106 | lc = $('#products'+i+'Lc').val(); | ||
| 107 | lcAmt = $('#products'+i+'LcAmt').val(); | ||
| 108 | |||
| 109 | if(lc != '' && lcAmt != ''){ | ||
| 110 | totalIncome = totalIncome + (lc * lcAmt); | ||
| 111 | } | ||
| 112 | } | ||
| 113 | $('#showCalculatedAmt').html(totalIncome); | ||
| 114 | |||
| 115 | }); | ||
| 116 | }); | ||
| 117 | |||
| 118 | |||
| 119 | </script> | ||
| 120 | |||
| 121 | |||
| 122 | </div> | ||
| 123 | </div> | ||
| 124 | </div> | ||
| 125 | <?php } ?> |
| 1 | |||
| 2 | <div class="container"> | ||
| 3 | <div style="text-align:center"> | ||
| 4 | <h2>Output Report</h2> | ||
| 5 | <p></p> | ||
| 6 | </div> | ||
| 7 | |||
| 8 | <div class="row"> | ||
| 9 | <div class="column"> | ||
| 10 | <form class="form-horizontal" id="output-report-supervisor" name="output-report-supervisor"> | ||
| 11 | <div class="table-responsive" style="background: #fff;"> | ||
| 12 | <br> | ||
| 13 | <div class="dropdown"> | ||
| 14 | <label style="text-indent: 2em;"> | ||
| 15 | <h5> | ||
| 16 | Select RM/PB : | ||
| 17 | </h5> | ||
| 18 | </label> | ||
| 19 | <select id="supervisorid" style="border:3px solid #efefef;" onchange='userchange("");'> | ||
| 20 | <option value="ALL">ALL | ||
| 21 | </option> | ||
| 22 | <?php | ||
| 23 | foreach($supervisor as $user){ | ||
| 24 | $selected = ($user->id == $users)?"selected":""; | ||
| 25 | ?> | ||
| 26 | <option value="{{$user->id }}" {{$selected}}>{{$user->username}}</option> | ||
| 27 | <?php } ?> | ||
| 28 | </select> | ||
| 29 | </div> | ||
| 30 | <br> | ||
| 31 | <table class="table"> | ||
| 32 | <thead> | ||
| 33 | <tr> | ||
| 34 | <th>No.of Attempts</th> | ||
| 35 | <th>{{ $Contacts->call_attempts }} | ||
| 36 | </th> | ||
| 37 | </tr> | ||
| 38 | <tr> | ||
| 39 | <th>No.of Contacts</th> | ||
| 40 | <th> {{ $Contacts->call_contacts }} | ||
| 41 | </th> | ||
| 42 | </tr> | ||
| 43 | <tr> | ||
| 44 | <th>Unique Contacts</th> | ||
| 45 | |||
| 46 | <th> {{ $Contacts->call_unique_contacts }} | ||
| 47 | </th> | ||
| 48 | </tr> | ||
| 49 | <tr> | ||
| 50 | <th>Income Achievement</th> | ||
| 51 | <th>{{ $totalIncome }}</th> | ||
| 52 | </tr> | ||
| 53 | |||
| 54 | <tr> | ||
| 55 | <th>Product</th> | ||
| 56 | <th>LG</th> | ||
| 57 | <th>Expected Amount(If Applicable)</th> | ||
| 58 | <th>LC</th> | ||
| 59 | <th>Amount(If Applicable)</th> | ||
| 60 | </tr> | ||
| 61 | </thead> | ||
| 62 | <tbody> | ||
| 63 | <?php foreach($report as $key => $val){ //print_r($val); ?> | ||
| 64 | <tr> | ||
| 65 | <td>{{$val->product_name}}</td> | ||
| 66 | <td>{{$val->totallead}}</td> | ||
| 67 | <td>{{$val->totalleadamt}}</td> | ||
| 68 | <td>{{$val->totalleadclosed}}</td> | ||
| 69 | <td>{{$val->leadcloseamt}}</td> | ||
| 70 | </tr> | ||
| 71 | <?php } ?> | ||
| 72 | </tbody> | ||
| 73 | </table> | ||
| 74 | </div> | ||
| 75 | </form> | ||
| 76 | <script> | ||
| 77 | function userchange() | ||
| 78 | { | ||
| 79 | var user = $('#supervisorid').val(); | ||
| 80 | //console.log(user); | ||
| 81 | doAjax('outputreport/supervisordata?user='+user,'','middlemainreportdiv','ajax_create_supervisor_report','singlethis','GET', function(retstr){ | ||
| 82 | menuAction('outputreport/supervisordata?user='+user); | ||
| 83 | }); | ||
| 84 | } | ||
| 85 | </script> | ||
| 86 | </div> | ||
| 87 | </div> | ||
| 88 |
| ... | @@ -107,7 +107,7 @@ if($varid!=""||$isuser) | ... | @@ -107,7 +107,7 @@ if($varid!=""||$isuser) |
| 107 | //no edit access and read other data.. | 107 | //no edit access and read other data.. |
| 108 | //check if we have owner access = read access | 108 | //check if we have owner access = read access |
| 109 | $oclientlst=$wakka->clientsReadAccess(); | 109 | $oclientlst=$wakka->clientsReadAccess(); |
| 110 | foreach($oclientlst as $tclnt)if($tclnt==$recruitdata["peopledata"]['client']&&$tclnt!=""){$noreaduser=0;break;} | 110 | foreach($oclientlst as $tclnt)if(strtolower($tclnt)==strtolower($recruitdata["peopledata"]['client'])&&$tclnt!=""){$noreaduser=0;break;} |
| 111 | } | 111 | } |
| 112 | } | 112 | } |
| 113 | } | 113 | } | ... | ... |
custom/.env
0 → 100755
| 1 | APP_ENV=local | ||
| 2 | APP_DEBUG=true | ||
| 3 | APP_ADMIN_DEBUG=true | ||
| 4 | APP_KEY=LEynnBaQoqsLncOWZwgdtfxxWU2hEyfp | ||
| 5 | APP_PROTOCOL=https:// | ||
| 6 | app_name=Flexydial | ||
| 7 | app_title=Flexydial | ||
| 8 | app_domain=10.125.14.55 | ||
| 9 | web_domain=10.125.14.55 | ||
| 10 | app_ip=10.125.14.55 | ||
| 11 | central_ip=10.125.14.127 | ||
| 12 | didnumber=-8 | ||
| 13 | asterisk_slaves=10.125.14.55:1001:2000:1:240 | ||
| 14 | asterisk_manager=10.125.14.55 | ||
| 15 | asterisk_extensions=31330,_X! | ||
| 16 | sip_dialstr=SIP/ | ||
| 17 | |||
| 18 | APP_Multiple_Logins=yes | ||
| 19 | kDialer_keeplocalconf=1 | ||
| 20 | |||
| 21 | kstych_viewportMeta=responsive:1:1 | ||
| 22 | |||
| 23 | DB_HOST=localhost | ||
| 24 | DB_DATABASE=kstych_flexydial | ||
| 25 | DB_USERNAME=root | ||
| 26 | DB_PASSWORD=yb9738z | ||
| 27 | |||
| 28 | CACHE_DRIVER=database | ||
| 29 | SESSION_DRIVER=database | ||
| 30 | SESSION_LIFEMin=43200 | ||
| 31 | QUEUE_DRIVER=sync | ||
| 32 | |||
| 33 | MAIL_DRIVER=smtp | ||
| 34 | MAIL_HOST=localhost | ||
| 35 | MAIL_PORT=587 | ||
| 36 | MAIL_USERNAME=mail | ||
| 37 | MAIL_PASSWORD=mail | ||
| 38 | [email protected] | ||
| 39 | |||
| 40 | AWS_KEY= | ||
| 41 | AWS_Secret= | ||
| 42 | AWS_Region=us-east-1 | ||
| 43 | AWS_Bucket= | ||
| 44 | |||
| 45 | FS_DefaultDriver=local | ||
| 46 | FS_CloudDriver=s3 | ||
| 47 | |||
| 48 | facebook_appid= | ||
| 49 | facebook_appkey= | ||
| 50 | gcm_apikey= | ||
| 51 | |||
| 52 | |||
| 53 | extAuth= | ||
| 54 | extAuthParams= | ||
| 55 | |||
| 56 | xssGlobal=tag,hent | ||
| 57 | xssGlobalIgnoreKeys=content,pdata,courseintroductiondiv,coursecoverphoto,data,rlog,rstring | ||
| 58 | |||
| 59 | MobileTitle=Flexydial |
custom/db/daily_output_report.sql
0 → 100644
| 1 | -- phpMyAdmin SQL Dump | ||
| 2 | -- version 4.5.3.1 | ||
| 3 | -- http://www.phpmyadmin.net | ||
| 4 | -- | ||
| 5 | -- Host: localhost | ||
| 6 | -- Generation Time: Jan 14, 2019 at 07:14 AM | ||
| 7 | -- Server version: 10.0.28-MariaDB | ||
| 8 | -- PHP Version: 5.6.29 | ||
| 9 | |||
| 10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; | ||
| 11 | SET time_zone = "+00:00"; | ||
| 12 | |||
| 13 | |||
| 14 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | ||
| 15 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | ||
| 16 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | ||
| 17 | /*!40101 SET NAMES utf8mb4 */; | ||
| 18 | |||
| 19 | -- | ||
| 20 | -- Database: `kstych_flexydial` | ||
| 21 | -- | ||
| 22 | |||
| 23 | -- -------------------------------------------------------- | ||
| 24 | |||
| 25 | -- | ||
| 26 | -- Table structure for table `daily_output_report` | ||
| 27 | -- | ||
| 28 | |||
| 29 | CREATE TABLE `daily_output_report` ( | ||
| 30 | `id` bigint(20) NOT NULL, | ||
| 31 | `user_id` varchar(20) NOT NULL, | ||
| 32 | `date` date NOT NULL, | ||
| 33 | `attempts` int(10) NOT NULL, | ||
| 34 | `contacts` int(10) NOT NULL, | ||
| 35 | `unique_contacts` int(10) NOT NULL, | ||
| 36 | `income` varchar(30) NOT NULL, | ||
| 37 | `product_id` varchar(10) NOT NULL, | ||
| 38 | `product_name` varchar(30) NOT NULL, | ||
| 39 | `lead_generated` int(10) NOT NULL, | ||
| 40 | `lead_amount` decimal(15,2) NOT NULL, | ||
| 41 | `lead_closed` int(10) NOT NULL, | ||
| 42 | `lead_closed_amount` decimal(15,2) NOT NULL, | ||
| 43 | `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
| 44 | `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP | ||
| 45 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ||
| 46 | |||
| 47 | -- | ||
| 48 | -- Indexes for dumped tables | ||
| 49 | -- | ||
| 50 | |||
| 51 | -- | ||
| 52 | -- Indexes for table `daily_output_report` | ||
| 53 | -- | ||
| 54 | ALTER TABLE `daily_output_report` | ||
| 55 | ADD PRIMARY KEY (`id`); | ||
| 56 | |||
| 57 | -- | ||
| 58 | -- AUTO_INCREMENT for dumped tables | ||
| 59 | -- | ||
| 60 | |||
| 61 | -- | ||
| 62 | -- AUTO_INCREMENT for table `daily_output_report` | ||
| 63 | -- | ||
| 64 | ALTER TABLE `daily_output_report` | ||
| 65 | MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; | ||
| 66 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; | ||
| 67 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; | ||
| 68 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; |
custom/db/output_products.sql
0 → 100644
| 1 | -- phpMyAdmin SQL Dump | ||
| 2 | -- version 4.5.3.1 | ||
| 3 | -- http://www.phpmyadmin.net | ||
| 4 | -- | ||
| 5 | -- Host: localhost | ||
| 6 | -- Generation Time: Jan 15, 2019 at 12:13 PM | ||
| 7 | -- Server version: 10.0.28-MariaDB | ||
| 8 | -- PHP Version: 5.6.29 | ||
| 9 | |||
| 10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; | ||
| 11 | SET time_zone = "+00:00"; | ||
| 12 | |||
| 13 | |||
| 14 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | ||
| 15 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | ||
| 16 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | ||
| 17 | /*!40101 SET NAMES utf8mb4 */; | ||
| 18 | |||
| 19 | -- | ||
| 20 | -- Database: `flexydial_hdfc_vrm` | ||
| 21 | -- | ||
| 22 | |||
| 23 | -- -------------------------------------------------------- | ||
| 24 | |||
| 25 | -- | ||
| 26 | -- Table structure for table `output_products` | ||
| 27 | -- | ||
| 28 | |||
| 29 | DROP TABLE IF EXISTS `output_products`; | ||
| 30 | CREATE TABLE `output_products` ( | ||
| 31 | `id` bigint(11) NOT NULL, | ||
| 32 | `Name` varchar(50) NOT NULL, | ||
| 33 | `Status` int(1) NOT NULL, | ||
| 34 | `created_at` datetime NOT NULL, | ||
| 35 | `updated_at` datetime NOT NULL | ||
| 36 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ||
| 37 | |||
| 38 | -- | ||
| 39 | -- Indexes for dumped tables | ||
| 40 | -- | ||
| 41 | |||
| 42 | -- | ||
| 43 | -- Indexes for table `output_products` | ||
| 44 | -- | ||
| 45 | ALTER TABLE `output_products` | ||
| 46 | ADD PRIMARY KEY (`id`); | ||
| 47 | |||
| 48 | -- | ||
| 49 | -- AUTO_INCREMENT for dumped tables | ||
| 50 | -- | ||
| 51 | |||
| 52 | -- | ||
| 53 | -- AUTO_INCREMENT for table `output_products` | ||
| 54 | -- | ||
| 55 | ALTER TABLE `output_products` | ||
| 56 | MODIFY `id` bigint(11) NOT NULL AUTO_INCREMENT; | ||
| 57 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; | ||
| 58 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; | ||
| 59 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; |
custom/db/output_report.sql
0 → 100644
| 1 | -- phpMyAdmin SQL Dump | ||
| 2 | -- version 4.5.3.1 | ||
| 3 | -- http://www.phpmyadmin.net | ||
| 4 | -- | ||
| 5 | -- Host: localhost | ||
| 6 | -- Generation Time: Jan 15, 2019 at 12:35 PM | ||
| 7 | -- Server version: 10.0.28-MariaDB | ||
| 8 | -- PHP Version: 5.6.29 | ||
| 9 | |||
| 10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; | ||
| 11 | SET time_zone = "+00:00"; | ||
| 12 | |||
| 13 | |||
| 14 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | ||
| 15 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | ||
| 16 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | ||
| 17 | /*!40101 SET NAMES utf8mb4 */; | ||
| 18 | |||
| 19 | -- | ||
| 20 | -- Database: `flexydial_hdfc_vrm` | ||
| 21 | -- | ||
| 22 | |||
| 23 | -- -------------------------------------------------------- | ||
| 24 | |||
| 25 | -- | ||
| 26 | -- Table structure for table `output_report` | ||
| 27 | -- | ||
| 28 | |||
| 29 | CREATE TABLE `output_report` ( | ||
| 30 | `id` bigint(20) NOT NULL, | ||
| 31 | `user_id` int(11) NOT NULL, | ||
| 32 | `user_name` varchar(200) NOT NULL, | ||
| 33 | `date` date NOT NULL, | ||
| 34 | `call_attempts` int(11) NOT NULL, | ||
| 35 | `call_contacts` int(11) NOT NULL, | ||
| 36 | `call_unique_contacts` int(11) NOT NULL, | ||
| 37 | `income` int(11) NOT NULL, | ||
| 38 | `product_id` bigint(11) NOT NULL, | ||
| 39 | `product_name` varchar(50) NOT NULL, | ||
| 40 | `lead_generated` int(11) NOT NULL, | ||
| 41 | `lead_generated_amount` decimal(13,2) NOT NULL, | ||
| 42 | `lead_closed` int(11) NOT NULL, | ||
| 43 | `lead_closed_amount` decimal(13,2) NOT NULL, | ||
| 44 | `created_at` datetime NOT NULL, | ||
| 45 | `updated_at` datetime NOT NULL | ||
| 46 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ||
| 47 | |||
| 48 | -- | ||
| 49 | -- Indexes for dumped tables | ||
| 50 | -- | ||
| 51 | |||
| 52 | -- | ||
| 53 | -- Indexes for table `output_report` | ||
| 54 | -- | ||
| 55 | ALTER TABLE `output_report` | ||
| 56 | ADD PRIMARY KEY (`id`), | ||
| 57 | ADD KEY `fk_product_id` (`product_id`); | ||
| 58 | |||
| 59 | -- | ||
| 60 | -- AUTO_INCREMENT for dumped tables | ||
| 61 | -- | ||
| 62 | |||
| 63 | -- | ||
| 64 | -- AUTO_INCREMENT for table `output_report` | ||
| 65 | -- | ||
| 66 | ALTER TABLE `output_report` | ||
| 67 | MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; | ||
| 68 | -- | ||
| 69 | -- Constraints for dumped tables | ||
| 70 | -- | ||
| 71 | |||
| 72 | -- | ||
| 73 | -- Constraints for table `output_report` | ||
| 74 | -- | ||
| 75 | ALTER TABLE `output_report` | ||
| 76 | ADD CONSTRAINT `fk_product_id` FOREIGN KEY (`product_id`) REFERENCES `output_products` (`id`); | ||
| 77 | |||
| 78 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; | ||
| 79 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; | ||
| 80 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; |
custom/db/sms_report.sql
0 → 100644
| 1 | -- phpMyAdmin SQL Dump | ||
| 2 | -- version 4.5.3.1 | ||
| 3 | -- http://www.phpmyadmin.net | ||
| 4 | -- | ||
| 5 | -- Host: localhost | ||
| 6 | -- Generation Time: Nov 30, 2018 at 12:00 PM | ||
| 7 | -- Server version: 10.0.28-MariaDB | ||
| 8 | -- PHP Version: 5.6.29 | ||
| 9 | |||
| 10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; | ||
| 11 | SET time_zone = "+00:00"; | ||
| 12 | |||
| 13 | |||
| 14 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | ||
| 15 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | ||
| 16 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | ||
| 17 | /*!40101 SET NAMES utf8mb4 */; | ||
| 18 | |||
| 19 | -- | ||
| 20 | -- Database: `kstych_flexydial` | ||
| 21 | -- | ||
| 22 | |||
| 23 | -- -------------------------------------------------------- | ||
| 24 | |||
| 25 | -- | ||
| 26 | -- Table structure for table `sms_report` | ||
| 27 | -- | ||
| 28 | |||
| 29 | CREATE TABLE `sms_report` ( | ||
| 30 | `id` int(10) NOT NULL, | ||
| 31 | `server` int(10) NOT NULL, | ||
| 32 | `sms_id` int(11) NOT NULL, | ||
| 33 | `ins_date_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
| 34 | `created_at` varchar(50) NOT NULL, | ||
| 35 | `message_time` datetime NOT NULL, | ||
| 36 | `server_ip` varchar(20) NOT NULL, | ||
| 37 | `call_id` int(20) NOT NULL, | ||
| 38 | `agent_name` varchar(30) NOT NULL, | ||
| 39 | `subdispo` varchar(60) NOT NULL, | ||
| 40 | `number` varchar(25) NOT NULL, | ||
| 41 | `message` varchar(50000) NOT NULL, | ||
| 42 | `response` varchar(50) NOT NULL | ||
| 43 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ||
| 44 | |||
| 45 | -- | ||
| 46 | -- Indexes for dumped tables | ||
| 47 | -- | ||
| 48 | |||
| 49 | -- | ||
| 50 | -- Indexes for table `sms_report` | ||
| 51 | -- | ||
| 52 | ALTER TABLE `sms_report` | ||
| 53 | ADD PRIMARY KEY (`id`); | ||
| 54 | |||
| 55 | -- | ||
| 56 | -- AUTO_INCREMENT for dumped tables | ||
| 57 | -- | ||
| 58 | |||
| 59 | -- | ||
| 60 | -- AUTO_INCREMENT for table `sms_report` | ||
| 61 | -- | ||
| 62 | ALTER TABLE `sms_report` | ||
| 63 | MODIFY `id` int(10) NOT NULL AUTO_INCREMENT; | ||
| 64 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; | ||
| 65 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; | ||
| 66 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; |
-
Please register or sign in to post a comment