c1f22105 by Prashant Jadhav

latest changes and new features

1 parent c28829f5
Showing 904 changed files with 3328 additions and 838 deletions
No preview for this file type
No preview for this file type
No preview for this file type
1 <?php namespace App\Console\Commands;
2
3 use Illuminate\Console\Command;
4 //use Mail;
5 use DB;
6 use Config;
7
8 use App\Models\User;
9 use App\Models\Accesslog;
10
11 use App\Models\CRMCall;
12 use Schema;
13 use PDO;
14 use App\Models\Notification;
15 use App\Jobs\KHRMSLib;
16
17 use Input;
18
19 use Illuminate\Database\Schema\Blueprint;
20
21 class bulkServerUpload extends Command {
22
23 /**
24 * The console command name.
25 *
26 * @var string
27 */
28 protected $signature = 'bulkServerUpload';
29
30 /**
31 * The console command description.
32 *
33 * @var string
34 */
35 protected $description = 'bulkServerUpload';
36
37 /**
38 * Execute the console command.
39 *
40 * @return mixed
41 */
42 public function handle()
43 {
44 echo "\n".date('Y-m-d')."\n";
45
46 $wakka = new KHRMSLib();
47
48 $kformlib=new \App\Jobs\KFormLib($wakka->HRCoreVars["HRFiledsStr"]);
49 $kformlib->gthis=$wakka;
50
51 $themehome=$wakka->GetThemePath('/');
52 $updatetime=time();
53
54 $clientlst=$wakka->GetBBBUserData("clientslist");
55
56 $isadmin=$wakka->IsAdmin();
57 $username=$wakka->GetUserName();
58 $triggers=Input::get("triggers");
59 $tmpstr=explode(",",$kformlib->HRFiledsStr);
60
61 $success="";$message="";$successcnt=0;$duplicatecount=0;
62
63
64 $conn = array(
65 'driver' => 'mysql',
66 'host' => '10.3.177.14',
67 'database' => env('DB_DATABASE', 'kstych_flexydial'),
68 'username' => env('DB_USERNAME', 'root'),
69 'password' => env('DB_PASSWORD', 'yb9738z'),
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 DB::connection("conn")->getDatabaseName();
80
81 // $excelarray = DB::table('bz_record_upload_uat')->select('*')->get();
82
83 $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat limit 1"));
84 $excelarray = (array)$excelarray;
85
86 $highestColumn = DB::connection("conn")->select(DB::raw("select count(*) from information_schema.columns where table_name='bz_record_upload_uat'"));
87 $highestrow = count($excelarray);
88 echo $highestColumn;
89 $flag = 0;
90 $editflag=0;
91
92 for($i=0;$i<=$highestrow;$i++)
93 {
94 if($excelarray[$i]["id"]!="")
95 {
96 if($excelarray[$i]["id"]=="CREATE")
97 {
98 $excelarray[$i]["id"]=$wakka->Query("insert into","","records_demo",array('created'=>date('Y-m-d H:i:s')));
99 }
100 else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]);
101
102 if($wakka->getCount("records_demo","id='".$excelarray[$i]["id"]."'")==1)
103 {
104 $empdata=$wakka->getPersonServer($excelarray[$i]["id"]);
105 $ppldata=$empdata["peopledata"];
106 $createdlog=$empdata['modifylog'];
107 $fdirty=$empdata['dirty'];
108
109 $createdlog[$updatetime]=$username."::";
110 $createdlog["updated"]=$updatetime;
111
112 $newdata=$ppldata;
113 foreach($excelarray[$i] as $key => $value)
114 {
115 if($value!="")
116 {
117 if("A".$ppldata[$key]!="A".$value)//forcing string comparrision //MAGIC
118 {
119 $value=str_replace("'"," ",$value);
120 if(strstr($createdlog[$updatetime],$key)==FALSE)$createdlog[$updatetime].="$key|".str_replace(array("|",",")," ",$ppldata[$key])."|".str_replace(array("|",",")," ",$value).",";
121
122 $fdirty[$key]=1;
123
124 $newdata[$key]=$value;
125 }
126 }
127 }
128 $empdata["peopledata"]=$newdata;
129 $empdata['modifylog']=$createdlog;
130 $empdata['dirty']=$fdirty;
131
132 $wakka->setPersonServer($excelarray[$i]["id"],$empdata);
133 $excelarray[$i]['modified']=date('Y-m-d H:i:s');
134
135 }
136 }
137
138 }
139 mysqli_close($conn);
140
141 }
142 }
143
144
145
146
1 <?php namespace App\Console\Commands;
2
3 use Illuminate\Console\Command;
4 //use Mail;
5 use DB;
6 use Config;
7
8 use App\Models\User;
9 use App\Models\Accesslog;
10
11 use App\Models\CRMCall;
12 use Schema;
13 use PDO;
14 use App\Models\Notification;
15 use App\Jobs\KHRMSLib;
16
17 use Input;
18
19 use Illuminate\Database\Schema\Blueprint;
20
21 class bulkServerUpload extends Command {
22
23 /**
24 * The console command name.
25 *
26 * @var string
27 */
28 protected $signature = 'bulkServerUpload';
29
30 /**
31 * The console command description.
32 *
33 * @var string
34 */
35 protected $description = 'bulkServerUpload';
36
37 /**
38 * Execute the console command.
39 *
40 * @return mixed
41 */
42 public function handle()
43 {
44
45 echo "\n".date('Y-m-d')."\n";
46
47 $wakka = new KHRMSLib();
48
49 $kformlib=new \App\Jobs\KFormLib($wakka->HRCoreVars["HRFiledsStr"]);
50 $kformlib->gthis=$wakka;
51
52 $themehome=$wakka->GetThemePath('/');
53 $updatetime=time();
54
55 $clientlst=$wakka->GetBBBUserData("clientslist");
56
57 $isadmin=$wakka->IsAdmin();
58 $username=$wakka->GetUserName();
59 $triggers=Input::get("triggers");
60 $tmpstr=explode(",",$kformlib->HRFiledsStr);
61
62 $success="";$message="";$successcnt=0;$duplicatecount=0;
63
64
65 $conn = array(
66 'driver' => 'mysql',
67 'host' => '10.3.177.14',
68 'database' => env('DB_DATABASE', 'kstych_flexydial'),
69 'username' => env('DB_USERNAME', 'root'),
70 'password' => env('DB_PASSWORD', 'yb9738z'),
71 'charset' => 'utf8',
72 'collation' => 'utf8_unicode_ci',
73 'prefix' => '',
74 'options' => array(
75 PDO::ATTR_TIMEOUT => 5,
76 ),
77 );
78 Config::set("database.connections.conn", $conn);
79
80 DB::connection("conn")->getDatabaseName();
81
82 $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat_080117 where SERVER_IP='10.3.179.121' and ins_date>'2016-11-29' order by auto_id asc limit 0,20000"));
83
84 foreach($excelarray as $key => $array){
85 $excelarray[$key] = (array)$array;
86 }
87
88 $highestColumn = DB::connection("conn")->select(DB::raw("select count(*) as cnt from information_schema.columns where table_name='bz_record_upload_uat_080117'"));
89 $highestColumn = $highestColumn[0]->cnt;
90
91 $highestrow = count($excelarray);
92
93 $flag = 0;
94 $editflag=0;
95
96 for($i=0;$i<=$highestrow;$i++)
97 {
98 if($excelarray[$i]["id"]!="")
99 {
100 if($excelarray[$i]["id"]=="CREATE")
101 {
102 $excelarray[$i]["id"]=$wakka->Query("insert into","","records_demo",array('created'=>date('Y-m-d H:i:s')));
103 }
104 else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]);
105
106 if($wakka->getCount("records_demo","id='".$excelarray[$i]["id"]."'")==1)
107 {
108 $empdata=$wakka->getPersonServer($excelarray[$i]["id"]);
109 $ppldata=$empdata["peopledata"];
110 $createdlog=$empdata['modifylog'];
111 $fdirty=$empdata['dirty'];
112
113 $createdlog[$updatetime]=$username."::";
114 $createdlog["updated"]=$updatetime;
115
116 $newdata=$ppldata;
117 foreach($excelarray[$i] as $key => $value)
118 {
119 if($value!="")
120 {
121 if("A".$ppldata[$key]!="A".$value)//forcing string comparrision //MAGIC
122 {
123 $value=str_replace("'"," ",$value);
124 if(strstr($createdlog[$updatetime],$key)==FALSE)$createdlog[$updatetime].="$key|".str_replace(array("|",",")," ",$ppldata[$key])."|".str_replace(array("|",",")," ",$value).",";
125
126 $fdirty[$key]=1;
127
128 $newdata[$key]=$value;
129 }
130 }
131 }
132
133 /*Start - Changes need to be done*/
134
135 if($excelarray[$i]["status"]==null)
136 {
137 $newdata['status'] = "";
138 }
139
140 if($excelarray[$i]["dialer_status"]==null)
141 {
142 $newdata['dialer_status'] = "";
143 }
144
145 if($excelarray[$i]["dialer_substatus"]==null)
146 {
147 $newdata['dialer_substatus'] = "";
148 }
149
150 /*End - Changes need to be done*/
151
152 $empdata["peopledata"]=$newdata;
153 $empdata['modifylog']=$createdlog;
154 $empdata['dirty']=$fdirty;
155
156 $wakka->setPersonServer($excelarray[$i]["id"],$empdata);
157 $excelarray[$i]['modified']=date('Y-m-d H:i:s');
158 $successArr[] = $excelarray[$i];
159
160 }
161 }
162 else
163 {
164 $reason = "";
165
166 if($excelarray[$i]["id"]=="")
167 $reason .= "Column ID is blank,";
168
169 $excelarray[$i]['server_ip'] = $server_ip;
170 $excelarray[$i]['location'] = $location;
171
172 if($excelarray[$i]["clientcode"]!="")
173 $excelarray[$i]['cust_id'] = $excelarray[$i]["clientcode"];
174
175 $excelarray[$i]['Reason'] = $reason;
176
177 $failureArr[] = $excelarray[$i];
178 }
179
180 }
181
182 if(!empty($successArr)){
183 foreach($successArr as $succes)
184 {
185 $setSuccess=array();
186
187 $setSuccess[] = "server_ip='$server_ip'";
188 $setSuccess[] = "location='$location'";
189 $setSuccess[] = "record_id='".$succes['id']."'";
190 $setSuccess[] = "cust_id='".$succes['clientcode']."'";
191 $setSuccess[] = "modified='".$succes['modified']."'";
192
193 $setSuccess = implode(",",$setSuccess);
194
195 DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success set $setSuccess"));
196 }
197 }
198
199 if(!empty($failureArr)){
200 foreach($failureArr as $failur)
201 {
202 $setFailure=array();
203
204 $setFailure[] = "server_ip='$server_ip'";
205 $setFailure[] = "location='$location'";
206 $setFailure[] = "cust_id='".$failur['clientcode']."'";
207 $setFailure[] = "reason='".$failur['Reason']."'";
208
209 $setFailure = implode(",",$setFailure);
210
211 DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_failure set $setFailure"));
212 }
213 }
214
215 DB::connection("conn")->disconnect();
216
217
218 }
219 }
...\ No newline at end of file ...\ No newline at end of file
1 <?php namespace App\Console\Commands;
2
3 use Illuminate\Console\Command;
4 //use Mail;
5 use DB;
6 use Config;
7
8 use App\Models\User;
9 use App\Models\Accesslog;
10
11 use App\Models\CRMCall;
12 use Schema;
13 use PDO;
14 use App\Models\Notification;
15 use App\Jobs\KHRMSLib;
16
17 use Input;
18
19 use Illuminate\Database\Schema\Blueprint;
20
21 class bulkServerUpload extends Command {
22
23 /**
24 * The console command name.
25 *
26 * @var string
27 */
28 protected $signature = 'bulkServerUpload';
29
30 /**
31 * The console command description.
32 *
33 * @var string
34 */
35 protected $description = 'bulkServerUpload';
36
37 /**
38 * Execute the console command.
39 *
40 * @return mixed
41 */
42 public function handle()
43 {
44
45 $wakka = new KHRMSLib();
46
47 $kformlib=new \App\Jobs\KFormLib($wakka->HRCoreVars["HRFiledsStr"]);
48 $kformlib->gthis=$wakka;
49
50 $themehome=$wakka->GetThemePath('/');
51 $updatetime=time();
52
53 $clientlst=$wakka->GetBBBUserData("clientslist");
54
55 $isadmin=$wakka->IsAdmin();
56 $username=$wakka->GetUserName();
57 $triggers=Input::get("triggers");
58 $tmpstr=explode(",",$kformlib->HRFiledsStr);
59
60 $success="";$message="";$successcnt=0;$duplicatecount=0;
61
62
63 $conn = array(
64 'driver' => 'mysql',
65 'host' => '10.3.177.14',
66 'database' => env('DB_DATABASE', 'kstych_flexydial'),
67 'username' => env('DB_USERNAME', 'root'),
68 'password' => env('DB_PASSWORD', 'yb9738z'),
69 'charset' => 'utf8',
70 'collation' => 'utf8_unicode_ci',
71 'prefix' => '',
72 'options' => array(
73 PDO::ATTR_TIMEOUT => 5,
74 ),
75 );
76 Config::set("database.connections.conn", $conn);
77
78 DB::connection("conn")->getDatabaseName();
79
80 $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='10.3.179.121' and client='G4015' order by auto_id asc limit 0,20000"));
81
82 foreach($excelarray as $key => $array){
83 $excelarray[$key] = (array)$array;
84 }
85
86 $highestColumn = DB::connection("conn")->select(DB::raw("select count(*) as cnt from information_schema.columns where table_name='bz_record_upload_uat'"));
87 $highestColumn = $highestColumn[0]->cnt;
88
89 $highestrow = count($excelarray);
90
91 $flag = 0;
92 $editflag=0;
93
94 for($i=0;$i<=$highestrow;$i++)
95 {
96 if($excelarray[$i]["id"]!="")
97 {
98 if($excelarray[$i]["id"]=="CREATE")
99 {
100 $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s')));
101 }
102 else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]);
103
104 if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1)
105 {
106 $empdata=$wakka->getPerson($excelarray[$i]["id"]);
107 $ppldata=$empdata["peopledata"];
108 $createdlog=$empdata['modifylog'];
109 $fdirty=$empdata['dirty'];
110
111 $createdlog[$updatetime]=$username."::";
112 $createdlog["updated"]=$updatetime;
113
114 $newdata=$ppldata;
115 foreach($excelarray[$i] as $key => $value)
116 {
117 if($value!="")
118 {
119 if("A".$ppldata[$key]!="A".$value)//forcing string comparrision //MAGIC
120 {
121 $value=str_replace("'"," ",$value);
122 if(strstr($createdlog[$updatetime],$key)==FALSE)$createdlog[$updatetime].="$key|".str_replace(array("|",",")," ",$ppldata[$key])."|".str_replace(array("|",",")," ",$value).",";
123
124 $fdirty[$key]=1;
125
126 $newdata[$key]=$value;
127 }
128 }
129 }
130 $empdata["peopledata"]=$newdata;
131 $empdata['modifylog']=$createdlog;
132 $empdata['dirty']=$fdirty;
133
134 $wakka->setPerson($excelarray[$i]["id"],$empdata);
135 $excelarray[$i]['modified']=date('Y-m-d H:i:s');
136
137 }
138 }
139
140 }
141 mysqli_close($conn);
142
143
144 }
145 }
146
147
148
149
...@@ -43,12 +43,13 @@ class CreportEight extends Command { ...@@ -43,12 +43,13 @@ class CreportEight extends Command {
43 $logdate=strtotime('0 day'); 43 $logdate=strtotime('0 day');
44 44
45 $tcol=0;$fieldsarr=array();$extrahdrarr=array(); 45 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
46 $server_id="08"; 46 $central_ip=env('central_ip');
47 $server_ip=env('app_ip');
47 $calllog_report = "calllog_report_".date("d_m_Y"); 48 $calllog_report = "calllog_report_".date("d_m_Y");
48 49
49 $conn = array( 50 $conn = array(
50 'driver' => 'mysql', 51 'driver' => 'mysql',
51 'host' => '10.3.177.14', 52 'host' => $central_ip,
52 'database' => env('DB_DATABASE', 'kstych_flexydial'), 53 'database' => env('DB_DATABASE', 'kstych_flexydial'),
53 'username' => env('DB_USERNAME', 'root'), 54 'username' => env('DB_USERNAME', 'root'),
54 'password' => env('DB_PASSWORD', ''), 55 'password' => env('DB_PASSWORD', ''),
...@@ -63,6 +64,12 @@ class CreportEight extends Command { ...@@ -63,6 +64,12 @@ class CreportEight extends Command {
63 64
64 DB::connection("conn")->getDatabaseName(); 65 DB::connection("conn")->getDatabaseName();
65 66
67 $serverclist=DB::connection("conn")->select(DB::raw("select id from server_details where server_ip='$server_ip'"));
68 $server_id=$serverclist[0]->id;
69 if($server_id<10){
70 $server_id="0".$server_id;
71 }
72
66 73
67 $maxid=DB::connection("conn")->select(DB::raw("SELECT max(crmcall_id) as maxid from $calllog_report where server='$server_id'")); 74 $maxid=DB::connection("conn")->select(DB::raw("SELECT max(crmcall_id) as maxid from $calllog_report where server='$server_id'"));
68 75
......
...@@ -49,6 +49,8 @@ class InsertCrmArchive extends Command { ...@@ -49,6 +49,8 @@ class InsertCrmArchive extends Command {
49 49
50 DB::insert(DB::raw("insert into crmcalls_archive select * from crmcalls where id>(select max(id) from crmcalls_archive)")); 50 DB::insert(DB::raw("insert into crmcalls_archive select * from crmcalls where id>(select max(id) from crmcalls_archive)"));
51 51
52 DB::update(DB::raw("UPDATE crmcalls_archive as ca INNER JOIN crmcalls as c on ca.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"));
53
52 echo 'End'; 54 echo 'End';
53 } 55 }
54 } 56 }
......
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 Userlog_data extends Command {
17
18 /**
19 * The console command name.
20 *
21 * @var string
22 */
23 protected $signature = 'Userlog_data';
24
25 /**
26 * The console command description.
27 *
28 * @var string
29 */
30 protected $description = 'Userlog_data';
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 $logdate=strtotime('-1 day');
43 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
44 $server_ip=env('app_ip');
45 $central_ip=env('central_ip');
46
47 $conn = array(
48 'driver' => 'mysql',
49 'host' => $central_ip,
50 'database' => env('DB_DATABASE', 'kstych_flexydial'),
51 'username' => env('DB_USERNAME', 'root'),
52 'password' => env('DB_PASSWORD', ''),
53 'charset' => 'utf8',
54 'collation' => 'utf8_unicode_ci',
55 'prefix' => '',
56 'options' => array(
57 PDO::ATTR_TIMEOUT => 5,
58 ),
59 );
60 Config::set("database.connections.conn", $conn);
61 if(DB::connection("conn")->getDatabaseName())
62 {
63 $serverclist=DB::connection("conn")->select(DB::raw("select id from server_details where server_ip='$server_ip'"));
64 $server_id=$serverclist[0]->id;
65 if($server_id<10){
66 $server_id="0".$server_id;
67 }
68
69
70 $i=0;
71
72
73 $ulist=DB::select(DB::raw("select * from users WHERE 1"));
74 foreach($ulist as $uline) {
75 $users[$uline->id] = $uline->username;
76 }
77 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)."'"))){
78
79
80 foreach($alist as $aline) {
81 $i++;
82 $global_id = $server_id . $i;
83 if($aline->enddate=='0000-00-00'|| $aline->endtime=='00:00:00' || $aline->durationsec=='0')
84 {
85 $enddatetime=date("Y-m-d H:i:s",strtotime($aline->updated_at));
86 $enddate=explode(" ",$enddatetime)[0];
87 $endtime=explode(" ",$enddatetime)[1];
88 $durationsec=date("Y-m-d H:i:s",strtotime($endtime-$aline->starttime));
89 }
90 else
91 {
92 $enddate=$aline->enddate;
93 $endtime=$aline->endtime;
94 $durationsec=$aline->durationsec;
95 }
96
97 $rowdata = array('server'=>$server_id,'server_ip'=>$server_ip,'global_id'=>$global_id,'id'=>$aline->id,
98 'created_at'=>$aline->created_at,'updated_at'=>$aline->updated_at,'user_id'=>$aline->user_id,'user'=>$users[$aline->user_id],
99 'startdate'=>$aline->startdate,'starttime'=>$aline->starttime,'enddate'=>$enddate,'endtime'=>$endtime,
100 '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'=>''
101 );
102
103 $data=json_decode($aline->data,true);
104 foreach($data as $sipid=>$sdata)
105 {
106 $prets= isset($sdata[1]) ? $sdata[1] : (strtotime($aline->startdate . " " . $aline->starttime)+19600)*1000;
107 if(isset($sdata['states']))
108 {
109 $previous="login";
110 foreach($sdata['states'] as $fts=>$states)
111 {
112 if($states[0] != 1)
113 {
114 $rowdata[$previous] +=round(($fts-$prets)/1000,2);
115
116 $previous = (trim($states[1]) != '') ? strtolower($states[0]."-".$states[1]) : strtolower($states[0]);
117 $prets=$fts;
118 }
119
120 }
121 $rowdata[$previous] += round(($sdata['ts']-$prets)/1000,2);
122 }
123 }
124 $rowdata["login"] = $aline->durationsec;
125
126 $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'];
127
128
129 $key_value = '';
130 foreach($rowdata AS $key=>$value) {
131 if($key != 1)
132 $key_value .= "`$key` = '$value', ";
133 }
134
135 $startTime=$aline->startdate." ".$aline->starttime;
136 $endTime=$aline->enddate." ".$aline->endtime;
137
138 $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."'"));
139
140 $ts_Wait=0;$ts_Call=0;$ts_Talk=0;$ts_Dispo=0;
141 $progTs_Wait=0;$progTs_Call=0;$progTs_Talk=0;$progTs_Dispo=0;
142 $manTs_Wait=0;$manTs_Call=0;$manTs_Talk=0;$manTs_Dispo=0;
143 $inbTs_Wait=0;$inbTs_Call=0;$inbTs_Talk=0;$inbTs_Dispo=0;
144 $tt_prog=0;$tt_man=0;$tt_inb=0;
145
146 if($crmCalls!=null){
147 foreach($crmCalls as $crmCall){
148 $ts_Wait += round(($crmCall->ts_Call - $crmCall->ts_Wait)/1000,2);
149 $ts_Call += round(($crmCall->ts_Talk - $crmCall->ts_Call)/1000,2);
150 $ts_Talk += round(($crmCall->ts_Dispo - $crmCall->ts_Talk)/1000,2);
151 $ts_Dispo += round(($crmCall->ts_Close - $crmCall->ts_Dispo)/1000,2);
152
153 if($crmCall->type == 'Progressive')
154 {
155 $progTs_Wait += round(($crmCall->ts_Call - $crmCall->ts_Wait)/1000,2);
156 $progTs_Call += round(($crmCall->ts_Talk - $crmCall->ts_Call)/1000,2);
157 $progTs_Talk += round(($crmCall->ts_Dispo - $crmCall->ts_Talk)/1000,2);
158 $progTs_Dispo += round(($crmCall->ts_Close - $crmCall->ts_Dispo)/1000,2);
159 }
160
161 if($crmCall->type == 'Manual')
162 {
163 $manTs_Wait += round(($crmCall->ts_Call - $crmCall->ts_Wait)/1000,2);
164 $manTs_Call += round(($crmCall->ts_Talk - $crmCall->ts_Call)/1000,2);
165 $manTs_Talk += round(($crmCall->ts_Dispo - $crmCall->ts_Talk)/1000,2);
166 $manTs_Dispo += round(($crmCall->ts_Close - $crmCall->ts_Dispo)/1000,2);
167 }
168
169 if($crmCall->type == 'Inbound')
170 {
171 $inbTs_Wait += round(($crmCall->ts_Call - $crmCall->ts_Wait)/1000,2);
172 $inbTs_Call += round(($crmCall->ts_Talk - $crmCall->ts_Call)/1000,2);
173 $inbTs_Talk += round(($crmCall->ts_Dispo - $crmCall->ts_Talk)/1000,2);
174 $inbTs_Dispo += round(($crmCall->ts_Close - $crmCall->ts_Dispo)/1000,2);
175 }
176 }
177 }
178
179 $tt_prog = $progTs_Wait + $progTs_Call + $progTs_Talk + $progTs_Dispo;
180 $tt_man = $manTs_Wait + $manTs_Call + $manTs_Talk + $manTs_Dispo;
181 $tt_inb = $inbTs_Wait + $inbTs_Call + $inbTs_Talk + $inbTs_Dispo;
182
183 $prod_TOS = $ts_Wait + $ts_Call + $ts_Talk + $ts_Dispo;
184
185 $key_value .= "`tt_prog` = '$tt_prog', ";
186 $key_value .= "`tt_man` = '$tt_man', ";
187 $key_value .= "`tt_inb` = '$tt_inb', ";
188
189 $key_value .= "`ts_Wait` = '$ts_Wait', ";
190 $key_value .= "`ts_Call` = '$ts_Call', ";
191 $key_value .= "`ts_Talk` = '$ts_Talk', ";
192 $key_value .= "`ts_Dispo` = '$ts_Dispo', ";
193 $key_value .= "`progts_Wait` = '$progTs_Wait', ";
194 $key_value .= "`progts_Call` = '$progTs_Call', ";
195 $key_value .= "`progts_Talk` = '$progTs_Talk', ";
196 $key_value .= "`progts_Dispo` = '$progTs_Dispo', ";
197 $key_value .= "`mants_Wait` = '$manTs_Wait', ";
198 $key_value .= "`mants_Call` = '$manTs_Call', ";
199 $key_value .= "`mants_Talk` = '$manTs_Talk', ";
200 $key_value .= "`mants_Dispo` = '$manTs_Dispo', ";
201 $key_value .= "`incts_Wait` = '$inbTs_Wait', ";
202 $key_value .= "`incts_Call` = '$inbTs_Call', ";
203 $key_value .= "`incts_Talk` = '$inbTs_Talk', ";
204 $key_value .= "`incts_Dispo` = '$inbTs_Dispo', ";
205 $key_value .= "`prod_tos` = '$prod_TOS', ";
206
207
208
209 $key_value = substr($key_value, 0, -2);
210
211 $userlogsTable = "userlogs_".date("d_m_Y",$logdate);
212 DB::connection("conn")->insert(DB::raw("INSERT INTO ".$userlogsTable." SET $key_value"));
213
214 }
215
216 }
217 }
218 }
219 }
...@@ -42,7 +42,12 @@ class bulkServerUpload extends Command { ...@@ -42,7 +42,12 @@ class bulkServerUpload extends Command {
42 public function handle() 42 public function handle()
43 { 43 {
44 44
45 echo "\n".date('Y-m-d')."\n"; 45 //echo "\n".date('Y-m-d')."\n";
46
47 echo "1";
48 echo "\n".date('Y-m-d H:i:s')."\n";
49 $server_ip=env('app_ip');
50 $central_ip=env('central_ip');
46 51
47 $wakka = new KHRMSLib(); 52 $wakka = new KHRMSLib();
48 53
...@@ -64,7 +69,7 @@ class bulkServerUpload extends Command { ...@@ -64,7 +69,7 @@ class bulkServerUpload extends Command {
64 69
65 $conn = array( 70 $conn = array(
66 'driver' => 'mysql', 71 'driver' => 'mysql',
67 'host' => '10.3.177.14', 72 'host' => $central_ip,
68 'database' => env('DB_DATABASE', 'kstych_flexydial'), 73 'database' => env('DB_DATABASE', 'kstych_flexydial'),
69 'username' => env('DB_USERNAME', 'root'), 74 'username' => env('DB_USERNAME', 'root'),
70 'password' => env('DB_PASSWORD', 'yb9738z'), 75 'password' => env('DB_PASSWORD', 'yb9738z'),
...@@ -79,10 +84,11 @@ class bulkServerUpload extends Command { ...@@ -79,10 +84,11 @@ class bulkServerUpload extends Command {
79 84
80 DB::connection("conn")->getDatabaseName(); 85 DB::connection("conn")->getDatabaseName();
81 86
82 $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='10.3.179.121' order by auto_id asc limit 0,20000")); 87 $serverclist=DB::connection("conn")->select(DB::raw("select location from server_details where server_ip='$server_ip'"));
83 88 $location=$serverclist[0]->location;
84 $server_ip='10.3.179.121'; 89 echo $central_ip;
85 $location='Mumbai'; 90 echo $location;
91 $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"));
86 $conn=''; 92 $conn='';
87 93
88 $tcol=0;$fieldsarr=array();$extrahdrarr=array(); 94 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
...@@ -99,7 +105,7 @@ class bulkServerUpload extends Command { ...@@ -99,7 +105,7 @@ class bulkServerUpload extends Command {
99 $flag = 0; 105 $flag = 0;
100 $editflag=0; 106 $editflag=0;
101 107
102 for($i=0;$i<=$highestrow;$i++) 108 for($i=0;$i<$highestrow;$i++)
103 { 109 {
104 if($excelarray[$i]["id"]!="") 110 if($excelarray[$i]["id"]!="")
105 { 111 {
...@@ -108,7 +114,6 @@ class bulkServerUpload extends Command { ...@@ -108,7 +114,6 @@ class bulkServerUpload extends Command {
108 $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s'))); 114 $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s')));
109 } 115 }
110 else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]); 116 else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]);
111
112 if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1) 117 if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1)
113 { 118 {
114 $empdata=$wakka->getPerson($excelarray[$i]["id"]); 119 $empdata=$wakka->getPerson($excelarray[$i]["id"]);
...@@ -164,9 +169,28 @@ class bulkServerUpload extends Command { ...@@ -164,9 +169,28 @@ class bulkServerUpload extends Command {
164 $successArr[] = $excelarray[$i]; 169 $successArr[] = $excelarray[$i];
165 170
166 } 171 }
172 else
173 {
174 $reason = "";
175
176 $reason .= "Record ID is not on local server,";
177
178 $excelarray[$i]['server_ip'] =$server_ip;
179 $excelarray[$i]['location'] =$location;
180
181 if($excelarray[$i]["clientcode"]!="")
182 $excelarray[$i]['cust_id'] =$excelarray[$i]["clientcode"];
183 $excelarray[$i]['record_id'] = $excelarray[$i]["id"];
184
185 $excelarray[$i]['Reason'] = $reason;
186
187 $failureArr[] = $excelarray[$i];
188
189 }
167 } 190 }
168 else 191 else
169 { 192 {
193
170 $reason = ""; 194 $reason = "";
171 195
172 if($excelarray[$i]["id"]=="") 196 if($excelarray[$i]["id"]=="")
...@@ -181,10 +205,10 @@ class bulkServerUpload extends Command { ...@@ -181,10 +205,10 @@ class bulkServerUpload extends Command {
181 $excelarray[$i]['Reason'] = $reason; 205 $excelarray[$i]['Reason'] = $reason;
182 206
183 $failureArr[] = $excelarray[$i]; 207 $failureArr[] = $excelarray[$i];
208
184 } 209 }
185 210
186 } 211 }
187
188 if(!empty($successArr)){ 212 if(!empty($successArr)){
189 foreach($successArr as $succes) 213 foreach($successArr as $succes)
190 { 214 {
...@@ -201,7 +225,6 @@ class bulkServerUpload extends Command { ...@@ -201,7 +225,6 @@ class bulkServerUpload extends Command {
201 DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success set $setSuccess")); 225 DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success set $setSuccess"));
202 } 226 }
203 } 227 }
204
205 if(!empty($failureArr)){ 228 if(!empty($failureArr)){
206 foreach($failureArr as $failur) 229 foreach($failureArr as $failur)
207 { 230 {
...@@ -210,6 +233,7 @@ class bulkServerUpload extends Command { ...@@ -210,6 +233,7 @@ class bulkServerUpload extends Command {
210 $setFailure[] = "server_ip='$server_ip'"; 233 $setFailure[] = "server_ip='$server_ip'";
211 $setFailure[] = "location='$location'"; 234 $setFailure[] = "location='$location'";
212 $setFailure[] = "cust_id='".$failur['clientcode']."'"; 235 $setFailure[] = "cust_id='".$failur['clientcode']."'";
236 $setFailure[] = "record_id='".$failur['record_id']."'";
213 $setFailure[] = "reason='".$failur['Reason']."'"; 237 $setFailure[] = "reason='".$failur['Reason']."'";
214 238
215 $setFailure = implode(",",$setFailure); 239 $setFailure = implode(",",$setFailure);
...@@ -217,7 +241,6 @@ class bulkServerUpload extends Command { ...@@ -217,7 +241,6 @@ class bulkServerUpload extends Command {
217 DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_failure set $setFailure")); 241 DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_failure set $setFailure"));
218 } 242 }
219 } 243 }
220 //DB::connection("conn")->delete(DB::raw("DELETE FROM `bz_record_upload_uat` where SERVER_IP='10.3.179.121'"));
221 244
222 DB::connection("conn")->disconnect(); 245 DB::connection("conn")->disconnect();
223 } 246 }
......
...@@ -42,7 +42,13 @@ class bulkServerUpload_1 extends Command { ...@@ -42,7 +42,13 @@ class bulkServerUpload_1 extends Command {
42 public function handle() 42 public function handle()
43 { 43 {
44 44
45 echo "\n".date('Y-m-d')."\n"; 45 //echo "\n".date('Y-m-d')."\n";
46
47 echo "2";
48 echo "\n".date('Y-m-d H:i:s')."\n";
49 $server_ip=env('app_ip');
50 $central_ip=env('central_ip');
51
46 52
47 $wakka = new KHRMSLib(); 53 $wakka = new KHRMSLib();
48 54
...@@ -64,7 +70,7 @@ class bulkServerUpload_1 extends Command { ...@@ -64,7 +70,7 @@ class bulkServerUpload_1 extends Command {
64 70
65 $conn = array( 71 $conn = array(
66 'driver' => 'mysql', 72 'driver' => 'mysql',
67 'host' => '10.3.177.14', 73 'host' => $central_ip,
68 'database' => env('DB_DATABASE', 'kstych_flexydial'), 74 'database' => env('DB_DATABASE', 'kstych_flexydial'),
69 'username' => env('DB_USERNAME', 'root'), 75 'username' => env('DB_USERNAME', 'root'),
70 'password' => env('DB_PASSWORD', 'yb9738z'), 76 'password' => env('DB_PASSWORD', 'yb9738z'),
...@@ -79,10 +85,12 @@ class bulkServerUpload_1 extends Command { ...@@ -79,10 +85,12 @@ class bulkServerUpload_1 extends Command {
79 85
80 DB::connection("conn")->getDatabaseName(); 86 DB::connection("conn")->getDatabaseName();
81 87
82 $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='10.3.179.121' order by auto_id asc limit 20001,40000")); 88 $serverclist=DB::connection("conn")->select(DB::raw("select location from server_details where server_ip='$server_ip'"));
89 $location=$serverclist[0]->location;
90
91
92 $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"));
83 93
84 $server_ip='10.3.179.121';
85 $location='Mumbai';
86 $conn=''; 94 $conn='';
87 95
88 $tcol=0;$fieldsarr=array();$extrahdrarr=array(); 96 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
......
...@@ -18,21 +18,21 @@ use Input; ...@@ -18,21 +18,21 @@ use Input;
18 18
19 use Illuminate\Database\Schema\Blueprint; 19 use Illuminate\Database\Schema\Blueprint;
20 20
21 class bulkServerUpload_5 extends Command { 21 class bulkServerUpload_2 extends Command {
22 22
23 /** 23 /**
24 * The console command name. 24 * The console command name.
25 * 25 *
26 * @var string 26 * @var string
27 */ 27 */
28 protected $signature = 'bulkServerUpload_5'; 28 protected $signature = 'bulkServerUpload_2';
29 29
30 /** 30 /**
31 * The console command description. 31 * The console command description.
32 * 32 *
33 * @var string 33 * @var string
34 */ 34 */
35 protected $description = 'bulkServerUpload_5'; 35 protected $description = 'bulkServerUpload_2';
36 36
37 /** 37 /**
38 * Execute the console command. 38 * Execute the console command.
...@@ -42,7 +42,13 @@ class bulkServerUpload_5 extends Command { ...@@ -42,7 +42,13 @@ class bulkServerUpload_5 extends Command {
42 public function handle() 42 public function handle()
43 { 43 {
44 44
45 echo "\n".date('Y-m-d')."\n"; 45 //echo "\n".date('Y-m-d')."\n";
46
47 echo "3";
48 echo "\n".date('Y-m-d H:i:s')."\n";
49 $server_ip=env('app_ip');
50 $central_ip=env('central_ip');
51
46 52
47 $wakka = new KHRMSLib(); 53 $wakka = new KHRMSLib();
48 54
...@@ -64,7 +70,7 @@ class bulkServerUpload_5 extends Command { ...@@ -64,7 +70,7 @@ class bulkServerUpload_5 extends Command {
64 70
65 $conn = array( 71 $conn = array(
66 'driver' => 'mysql', 72 'driver' => 'mysql',
67 'host' => '10.3.177.14', 73 'host' => $central_ip,
68 'database' => env('DB_DATABASE', 'kstych_flexydial'), 74 'database' => env('DB_DATABASE', 'kstych_flexydial'),
69 'username' => env('DB_USERNAME', 'root'), 75 'username' => env('DB_USERNAME', 'root'),
70 'password' => env('DB_PASSWORD', 'yb9738z'), 76 'password' => env('DB_PASSWORD', 'yb9738z'),
...@@ -79,10 +85,12 @@ class bulkServerUpload_5 extends Command { ...@@ -79,10 +85,12 @@ class bulkServerUpload_5 extends Command {
79 85
80 DB::connection("conn")->getDatabaseName(); 86 DB::connection("conn")->getDatabaseName();
81 87
82 $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='10.3.179.121' order by auto_id asc limit 100001,120000")); 88 $serverclist=DB::connection("conn")->select(DB::raw("select location from server_details where server_ip='$server_ip'"));
89 $location=$serverclist[0]->location;
90
91
92 $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"));
83 93
84 $server_ip='10.3.179.121';
85 $location='Mumbai';
86 $conn=''; 94 $conn='';
87 95
88 $tcol=0;$fieldsarr=array();$extrahdrarr=array(); 96 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
...@@ -99,7 +107,7 @@ class bulkServerUpload_5 extends Command { ...@@ -99,7 +107,7 @@ class bulkServerUpload_5 extends Command {
99 $flag = 0; 107 $flag = 0;
100 $editflag=0; 108 $editflag=0;
101 109
102 for($i=0;$i<=$highestrow;$i++) 110 for($i=0;$i<$highestrow;$i++)
103 { 111 {
104 if($excelarray[$i]["id"]!="") 112 if($excelarray[$i]["id"]!="")
105 { 113 {
...@@ -108,7 +116,6 @@ class bulkServerUpload_5 extends Command { ...@@ -108,7 +116,6 @@ class bulkServerUpload_5 extends Command {
108 $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s'))); 116 $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s')));
109 } 117 }
110 else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]); 118 else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]);
111
112 if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1) 119 if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1)
113 { 120 {
114 $empdata=$wakka->getPerson($excelarray[$i]["id"]); 121 $empdata=$wakka->getPerson($excelarray[$i]["id"]);
...@@ -164,9 +171,28 @@ class bulkServerUpload_5 extends Command { ...@@ -164,9 +171,28 @@ class bulkServerUpload_5 extends Command {
164 $successArr[] = $excelarray[$i]; 171 $successArr[] = $excelarray[$i];
165 172
166 } 173 }
174 else
175 {
176 $reason = "";
177
178 $reason .= "Record ID is not on local server,";
179
180 $excelarray[$i]['server_ip'] =$server_ip;
181 $excelarray[$i]['location'] =$location;
182
183 if($excelarray[$i]["clientcode"]!="")
184 $excelarray[$i]['cust_id'] =$excelarray[$i]["clientcode"];
185 $excelarray[$i]['record_id'] = $excelarray[$i]["id"];
186
187 $excelarray[$i]['Reason'] = $reason;
188
189 $failureArr[] = $excelarray[$i];
190
191 }
167 } 192 }
168 else 193 else
169 { 194 {
195
170 $reason = ""; 196 $reason = "";
171 197
172 if($excelarray[$i]["id"]=="") 198 if($excelarray[$i]["id"]=="")
...@@ -181,10 +207,10 @@ class bulkServerUpload_5 extends Command { ...@@ -181,10 +207,10 @@ class bulkServerUpload_5 extends Command {
181 $excelarray[$i]['Reason'] = $reason; 207 $excelarray[$i]['Reason'] = $reason;
182 208
183 $failureArr[] = $excelarray[$i]; 209 $failureArr[] = $excelarray[$i];
210
184 } 211 }
185 212
186 } 213 }
187
188 if(!empty($successArr)){ 214 if(!empty($successArr)){
189 foreach($successArr as $succes) 215 foreach($successArr as $succes)
190 { 216 {
...@@ -201,7 +227,6 @@ class bulkServerUpload_5 extends Command { ...@@ -201,7 +227,6 @@ class bulkServerUpload_5 extends Command {
201 DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success set $setSuccess")); 227 DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success set $setSuccess"));
202 } 228 }
203 } 229 }
204
205 if(!empty($failureArr)){ 230 if(!empty($failureArr)){
206 foreach($failureArr as $failur) 231 foreach($failureArr as $failur)
207 { 232 {
...@@ -210,6 +235,7 @@ class bulkServerUpload_5 extends Command { ...@@ -210,6 +235,7 @@ class bulkServerUpload_5 extends Command {
210 $setFailure[] = "server_ip='$server_ip'"; 235 $setFailure[] = "server_ip='$server_ip'";
211 $setFailure[] = "location='$location'"; 236 $setFailure[] = "location='$location'";
212 $setFailure[] = "cust_id='".$failur['clientcode']."'"; 237 $setFailure[] = "cust_id='".$failur['clientcode']."'";
238 $setFailure[] = "record_id='".$failur['record_id']."'";
213 $setFailure[] = "reason='".$failur['Reason']."'"; 239 $setFailure[] = "reason='".$failur['Reason']."'";
214 240
215 $setFailure = implode(",",$setFailure); 241 $setFailure = implode(",",$setFailure);
...@@ -217,7 +243,6 @@ class bulkServerUpload_5 extends Command { ...@@ -217,7 +243,6 @@ class bulkServerUpload_5 extends Command {
217 DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_failure set $setFailure")); 243 DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_failure set $setFailure"));
218 } 244 }
219 } 245 }
220 // DB::connection("conn")->delete(DB::raw("DELETE FROM `bz_record_upload_uat` where SERVER_IP='10.3.179.121'"));
221 246
222 DB::connection("conn")->disconnect(); 247 DB::connection("conn")->disconnect();
223 } 248 }
......
...@@ -42,7 +42,13 @@ class bulkServerUpload_3 extends Command { ...@@ -42,7 +42,13 @@ class bulkServerUpload_3 extends Command {
42 public function handle() 42 public function handle()
43 { 43 {
44 44
45 echo "\n".date('Y-m-d')."\n"; 45 //echo "\n".date('Y-m-d')."\n";
46
47 echo "4";
48 echo "\n".date('Y-m-d H:i:s')."\n";
49 $server_ip=env('app_ip');
50 $central_ip=env('central_ip');
51
46 52
47 $wakka = new KHRMSLib(); 53 $wakka = new KHRMSLib();
48 54
...@@ -64,7 +70,7 @@ class bulkServerUpload_3 extends Command { ...@@ -64,7 +70,7 @@ class bulkServerUpload_3 extends Command {
64 70
65 $conn = array( 71 $conn = array(
66 'driver' => 'mysql', 72 'driver' => 'mysql',
67 'host' => '10.3.177.14', 73 'host' => $central_ip,
68 'database' => env('DB_DATABASE', 'kstych_flexydial'), 74 'database' => env('DB_DATABASE', 'kstych_flexydial'),
69 'username' => env('DB_USERNAME', 'root'), 75 'username' => env('DB_USERNAME', 'root'),
70 'password' => env('DB_PASSWORD', 'yb9738z'), 76 'password' => env('DB_PASSWORD', 'yb9738z'),
...@@ -79,10 +85,12 @@ class bulkServerUpload_3 extends Command { ...@@ -79,10 +85,12 @@ class bulkServerUpload_3 extends Command {
79 85
80 DB::connection("conn")->getDatabaseName(); 86 DB::connection("conn")->getDatabaseName();
81 87
82 $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='10.3.179.121' order by auto_id asc limit 60001,80000")); 88 $serverclist=DB::connection("conn")->select(DB::raw("select location from server_details where server_ip='$server_ip'"));
89 $location=$serverclist[0]->location;
90
91
92 $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"));
83 93
84 $server_ip='10.3.179.121';
85 $location='Mumbai';
86 $conn=''; 94 $conn='';
87 95
88 $tcol=0;$fieldsarr=array();$extrahdrarr=array(); 96 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
...@@ -99,7 +107,7 @@ class bulkServerUpload_3 extends Command { ...@@ -99,7 +107,7 @@ class bulkServerUpload_3 extends Command {
99 $flag = 0; 107 $flag = 0;
100 $editflag=0; 108 $editflag=0;
101 109
102 for($i=0;$i<=$highestrow;$i++) 110 for($i=0;$i<$highestrow;$i++)
103 { 111 {
104 if($excelarray[$i]["id"]!="") 112 if($excelarray[$i]["id"]!="")
105 { 113 {
...@@ -108,7 +116,6 @@ class bulkServerUpload_3 extends Command { ...@@ -108,7 +116,6 @@ class bulkServerUpload_3 extends Command {
108 $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s'))); 116 $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s')));
109 } 117 }
110 else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]); 118 else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]);
111
112 if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1) 119 if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1)
113 { 120 {
114 $empdata=$wakka->getPerson($excelarray[$i]["id"]); 121 $empdata=$wakka->getPerson($excelarray[$i]["id"]);
...@@ -164,9 +171,28 @@ class bulkServerUpload_3 extends Command { ...@@ -164,9 +171,28 @@ class bulkServerUpload_3 extends Command {
164 $successArr[] = $excelarray[$i]; 171 $successArr[] = $excelarray[$i];
165 172
166 } 173 }
174 else
175 {
176 $reason = "";
177
178 $reason .= "Record ID is not on local server,";
179
180 $excelarray[$i]['server_ip'] =$server_ip;
181 $excelarray[$i]['location'] =$location;
182
183 if($excelarray[$i]["clientcode"]!="")
184 $excelarray[$i]['cust_id'] =$excelarray[$i]["clientcode"];
185 $excelarray[$i]['record_id'] = $excelarray[$i]["id"];
186
187 $excelarray[$i]['Reason'] = $reason;
188
189 $failureArr[] = $excelarray[$i];
190
191 }
167 } 192 }
168 else 193 else
169 { 194 {
195
170 $reason = ""; 196 $reason = "";
171 197
172 if($excelarray[$i]["id"]=="") 198 if($excelarray[$i]["id"]=="")
...@@ -181,10 +207,10 @@ class bulkServerUpload_3 extends Command { ...@@ -181,10 +207,10 @@ class bulkServerUpload_3 extends Command {
181 $excelarray[$i]['Reason'] = $reason; 207 $excelarray[$i]['Reason'] = $reason;
182 208
183 $failureArr[] = $excelarray[$i]; 209 $failureArr[] = $excelarray[$i];
210
184 } 211 }
185 212
186 } 213 }
187
188 if(!empty($successArr)){ 214 if(!empty($successArr)){
189 foreach($successArr as $succes) 215 foreach($successArr as $succes)
190 { 216 {
...@@ -201,7 +227,6 @@ class bulkServerUpload_3 extends Command { ...@@ -201,7 +227,6 @@ class bulkServerUpload_3 extends Command {
201 DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success set $setSuccess")); 227 DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success set $setSuccess"));
202 } 228 }
203 } 229 }
204
205 if(!empty($failureArr)){ 230 if(!empty($failureArr)){
206 foreach($failureArr as $failur) 231 foreach($failureArr as $failur)
207 { 232 {
...@@ -210,6 +235,7 @@ class bulkServerUpload_3 extends Command { ...@@ -210,6 +235,7 @@ class bulkServerUpload_3 extends Command {
210 $setFailure[] = "server_ip='$server_ip'"; 235 $setFailure[] = "server_ip='$server_ip'";
211 $setFailure[] = "location='$location'"; 236 $setFailure[] = "location='$location'";
212 $setFailure[] = "cust_id='".$failur['clientcode']."'"; 237 $setFailure[] = "cust_id='".$failur['clientcode']."'";
238 $setFailure[] = "record_id='".$failur['record_id']."'";
213 $setFailure[] = "reason='".$failur['Reason']."'"; 239 $setFailure[] = "reason='".$failur['Reason']."'";
214 240
215 $setFailure = implode(",",$setFailure); 241 $setFailure = implode(",",$setFailure);
......
...@@ -18,21 +18,21 @@ use Input; ...@@ -18,21 +18,21 @@ use Input;
18 18
19 use Illuminate\Database\Schema\Blueprint; 19 use Illuminate\Database\Schema\Blueprint;
20 20
21 class bulkServerUpload_daily extends Command { 21 class bulkServerUpload_4 extends Command {
22 22
23 /** 23 /**
24 * The console command name. 24 * The console command name.
25 * 25 *
26 * @var string 26 * @var string
27 */ 27 */
28 protected $signature = 'bulkServerUpload_daily'; 28 protected $signature = 'bulkServerUpload_4';
29 29
30 /** 30 /**
31 * The console command description. 31 * The console command description.
32 * 32 *
33 * @var string 33 * @var string
34 */ 34 */
35 protected $description = 'bulkServerUpload_daily'; 35 protected $description = 'bulkServerUpload_4';
36 36
37 /** 37 /**
38 * Execute the console command. 38 * Execute the console command.
...@@ -42,7 +42,13 @@ class bulkServerUpload_daily extends Command { ...@@ -42,7 +42,13 @@ class bulkServerUpload_daily extends Command {
42 public function handle() 42 public function handle()
43 { 43 {
44 44
45 echo "\n".date('Y-m-d')."\n"; 45 //echo "\n".date('Y-m-d')."\n";
46
47 echo "5";
48 echo "\n".date('Y-m-d H:i:s')."\n";
49 $server_ip=env('app_ip');
50 $central_ip=env('central_ip');
51
46 52
47 $wakka = new KHRMSLib(); 53 $wakka = new KHRMSLib();
48 54
...@@ -64,7 +70,7 @@ class bulkServerUpload_daily extends Command { ...@@ -64,7 +70,7 @@ class bulkServerUpload_daily extends Command {
64 70
65 $conn = array( 71 $conn = array(
66 'driver' => 'mysql', 72 'driver' => 'mysql',
67 'host' => '10.3.177.14', 73 'host' => $central_ip,
68 'database' => env('DB_DATABASE', 'kstych_flexydial'), 74 'database' => env('DB_DATABASE', 'kstych_flexydial'),
69 'username' => env('DB_USERNAME', 'root'), 75 'username' => env('DB_USERNAME', 'root'),
70 'password' => env('DB_PASSWORD', 'yb9738z'), 76 'password' => env('DB_PASSWORD', 'yb9738z'),
...@@ -78,11 +84,12 @@ class bulkServerUpload_daily extends Command { ...@@ -78,11 +84,12 @@ class bulkServerUpload_daily extends Command {
78 Config::set("database.connections.conn", $conn); 84 Config::set("database.connections.conn", $conn);
79 85
80 DB::connection("conn")->getDatabaseName(); 86 DB::connection("conn")->getDatabaseName();
87 $serverclist=DB::connection("conn")->select(DB::raw("select location from server_details where server_ip='$server_ip'"));
88 $location=$serverclist[0]->location;
89
81 90
82 $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat_daily where SERVER_IP='10.3.179.121' order by auto_id asc limit 0,200")); 91 $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='$server_ip' order by auto_id asc limit 80001,100000"));
83 92
84 $server_ip='10.3.179.121';
85 $location='Mumbai';
86 $conn=''; 93 $conn='';
87 94
88 $tcol=0;$fieldsarr=array();$extrahdrarr=array(); 95 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
...@@ -91,7 +98,7 @@ class bulkServerUpload_daily extends Command { ...@@ -91,7 +98,7 @@ class bulkServerUpload_daily extends Command {
91 $excelarray[$key] = (array)$array; 98 $excelarray[$key] = (array)$array;
92 } 99 }
93 100
94 $highestColumn = DB::connection("conn")->select(DB::raw("select count(*) as cnt from information_schema.columns where table_name='bz_record_upload_uat_daily'")); 101 $highestColumn = DB::connection("conn")->select(DB::raw("select count(*) as cnt from information_schema.columns where table_name='bz_record_upload_uat'"));
95 $highestColumn = $highestColumn[0]->cnt; 102 $highestColumn = $highestColumn[0]->cnt;
96 103
97 $highestrow = count($excelarray); 104 $highestrow = count($excelarray);
...@@ -99,7 +106,7 @@ class bulkServerUpload_daily extends Command { ...@@ -99,7 +106,7 @@ class bulkServerUpload_daily extends Command {
99 $flag = 0; 106 $flag = 0;
100 $editflag=0; 107 $editflag=0;
101 108
102 for($i=0;$i<=$highestrow;$i++) 109 for($i=0;$i<$highestrow;$i++)
103 { 110 {
104 if($excelarray[$i]["id"]!="") 111 if($excelarray[$i]["id"]!="")
105 { 112 {
...@@ -108,7 +115,6 @@ class bulkServerUpload_daily extends Command { ...@@ -108,7 +115,6 @@ class bulkServerUpload_daily extends Command {
108 $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s'))); 115 $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s')));
109 } 116 }
110 else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]); 117 else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]);
111
112 if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1) 118 if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1)
113 { 119 {
114 $empdata=$wakka->getPerson($excelarray[$i]["id"]); 120 $empdata=$wakka->getPerson($excelarray[$i]["id"]);
...@@ -164,9 +170,28 @@ class bulkServerUpload_daily extends Command { ...@@ -164,9 +170,28 @@ class bulkServerUpload_daily extends Command {
164 $successArr[] = $excelarray[$i]; 170 $successArr[] = $excelarray[$i];
165 171
166 } 172 }
173 else
174 {
175 $reason = "";
176
177 $reason .= "Record ID is not on local server,";
178
179 $excelarray[$i]['server_ip'] =$server_ip;
180 $excelarray[$i]['location'] =$location;
181
182 if($excelarray[$i]["clientcode"]!="")
183 $excelarray[$i]['cust_id'] =$excelarray[$i]["clientcode"];
184 $excelarray[$i]['record_id'] = $excelarray[$i]["id"];
185
186 $excelarray[$i]['Reason'] = $reason;
187
188 $failureArr[] = $excelarray[$i];
189
190 }
167 } 191 }
168 else 192 else
169 { 193 {
194
170 $reason = ""; 195 $reason = "";
171 196
172 if($excelarray[$i]["id"]=="") 197 if($excelarray[$i]["id"]=="")
...@@ -181,10 +206,10 @@ class bulkServerUpload_daily extends Command { ...@@ -181,10 +206,10 @@ class bulkServerUpload_daily extends Command {
181 $excelarray[$i]['Reason'] = $reason; 206 $excelarray[$i]['Reason'] = $reason;
182 207
183 $failureArr[] = $excelarray[$i]; 208 $failureArr[] = $excelarray[$i];
209
184 } 210 }
185 211
186 } 212 }
187
188 if(!empty($successArr)){ 213 if(!empty($successArr)){
189 foreach($successArr as $succes) 214 foreach($successArr as $succes)
190 { 215 {
...@@ -198,10 +223,9 @@ class bulkServerUpload_daily extends Command { ...@@ -198,10 +223,9 @@ class bulkServerUpload_daily extends Command {
198 223
199 $setSuccess = implode(",",$setSuccess); 224 $setSuccess = implode(",",$setSuccess);
200 225
201 DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success_daily set $setSuccess")); 226 DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success set $setSuccess"));
202 } 227 }
203 } 228 }
204
205 if(!empty($failureArr)){ 229 if(!empty($failureArr)){
206 foreach($failureArr as $failur) 230 foreach($failureArr as $failur)
207 { 231 {
...@@ -210,17 +234,15 @@ class bulkServerUpload_daily extends Command { ...@@ -210,17 +234,15 @@ class bulkServerUpload_daily extends Command {
210 $setFailure[] = "server_ip='$server_ip'"; 234 $setFailure[] = "server_ip='$server_ip'";
211 $setFailure[] = "location='$location'"; 235 $setFailure[] = "location='$location'";
212 $setFailure[] = "cust_id='".$failur['clientcode']."'"; 236 $setFailure[] = "cust_id='".$failur['clientcode']."'";
237 $setFailure[] = "record_id='".$failur['record_id']."'";
213 $setFailure[] = "reason='".$failur['Reason']."'"; 238 $setFailure[] = "reason='".$failur['Reason']."'";
214 239
215 $setFailure = implode(",",$setFailure); 240 $setFailure = implode(",",$setFailure);
216 241
217 DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_failure_daily set $setFailure")); 242 DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_failure set $setFailure"));
218 } 243 }
219 } 244 }
220 DB::connection("conn")->delete(DB::raw("DELETE FROM `bz_record_upload_uat_daily` where SERVER_IP='10.3.179.121'"));
221 245
222 DB::connection("conn")->disconnect(); 246 DB::connection("conn")->disconnect();
223
224
225 } 247 }
226 } 248 }
......
...@@ -18,21 +18,21 @@ use Input; ...@@ -18,21 +18,21 @@ use Input;
18 18
19 use Illuminate\Database\Schema\Blueprint; 19 use Illuminate\Database\Schema\Blueprint;
20 20
21 class bulkServerUpload_2 extends Command { 21 class bulkServerUpload_6 extends Command {
22 22
23 /** 23 /**
24 * The console command name. 24 * The console command name.
25 * 25 *
26 * @var string 26 * @var string
27 */ 27 */
28 protected $signature = 'bulkServerUpload_2'; 28 protected $signature = 'bulkServerUpload_6';
29 29
30 /** 30 /**
31 * The console command description. 31 * The console command description.
32 * 32 *
33 * @var string 33 * @var string
34 */ 34 */
35 protected $description = 'bulkServerUpload_2'; 35 protected $description = 'bulkServerUpload_6';
36 36
37 /** 37 /**
38 * Execute the console command. 38 * Execute the console command.
...@@ -42,7 +42,13 @@ class bulkServerUpload_2 extends Command { ...@@ -42,7 +42,13 @@ class bulkServerUpload_2 extends Command {
42 public function handle() 42 public function handle()
43 { 43 {
44 44
45 echo "\n".date('Y-m-d')."\n"; 45 //echo "\n".date('Y-m-d')."\n";
46
47 echo "6";
48 echo "\n".date('Y-m-d H:i:s')."\n";
49 $server_ip=env('app_ip');
50 $central_ip=env('central_ip');
51
46 52
47 $wakka = new KHRMSLib(); 53 $wakka = new KHRMSLib();
48 54
...@@ -64,7 +70,7 @@ class bulkServerUpload_2 extends Command { ...@@ -64,7 +70,7 @@ class bulkServerUpload_2 extends Command {
64 70
65 $conn = array( 71 $conn = array(
66 'driver' => 'mysql', 72 'driver' => 'mysql',
67 'host' => '10.3.177.14', 73 'host' => $central_ip,
68 'database' => env('DB_DATABASE', 'kstych_flexydial'), 74 'database' => env('DB_DATABASE', 'kstych_flexydial'),
69 'username' => env('DB_USERNAME', 'root'), 75 'username' => env('DB_USERNAME', 'root'),
70 'password' => env('DB_PASSWORD', 'yb9738z'), 76 'password' => env('DB_PASSWORD', 'yb9738z'),
...@@ -79,10 +85,12 @@ class bulkServerUpload_2 extends Command { ...@@ -79,10 +85,12 @@ class bulkServerUpload_2 extends Command {
79 85
80 DB::connection("conn")->getDatabaseName(); 86 DB::connection("conn")->getDatabaseName();
81 87
82 $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='10.3.179.121' order by auto_id asc limit 40001,60000")); 88 $serverclist=DB::connection("conn")->select(DB::raw("select location from server_details where server_ip='$server_ip'"));
89 $location=$serverclist[0]->location;
90
91
92 $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='$server_ip' order by auto_id asc limit 120001,140000"));
83 93
84 $server_ip='10.3.179.121';
85 $location='Mumbai';
86 $conn=''; 94 $conn='';
87 95
88 $tcol=0;$fieldsarr=array();$extrahdrarr=array(); 96 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
...@@ -99,7 +107,7 @@ class bulkServerUpload_2 extends Command { ...@@ -99,7 +107,7 @@ class bulkServerUpload_2 extends Command {
99 $flag = 0; 107 $flag = 0;
100 $editflag=0; 108 $editflag=0;
101 109
102 for($i=0;$i<=$highestrow;$i++) 110 for($i=0;$i<$highestrow;$i++)
103 { 111 {
104 if($excelarray[$i]["id"]!="") 112 if($excelarray[$i]["id"]!="")
105 { 113 {
...@@ -108,7 +116,6 @@ class bulkServerUpload_2 extends Command { ...@@ -108,7 +116,6 @@ class bulkServerUpload_2 extends Command {
108 $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s'))); 116 $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s')));
109 } 117 }
110 else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]); 118 else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]);
111
112 if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1) 119 if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1)
113 { 120 {
114 $empdata=$wakka->getPerson($excelarray[$i]["id"]); 121 $empdata=$wakka->getPerson($excelarray[$i]["id"]);
...@@ -164,9 +171,28 @@ class bulkServerUpload_2 extends Command { ...@@ -164,9 +171,28 @@ class bulkServerUpload_2 extends Command {
164 $successArr[] = $excelarray[$i]; 171 $successArr[] = $excelarray[$i];
165 172
166 } 173 }
174 else
175 {
176 $reason = "";
177
178 $reason .= "Record ID is not on local server,";
179
180 $excelarray[$i]['server_ip'] =$server_ip;
181 $excelarray[$i]['location'] =$location;
182
183 if($excelarray[$i]["clientcode"]!="")
184 $excelarray[$i]['cust_id'] =$excelarray[$i]["clientcode"];
185 $excelarray[$i]['record_id'] = $excelarray[$i]["id"];
186
187 $excelarray[$i]['Reason'] = $reason;
188
189 $failureArr[] = $excelarray[$i];
190
191 }
167 } 192 }
168 else 193 else
169 { 194 {
195
170 $reason = ""; 196 $reason = "";
171 197
172 if($excelarray[$i]["id"]=="") 198 if($excelarray[$i]["id"]=="")
...@@ -181,10 +207,10 @@ class bulkServerUpload_2 extends Command { ...@@ -181,10 +207,10 @@ class bulkServerUpload_2 extends Command {
181 $excelarray[$i]['Reason'] = $reason; 207 $excelarray[$i]['Reason'] = $reason;
182 208
183 $failureArr[] = $excelarray[$i]; 209 $failureArr[] = $excelarray[$i];
210
184 } 211 }
185 212
186 } 213 }
187
188 if(!empty($successArr)){ 214 if(!empty($successArr)){
189 foreach($successArr as $succes) 215 foreach($successArr as $succes)
190 { 216 {
...@@ -201,7 +227,6 @@ class bulkServerUpload_2 extends Command { ...@@ -201,7 +227,6 @@ class bulkServerUpload_2 extends Command {
201 DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success set $setSuccess")); 227 DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success set $setSuccess"));
202 } 228 }
203 } 229 }
204
205 if(!empty($failureArr)){ 230 if(!empty($failureArr)){
206 foreach($failureArr as $failur) 231 foreach($failureArr as $failur)
207 { 232 {
...@@ -210,6 +235,7 @@ class bulkServerUpload_2 extends Command { ...@@ -210,6 +235,7 @@ class bulkServerUpload_2 extends Command {
210 $setFailure[] = "server_ip='$server_ip'"; 235 $setFailure[] = "server_ip='$server_ip'";
211 $setFailure[] = "location='$location'"; 236 $setFailure[] = "location='$location'";
212 $setFailure[] = "cust_id='".$failur['clientcode']."'"; 237 $setFailure[] = "cust_id='".$failur['clientcode']."'";
238 $setFailure[] = "record_id='".$failur['record_id']."'";
213 $setFailure[] = "reason='".$failur['Reason']."'"; 239 $setFailure[] = "reason='".$failur['Reason']."'";
214 240
215 $setFailure = implode(",",$setFailure); 241 $setFailure = implode(",",$setFailure);
......
...@@ -18,21 +18,21 @@ use Input; ...@@ -18,21 +18,21 @@ use Input;
18 18
19 use Illuminate\Database\Schema\Blueprint; 19 use Illuminate\Database\Schema\Blueprint;
20 20
21 class bulkServerUpload_4 extends Command { 21 class bulkServerUpload_daily extends Command {
22 22
23 /** 23 /**
24 * The console command name. 24 * The console command name.
25 * 25 *
26 * @var string 26 * @var string
27 */ 27 */
28 protected $signature = 'bulkServerUpload_4'; 28 protected $signature = 'bulkServerUpload_daily';
29 29
30 /** 30 /**
31 * The console command description. 31 * The console command description.
32 * 32 *
33 * @var string 33 * @var string
34 */ 34 */
35 protected $description = 'bulkServerUpload_4'; 35 protected $description = 'bulkServerUpload_daily';
36 36
37 /** 37 /**
38 * Execute the console command. 38 * Execute the console command.
...@@ -42,7 +42,13 @@ class bulkServerUpload_4 extends Command { ...@@ -42,7 +42,13 @@ class bulkServerUpload_4 extends Command {
42 public function handle() 42 public function handle()
43 { 43 {
44 44
45 echo "\n".date('Y-m-d')."\n"; 45 //echo "\n".date('Y-m-d')."\n";
46
47 echo "1";
48 echo "\n".date('Y-m-d H:i:s')."\n";
49
50 $server_ip=env('app_ip');
51 $central_ip=env('central_ip');
46 52
47 $wakka = new KHRMSLib(); 53 $wakka = new KHRMSLib();
48 54
...@@ -64,7 +70,7 @@ class bulkServerUpload_4 extends Command { ...@@ -64,7 +70,7 @@ class bulkServerUpload_4 extends Command {
64 70
65 $conn = array( 71 $conn = array(
66 'driver' => 'mysql', 72 'driver' => 'mysql',
67 'host' => '10.3.177.14', 73 'host' => $central_ip,
68 'database' => env('DB_DATABASE', 'kstych_flexydial'), 74 'database' => env('DB_DATABASE', 'kstych_flexydial'),
69 'username' => env('DB_USERNAME', 'root'), 75 'username' => env('DB_USERNAME', 'root'),
70 'password' => env('DB_PASSWORD', 'yb9738z'), 76 'password' => env('DB_PASSWORD', 'yb9738z'),
...@@ -79,10 +85,14 @@ class bulkServerUpload_4 extends Command { ...@@ -79,10 +85,14 @@ class bulkServerUpload_4 extends Command {
79 85
80 DB::connection("conn")->getDatabaseName(); 86 DB::connection("conn")->getDatabaseName();
81 87
82 $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='10.3.179.121' order by auto_id asc limit 80001,100000")); 88 $serverclist=DB::connection("conn")->select(DB::raw("select location from server_details where server_ip='$server_ip'"));
89 $location=$serverclist[0]->location;
90 echo $central_ip;
91 echo $location;
92
93
94 $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"));
83 95
84 $server_ip='10.3.179.121';
85 $location='Mumbai';
86 $conn=''; 96 $conn='';
87 97
88 $tcol=0;$fieldsarr=array();$extrahdrarr=array(); 98 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
...@@ -99,7 +109,7 @@ class bulkServerUpload_4 extends Command { ...@@ -99,7 +109,7 @@ class bulkServerUpload_4 extends Command {
99 $flag = 0; 109 $flag = 0;
100 $editflag=0; 110 $editflag=0;
101 111
102 for($i=0;$i<=$highestrow;$i++) 112 for($i=0;$i<$highestrow;$i++)
103 { 113 {
104 if($excelarray[$i]["id"]!="") 114 if($excelarray[$i]["id"]!="")
105 { 115 {
...@@ -108,7 +118,6 @@ class bulkServerUpload_4 extends Command { ...@@ -108,7 +118,6 @@ class bulkServerUpload_4 extends Command {
108 $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s'))); 118 $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s')));
109 } 119 }
110 else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]); 120 else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]);
111
112 if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1) 121 if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1)
113 { 122 {
114 $empdata=$wakka->getPerson($excelarray[$i]["id"]); 123 $empdata=$wakka->getPerson($excelarray[$i]["id"]);
...@@ -164,9 +173,28 @@ class bulkServerUpload_4 extends Command { ...@@ -164,9 +173,28 @@ class bulkServerUpload_4 extends Command {
164 $successArr[] = $excelarray[$i]; 173 $successArr[] = $excelarray[$i];
165 174
166 } 175 }
176 else
177 {
178 $reason = "";
179
180 $reason .= "Record ID is not on local server,";
181
182 $excelarray[$i]['server_ip'] =$server_ip;
183 $excelarray[$i]['location'] =$location;
184
185 if($excelarray[$i]["clientcode"]!="")
186 $excelarray[$i]['cust_id'] =$excelarray[$i]["clientcode"];
187 $excelarray[$i]['record_id'] = $excelarray[$i]["id"];
188
189 $excelarray[$i]['Reason'] = $reason;
190
191 $failureArr[] = $excelarray[$i];
192
193 }
167 } 194 }
168 else 195 else
169 { 196 {
197
170 $reason = ""; 198 $reason = "";
171 199
172 if($excelarray[$i]["id"]=="") 200 if($excelarray[$i]["id"]=="")
...@@ -181,10 +209,10 @@ class bulkServerUpload_4 extends Command { ...@@ -181,10 +209,10 @@ class bulkServerUpload_4 extends Command {
181 $excelarray[$i]['Reason'] = $reason; 209 $excelarray[$i]['Reason'] = $reason;
182 210
183 $failureArr[] = $excelarray[$i]; 211 $failureArr[] = $excelarray[$i];
212
184 } 213 }
185 214
186 } 215 }
187
188 if(!empty($successArr)){ 216 if(!empty($successArr)){
189 foreach($successArr as $succes) 217 foreach($successArr as $succes)
190 { 218 {
...@@ -198,10 +226,11 @@ class bulkServerUpload_4 extends Command { ...@@ -198,10 +226,11 @@ class bulkServerUpload_4 extends Command {
198 226
199 $setSuccess = implode(",",$setSuccess); 227 $setSuccess = implode(",",$setSuccess);
200 228
201 DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success set $setSuccess")); 229 DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success_daily set $setSuccess"));
230
231 DB::connection("conn")->delete(DB::raw("DELETE FROM `bz_record_upload_uat_daily` where SERVER_IP='$server_ip' and id='".$succes['id']."'"));
202 } 232 }
203 } 233 }
204
205 if(!empty($failureArr)){ 234 if(!empty($failureArr)){
206 foreach($failureArr as $failur) 235 foreach($failureArr as $failur)
207 { 236 {
...@@ -210,14 +239,19 @@ class bulkServerUpload_4 extends Command { ...@@ -210,14 +239,19 @@ class bulkServerUpload_4 extends Command {
210 $setFailure[] = "server_ip='$server_ip'"; 239 $setFailure[] = "server_ip='$server_ip'";
211 $setFailure[] = "location='$location'"; 240 $setFailure[] = "location='$location'";
212 $setFailure[] = "cust_id='".$failur['clientcode']."'"; 241 $setFailure[] = "cust_id='".$failur['clientcode']."'";
242 $setFailure[] = "record_id='".$failur['record_id']."'";
213 $setFailure[] = "reason='".$failur['Reason']."'"; 243 $setFailure[] = "reason='".$failur['Reason']."'";
214 244
215 $setFailure = implode(",",$setFailure); 245 $setFailure = implode(",",$setFailure);
216 246
217 DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_failure set $setFailure")); 247 DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_failure_daily set $setFailure"));
218 } 248 }
219 } 249 }
250
251 //DB::connection("conn")->delete(DB::raw("DELETE FROM `bz_record_upload_uat_daily` where SERVER_IP='10.3.179.121'"));
220 252
221 DB::connection("conn")->disconnect(); 253 DB::connection("conn")->disconnect();
222 } 254
255
256 }
223 } 257 }
......
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 dailyupload_calllog extends Command {
17
18 /**
19 * The console command name.
20 *
21 * @var string
22 */
23 protected $signature = 'dailyupload_calllog';
24
25 /**
26 * The console command description.
27 *
28 * @var string
29 */
30 protected $description = 'dailyupload_calllog';
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 H:i:s')."\n";
41 $logdate=strtotime('0 day');
42
43 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
44 $server_ip=env('app_ip');
45 $central_ip=env('central_ip');
46 $calllog_report = "calllog_report_".date("d_m_Y",$logdate);
47 $created_at=date("Y-m-d H:i:s");
48
49 $conn = array(
50 'driver' => 'mysql',
51 'host' => $central_ip,
52 'database' => env('DB_DATABASE', 'kstych_flexydial'),
53 'username' => env('DB_USERNAME', 'root'),
54 'password' => env('DB_PASSWORD', ''),
55 'charset' => 'utf8',
56 'collation' => 'utf8_unicode_ci',
57 'prefix' => '',
58 'options' => array(
59 PDO::ATTR_TIMEOUT => 5,
60 ),
61 );
62 Config::set("database.connections.conn", $conn);
63 if(DB::connection("conn")->getDatabaseName())
64 {
65
66 $serverclist=DB::connection("conn")->select(DB::raw("select id from server_details where server_ip='$server_ip'"));
67 $server_id=$serverclist[0]->id;
68 if($server_id<10){
69 $server_id="0".$server_id;
70 }
71
72 $clist=DB::connection("conn")->select(DB::raw("select count(*) as cnt,server from $calllog_report group by server"));
73 $caar=[];
74 foreach($clist as $cline)
75 {
76 $caar[$cline->server]= $cline->cnt;
77
78
79 }
80 $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)."'"));
81
82 $location_cont='0';
83 $central_cont='0';
84
85 $location_cont=$mlist[0]->countrecord;
86 if(array_key_exists($server_id,$caar)){
87 $central_cont=$caar[$server_id];
88 }else{
89 $central_cont=0;
90
91 }
92 $dif=($mlist[0]->countrecord)-($central_cont);
93
94 if($dif<=5 && $dif>=-5){
95
96 $result="Y";
97
98 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'"));
99
100 }else{
101
102 $result="N";
103 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'"));
104
105 }
106
107 DB::connection("conn")->disconnect();
108
109 }
110
111 }
112
113
114 }
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 dailyupload_questionaire extends Command {
17
18 /**
19 * The console command name.
20 *
21 * @var string
22 */
23 protected $signature = 'dailyupload_questionaire';
24
25 /**
26 * The console command description.
27 *
28 * @var string
29 */
30 protected $description = 'dailyupload_questionaire';
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 H:i:s')."\n";
41
42
43 $logdate=strtotime('0 day');
44
45 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
46 $server_ip=env('app_ip');
47 $central_ip=env('central_ip');
48 $questionaire_details = "questionaire_details_".date("d_m_Y",$logdate);
49 $created_at=date("Y-m-d H:i:s");
50
51 $conn = array(
52 'driver' => 'mysql',
53 'host' => $central_ip,
54 'database' => env('DB_DATABASE', 'kstych_flexydial'),
55 'username' => env('DB_USERNAME', 'root'),
56 'password' => env('DB_PASSWORD', ''),
57 'charset' => 'utf8',
58 'collation' => 'utf8_unicode_ci',
59 'prefix' => '',
60 'options' => array(
61 PDO::ATTR_TIMEOUT => 5,
62 ),
63 );
64 Config::set("database.connections.conn", $conn);
65
66
67 if(DB::connection("conn")->getDatabaseName())
68 {
69
70 $serverclist=DB::connection("conn")->select(DB::raw("select id from server_details where server_ip='$server_ip'"));
71 $server_id=$serverclist[0]->id;
72 if($server_id<10){
73 $server_id="0".$server_id;
74 }
75
76
77 $clist=DB::connection("conn")->select(DB::raw("select count(*) as cnt,server from $questionaire_details group by server"));
78
79 $caar=[];
80 foreach($clist as $cline)
81 {
82 $caar[$cline->server]= $cline->cnt;
83 }
84
85 $mlist=DB::select(DB::raw("select count(*) as countrecord from questionaire_details where created_at>'".date("Y-m-d",$logdate)."' and created_at<'".date("Y-m-d",$logdate+24*60*60)."'"));
86
87 $location_cont='0';
88 $central_cont='0';
89
90 $location_cont=$mlist[0]->countrecord;
91 if(array_key_exists($server_id,$caar)){
92 $central_cont=$caar[$server_id];
93 }else{
94 $central_cont=0;
95
96 }
97 $dif=($mlist[0]->countrecord)-($central_cont);
98
99 if($dif<=1 && $dif>=-1){
100
101 $result="Y";
102
103 DB::connection("conn")->insert(DB::raw("insert into dailyupload_questionaire 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'"));
104
105 }else{
106
107 $result="N";
108 DB::connection("conn")->insert(DB::raw("insert into dailyupload_questionaire 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'"));
109
110 }
111
112 DB::connection("conn")->disconnect();
113
114 }
115
116 }
117
118
119 }
...@@ -13,21 +13,21 @@ use PDO; ...@@ -13,21 +13,21 @@ use PDO;
13 13
14 use Illuminate\Database\Schema\Blueprint; 14 use Illuminate\Database\Schema\Blueprint;
15 15
16 class seatcount extends Command { 16 class full_remark_details extends Command {
17 17
18 /** 18 /**
19 * The console command name. 19 * The console command name.
20 * 20 *
21 * @var string 21 * @var string
22 */ 22 */
23 protected $signature = 'seatcount'; 23 protected $signature = 'full_remark_details';
24 24
25 /** 25 /**
26 * The console command description. 26 * The console command description.
27 * 27 *
28 * @var string 28 * @var string
29 */ 29 */
30 protected $description = 'seatcount'; 30 protected $description = 'full_remark_details';
31 31
32 /** 32 /**
33 * Execute the console command. 33 * Execute the console command.
...@@ -37,18 +37,19 @@ class seatcount extends Command { ...@@ -37,18 +37,19 @@ class seatcount extends Command {
37 public function handle() 37 public function handle()
38 { 38 {
39 $nowts=time(); 39 $nowts=time();
40 echo "\n".date('Y-m-d')."\n"; 40 echo "\n".date('Y-m-d H:i:s')."\n";
41 41
42 42
43 //$logdate=strtotime('0 day'); 43 $logdate=strtotime('0 day');
44 44
45 $tcol=0;$fieldsarr=array();$extrahdrarr=array(); 45 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
46 $server_id="08"; 46 $server_ip=env('app_ip');
47 $seatcount = "seatcount"; 47 $full_remark = "full_remark_details";
48 $central_ip=env('central_ip');
48 49
49 $conn = array( 50 $conn = array(
50 'driver' => 'mysql', 51 'driver' => 'mysql',
51 'host' => '10.3.177.14', 52 'host' => $central_ip,
52 'database' => env('DB_DATABASE', 'kstych_flexydial'), 53 'database' => env('DB_DATABASE', 'kstych_flexydial'),
53 'username' => env('DB_USERNAME', 'root'), 54 'username' => env('DB_USERNAME', 'root'),
54 'password' => env('DB_PASSWORD', ''), 55 'password' => env('DB_PASSWORD', ''),
...@@ -64,15 +65,18 @@ class seatcount extends Command { ...@@ -64,15 +65,18 @@ class seatcount extends Command {
64 65
65 if(DB::connection("conn")->getDatabaseName()) 66 if(DB::connection("conn")->getDatabaseName())
66 { 67 {
67 68 $serverclist=DB::connection("conn")->select(DB::raw("select id from server_details where server_ip='$server_ip'"));
68 echo ",".$server_id; 69 $server_id=$serverclist[0]->id;
70 if($server_id<10){
71 $server_id="0".$server_id;
72 }
69 73
70 $maxid=DB::connection("conn")->select(DB::raw("SELECT max(full_remark_id) as maxid from $full_remark where server_id='$server_id'")); 74 $maxid=DB::connection("conn")->select(DB::raw("SELECT max(full_remark_id) as maxid from $full_remark where server_id='$server_id'"));
71 75
72 $maxids=$maxid[0]->maxid; 76 $maxids=$maxid[0]->maxid;
73 77
74 78 //$qlist=DB::select(DB::raw("SELECT * from full_remark"));
75 $qlist=DB::select(DB::raw("SELECT * from daily_count where id>'$maxids' and created_at>'".date("Y-m-d")."' and created_at<'".date("Y-m-d H:i:s",$logdate-(60*60))."'")); 79 $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))."'"));
76 80
77 $userarr=array(); 81 $userarr=array();
78 foreach($qlist as $qline) 82 foreach($qlist as $qline)
......
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 lead_form_details extends Command {
17
18 /**
19 * The console command name.
20 *
21 * @var string
22 */
23 protected $signature = 'lead_form_details';
24
25 /**
26 * The console command description.
27 *
28 * @var string
29 */
30 protected $description = 'lead_form_details';
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 H:i:s')."\n";
41
42
43 $logdate=strtotime('0 day');
44
45 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
46 $server_ip=env('app_ip');
47 $lead_form = "lead_form_details";
48 $central_ip=env('central_ip');
49
50 $conn = array(
51 'driver' => 'mysql',
52 'host' => $central_ip,
53 'database' => env('DB_DATABASE', 'kstych_flexydial'),
54 'username' => env('DB_USERNAME', 'root'),
55 'password' => env('DB_PASSWORD', ''),
56 'charset' => 'utf8',
57 'collation' => 'utf8_unicode_ci',
58 'prefix' => '',
59 'options' => array(
60 PDO::ATTR_TIMEOUT => 5,
61 ),
62 );
63 Config::set("database.connections.conn", $conn);
64
65
66 if(DB::connection("conn")->getDatabaseName())
67 {
68 $serverclist=DB::connection("conn")->select(DB::raw("select id,location from server_details where server_ip='$server_ip'"));
69 $server_id=$serverclist[0]->id;
70 if($server_id<10){
71 $server_id="0".$server_id;
72 }
73 $location=$serverclist[0]->location;
74 $maxid=DB::connection("conn")->select(DB::raw("SELECT max(lead_form_id) as maxid from lead_form_details where server_ip='$server_ip'"));
75
76 $maxids=$maxid[0]->maxid;
77
78 $qlist=DB::select(DB::raw("SELECT * from lead_form where id>'$maxids'"));
79 print_r($qlist);
80 $userarr=array();
81 foreach($qlist as $qline)
82 {
83
84 $setstrarr=array();
85
86
87 $setstrarr[]="lead_form_id='$qline->id'";
88 $setstrarr[]="created_at='$qline->created_at'";
89 $setstrarr[]="updated_at='$qline->updated_at'";
90 $setstrarr[]="product='$qline->product'";
91 $setstrarr[]="customer_name='$qline->customer_name'";
92 $setstrarr[]="mobile_number='$qline->mobile_number'";
93 $setstrarr[]="city='$qline->city'";
94 $setstrarr[]="state='$qline->state'";
95 $setstrarr[]="agent_memo='$qline->agent_memo'";
96 $setstrarr[]="customer_memo='$qline->customer_memo'";
97 $setstrarr[]="remarks='$qline->remarks'";
98 $setstrarr[]="transfer_memo='$qline->transfer_memo'";
99 $setstrarr[]="server_ip='$server_ip'";
100 $setstrarr[]="location='$location'";
101 $setstrarr[]="address='$qline->address'";
102 $setstrarr[]="mobile='$qline->mobile'";
103 $setstrarr[]="client='$qline->client'";
104 $setstrarr[]="user_id='$qline->user_id'";
105 $setstrarr[]="firstname='$qline->firstname'";
106 $setstrarr[]="clientcode='$qline->clientcode'";
107 $setstrarr[]="call_id='$qline->call_id'";
108 $setstrarr[]="record_id='$qline->record_id'";
109
110 $setstr=implode(",",$setstrarr);
111 echo "prashant";
112 print_r($setstr);
113 DB::connection("conn")->insert(DB::raw("insert into lead_form_details set $setstr"));
114
115 }
116 DB::connection("conn")->disconnect();
117
118 }
119
120 }
121
122
123 }
...@@ -43,13 +43,13 @@ class questionnaire_details extends Command { ...@@ -43,13 +43,13 @@ class questionnaire_details extends Command {
43 $logdate=strtotime('0 day'); 43 $logdate=strtotime('0 day');
44 44
45 $tcol=0;$fieldsarr=array();$extrahdrarr=array(); 45 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
46 $server_id="08"; 46 $questionaire = "questionaire_details_".date("d_m_Y");
47 $questionaire = "questionaire_details_".date("d_m_Y"); 47 $server_ip=env('app_ip');
48 //$questionaire = "questionaire_details_23_06_2017"; 48 $central_ip=env('central_ip');
49 49
50 $conn = array( 50 $conn = array(
51 'driver' => 'mysql', 51 'driver' => 'mysql',
52 'host' => '10.3.177.14', 52 'host' => $central_ip,
53 'database' => env('DB_DATABASE', 'kstych_flexydial'), 53 'database' => env('DB_DATABASE', 'kstych_flexydial'),
54 'username' => env('DB_USERNAME', 'root'), 54 'username' => env('DB_USERNAME', 'root'),
55 'password' => env('DB_PASSWORD', ''), 55 'password' => env('DB_PASSWORD', ''),
...@@ -65,7 +65,12 @@ class questionnaire_details extends Command { ...@@ -65,7 +65,12 @@ class questionnaire_details extends Command {
65 65
66 if(DB::connection("conn")->getDatabaseName()) 66 if(DB::connection("conn")->getDatabaseName())
67 { 67 {
68 68 $serverclist=DB::connection("conn")->select(DB::raw("select id from server_details where server_ip='$server_ip'"));
69 $server_id=$serverclist[0]->id;
70 if($server_id<10){
71 $server_id="0".$server_id;
72 }
73
69 echo ",".$server_id; 74 echo ",".$server_id;
70 75
71 $maxid=DB::connection("conn")->select(DB::raw("SELECT max(question_id) as maxid from $questionaire where server='$server_id'")); 76 $maxid=DB::connection("conn")->select(DB::raw("SELECT max(question_id) as maxid from $questionaire where server='$server_id'"));
...@@ -73,6 +78,8 @@ class questionnaire_details extends Command { ...@@ -73,6 +78,8 @@ class questionnaire_details extends Command {
73 $maxids=$maxid[0]->maxid; 78 $maxids=$maxid[0]->maxid;
74 79
75 80
81 //$qlist=DB::select(DB::raw("SELECT * from questionaire_details where id>'$maxids'"));
82
76 $qlist=DB::select(DB::raw("SELECT * from questionaire_details where id>'$maxids' and created_at>'".date("Y-m-d")."' and created_at<'".date("Y-m-d H:i:s",$logdate-(60*60))."'")); 83 $qlist=DB::select(DB::raw("SELECT * from questionaire_details where id>'$maxids' and created_at>'".date("Y-m-d")."' and created_at<'".date("Y-m-d H:i:s",$logdate-(60*60))."'"));
77 84
78 $userarr=array(); 85 $userarr=array();
......
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 recording_reconcilation extends Command {
17
18 /**
19 * The console command name.
20 *
21 * @var string
22 */
23 protected $signature = 'recording_reconcilation';
24
25 /**
26 * The console command description.
27 *
28 * @var string
29 */
30 protected $description = 'recording_reconcilation';
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 H:i:s')."\n";
41
42 $logdate=strtotime(date('Y-m-d')." 00:00:00");
43 //$logdate=strtotime("-1 days"." 00:00:00");
44 $logtodate=strtotime(date('Y-m-d')." 23:59:59");
45 //$logtodate=strtotime("-1 days"." 23:59:59");
46 $server_ip=env('app_ip');
47 $central_ip=env('central_ip');
48
49 $reporthead=array("id","server_ip","call_id","call_start_date","call_start_time","call_duration","DNIS","ANI","call_direction","cti_var1","cti_var2","cti_var4","transfer_status","recording_filename");
50
51 $ftp_server="10.3.177.14";
52 $ftp_user_name="buzzworks";
53 $ftp_user_pass="0per@ti0n@1";
54 $conn_id = ftp_connect($ftp_server);
55
56 // login with username and password
57 $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
58
59
60 $conn = array(
61 'driver' => 'mysql',
62 'host' => $central_ip,
63 'database' => env('DB_DATABASE', 'kstych_flexydial'),
64 'username' => env('DB_USERNAME', 'root'),
65 'password' => env('DB_PASSWORD', ''),
66 'charset' => 'utf8',
67 'collation' => 'utf8_unicode_ci',
68 'prefix' => '',
69 'options' => array(
70 PDO::ATTR_TIMEOUT => 5,
71 ),
72 );
73 Config::set("database.connections.conn", $conn);
74
75
76 if(DB::connection("conn")->getDatabaseName())
77 {
78 //check maximum id saved in the table
79 $maxid=DB::connection("conn")->select(DB::raw("SELECT max(call_id) as maxid from recording_reconcilation where server_ip='$server_ip'"));
80 if($maxid)$maxids=$maxid[0]->maxid;
81
82 echo "\n"."maxids---".$maxids."\n";
83 echo "\n".date("Y-m-d H:i:s",$logdate)."\n";
84 echo "\n".date("Y-m-d H:i:s",$logtodate)."\n";
85
86 //query for calllog and recording
87 /*$qlist=DB::table('crmcalls')->select('*')->where('id','>','$maxid')->where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logtodate))->get();*/
88 $qlist=DB::table('crmcalls')->select('*')->where('id','=','1079409')->get();
89
90 //create csv file
91 $ii=1;
92 $fileName = 'recording_Excel_'.date("Y-m-d",$logdate);
93 $fileName=storage_path().'/recording_excel/'.$fileName .'.csv';
94 $filesave = fopen($fileName, 'w');
95 fputcsv($filesave, $reporthead);
96
97 $userdatavalue="";
98 foreach ($qlist as $qline)
99 {
100
101 $fulldate=date("Y-m-d H:i:s",strtotime($qline->created_at)+330*60);
102 //$talktime=$qline->talkSec+$qline->recstartSec+$qline->recendSec;
103 //$length=round(($qline->waitSec+$qline->callSec+$talktime+$qline->dispoSec)/1000,2);
104 $length=round(($qline->talkSec+$qline->recstartSec+$qline->recendSec)/1000,2);
105 echo "\n"."startdate--".explode(" ",$fulldate)[0]."\n";
106 echo "\n"."starttime--".explode(" ",$fulldate)[1]."\n";
107 echo "\n"."call duration--". $length."\n";
108 $userdatavalue="";
109
110 $userdata=json_decode($qline->userdata,true);
111
112 //print_r(array_values($userdata));
113 if($userdata)
114 {
115 if(array_values($userdata)!=""||array_values($userdata)!=null)
116 {
117 $userdatavalue=implode(",",array_values($userdata));
118 }
119 else
120 {
121 $userdatavalue="";
122 }
123 }
124
125
126
127
128
129
130 $setstrarr=array();
131 $setstrarr[]="server_ip='$server_ip'";
132 $setstrarr[]="call_id='$qline->id'";
133 $setstrarr[]="call_start_date='".explode(" ",$fulldate)[0]."'";
134 $setstrarr[]="call_start_time='".explode(" ",$fulldate)[1]."'";
135 $setstrarr[]="call_duration='$length'";
136 $setstrarr[]="DNIS='$qline->did'";
137 $setstrarr[]="ANI='$qline->number'";
138 $setstrarr[]="call_direction='$qline->type'";
139 $setstrarr[]="cti_var1='$userdatavalue'";
140 $setstrarr[]="cti_var2='$qline->client'";
141 $setstrarr[]="cti_var4='$qline->crm_id'";
142
143
144 //send recording file to server
145 $file = storage_path()."/app/drec/2017-09/".$qline->id.".gsm";//tobe uploaded
146 //$remote_file = "/home/buzzworks/recording_test";
147 $remote_file = "recording_test/".$server_ip."_".$qline->id.".wav";
148 /*$out='wav';
149
150 header("Content-type: audio/x-$out");
151 header("Content-disposition: attachment; filename=\"".basename($file).".$out\"");
152 $descriptorspec = array(0 => array("pipe", "r"),1 => array("pipe", "w"),2 => array("pipe", "w"));
153 $process = proc_open( "/usr/bin/sox $file /tmp/".basename($file).".$out", $descriptorspec, $pipes );
154 while( stream_get_contents( $pipes[1] ));
155 header("Content-length: ".filesize("/tmp/".basename($file).".$out"));
156 readfile("/tmp/".basename($file).".$out");unlink("/tmp/".basename($file).".$out");
157 fclose( $pipes[1] );
158 fclose( $pipes[2] );*/
159
160 // set up basic connection
161
162
163 if($login_result)
164 {
165 echo "Successfully connect";
166 if (file_exists($file))
167 {
168 echo "The file $file exists";
169 if(ftp_put($conn_id, $remote_file, $file, FTP_BINARY))
170 {
171 echo "successfully uploaded $file\n";
172 $setstrarr[]="transfer_status='success'";
173 $setstrarr[]="recording_filename='$remote_file'";
174 $success_fail="success";
175
176 $setstr=implode(",",$setstrarr);
177 DB::connection("conn")->insert(DB::raw("insert into recording_reconcilation set $setstr"));
178 $data=array($ii++,$server_ip,$qline->id,explode(" ",$fulldate)[0],explode(" ",$fulldate)[1],$length,$qline->did,$qline->number,$qline->type,$userdatavalue,$qline->client,$qline->crm_id,$success_fail,$remote_file);
179
180
181 fputcsv($filesave, $data);
182 }
183 else
184 {
185 echo "There was a problem while uploading $file\n";
186 $setstrarr[]="transfer_status='fail'";
187 $success_fail="fail";
188 }
189 }
190 else
191 {
192
193 echo "The file $file does not exist";
194 $setstrarr[]="transfer_status='file does not exist'";
195 $success_fail="file does not exist";
196 }
197 }
198 else
199 {
200 echo "not connect to server";
201 }
202 // close the connection
203 }
204
205 echo "file save\n";
206 fclose($filesave);
207 ftp_close($conn_id);
208
209 //send csv file to ftp server
210 $conn_id_csv = ftp_connect($ftp_server);
211 $remote_filecsv = "recording_excel/".$server_ip."_".date("Y-m-d",$logdate).".csv";
212 $login_result_csv = ftp_login($conn_id_csv, $ftp_user_name, $ftp_user_pass);
213
214 if($login_result_csv)
215 {
216 if (file_exists($fileName))
217 {
218 echo "The file $fileName exists\n";
219 if(ftp_put($conn_id_csv, $remote_filecsv, $fileName, FTP_BINARY))
220 {
221 echo "successfully uploaded $fileName\n";
222 }
223 else
224 {
225 echo "There was a problem while uploading $fileName\n";
226 }
227 }
228 else
229 {
230 echo "The file $fileName does not exist";
231 }
232 }
233 else
234 {
235 echo "not connect to server";
236 }
237
238
239 ftp_close($conn_id_csv);
240 DB::connection("conn")->disconnect();
241 }
242 }
243 }
244
245 ?>
246
247
...@@ -38,69 +38,66 @@ class records_details extends Command { ...@@ -38,69 +38,66 @@ class records_details extends Command {
38 { 38 {
39 $nowts=time(); 39 $nowts=time();
40 echo "\n".date('Y-m-d')."\n"; 40 echo "\n".date('Y-m-d')."\n";
41 $server_ip=env('app_ip');
42 $central_ip=env('central_ip');
43 $conn='';
44 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
41 45
42 46 $conn = array(
43 //$slist=DB::connection("conn")->select(DB::raw("select * from server_details where type='COP' and id='1'")); 47 'driver' => 'mysql',
48 'host' => $central_ip,
49 'database' => env('DB_DATABASE', 'kstych_flexydial'),
50 'username' => env('DB_USERNAME', 'root'),
51 'password' => env('DB_PASSWORD', ''),
52 'charset' => 'utf8',
53 'collation' => 'utf8_unicode_ci',
54 'prefix' => '',
55 'options' => array(
56 PDO::ATTR_TIMEOUT => 5,
57 ),
58 );
59 Config::set("database.connections.conn", $conn);
44 60
45 //$slist=DB::select(DB::raw("select * from server_details where type='COP' and id>'27' and id!='54'")); 61
62 if(DB::connection("conn")->getDatabaseName())
63 {
64 $serverclist=DB::connection("conn")->select(DB::raw("select id,location from server_details where server_ip='$server_ip'"));
65 $server_id=$serverclist[0]->id;
66 if($server_id<10){
67 $server_id="0".$server_id;
68 }
69 $location=$serverclist[0]->location;
46 70
47 $server_ip='10.3.179.121'; 71 echo ",".$server_ip;
48 $location='mumbai'; 72
49 $conn=''; 73 $qlist=DB::select(DB::raw("SELECT id,clientcode,client,status,clientinternalid,mobile,priority,modified,question,firstname FROM `records`"));
50 74 $datainser='';
51 $tcol=0;$fieldsarr=array();$extrahdrarr=array(); 75 foreach($qlist as $qline)
76 {
52 77
53 $conn = array( 78 $record_id=$qline->id;
54 'driver' => 'mysql', 79 $clientcode=$qline->clientcode;
55 'host' => '10.3.177.14', 80 $client=$qline->client;
56 'database' => env('DB_DATABASE', 'kstych_flexydial'), 81 $status=$qline->status;
57 'username' => env('DB_USERNAME', 'root'), 82 $clientinternalid=$qline->clientinternalid;
58 'password' => env('DB_PASSWORD', ''), 83 $mobile=$qline->mobile;
59 'charset' => 'utf8', 84 $priority=$qline->priority;
60 'collation' => 'utf8_unicode_ci', 85 $modified=$qline->modified;
61 'prefix' => '', 86 $question=$qline->question;
62 'options' => array( 87 $firstname=$qline->firstname;
63 PDO::ATTR_TIMEOUT => 5,
64 ),
65 );
66 Config::set("database.connections.conn", $conn);
67 88
68 89
69 if(DB::connection("conn")->getDatabaseName()) 90 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'"));
70 { 91
71 92
72 echo ",".$server_ip;
73
74 $qlist=DB::select(DB::raw("SELECT id,clientcode,client,status,clientinternalid,mobile,priority,modified,question,firstname FROM `records`"));
75
76
77 $datainser='';
78 foreach($qlist as $qline)
79 {
80
81 $record_id=$qline->id;
82 $clientcode=$qline->clientcode;
83 $client=$qline->client;
84 $status=$qline->status;
85 $clientinternalid=$qline->clientinternalid;
86 $mobile=$qline->mobile;
87 $priority=$qline->priority;
88 $modified=$qline->modified;
89 $question=$qline->question;
90 $firstname=$qline->firstname;
91
92
93 DB::connection("conn")->insert(DB::raw("insert into records_details_server_1 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'"));
94
95
96 }
97 DB::connection("conn")->disconnect();
98
99 }
100 } 93 }
94 DB::connection("conn")->disconnect();
101 95
102 } 96 }
103 97 }
104 98
99 }
100
101
105 102
106 103
......
1 <?php namespace App\Console\Commands;
2
3 use Illuminate\Console\Command;
4 //use Mail;
5 use DB;
6 use Config;
7
8 use App\Models\User;
9 use App\Models\Accesslog;
10
11 use App\Models\CRMCall;
12 use Schema;
13 use PDO;
14 use App\Models\Notification;
15 use App\Jobs\KHRMSLib;
16
17 use Input;
18 use App\Models\Sipid;
19 use App\Models\Kqueue;
20 use App\Models\Dialline;
21 use App\Models\Session;
22
23 use Illuminate\Database\Schema\Blueprint;
24
25 class relationship_data extends Command {
26
27 /**
28 * The console command name.
29 *
30 * @var string
31 */
32 protected $signature = 'relationship_data';
33
34 /**
35 * The console command description.
36 *
37 * @var string
38 */
39 protected $description = 'relationship_data';
40
41 /**
42 * Execute the console command.
43 *
44 * @return mixed
45 */
46 public function handle()
47 {
48 echo 'Start';
49
50 $local_data=DB::select(DB::raw("SELECT mvalue FROM `hrms_masters` where mid='1'"));
51 $local_data_value=$local_data[0]->mvalue;
52
53 echo "Hrms core data----".$local_data_value;
54
55 if(is_array($local_data_value)) $core_data_value= array_map(__METHOD__, $local_data_value);
56
57 if(!empty($local_data_value) && is_string($local_data_value)) {
58 $core_data_value = str_replace(array('\\', "\0", "\n", "\r", "'", '"', "\x1a"), array('\\\\', '\\0', '\\n', '\\r', "\\'", '\\"', '\\Z'), $local_data_value);
59
60 echo "core data value replace".$core_data_value;
61 }
62
63
64
65 DB::update(DB::raw("UPDATE hrms_masters_demo SET mvalue='$core_data_value' WHERE mid='1'"));
66
67 echo 'End';
68 }
69 }
70
71
72
73
...@@ -6,52 +6,91 @@ use Illuminate\Foundation\Console\Kernel as ConsoleKernel; ...@@ -6,52 +6,91 @@ use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
6 class Kernel extends ConsoleKernel 6 class Kernel extends ConsoleKernel
7 { 7 {
8 8
9 /** 9 /**
10 * The Artisan commands provided by your application. 10 * The Artisan commands provided by your application.
11 * 11 *
12 * @var array 12 * @var array
13 */ 13 */
14 protected $commands = [ 14 protected $commands = [
15 'App\Console\Commands\KstychDaily', 15 'App\Console\Commands\KstychDaily',
16 'App\Console\Commands\KstychPAMI', 16 'App\Console\Commands\KstychPAMI',
17 'App\Console\Commands\KstychPAGI', 17 'App\Console\Commands\KstychPAGI',
18 'App\Console\Commands\DailyLogout', 18 'App\Console\Commands\DailyLogout',
19 'App\Console\Commands\bulkServerUpload', 19 'App\Console\Commands\bulkServerUpload',
20 'App\Console\Commands\bulkServerUpload_1', 20 'App\Console\Commands\bulkServerUpload_1',
21 'App\Console\Commands\bulkServerUpload_2', 21 'App\Console\Commands\bulkServerUpload_2',
22 'App\Console\Commands\bulkServerUpload_3', 22 'App\Console\Commands\bulkServerUpload_3',
23 'App\Console\Commands\bulkServerUpload_4', 23 'App\Console\Commands\bulkServerUpload_4',
24 //'App\Console\Commands\bulkServerUpload_5', 24 //'App\Console\Commands\bulkServerUpload_5',
25 'App\Console\Commands\InsertCrmArchive', 25 'App\Console\Commands\bulkServerUpload_daily',
26 'App\Console\Commands\DeleteCrmcalls', 26 'App\Console\Commands\InsertCrmArchive',
27 ]; 27 'App\Console\Commands\DeleteCrmcalls',
28 28 'App\Console\Commands\records_details',
29 /** 29 'App\Console\Commands\CreportEight',
30 * Define the application's command schedule. 30 'App\Console\Commands\questionnaire_details',
31 * 31 'App\Console\Commands\Userlog_data',
32 * @param \Illuminate\Console\Scheduling\Schedule $schedule 32 'App\Console\Commands\lead_form_details',
33 * @return void 33 'App\Console\Commands\full_remark_details',
34 */ 34 'App\Console\Commands\recording_reconcilation',
35 protected function schedule(Schedule $schedule) 35 'App\Console\Commands\dailyupload_calllog',
36 { 36 'App\Console\Commands\dailyupload_questionaire',
37 $schedule->command('KstychDaily')->daily()->withoutOverlapping(); 37 'App\Console\Commands\relationship_data',
38 //$schedule->command('bulkServerUpload')->everyMinute()->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping(); 38 ];
39 39
40 40 /**
41 41 * Define the application's command schedule.
42 42 *
43 $schedule->command('bulkServerUpload')->dailyAt('14:45')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping(); 43 * @param \Illuminate\Console\Scheduling\Schedule $schedule
44 $schedule->command('bulkServerUpload_1')->dailyAt('16:18')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping(); 44 * @return void
45 $schedule->command('bulkServerUpload_2')->dailyAt('17:45')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping(); 45 */
46 $schedule->command('bulkServerUpload_3')->dailyAt('19:15')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping(); 46 protected function schedule(Schedule $schedule)
47 $schedule->command('bulkServerUpload_4')->dailyAt('20:45')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping(); 47 {
48 //$schedule->command('bulkServerUpload_5')->dailyAt('22:15')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping(); 48 $schedule->command('KstychDaily')->daily()->withoutOverlapping();
49 49 //$schedule->command('bulkServerUpload')->everyMinute()->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping();
50 $schedule->command('InsertCrmArchive')->hourly()->withoutOverlapping(); 50
51 $schedule->command('DeleteCrmcalls')->hourly()->withoutOverlapping(); 51
52 52 $schedule->command('Userlog_data')->dailyAt('01:10')->appendOutputTo(storage_path()."/reason/Userlog_data.txt")->withoutOverlapping();
53 $schedule->command('DailyLogout')->dailyAt('14:30')->withoutOverlapping(); 53
54 54 $schedule->command('bulkServerUpload')->dailyAt('14:45')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping();
55 } 55 $schedule->command('bulkServerUpload_1')->dailyAt('16:18')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping();
56 $schedule->command('bulkServerUpload_2')->dailyAt('17:45')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping();
57 $schedule->command('bulkServerUpload_3')->dailyAt('19:15')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping();
58 $schedule->command('bulkServerUpload_4')->dailyAt('20:45')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping();
59 //$schedule->command('bulkServerUpload_daily')->everyMinute()->appendOutputTo(storage_path()."/reason/bulkServerUpload_daily.txt")->withoutOverlapping();
60 //$schedule->command('bulkServerUpload_daily')->everyMinute()->appendOutputTo(storage_path()."/reason/bulkserver_daily.txt")->withoutOverlapping();
61
62 $schedule->command('bulkServerUpload_daily')->dailyAt('05:05')->appendOutputTo(storage_path()."/reason/bulkserver_daily.txt")->withoutOverlapping();
63 $schedule->command('bulkServerUpload_daily')->dailyAt('07:05')->appendOutputTo(storage_path()."/reason/bulkserver_daily.txt")->withoutOverlapping();
64 $schedule->command('bulkServerUpload_daily')->dailyAt('09:05')->appendOutputTo(storage_path()."/reason/bulkserver_daily.txt")->withoutOverlapping();
65 $schedule->command('bulkServerUpload_daily')->dailyAt('11:05')->appendOutputTo(storage_path()."/reason/bulkserver_daily.txt")->withoutOverlapping();
66 $schedule->command('bulkServerUpload_daily')->dailyAt('13:05')->appendOutputTo(storage_path()."/reason/bulkserver_daily.txt")->withoutOverlapping();
67
68 $schedule->command('dailyupload_questionaire')->dailyAt('19:30')->appendOutputTo(storage_path()."/reason/dailyupload_questionaire.txt")->withoutOverlapping();
69 $schedule->command('CreportEight')->everyFiveMinutes()->appendOutputTo(storage_path()."/reason/CreportEight.txt")->withoutOverlapping();
70
71
72 //$schedule->command('CreportEight')->hourly()->appendOutputTo(storage_path()."/reason/CreportEight.txt")->withoutOverlapping();
73 $schedule->command('questionnaire_details')->hourly()->appendOutputTo(storage_path()."/reason/questionnaire_details.txt")->withoutOverlapping();
74
75 $schedule->command('InsertCrmArchive')->hourly()->withoutOverlapping();
76 $schedule->command('DeleteCrmcalls')->hourly()->withoutOverlapping();
77
78 $schedule->command('DailyLogout')->dailyAt('14:30')->withoutOverlapping();
79
80 $schedule->command('lead_form_details')->everyTenMinutes()->appendOutputTo(storage_path()."/reason/lead_form_details.txt")->withoutOverlapping();
81 $schedule->command('records_details')->dailyAt('17:45')->appendOutputTo(storage_path()."/reason/records_details.txt")->withoutOverlapping();
82 //$schedule->command('recording_reconcilation')->everyMinute()->appendOutputTo(storage_path()."/reason/recording_reconcilation.txt")->withoutOverlapping();
83
84 //$schedule->command('lead_form_details')->everyMinute()->appendOutputTo(storage_path()."/reason/lead_form_details.txt")->withoutOverlapping();
85
86 $schedule->command('dailyupload_calllog')->dailyAt('19:30')->appendOutputTo(storage_path()."/reason/dailycalllog_records.txt")->withoutOverlapping();
87
88 //$schedule->command('records_details')->everyMinute()->appendOutputTo(storage_path()."/reason/records_details.txt")->withoutOverlapping();
89 $schedule->command('full_remark_details')->hourly()->appendOutputTo(storage_path()."/reason/full_remark_details.txt")->withoutOverlapping();
90 //$schedule->command('questionnaire_details')->everyMinute()->appendOutputTo(storage_path()."/reason/questionnaire_details.txt")->withoutOverlapping();
91
92 //$schedule->command('relationship_data')->everyMinute()->appendOutputTo(storage_path()."/reason/relationship_data.txt")->withoutOverlapping();
93
94 }
56 95
57 } 96 }
......
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 relationship_tag extends Command {
17
18 /**
19 * The console command name.
20 *
21 * @var string
22 */
23 protected $signature = 'relationship_tag';
24
25 /**
26 * The console command description.
27 *
28 * @var string
29 */
30 protected $description = 'relationship_tag';
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 H:i:s')."\n";
41
42 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
43 $server_ip=env('app_ip');
44 $central_ip=env('central_ip');
45
46 $conn = array(
47 'driver' => 'mysql',
48 'host' => $central_ip,
49 'database' => env('DB_DATABASE', 'kstych_flexydial'),
50 'username' => env('DB_USERNAME', 'root'),
51 'password' => env('DB_PASSWORD', ''),
52 'charset' => 'utf8',
53 'collation' => 'utf8_unicode_ci',
54 'prefix' => '',
55 'options' => array(
56 PDO::ATTR_TIMEOUT => 5,
57 ),
58 );
59 Config::set("database.connections.conn", $conn);
60
61
62 if(DB::connection("conn")->getDatabaseName())
63 {
64
65 $relationshipList = DB::connection("conn")->select(DB::raw("SELECT * FROM relationship_tagging"));
66
67 $relationshipData = 0; $newService = 0; $newCategory = 0; $newSubCategory = 0;
68
69 foreach ($relationshipList as $list) {
70 $serviceId = 0;
71
72 $service = DB::select(DB::raw("SELECT * FROM relationship_service WHERE title = '$list->service'"));
73
74 if(count($service)){
75 $serviceId = $service[0]->id;
76 }else{
77 $addService = DB::table('relationship_service')->insert(['title'=>$list->service]);
78 $serviceId = $addService;
79 $newService++;
80 }
81
82 $category = DB::select(DB::raw("SELECT * FROM relationship_category WHERE service_id = $serviceId AND title = '$list->category'"));
83
84 if(count($category)){
85 $categoryId = $category[0]->id;
86 }else{
87 $addCategory = DB::table('relationship_category')->insert(['service_id'=>$serviceId,'title'=>$list->category]);
88 $categoryId = $addCategory;
89 $newCategory++;
90 }
91
92 $subCategory = DB::select(DB::raw("SELECT * FROM relationship_sub_category WHERE category_id = $categoryId AND title = '$list->sub_category'"));
93
94 if(count($subCategory)){
95 $subCategoryId = $subCategory[0]->id;
96 }else{
97 $addSubCategory = DB::table('relationship_sub_category')->insert(['category_id'=>$categoryId,'title'=>$list->sub_category]);
98 $subCategoryId = $addSubCategory;
99 $newSubCategory++;
100 }
101 //DB::table('relationship_tagging')->where('id', $list->id)->update(['status'=>'InActive']);
102 $relationshipData++;
103 }
104 echo "Total ".$relationshipData." data process and ". $newService." service, ".$newCategory." category, ".$newSubCategory." sub category added";
105
106 DB::connection("conn")->disconnect();
107
108 }
109
110 }
111
112
113 }
1 <?php namespace App\Console\Commands;
2
3 use Illuminate\Console\Command;
4 //use Mail;
5 use DB;
6 use Config;
7
8 use App\Models\User;
9 use App\Models\Accesslog;
10
11 use App\Models\CRMCall;
12 use Schema;
13 use PDO;
14
15 use Illuminate\Database\Schema\Blueprint;
16
17 class CreportEight extends Command {
18
19 /**
20 * The console command name.
21 *
22 * @var string
23 */
24 protected $signature = 'CreportEight';
25
26 /**
27 * The console command description.
28 *
29 * @var string
30 */
31 protected $description = 'App Main Daily Task for CreportEight';
32
33 /**
34 * Execute the console command.
35 *
36 * @return mixed
37 */
38 public function handle()
39 {
40 $nowts=time();
41 echo "\n".date('Y-m-d H:i:s')."\n";
42
43 $logdate=strtotime('0 day');
44
45 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
46 $central_ip=env('central_ip');
47 $server_ip=env('app_ip');
48 $calllog_report = "calllog_report_".date("d_m_Y");
49
50 $conn = array(
51 'driver' => 'mysql',
52 'host' => $central_ip,
53 'database' => env('DB_DATABASE', 'kstych_flexydial'),
54 'username' => env('DB_USERNAME', 'root'),
55 'password' => env('DB_PASSWORD', ''),
56 'charset' => 'utf8',
57 'collation' => 'utf8_unicode_ci',
58 'prefix' => '',
59 'options' => array(
60 PDO::ATTR_TIMEOUT => 5,
61 ),
62 );
63 Config::set("database.connections.conn", $conn);
64
65 DB::connection("conn")->getDatabaseName();
66
67 $serverclist=DB::connection("conn")->select(DB::raw("select id from server_details where server_ip='$server_ip'"));
68 $server_id=$serverclist[0]->id;
69 if($server_id<10){
70 $server_id="0".$server_id;
71 }
72
73
74 $maxid=DB::connection("conn")->select(DB::raw("SELECT max(crmcall_id) as maxid from $calllog_report where server='$server_id'"));
75
76 $maxids=$maxid[0]->maxid;
77
78 $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))."'"));
79
80 //$alist=DB::select(DB::raw("SELECT * from crmcalls where id>'$maxids' and created_at<'".date("Y-m-d H:i:s",$logdate-(60*60))."'"));
81
82 $userarr=array();
83 foreach($alist as $aline)
84 {
85 $setstrarr=array();
86
87
88 $clientcode="";$currentstatus="";$legalstatus="";$record_id="";
89 if($aline->crm_id>0)
90 {
91 $user=DB::select(DB::raw("select id,clientcode,currentstatus,legalstatus from records where id='".$aline->crm_id."' limit 1;"));
92 if(isset($user[0]))
93 {
94 $record_id=$user[0]->id;
95 $clientcode=$user[0]->clientcode;
96 $currentstatus=$user[0]->currentstatus;
97 $legalstatus=$user[0]->legalstatus;
98 }
99 }
100 $tpostdata=json_decode($aline->data,true);
101 $fulldate=date("Y-m-d H:i:s",strtotime($aline->created_at)+330*60);
102 $talktime=$aline->talkSec+$aline->recstartSec+$aline->recendSec;
103 $length=round(($aline->waitSec+$aline->callSec+$talktime+$aline->dispoSec)/1000,2);
104
105 if(!isset($userarr[$aline->user_id])&&$aline->user_id>0)$userarr[$aline->user_id]=User::find($aline->user_id);
106 $dispname="";if(isset($userarr[$aline->user_id]))$dispname=$userarr[$aline->user_id]->dispname();
107 $username="";if(isset($userarr[$aline->user_id]))$username=$userarr[$aline->user_id]->username;
108 $globalid=$server_id.$record_id;
109 $setstrarr[]="server='$server_id'";
110 $setstrarr[]="record_id='$record_id'";
111 $setstrarr[]="crmcall_id='$aline->id'";
112 $countid=DB::connection("conn")->select(DB::raw("SELECT count(crmcall_id) as countid from $calllog_report where server='$server_id' and crmcall_id='$aline->id'"));
113 $countids=$countid[0]->countid;
114 if($countids>0){continue;}
115 $setstrarr[]="globalid='$globalid'";
116 $setstrarr[]="start='$fulldate'";
117 $setstrarr[]="length='$length'";
118 $setstrarr[]="user='$username'";
119 $setstrarr[]="name='$dispname'";
120 $setstrarr[]="dispo='$aline->userstatus'";
121 $setstrarr[]="subdispo='$aline->usersubstatus'";
122 $setstrarr[]="callback='$aline->usercallback'";
123
124 $setstrarr[]="number='$aline->number'";
125 $setstrarr[]="clientcode='$clientcode'";
126 $setstrarr[]="currentstatus='$currentstatus'";
127 $setstrarr[]="legalstatus='$legalstatus'";
128 $setstrarr[]="client='$aline->client'";
129 $setstrarr[]="department='$aline->department'";
130 $setstrarr[]="state='$aline->state'";
131 $setstrarr[]="hsource='$aline->hsource'";
132
133 $setstrarr[]="type='$aline->type'";
134 $setstrarr[]="status='$aline->status'";
135 $setstrarr[]="statuscode='$aline->statuscode'";
136 $setstrarr[]="statusstr='$aline->substatus'";
137 $setstrarr[]="dialline='$aline->dialline_id'";
138 $setstrarr[]="did='$aline->did'";
139 $setstrarr[]="waitsec='".round($aline->waitSec/1000,2)."'";
140 $setstrarr[]="callsec='".round($aline->callSec/1000,2)."'";
141 $setstrarr[]="talksec='".round($talktime/1000,2)."'";
142 $setstrarr[]="disposec='".round($aline->dispoSec/1000,2)."'";
143 $setstrarr[]="remarks='".str_replace("'","",$aline->userremarks)."'";
144 $setstrarr[]="userdata='$aline->userdata'";
145 $setstrarr[]="attempt='$aline->attempt'";
146
147 $setstr=implode(",",$setstrarr);
148 DB::connection("conn")->insert(DB::raw("insert into ".$calllog_report." set $setstr"));
149 }
150
151 }
152 }
153
154
1 <?php namespace App\Console\Commands;
2
3 use Illuminate\Console\Command;
4
5 use DB;
6 use App\Models\RelationshipService;
7 use App\Models\RelationshipCategory;
8 use App\Models\RelationshipSubCategory;
9
10 use Config;
11 use Schema;
12 use PDO;
13
14 use Illuminate\Database\Schema\Blueprint;
15
16 class relationship_tag extends Command {
17
18 /**
19 * The console command name.
20 *
21 * @var string
22 */
23 protected $signature = 'relationship_tag';
24
25 /**
26 * The console command description.
27 *
28 * @var string
29 */
30 protected $description = 'relationship_tag';
31
32 /**
33 * Execute the console command.
34 *
35 * @return mixed
36 */
37 public function handle()
38 {
39 $nowts=time();
40
41 echo date('Y-m-d H:i:s')."\n";
42
43 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
44 $server_ip=env('app_ip');
45 $central_ip=env('central_ip');
46
47 $conn = array(
48 'driver' => 'mysql',
49 'host' => $central_ip,
50 'database' => env('DB_DATABASE', 'kstych_flexydial'),
51 'username' => env('DB_USERNAME', 'root'),
52 'password' => env('DB_PASSWORD', ''),
53 'charset' => 'utf8',
54 'collation' => 'utf8_unicode_ci',
55 'prefix' => '',
56 'options' => array(
57 PDO::ATTR_TIMEOUT => 5,
58 ),
59 );
60
61 Config::set("database.connections.conn", $conn);
62
63 if(DB::connection("conn")->getDatabaseName())
64 {
65 $relationshipList = DB::connection("conn")->select(DB::raw("SELECT * FROM relationship_tagging"));
66
67 $relationshipData = 0; $newService = 0; $newCategory = 0; $newSubCategory = 0;
68
69 foreach ($relationshipList as $list) {
70 $service = RelationshipService::where('title','=',$list->service)->first();
71
72 if(count($service)){
73 $serviceId = $service->id;
74
75 }else{
76 $addService = RelationshipService::create(['title'=>$list->service]);
77 $serviceId = $addService->id;
78 $newService++;
79 }
80 //echo $list->service." : ".$serviceId." - ";
81
82 $category = RelationshipCategory::where('service_id','=',$serviceId)->where('title','=',$list->category)->first();
83
84 if(count($category)){
85 $categoryId = $category->id;
86
87 }else{
88 $addCategory = RelationshipCategory::create(['service_id'=>$serviceId,'title'=>$list->category]);
89 $categoryId = $addCategory->id;
90 $newCategory++;
91 }
92 //echo $list->category." : ".$categoryId." - ";
93
94 $subCategory = RelationshipSubCategory::where('category_id','=',$categoryId)->where('title','=',$list->sub_category)->first();
95
96 if(count($subCategory)){
97 $subCategoryId = $subCategory->id;
98 $updateSubCategory = DB::table('relationship_sub_category')->where('category_id','=',$categoryId)->where('title','=',$list->sub_category)->update(['status'=>$list->status]);
99 }else{
100 $addSubCategory = RelationshipSubCategory::create(['category_id'=>$categoryId,'title'=>$list->sub_category,'status'=>$list->status]);
101 $subCategoryId = $addSubCategory->id;
102 $newSubCategory++;
103 }
104 echo $list->sub_category." : ".$subCategoryId."\n";
105
106 //DB::table('relationship_tagging')->where('id', $list->id)->update(['status'=>'InActive']);
107 $relationshipData++;
108 }
109 echo "Total ".$relationshipData." data process and ". $newService." service, ".$newCategory." category, ".$newSubCategory." sub category added\n";
110
111 DB::connection("conn")->disconnect();
112
113 }
114
115 }
116
117 }
1 <?php namespace App\Console\Commands;
2
3 use Illuminate\Console\Command;
4
5 use DB;
6 use App\Models\RelationshipService;
7 use App\Models\RelationshipCategory;
8 use App\Models\RelationshipSubCategory;
9
10 use Config;
11 use Schema;
12 use PDO;
13
14 use Illuminate\Database\Schema\Blueprint;
15
16 class relationship_tag extends Command {
17
18 /**
19 * The console command name.
20 *
21 * @var string
22 */
23 protected $signature = 'relationship_tag';
24
25 /**
26 * The console command description.
27 *
28 * @var string
29 */
30 protected $description = 'relationship_tag';
31
32 /**
33 * Execute the console command.
34 *
35 * @return mixed
36 */
37 public function handle()
38 {
39 $nowts=time();
40
41 echo date('Y-m-d H:i:s')."\n";
42
43 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
44 $server_ip=env('app_ip');
45 $central_ip=env('central_ip');
46
47 $conn = array(
48 'driver' => 'mysql',
49 'host' => $central_ip,
50 'database' => env('DB_DATABASE', 'kstych_flexydial'),
51 'username' => env('DB_USERNAME', 'root'),
52 'password' => env('DB_PASSWORD', ''),
53 'charset' => 'utf8',
54 'collation' => 'utf8_unicode_ci',
55 'prefix' => '',
56 'options' => array(
57 PDO::ATTR_TIMEOUT => 5,
58 ),
59 );
60
61 Config::set("database.connections.conn", $conn);
62
63 if(DB::connection("conn")->getDatabaseName())
64 {
65
66 DB::table('relationship_service')->truncate();
67 DB::table('relationship_category')->truncate();
68 DB::table('relationship_sub_category')->truncate();
69
70 $relationshipList = DB::connection("conn")->select(DB::raw("SELECT * FROM relationship_tagging"));
71
72 $relationshipData = 0; $newService = 0; $newCategory = 0; $newSubCategory = 0;
73
74 foreach ($relationshipList as $list) {
75 $service = RelationshipService::where('title','=',$list->service)->first();
76
77 if(count($service)){
78 $serviceId = $service->id;
79
80 }else{
81 $addService = RelationshipService::create(['title'=>$list->service]);
82 $serviceId = $addService->id;
83 $newService++;
84 }
85 //echo $list->service." : ".$serviceId." - ";
86
87 $category = RelationshipCategory::where('service_id','=',$serviceId)->where('title','=',$list->category)->first();
88
89 if(count($category)){
90 $categoryId = $category->id;
91
92 }else{
93 $addCategory = RelationshipCategory::create(['service_id'=>$serviceId,'title'=>$list->category]);
94 $categoryId = $addCategory->id;
95 $newCategory++;
96 }
97 //echo $list->category." : ".$categoryId." - ";
98
99 $subCategory = RelationshipSubCategory::where('category_id','=',$categoryId)->where('title','=',$list->sub_category)->first();
100
101 if(count($subCategory)){
102 $subCategoryId = $subCategory->id;
103 //$updateSubCategory = DB::table('relationship_sub_category')->where('category_id','=',$categoryId)->where('title','=',$list->sub_category)->update(['status'=>$list->status]);
104 }else{
105 $addSubCategory = RelationshipSubCategory::create(['category_id'=>$categoryId,'title'=>$list->sub_category,'status'=>$list->status]);
106 $subCategoryId = $addSubCategory->id;
107 $newSubCategory++;
108 }
109 echo $list->sub_category." : ".$subCategoryId."\n";
110
111 //DB::table('relationship_tagging')->where('id', $list->id)->update(['status'=>'InActive']);
112 $relationshipData++;
113 }
114 echo "Total ".$relationshipData." data process and ". $newService." service, ".$newCategory." category, ".$newSubCategory." sub category added\n";
115
116 DB::connection("conn")->disconnect();
117
118 }
119
120 }
121
122 }
...@@ -38,6 +38,7 @@ class CreportEight extends Command { ...@@ -38,6 +38,7 @@ class CreportEight extends Command {
38 public function handle() 38 public function handle()
39 { 39 {
40 $nowts=time(); 40 $nowts=time();
41 $date=date('F_Y');
41 echo "\n".date('Y-m-d H:i:s')."\n"; 42 echo "\n".date('Y-m-d H:i:s')."\n";
42 43
43 $logdate=strtotime('0 day'); 44 $logdate=strtotime('0 day');
...@@ -45,8 +46,8 @@ class CreportEight extends Command { ...@@ -45,8 +46,8 @@ class CreportEight extends Command {
45 $tcol=0;$fieldsarr=array();$extrahdrarr=array(); 46 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
46 $central_ip=env('central_ip'); 47 $central_ip=env('central_ip');
47 $server_ip=env('app_ip'); 48 $server_ip=env('app_ip');
48 $calllog_report = "calllog_report_".date("d_m_Y"); 49 //$calllog_report = "calllog_report_".date("d_m_Y");
49 50 $calllog_report = "calllog_report_".$date;
50 $conn = array( 51 $conn = array(
51 'driver' => 'mysql', 52 'driver' => 'mysql',
52 'host' => $central_ip, 53 'host' => $central_ip,
...@@ -75,7 +76,10 @@ class CreportEight extends Command { ...@@ -75,7 +76,10 @@ class CreportEight extends Command {
75 76
76 $maxids=$maxid[0]->maxid; 77 $maxids=$maxid[0]->maxid;
77 78
78 $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))."'")); 79 $alist=DB::select(DB::raw("SELECT * from crmcalls where id>'$maxids' and created_at<'".date("Y-m-d H:i:s",$logdate-(60*60))."'"));
80 //$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))."'"));
81
82 //$alist=DB::select(DB::raw("SELECT * from crmcalls where id>'$maxids' and created_at<'".date("Y-m-d H:i:s",$logdate-(60*60))."'"));
79 83
80 $userarr=array(); 84 $userarr=array();
81 foreach($alist as $aline) 85 foreach($alist as $aline)
...@@ -108,6 +112,7 @@ class CreportEight extends Command { ...@@ -108,6 +112,7 @@ class CreportEight extends Command {
108 $setstrarr[]="record_id='$record_id'"; 112 $setstrarr[]="record_id='$record_id'";
109 $setstrarr[]="crmcall_id='$aline->id'"; 113 $setstrarr[]="crmcall_id='$aline->id'";
110 $setstrarr[]="globalid='$globalid'"; 114 $setstrarr[]="globalid='$globalid'";
115 $setstrarr[]="created_at='$aline->created_at'";
111 $setstrarr[]="start='$fulldate'"; 116 $setstrarr[]="start='$fulldate'";
112 $setstrarr[]="length='$length'"; 117 $setstrarr[]="length='$length'";
113 $setstrarr[]="user='$username'"; 118 $setstrarr[]="user='$username'";
...@@ -137,6 +142,9 @@ class CreportEight extends Command { ...@@ -137,6 +142,9 @@ class CreportEight extends Command {
137 $setstrarr[]="disposec='".round($aline->dispoSec/1000,2)."'"; 142 $setstrarr[]="disposec='".round($aline->dispoSec/1000,2)."'";
138 $setstrarr[]="remarks='".str_replace("'","",$aline->userremarks)."'"; 143 $setstrarr[]="remarks='".str_replace("'","",$aline->userremarks)."'";
139 $setstrarr[]="userdata='$aline->userdata'"; 144 $setstrarr[]="userdata='$aline->userdata'";
145 $setstrarr[]="attempt='$aline->attempt'";
146 $setstrarr[]="priority='$aline->priority'";
147 $setstrarr[]="question='$aline->question'";
140 148
141 $setstr=implode(",",$setstrarr); 149 $setstr=implode(",",$setstrarr);
142 DB::connection("conn")->insert(DB::raw("insert into ".$calllog_report." set $setstr")); 150 DB::connection("conn")->insert(DB::raw("insert into ".$calllog_report." set $setstr"));
......
...@@ -49,7 +49,7 @@ class InsertCrmArchive extends Command { ...@@ -49,7 +49,7 @@ class InsertCrmArchive extends Command {
49 49
50 DB::insert(DB::raw("insert into crmcalls_archive select * from crmcalls where id>(select max(id) from crmcalls_archive)")); 50 DB::insert(DB::raw("insert into crmcalls_archive select * from crmcalls where id>(select max(id) from crmcalls_archive)"));
51 51
52 DB::update(DB::raw("UPDATE crmcalls_archive as ca INNER JOIN crmcalls as c on ca.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")); 52 DB::update(DB::raw("UPDATE crmcalls_archive as ca INNER JOIN crmcalls as c on ca.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"));
53 53
54 echo 'End'; 54 echo 'End';
55 } 55 }
......
1 <?php namespace App\Console\Commands;
2
3 use Illuminate\Console\Command;
4 //use Mail;
5 use DB;
6 use Config;
7
8 use App\Models\User;
9 use App\Models\Accesslog;
10
11 use App\Models\CRMCall;
12 use Schema;
13 use PDO;
14
15 use Illuminate\Database\Schema\Blueprint;
16
17 class calllog extends Command {
18
19 /**
20 * The console command name.
21 *
22 * @var string
23 */
24 protected $signature = 'calllog';
25
26 /**
27 * The console command description.
28 *
29 * @var string
30 */
31 protected $description = 'App Main Daily Task for calllog';
32
33 /**
34 * Execute the console command.
35 *
36 * @return mixed
37 */
38 public function handle()
39 {
40 $nowts=time();
41 $date=date('F_Y');
42 echo "\n".date('Y-m-d H:i:s')."\n";
43
44 $logdate=strtotime('0 day');
45
46 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
47 $central_ip=env('central_ip');
48 $server_ip=env('app_ip');
49 $calllog_report = "calllog_report_".$date;
50
51 $conn = array(
52 'driver' => 'mysql',
53 'host' => $central_ip,
54 'database' => env('DB_DATABASE', 'kstych_flexydial'),
55 'username' => env('DB_USERNAME', 'root'),
56 'password' => env('DB_PASSWORD', ''),
57 'charset' => 'utf8',
58 'collation' => 'utf8_unicode_ci',
59 'prefix' => '',
60 'options' => array(
61 PDO::ATTR_TIMEOUT => 5,
62 ),
63 );
64 Config::set("database.connections.conn", $conn);
65
66 DB::connection("conn")->getDatabaseName();
67
68 $serverclist=DB::connection("conn")->select(DB::raw("select id from server_details where server_ip='$server_ip'"));
69 $server_id=$serverclist[0]->id;
70 if($server_id<10){
71 $server_id="0".$server_id;
72 }
73
74
75 $maxid=DB::connection("conn")->select(DB::raw("SELECT max(crmcall_id) as maxid from $calllog_report where server='$server_id'"));
76
77 $maxids=$maxid[0]->maxid;
78
79 $alist=DB::select(DB::raw("SELECT * from crmcalls where id>'$maxids' and created_at<'".date("Y-m-d H:i:s",$logdate-(60*60))."'"));
80
81 //$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))."'"));
82
83 //$alist=DB::select(DB::raw("SELECT * from crmcalls where id>'$maxids' and created_at<'".date("Y-m-d H:i:s",$logdate-(60*60))."'"));
84
85 $userarr=array();
86 foreach($alist as $aline)
87 {
88 $setstrarr=array();
89
90
91 $clientcode="";$currentstatus="";$legalstatus="";$record_id="";
92 if($aline->crm_id>0)
93 {
94 $user=DB::select(DB::raw("select id,clientcode,currentstatus,legalstatus from records where id='".$aline->crm_id."' limit 1;"));
95 if(isset($user[0]))
96 {
97 $record_id=$user[0]->id;
98 $clientcode=$user[0]->clientcode;
99 $currentstatus=$user[0]->currentstatus;
100 $legalstatus=$user[0]->legalstatus;
101 }
102 }
103 $tpostdata=json_decode($aline->data,true);
104 $fulldate=date("Y-m-d H:i:s",strtotime($aline->created_at)+330*60);
105 $talktime=$aline->talkSec+$aline->recstartSec+$aline->recendSec;
106 $length=round(($aline->waitSec+$aline->callSec+$talktime+$aline->dispoSec)/1000,2);
107
108 if(!isset($userarr[$aline->user_id])&&$aline->user_id>0)$userarr[$aline->user_id]=User::find($aline->user_id);
109 $dispname="";if(isset($userarr[$aline->user_id]))$dispname=$userarr[$aline->user_id]->dispname();
110 $username="";if(isset($userarr[$aline->user_id]))$username=$userarr[$aline->user_id]->username;
111 $globalid=$server_id.$record_id;
112 $setstrarr[]="server='$server_id'";
113 $setstrarr[]="record_id='$record_id'";
114 $setstrarr[]="crmcall_id='$aline->id'";
115 $countid=DB::connection("conn")->select(DB::raw("SELECT count(crmcall_id) as countid from $calllog_report where server='$server_id' and crmcall_id='$aline->id'"));
116 $countids=$countid[0]->countid;
117 if($countids>0){continue;}
118 $setstrarr[]="globalid='$globalid'";
119 $setstrarr[]="start='$fulldate'";
120 $setstrarr[]="length='$length'";
121 $setstrarr[]="user='$username'";
122 $setstrarr[]="name='$dispname'";
123 $setstrarr[]="dispo='$aline->userstatus'";
124 $setstrarr[]="subdispo='$aline->usersubstatus'";
125 $setstrarr[]="callback='$aline->usercallback'";
126
127 $setstrarr[]="number='$aline->number'";
128 $setstrarr[]="clientcode='$clientcode'";
129 $setstrarr[]="currentstatus='$currentstatus'";
130 $setstrarr[]="legalstatus='$legalstatus'";
131 $setstrarr[]="client='$aline->client'";
132 $setstrarr[]="department='$aline->department'";
133 $setstrarr[]="state='$aline->state'";
134 $setstrarr[]="hsource='$aline->hsource'";
135
136 $setstrarr[]="type='$aline->type'";
137 $setstrarr[]="status='$aline->status'";
138 $setstrarr[]="statuscode='$aline->statuscode'";
139 $setstrarr[]="statusstr='$aline->substatus'";
140 $setstrarr[]="dialline='$aline->dialline_id'";
141 $setstrarr[]="did='$aline->did'";
142 $setstrarr[]="waitsec='".round($aline->waitSec/1000,2)."'";
143 $setstrarr[]="callsec='".round($aline->callSec/1000,2)."'";
144 $setstrarr[]="talksec='".round($talktime/1000,2)."'";
145 $setstrarr[]="disposec='".round($aline->dispoSec/1000,2)."'";
146 $setstrarr[]="remarks='".str_replace("'","",$aline->userremarks)."'";
147 $setstrarr[]="userdata='$aline->userdata'";
148 $setstrarr[]="attempt='$aline->attempt'";
149
150 $setstr=implode(",",$setstrarr);
151 DB::connection("conn")->insert(DB::raw("insert into ".$calllog_report." set $setstr"));
152 }
153
154 }
155 }
156
157
...@@ -89,9 +89,9 @@ class dailyupload_calllog extends Command { ...@@ -89,9 +89,9 @@ class dailyupload_calllog extends Command {
89 $central_cont=0; 89 $central_cont=0;
90 90
91 } 91 }
92 $dif=($mlist[0]->countrecord)-($central_cont); 92 $dif=($central_cont)-($mlist[0]->countrecord);
93 93
94 if($dif<=5 && $dif>=-5){ 94 if($dif==0){
95 95
96 $result="Y"; 96 $result="Y";
97 97
......
...@@ -94,9 +94,9 @@ class dailyupload_questionaire extends Command { ...@@ -94,9 +94,9 @@ class dailyupload_questionaire extends Command {
94 $central_cont=0; 94 $central_cont=0;
95 95
96 } 96 }
97 $dif=($mlist[0]->countrecord)-($central_cont); 97 $dif=($central_cont)-($mlist[0]->countrecord);
98 98
99 if($dif<=1 && $dif>=-1){ 99 if($dif==0){
100 100
101 $result="Y"; 101 $result="Y";
102 102
......
...@@ -15,109 +15,110 @@ use Illuminate\Database\Schema\Blueprint; ...@@ -15,109 +15,110 @@ use Illuminate\Database\Schema\Blueprint;
15 15
16 class lead_form_details extends Command { 16 class lead_form_details extends Command {
17 17
18 /** 18 /**
19 * The console command name. 19 * The console command name.
20 * 20 *
21 * @var string 21 * @var string
22 */ 22 */
23 protected $signature = 'lead_form_details'; 23 protected $signature = 'lead_form_details';
24 24
25 /** 25 /**
26 * The console command description. 26 * The console command description.
27 * 27 *
28 * @var string 28 * @var string
29 */ 29 */
30 protected $description = 'lead_form_details'; 30 protected $description = 'lead_form_details';
31 31
32 /** 32 /**
33 * Execute the console command. 33 * Execute the console command.
34 * 34 *
35 * @return mixed 35 * @return mixed
36 */ 36 */
37 public function handle() 37 public function handle()
38 {
39 $nowts=time();
40 echo "\n".date('Y-m-d H:i:s')."\n";
41
42
43 $logdate=strtotime('0 day');
44
45 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
46 $server_ip=env('app_ip');
47 $lead_form = "lead_form_details";
48 $central_ip=env('central_ip');
49
50 $conn = array(
51 'driver' => 'mysql',
52 'host' => $central_ip,
53 'database' => env('DB_DATABASE', 'kstych_flexydial'),
54 'username' => env('DB_USERNAME', 'root'),
55 'password' => env('DB_PASSWORD', ''),
56 'charset' => 'utf8',
57 'collation' => 'utf8_unicode_ci',
58 'prefix' => '',
59 'options' => array(
60 PDO::ATTR_TIMEOUT => 5,
61 ),
62 );
63 Config::set("database.connections.conn", $conn);
64
65
66 if(DB::connection("conn")->getDatabaseName())
38 { 67 {
39 $nowts=time(); 68 $serverclist=DB::connection("conn")->select(DB::raw("select id,location from server_details where server_ip='$server_ip'"));
40 echo "\n".date('Y-m-d H:i:s')."\n"; 69 $server_id=$serverclist[0]->id;
41 70 if($server_id<10){
71 $server_id="0".$server_id;
72 }
73 $location=$serverclist[0]->location;
74 $maxid=DB::connection("conn")->select(DB::raw("SELECT max(lead_form_id) as maxid from lead_form_details where server_ip='$server_ip'"));
42 75
43 $logdate=strtotime('0 day'); 76 $maxids=$maxid[0]->maxid;
44
45 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
46 $server_ip=env('app_ip');
47 $lead_form = "lead_form_details";
48 $central_ip=env('central_ip');
49
50 $conn = array(
51 'driver' => 'mysql',
52 'host' => $central_ip,
53 'database' => env('DB_DATABASE', 'kstych_flexydial'),
54 'username' => env('DB_USERNAME', 'root'),
55 'password' => env('DB_PASSWORD', ''),
56 'charset' => 'utf8',
57 'collation' => 'utf8_unicode_ci',
58 'prefix' => '',
59 'options' => array(
60 PDO::ATTR_TIMEOUT => 5,
61 ),
62 );
63 Config::set("database.connections.conn", $conn);
64 77
78 $qlist=DB::select(DB::raw("SELECT * from lead_form where id>'$maxids'"));
79 $userarr=array();
80 foreach($qlist as $qline)
81 {
82
83 $setstrarr=array();
65 84
66 if(DB::connection("conn")->getDatabaseName()) 85 $crtdate=date("Y-m-d H:i:s",strtotime($qline->created_at)+330*60);
67 { 86 $update=date("Y-m-d H:i:s",strtotime($qline->updated_at)+330*60);
68 $serverclist=DB::connection("conn")->select(DB::raw("select id,location from server_details where server_ip='$server_ip'")); 87
69 $server_id=$serverclist[0]->id; 88
70 if($server_id<10){ 89 $setstrarr[]="lead_form_id='$qline->id'";
71 $server_id="0".$server_id; 90 $setstrarr[]="created_at='$crtdate'";
72 } 91 $setstrarr[]="updated_at='$update'";
73 $location=$serverclist[0]->location; 92 $setstrarr[]="br_code='$qline->br_code'";
74 $maxid=DB::connection("conn")->select(DB::raw("SELECT max(lead_form_id) as maxid from lead_form_details where server_ip='$server_ip'")); 93 $setstrarr[]="br_name='$qline->br_name'";
75 94 $setstrarr[]="lg_code='$qline->lg_code'";
76 $maxids=$maxid[0]->maxid; 95 $setstrarr[]="processing_entity='$qline->processing_entity'";
77 96 $setstrarr[]="lead_owner='$qline->lead_owner'";
78 $qlist=DB::select(DB::raw("SELECT * from lead_form where id>'$maxids'")); 97 $setstrarr[]="lead_priority='$qline->lead_priority'";
79 print_r($qlist); 98 $setstrarr[]="product='$qline->product'";
80 $userarr=array(); 99 $setstrarr[]="customer_profile='$qline->customer_profile'";
81 foreach($qlist as $qline) 100 $setstrarr[]="customer_name='$qline->customer_name'";
82 { 101 $setstrarr[]="connected_number='$qline->connected_number'";
83 102 $setstrarr[]="remarks='$qline->remarks'";
84 $setstrarr=array(); 103 $setstrarr[]="mobile='$qline->mobile'";
85 104 $setstrarr[]="client='$qline->client'";
86 105 $setstrarr[]="user_id='$qline->user_id'";
87 $setstrarr[]="lead_form_id='$qline->id'"; 106 $setstrarr[]="firstname='$qline->firstname'";
88 $setstrarr[]="created_at='$qline->created_at'"; 107 $setstrarr[]="clientcode='$qline->clientcode'";
89 $setstrarr[]="updated_at='$qline->updated_at'"; 108 $setstrarr[]="call_id='$qline->call_id'";
90 $setstrarr[]="product='$qline->product'"; 109 $setstrarr[]="record_id='$qline->record_id'";
91 $setstrarr[]="customer_name='$qline->customer_name'"; 110 $setstrarr[]="server_id='$server_id'";
92 $setstrarr[]="mobile_number='$qline->mobile_number'"; 111 $setstrarr[]="server_ip='$server_ip'";
93 $setstrarr[]="city='$qline->city'"; 112
94 $setstrarr[]="state='$qline->state'"; 113 $setstr=implode(",",$setstrarr);
95 $setstrarr[]="agent_memo='$qline->agent_memo'"; 114 DB::connection("conn")->insert(DB::raw("insert into lead_form_details set $setstr"));
96 $setstrarr[]="customer_memo='$qline->customer_memo'"; 115
97 $setstrarr[]="remarks='$qline->remarks'";
98 $setstrarr[]="transfer_memo='$qline->transfer_memo'";
99 $setstrarr[]="server_ip='$server_ip'";
100 $setstrarr[]="location='$location'";
101 $setstrarr[]="address='$qline->address'";
102 $setstrarr[]="mobile='$qline->mobile'";
103 $setstrarr[]="client='$qline->client'";
104 $setstrarr[]="user_id='$qline->user_id'";
105 $setstrarr[]="firstname='$qline->firstname'";
106 $setstrarr[]="clientcode='$qline->clientcode'";
107 $setstrarr[]="call_id='$qline->call_id'";
108 $setstrarr[]="record_id='$qline->record_id'";
109
110 $setstr=implode(",",$setstrarr);
111 echo "prashant";
112 print_r($setstr);
113 DB::connection("conn")->insert(DB::raw("insert into lead_form_details set $setstr"));
114
115 }
116 DB::connection("conn")->disconnect();
117
118 } 116 }
119 117 DB::connection("conn")->disconnect();
120 } 118
121 119 }
120
121 }
122
122 123
123 } 124 }
......
1 <?php namespace App\Console\Commands;
2
3 use Illuminate\Console\Command;
4
5 use DB;
6 use App\Models\RelationshipService;
7 use App\Models\RelationshipCategory;
8 use App\Models\RelationshipSubCategory;
9
10 use Config;
11 use Schema;
12 use PDO;
13
14 use Illuminate\Database\Schema\Blueprint;
15
16 class relationship_tag extends Command {
17
18 /**
19 * The console command name.
20 *
21 * @var string
22 */
23 protected $signature = 'relationship_tag';
24
25 /**
26 * The console command description.
27 *
28 * @var string
29 */
30 protected $description = 'relationship_tag';
31
32 /**
33 * Execute the console command.
34 *
35 * @return mixed
36 */
37 public function handle()
38 {
39 $nowts=time();
40
41 echo date('Y-m-d H:i:s')."\n";
42
43 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
44 $server_ip=env('app_ip');
45 $central_ip=env('central_ip');
46
47 $conn = array(
48 'driver' => 'mysql',
49 'host' => $central_ip,
50 'database' => env('DB_DATABASE', 'kstych_flexydial'),
51 'username' => env('DB_USERNAME', 'root'),
52 'password' => env('DB_PASSWORD', ''),
53 'charset' => 'utf8',
54 'collation' => 'utf8_unicode_ci',
55 'prefix' => '',
56 'options' => array(
57 PDO::ATTR_TIMEOUT => 5,
58 ),
59 );
60
61 Config::set("database.connections.conn", $conn);
62
63 if(DB::connection("conn")->getDatabaseName())
64 {
65 $relationshipList = DB::connection("conn")->select(DB::raw("SELECT * FROM relationship_tagging"));
66
67 $relationshipData = 0; $newService = 0; $newCategory = 0; $newSubCategory = 0;
68
69 foreach ($relationshipList as $list) {
70 $service = RelationshipService::where('title','=',$list->service)->first();
71
72 if(count($service)){
73 $serviceId = $service->id;
74 }else{
75 $addService = RelationshipService::create(['title'=>$list->service]);
76 $serviceId = $addService->id;
77 $newService++;
78 }
79 echo $list->service." : ".$serviceId." - ";
80
81 $category = RelationshipCategory::where('service_id','=',$serviceId)->where('title','=',$list->category)->first();
82
83 if(count($category)){
84 $categoryId = $category->id;
85 }else{
86 $addCategory = RelationshipCategory::create(['service_id'=>$serviceId,'title'=>$list->category]);
87 $categoryId = $addCategory->id;
88 $newCategory++;
89 }
90 echo $list->category." : ".$categoryId." - ";
91
92 $subCategory = RelationshipSubCategory::where('category_id','=',$categoryId)->where('title','=',$list->sub_category)->first();
93
94 if(count($subCategory)){
95 $subCategoryId = $subCategory->id;
96 }else{
97 $addSubCategory = RelationshipSubCategory::create(['category_id'=>$categoryId,'title'=>$list->sub_category,'status'=>$list->status]);
98 $subCategoryId = $addSubCategory->id;
99 $newSubCategory++;
100 }
101 echo $list->sub_category." : ".$subCategoryId."\n";
102
103 //DB::table('relationship_tagging')->where('id', $list->id)->update(['status'=>'InActive']);
104 $relationshipData++;
105 }
106 echo "Total ".$relationshipData." data process and ". $newService." service, ".$newCategory." category, ".$newSubCategory." sub category added\n";
107
108 DB::connection("conn")->disconnect();
109
110 }
111
112 }
113
114 }
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 question_tree extends Command {
17
18 /**
19 * The console command name.
20 *
21 * @var string
22 */
23 protected $signature = 'question_tree';
24
25 /**
26 * The console command description.
27 *
28 * @var string
29 */
30 protected $description = 'question_tree';
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 H:i:s')."\n";
41
42 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
43 $server_ip=env('app_ip');
44 $lead_form = "lead_form_details";
45 $central_ip=env('central_ip');
46
47 $conn = array(
48 'driver' => 'mysql',
49 'host' => $central_ip,
50 'database' => env('DB_DATABASE', 'kstych_flexydial'),
51 'username' => env('DB_USERNAME', 'root'),
52 'password' => env('DB_PASSWORD', ''),
53 'charset' => 'utf8',
54 'collation' => 'utf8_unicode_ci',
55 'prefix' => '',
56 'options' => array(
57 PDO::ATTR_TIMEOUT => 5,
58 ),
59 );
60 Config::set("database.connections.conn", $conn);
61
62
63 if(DB::connection("conn")->getDatabaseName())
64 {
65 DB::table('question_tree')->truncate();
66 DB::table('question')->truncate();
67
68
69 $qlist=DB::connection("conn")->select(DB::raw("SELECT * from question_tree"));
70
71 foreach($qlist as $qline)
72 {
73
74 $setstrarr=array();
75
76 $setstrarr[]="parent_id='$qline->parent_id'";
77 $setstrarr[]="parent_opt='$qline->parent_opt'";
78 $setstrarr[]="question_id='$qline->question_id'";
79 $setstrarr[]="priority='$qline->priority'";
80
81 $setstr=implode(",",$setstrarr);
82 DB::insert(DB::raw("insert into question_tree set $setstr"));
83
84 }
85
86 $slist=DB::connection("conn")->select(DB::raw("SELECT * from question_bank"));
87 foreach($slist as $sline)
88 {
89
90 $setstrarr=array();
91
92 $setstrarr[]="question_no='$sline->question_no'";
93 $setstrarr[]="questions='$sline->questions'";
94 $setstrarr[]="opt_1='$sline->opt_1'";
95 $setstrarr[]="opt_2='$sline->opt_2'";
96 $setstrarr[]="opt_3='$sline->opt_3'";
97 $setstrarr[]="opt_4='$sline->opt_4'";
98 $setstrarr[]="opt_5='$sline->opt_5'";
99 $setstrarr[]="opt_6='$sline->opt_6'";
100 $setstrarr[]="opt_7='$sline->opt_7'";
101 $setstrarr[]="opt_8='$sline->opt_8'";
102 $setstrarr[]="opt_9='$sline->opt_9'";
103 $setstrarr[]="opt_10='$sline->opt_10'";
104 $setstrarr[]="type='$sline->type'";
105 $setstrarr[]="compulsory_qes='$sline->compulsory_qes'";
106
107 $setstr=implode(",",$setstrarr);
108 DB::insert(DB::raw("insert into question set $setstr"));
109
110 }
111 DB::connection("conn")->disconnect();
112
113 }
114
115 }
116
117
118 }
...@@ -46,7 +46,7 @@ use Illuminate\Database\Schema\Blueprint; ...@@ -46,7 +46,7 @@ use Illuminate\Database\Schema\Blueprint;
46 $server_ip=env('app_ip'); 46 $server_ip=env('app_ip');
47 $central_ip=env('central_ip'); 47 $central_ip=env('central_ip');
48 48
49 $reporthead=array("id","server_ip","call_id","call_start_date","call_start_time","call_duration","DNIS","ANI","call_direction","cti_var1","cti_var2","cti_var4","transfer_status","recording_filename"); 49 $reporthead=array("id","server_ip","call_start_date","call_start_time","call_duration","DNIS","ANI","call_id","call_direction","transfer_type","cti_var1","cti_var2","cti_var4","cti_var5","cti_var6","cti_var10","transfer_status","recording_filename");
50 50
51 $ftp_server="10.3.177.14"; 51 $ftp_server="10.3.177.14";
52 $ftp_user_name="buzzworks"; 52 $ftp_user_name="buzzworks";
...@@ -78,14 +78,20 @@ use Illuminate\Database\Schema\Blueprint; ...@@ -78,14 +78,20 @@ use Illuminate\Database\Schema\Blueprint;
78 //check maximum id saved in the table 78 //check maximum id saved in the table
79 $maxid=DB::connection("conn")->select(DB::raw("SELECT max(call_id) as maxid from recording_reconcilation where server_ip='$server_ip'")); 79 $maxid=DB::connection("conn")->select(DB::raw("SELECT max(call_id) as maxid from recording_reconcilation where server_ip='$server_ip'"));
80 if($maxid)$maxids=$maxid[0]->maxid; 80 if($maxid)$maxids=$maxid[0]->maxid;
81
82 $server_type=DB::connection("conn")->select(DB::raw("SELECT type from server_details where server_ip='$server_ip'"));
83 if($server_type)$servertype=$server_type[0]->type;
84
81 85
82 echo "\n"."maxids---".$maxids."\n"; 86 echo "\n"."maxids---".$maxids."\n";
83 echo "\n".date("Y-m-d H:i:s",$logdate)."\n"; 87 echo "\n".date("Y-m-d H:i:s",$logdate)."\n";
84 echo "\n".date("Y-m-d H:i:s",$logtodate)."\n"; 88 echo "\n".date("Y-m-d H:i:s",$logtodate)."\n";
89 echo "\n"."servertype---".$servertype."\n";
85 90
86 //query for calllog and recording 91 //query for calllog and recording
87 /*$qlist=DB::table('crmcalls')->select('*')->where('id','>','$maxid')->where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logtodate))->get();*/ 92 /*$qlist=DB::table('crmcalls')->select('*')->where('id','>','$maxid')->where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logtodate))->get();*/
88 $qlist=DB::table('crmcalls')->select('*')->where('id','=','1079409')->get(); 93
94 $qlist=DB::table('crmcalls_archive')->select('*')->whereIN('id',array('1014744','1014698','1014743','1014752','1014744','1014755','1014774','1014780','1014781','1014782','1014793'))->get();
89 95
90 //create csv file 96 //create csv file
91 $ii=1; 97 $ii=1;
...@@ -101,7 +107,9 @@ use Illuminate\Database\Schema\Blueprint; ...@@ -101,7 +107,9 @@ use Illuminate\Database\Schema\Blueprint;
101 $fulldate=date("Y-m-d H:i:s",strtotime($qline->created_at)+330*60); 107 $fulldate=date("Y-m-d H:i:s",strtotime($qline->created_at)+330*60);
102 //$talktime=$qline->talkSec+$qline->recstartSec+$qline->recendSec; 108 //$talktime=$qline->talkSec+$qline->recstartSec+$qline->recendSec;
103 //$length=round(($qline->waitSec+$qline->callSec+$talktime+$qline->dispoSec)/1000,2); 109 //$length=round(($qline->waitSec+$qline->callSec+$talktime+$qline->dispoSec)/1000,2);
104 $length=round(($qline->talkSec+$qline->recstartSec+$qline->recendSec)/1000,2); 110 $length=round(($qline->talkSec+$qline->recstartSec+$qline->recendSec)/1000,0);
111 $length=gmdate("H:i:s", $length);
112
105 echo "\n"."startdate--".explode(" ",$fulldate)[0]."\n"; 113 echo "\n"."startdate--".explode(" ",$fulldate)[0]."\n";
106 echo "\n"."starttime--".explode(" ",$fulldate)[1]."\n"; 114 echo "\n"."starttime--".explode(" ",$fulldate)[1]."\n";
107 echo "\n"."call duration--". $length."\n"; 115 echo "\n"."call duration--". $length."\n";
...@@ -124,21 +132,38 @@ use Illuminate\Database\Schema\Blueprint; ...@@ -124,21 +132,38 @@ use Illuminate\Database\Schema\Blueprint;
124 132
125 133
126 134
127 135 $call_direction="";
136 $disposubdispo="";
137 $transfer_status="";
138 if($qline->type=='Manual' || $qline->type='Progressive')
139 {
140 $call_direction="OB-".$qline->type;
141 $transfer_type='null';
142 }
143 else
144 {
145 $call_direction=$qline->type;
146 $transfer_type='null';
147 }
148 $disposubdispo=$qline->userstatus.','.$qline->usersubstatus;
128 149
129 150
130 $setstrarr=array(); 151 $setstrarr=array();
131 $setstrarr[]="server_ip='$server_ip'"; 152 $setstrarr[]="server_ip='$server_ip'";
132 $setstrarr[]="call_id='$qline->id'";
133 $setstrarr[]="call_start_date='".explode(" ",$fulldate)[0]."'"; 153 $setstrarr[]="call_start_date='".explode(" ",$fulldate)[0]."'";
134 $setstrarr[]="call_start_time='".explode(" ",$fulldate)[1]."'"; 154 $setstrarr[]="call_start_time='".explode(" ",$fulldate)[1]."'";
135 $setstrarr[]="call_duration='$length'"; 155 $setstrarr[]="call_duration='$length'";
136 $setstrarr[]="DNIS='$qline->did'"; 156 $setstrarr[]="DNIS='$qline->did'";
137 $setstrarr[]="ANI='$qline->number'"; 157 $setstrarr[]="ANI='$qline->number'";
138 $setstrarr[]="call_direction='$qline->type'"; 158 $setstrarr[]="call_id='$qline->id'";
159 $setstrarr[]="call_direction='$call_direction'";
160 $setstrarr[]="transfer_type='$transfer_type'";
139 $setstrarr[]="cti_var1='$userdatavalue'"; 161 $setstrarr[]="cti_var1='$userdatavalue'";
140 $setstrarr[]="cti_var2='$qline->client'"; 162 $setstrarr[]="cti_var2='$qline->client'";
141 $setstrarr[]="cti_var4='$qline->crm_id'"; 163 $setstrarr[]="cti_var4='$qline->crm_id'";
164 $setstrarr[]="cti_var5='$qline->id'";
165 $setstrarr[]="cti_var6='$servertype'";
166 $setstrarr[]="cti_var10='$disposubdispo'";
142 167
143 168
144 //send recording file to server 169 //send recording file to server
...@@ -175,7 +200,9 @@ use Illuminate\Database\Schema\Blueprint; ...@@ -175,7 +200,9 @@ use Illuminate\Database\Schema\Blueprint;
175 200
176 $setstr=implode(",",$setstrarr); 201 $setstr=implode(",",$setstrarr);
177 DB::connection("conn")->insert(DB::raw("insert into recording_reconcilation set $setstr")); 202 DB::connection("conn")->insert(DB::raw("insert into recording_reconcilation set $setstr"));
178 $data=array($ii++,$server_ip,$qline->id,explode(" ",$fulldate)[0],explode(" ",$fulldate)[1],$length,$qline->did,$qline->number,$qline->type,$userdatavalue,$qline->client,$qline->crm_id,$success_fail,$remote_file); 203
204
205 $data=array($ii++,$server_ip,explode(" ",$fulldate)[0],explode(" ",$fulldate)[1],$length,$qline->did,$qline->number,$qline->id,$call_direction,$transfer_type,$userdatavalue,$qline->client,$qline->crm_id,$qline->id,$servertype,$disposubdispo,$success_fail,$remote_file);
179 206
180 207
181 fputcsv($filesave, $data); 208 fputcsv($filesave, $data);
......
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 App\Jobs\KHRMSLib;
12 use Schema;
13 use PDO;
14
15 use Illuminate\Database\Schema\Blueprint;
16
17 class recording_reconcilation_metadata extends Command
18 {
19
20 /**
21 * The console command name.
22 *
23 * @var string
24 */
25 protected $signature = 'recording_reconcilation_metadata';
26
27 /**
28 * The console command description.
29 *
30 * @var string
31 */
32 protected $description = 'recording_reconcilation_metadata';
33
34 /**
35 * Execute the console command.
36 *
37 * @return mixed
38 */
39 public function handle()
40 {
41 $nowts=time();
42 echo "\n"."start Time---".date('Y-m-d H:i:s')."\n";
43
44 $logdate=strtotime(date('Y-m-d')." 00:00:00");
45 //$logdate=strtotime(date("2017-09-01")." 00:00:00");
46 $logtodate=strtotime(date('Y-m-d')." 23:59:59");
47 //$logtodate=strtotime(date("2017-11-30")." 23:59:59");
48 $server_ip=env('app_ip');
49 $central_ip=env('central_ip');
50 $wakka = new KHRMSLib();
51 $conn = array(
52 'driver' => 'mysql',
53 'host' => $central_ip,
54 'database' => env('DB_DATABASE', 'kstych_flexydial'),
55 'username' => env('DB_USERNAME', 'root'),
56 'password' => env('DB_PASSWORD', ''),
57 'charset' => 'utf8',
58 'collation' => 'utf8_unicode_ci',
59 'prefix' => '',
60 'options' => array(
61 PDO::ATTR_TIMEOUT => 5,
62 ),
63 );
64 Config::set("database.connections.conn", $conn);
65
66
67 if(DB::connection("conn")->getDatabaseName())
68 {
69 //check maximum id saved in the table
70 $maxid=DB::connection("conn")->select(DB::raw("SELECT max(call_id) as maxid from recording_reconcilation_metadata where server_ip='$server_ip'"));
71 if($maxid)$maxids=$maxid[0]->maxid;
72
73 $server_type=DB::connection("conn")->select(DB::raw("SELECT type from server_details where server_ip='$server_ip'"));
74 if($server_type)$servertype=$server_type[0]->type;
75
76
77 echo "\n"."maxids---".$maxids."\n";
78 /*echo "\n".date("Y-m-d H:i:s",$logdate)."\n";
79 echo "\n".date("Y-m-d H:i:s",$logtodate)."\n";
80 echo "\n"."servertype---".$servertype."\n";*/
81 $qlist="";
82
83 //query for calllog and recording
84 //$qlist=DB::table('crmcalls_archive')->select('id','created_at','recstartSec','recendSec','userdata','crm_id','type','userstatus','usersubstatus','did','number','client')->where('id','>','$maxids')->get();
85
86 $qlist=DB::select("SELECT id,created_at,recstartSec,recendSec,userdata,crm_id,type,userstatus,usersubstatus,did,number,client FROM crmcalls_archive where id > '$maxids' ");
87 //$qlist=DB::select("SELECT * FROM crmcalls_archive where id > '$maxids' ");
88 /*$qlist=DB::table('crmcalls_archive')->select('*')->where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logtodate))->get();*/
89
90 /*$qlist=DB::table('crmcalls_archive')->select('*')->whereIN('id',array('1014744','1014698','1014743','1014752','1014744','1014755','1014774','1014780','1014781','1014782','1014793'))->get();*/
91
92
93
94 $userdatavalue="";
95 foreach ($qlist as $qline)
96 {
97 //$file = storage_path()."/app/drec/2017-11/".$qline->id.".gsm";//tobe uploaded
98
99 //echo "\n".date("Y-m",strtotime($qline->created_at))."\n";
100 $file = storage_path()."/app/drec/".date("Y-m",strtotime($qline->created_at))."/".$qline->id.".gsm";
101
102 //$remote_file = "/home/buzzworks/recording_test";
103 $remote_file = "recording_test/".$server_ip."_".$qline->id.".wav";
104 //echo "\n"."file is exist or not".file_exists($file)."\n";
105 if (file_exists($file))
106 {
107
108 $fulldate=date("Y-m-d H:i:s",strtotime($qline->created_at)+330*60);
109 //$talktime=$qline->talkSec+$qline->recstartSec+$qline->recendSec;
110 //$length=round(($qline->waitSec+$qline->callSec+$talktime+$qline->dispoSec)/1000,2);
111 $length=round(($qline->talkSec+$qline->recstartSec+$qline->recendSec)/1000,0);
112 $length=gmdate("H:i:s", $length);
113
114 /*echo "\n"."startdate--".explode(" ",$fulldate)[0]."\n";
115 echo "\n"."starttime--".explode(" ",$fulldate)[1]."\n";
116 echo "\n"."call duration--". $length."\n";*/
117 $userdatavalue="";
118
119 $userdata=json_decode($qline->userdata,true);
120
121 //print_r(array_values($userdata));
122 if($userdata)
123 {
124 if(array_values($userdata)!=""||array_values($userdata)!=null)
125 {
126 $userdatavalue=implode(",",array_values($userdata));
127 }
128 else
129 {
130 $userdatavalue="";
131 }
132 }
133 $user=$wakka->getPerson($qline->crm_id);
134 $clientcode=$user["peopledata"]["clientcode"];
135
136
137 $call_direction="";
138 $disposubdispo="";
139 $transfer_status="";
140 if($qline->type=='Manual' || $qline->type='Progressive')
141 {
142 $call_direction="OB-".$qline->type;
143 $transfer_type='null';
144 }
145 else
146 {
147 $call_direction=$qline->type;
148 $transfer_type='null';
149 }
150 $disposubdispo=$qline->userstatus.','.$qline->usersubstatus;
151
152
153 $setstrarr=array();
154 $setstrarr[]="server_ip='$server_ip'";
155 $setstrarr[]="call_start_date='".explode(" ",$fulldate)[0]."'";
156 $setstrarr[]="call_start_time='".explode(" ",$fulldate)[1]."'";
157 $setstrarr[]="call_duration='$length'";
158 $setstrarr[]="DNIS='$qline->did'";
159 $setstrarr[]="ANI='$qline->number'";
160 $setstrarr[]="call_id='$qline->id'";
161 $setstrarr[]="call_direction='$call_direction'";
162 $setstrarr[]="transfer_type='$transfer_type'";
163 $setstrarr[]="cti_var1='$userdatavalue'";
164 $setstrarr[]="cti_var2='$qline->client'";
165 $setstrarr[]="cti_var4='$qline->crm_id'";
166 $setstrarr[]="cti_var5='$qline->id'";
167 $setstrarr[]="cti_var6='$servertype'";
168 $setstrarr[]="cti_var10='$disposubdispo'";
169 $setstrarr[]="customer_id='$clientcode'";
170
171
172 /*echo "Successfully connect";
173
174 echo "The file $file exists";
175
176 echo "successfully uploaded $file\n";*/
177 //$setstrarr[]="transfer_status='success'";
178 $setstrarr[]="recording_filename='$file'";
179
180
181 $setstr=implode(",",$setstrarr);
182 DB::connection("conn")->insert(DB::raw("insert into recording_reconcilation_metadata set $setstr"));
183 }
184
185
186 // close the connection
187 }
188
189 echo "\n"."End Time---".date('Y-m-d H:i:s')."\n";
190 DB::connection("conn")->disconnect();
191 }
192 }
193 }
194
195 ?>
196
197
...@@ -42,7 +42,7 @@ class relationship_tag extends Command { ...@@ -42,7 +42,7 @@ class relationship_tag extends Command {
42 42
43 $tcol=0;$fieldsarr=array();$extrahdrarr=array(); 43 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
44 $server_ip=env('app_ip'); 44 $server_ip=env('app_ip');
45 $central_ip=env('app_ip'); 45 $central_ip=env('central_ip');
46 46
47 $conn = array( 47 $conn = array(
48 'driver' => 'mysql', 48 'driver' => 'mysql',
...@@ -62,6 +62,11 @@ class relationship_tag extends Command { ...@@ -62,6 +62,11 @@ class relationship_tag extends Command {
62 62
63 if(DB::connection("conn")->getDatabaseName()) 63 if(DB::connection("conn")->getDatabaseName())
64 { 64 {
65
66 DB::table('relationship_service')->truncate();
67 DB::table('relationship_category')->truncate();
68 DB::table('relationship_sub_category')->truncate();
69
65 $relationshipList = DB::connection("conn")->select(DB::raw("SELECT * FROM relationship_tagging")); 70 $relationshipList = DB::connection("conn")->select(DB::raw("SELECT * FROM relationship_tagging"));
66 71
67 $relationshipData = 0; $newService = 0; $newCategory = 0; $newSubCategory = 0; 72 $relationshipData = 0; $newService = 0; $newCategory = 0; $newSubCategory = 0;
...@@ -71,30 +76,34 @@ class relationship_tag extends Command { ...@@ -71,30 +76,34 @@ class relationship_tag extends Command {
71 76
72 if(count($service)){ 77 if(count($service)){
73 $serviceId = $service->id; 78 $serviceId = $service->id;
79
74 }else{ 80 }else{
75 $addService = RelationshipService::create(['title'=>$list->service]); 81 $addService = RelationshipService::create(['title'=>$list->service]);
76 $serviceId = $addService->id; 82 $serviceId = $addService->id;
77 $newService++; 83 $newService++;
78 } 84 }
79 echo $list->service." : ".$serviceId." - "; 85 //echo $list->service." : ".$serviceId." - ";
80 86
81 $category = RelationshipCategory::where('service_id','=',$serviceId)->where('title','=',$list->category)->first(); 87 $category = RelationshipCategory::where('service_id','=',$serviceId)->where('title','=',$list->category)->first();
82 88
83 if(count($category)){ 89 if(count($category)){
84 $categoryId = $category->id; 90 $categoryId = $category->id;
91
85 }else{ 92 }else{
86 $addCategory = RelationshipCategory::create(['service_id'=>$serviceId,'title'=>$list->category]); 93 $addCategory = RelationshipCategory::create(['service_id'=>$serviceId,'title'=>$list->category]);
87 $categoryId = $addCategory->id; 94 $categoryId = $addCategory->id;
88 $newCategory++; 95 $newCategory++;
89 } 96 }
90 echo $list->category." : ".$categoryId." - "; 97 //echo $list->category." : ".$categoryId." - ";
98
99 $subCategory = DB::select(DB::raw("SELECT * from relationship_sub_category where category_id = $categoryId and title = '$list->sub_category'"));
91 100
92 $subCategory = RelationshipSubCategory::where('category_id','=',$categoryId)->where('title','=',$list->sub_category)->first(); 101 //$subCategory = RelationshipSubCategory::where('category_id','=',$categoryId)->where('title','=',$list->sub_category)->first();
93 102
94 if(count($subCategory)){ 103 if(count($subCategory)){
95 $subCategoryId = $subCategory->id; 104 $subCategoryId = $subCategory->id;
96 }else{ 105 }else{
97 $addSubCategory = RelationshipSubCategory::create(['category_id'=>$categoryId,'title'=>$list->sub_category]); 106 $addSubCategory = RelationshipSubCategory::create(['category_id'=>$categoryId,'title'=>$list->sub_category,'status'=>$list->status]);
98 $subCategoryId = $addSubCategory->id; 107 $subCategoryId = $addSubCategory->id;
99 $newSubCategory++; 108 $newSubCategory++;
100 } 109 }
...@@ -111,4 +120,4 @@ class relationship_tag extends Command { ...@@ -111,4 +120,4 @@ class relationship_tag extends Command {
111 120
112 } 121 }
113 122
114 }
...\ No newline at end of file ...\ No newline at end of file
123 }
......
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 relationship_tag extends Command {
17
18 /**
19 * The console command name.
20 *
21 * @var string
22 */
23 protected $signature = 'relationship_tag';
24
25 /**
26 * The console command description.
27 *
28 * @var string
29 */
30 protected $description = 'relationship_tag';
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 H:i:s')."\n";
41
42 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
43 $server_ip=env('app_ip');
44 $central_ip=env('central_ip');
45
46 $conn = array(
47 'driver' => 'mysql',
48 'host' => $central_ip,
49 'database' => env('DB_DATABASE', 'kstych_flexydial'),
50 'username' => env('DB_USERNAME', 'root'),
51 'password' => env('DB_PASSWORD', ''),
52 'charset' => 'utf8',
53 'collation' => 'utf8_unicode_ci',
54 'prefix' => '',
55 'options' => array(
56 PDO::ATTR_TIMEOUT => 5,
57 ),
58 );
59 Config::set("database.connections.conn", $conn);
60
61
62 if(DB::connection("conn")->getDatabaseName())
63 {
64
65 $qlist=DB::connection("conn")->select(DB::raw("SELECT * from relationship_tagging"));
66
67 foreach($qlist as $qline)
68 {
69 $setstrarr=array();
70
71 $idqlist=DB::select(DB::raw("SELECT * from relationship_service where title='$qline->service'"));
72
73 if(!empty($idqlist)){
74 $servid=$idqlist[0]->id;
75 }else{
76 $servid='';
77 }
78
79
80 $setstrarr[]="title='$qline->service'";
81 $setstrarr[]="status='$qline->status'";
82
83 $setstr=implode(",",$setstrarr);
84
85
86 if($servid!='')
87 {
88 DB::update(DB::raw("update relationship_service set $setstr where id=$servid"));
89 }else{
90 DB::insert(DB::raw("insert into relationship_service set $setstr"));
91 //$servid = DB::table('relationship_service')->insertGetId();
92 }
93 }
94
95 $service_id=DB::select(DB::raw("SELECT * from relationship_service"));
96
97
98 //foreach($qlist as $qline)
99 //{
100
101 foreach ($service_id as $sid)
102 {
103 $setcatarr=array();
104
105 $idrlist=DB::select(DB::raw("SELECT * from relationship_category where title='$qline->category' and service_id=$sid->id"));
106
107 if(!empty($idrlist)){
108
109 $cateid=$idrlist[0]->id;
110 print_r($cateid);
111 echo "update";
112 }else{
113 $cateid='';
114 echo "no id";
115 }
116
117 $setcatarr[]="service_id='$sid->id'";
118 $setcatarr[]="title='$qline->category'";
119 $setcatarr[]="status='$qline->status'";
120
121 $setcat=implode(",",$setcatarr);
122
123 if($cateid!='')
124 {
125 DB::update(DB::raw("update relationship_category set $setcat where service_id=$cateid"));
126 echo "update";
127 }else{
128 DB::insert(DB::raw("insert into relationship_category set $setcat"));
129 echo "insert";
130 }
131 }echo "prashant1";
132
133 //}
134
135
136 $category_id=DB::select(DB::raw("SELECT * from relationship_category"));
137
138 foreach($qlist as $qline)
139 {
140 foreach ($category_id as $cid) {
141
142 $subcatarr=array();
143 $idslist=DB::select(DB::raw("SELECT * from relationship_sub_category where title='$qline->sub_category'"));
144
145 if(!empty($idslist)){
146 $subcateid=$idslist[0]->id;
147 }else{
148 $subcateid='';
149 }
150 $subcatarr[]="category_id='$cid->id'";
151 $subcatarr[]="title='$qline->sub_category'";
152 $subcatarr[]="status='$qline->status'";
153
154 $setsubcat=implode(",",$subcatarr);
155
156 if($subcateid!='')
157 {
158 //DB::update(DB::raw("update relationship_sub_category set $setsubcat where category_id=$subcateid"));
159 }else{
160 //DB::insert(DB::raw("insert into relationship_sub_category set $setsubcat"));
161
162 //$servid = DB::table('relationship_sub_category')->insertGetId();
163 }
164
165 }
166
167 }
168 echo "prashant";
169
170 DB::connection("conn")->disconnect();
171
172 }
173
174 }
175
176
177 }
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 relationship_tag extends Command {
17
18 /**
19 * The console command name.
20 *
21 * @var string
22 */
23 protected $signature = 'relationship_tag';
24
25 /**
26 * The console command description.
27 *
28 * @var string
29 */
30 protected $description = 'relationship_tag';
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 H:i:s')."\n";
41
42 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
43 $server_ip=env('app_ip');
44 $central_ip=env('central_ip');
45
46 $conn = array(
47 'driver' => 'mysql',
48 'host' => $central_ip,
49 'database' => env('DB_DATABASE', 'kstych_flexydial'),
50 'username' => env('DB_USERNAME', 'root'),
51 'password' => env('DB_PASSWORD', ''),
52 'charset' => 'utf8',
53 'collation' => 'utf8_unicode_ci',
54 'prefix' => '',
55 'options' => array(
56 PDO::ATTR_TIMEOUT => 5,
57 ),
58 );
59 Config::set("database.connections.conn", $conn);
60
61
62 if(DB::connection("conn")->getDatabaseName())
63 {
64
65 $qlist=DB::connection("conn")->select(DB::raw("SELECT * from relationship_tagging"));
66
67 foreach($qlist as $qline)
68 {
69
70
71 $idqlist=DB::select(DB::raw("SELECT title,id from relationship_service where title='$qline->service' and id=$qline->id"));
72
73 if(!empty($idqlist)){
74 $servid=$idqlist[0]->id;
75 }else{
76 $servid='';
77 }
78 $setstrarr=array();
79
80 $setstrarr[]="title='$qline->service'";
81 $setstrarr[]="status='$qline->status'";
82
83 $setstr=implode(",",$setstrarr);
84 if($servid!='')
85 {
86 DB::update(DB::raw("update relationship_service set $setstr where id=$servid"));
87
88 }else{
89 DB::insert(DB::raw("insert into relationship_service set $setstr"));
90
91 }
92 }
93
94 $service_id=DB::select(DB::raw("SELECT title,id from relationship_service"));
95
96
97 foreach($qlist as $qline)
98 {
99 foreach ($service_id as $sid) {
100 $idrlist=DB::select(DB::raw("SELECT id,title from relationship_category where title='$qline->category' and service_id='$sid->id'"));
101
102
103 if(!empty($idrlist)){
104
105 $cateid=$idrlist[0]->id;
106 }else{
107 $cateid='';
108 }
109 $setcatarr=array();
110
111 $setcatarr[]="service_id='$sid->id'";
112 $setcatarr[]="title='$qline->category'";
113 $setcatarr[]="status='$qline->status'";
114
115 $setcat=implode(",",$setstrarr);
116 if($cateid!='')
117 {
118 DB::update(DB::raw("update relationship_category set $setcat where id=$cateid"));
119 }else{
120 DB::insert(DB::raw("insert into relationship_category set $setcat"));
121
122 }
123 }
124
125 }
126
127 $category_id=DB::select(DB::raw("SELECT title,id from relationship_category"));
128
129 foreach($qlist as $qline)
130 {
131 foreach ($category_id as $cid) {
132 $idslist=DB::select(DB::raw("SELECT id,title from relationship_sub_category where title='$qline->category' and category_id='$cid->id'"));
133
134 if(!empty($idslist)){
135 print_r($idslist);
136 $subcateid=$idslist[0]->id;
137 }else{
138 $subcateid='';
139 }
140 $subcatarr[]="category_id='$cid->id'";
141 $subcatarr[]="title='$qline->sub_category'";
142 $subcatarr[]="status='$qline->status'";
143
144 $setsubcat=implode(",",$subcatarr);
145 if($$subcateid!='')
146 {
147 DB::update(DB::raw("update relationship_sub_category set $setsubcat where id=$subcateid"));
148 }else{
149 DB::insert(DB::raw("insert into relationship_sub_category set $setsubcat"));
150
151 }
152
153 }
154
155 }
156 echo "prashant3<br>";
157
158 DB::connection("conn")->disconnect();
159
160 }
161
162 }
163
164
165 }
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 rlpcust_details extends Command {
17
18 /**
19 * The console command name.
20 *
21 * @var string
22 */
23 protected $signature = 'rlpcust_details';
24
25 /**
26 * The console command description.
27 *
28 * @var string
29 */
30 protected $description = 'rlpcust_details';
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 H:i:s')."\n";
41
42
43 $logdate=strtotime('0 day');
44
45 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
46 $server_ip=env('app_ip');
47 $p11086_cop_rlp_cust_base_uat = "p11086_cop_rlp_cust_base_uat";
48 $central_ip=env('central_ip');
49
50 $conn = array(
51 'driver' => 'mysql',
52 'host' => $central_ip,
53 'database' => env('DB_DATABASE', 'kstych_flexydial'),
54 'username' => env('DB_USERNAME', 'root'),
55 'password' => env('DB_PASSWORD', ''),
56 'charset' => 'utf8',
57 'collation' => 'utf8_unicode_ci',
58 'prefix' => '',
59 'options' => array(
60 PDO::ATTR_TIMEOUT => 5,
61 ),
62 );
63 Config::set("database.connections.conn", $conn);
64
65
66 if(DB::connection("conn")->getDatabaseName())
67 {
68
69 $qlist=DB::connection("conn")->select(DB::raw("SELECT * from p11086_cop_rlp_cust_base_uat"));
70
71 $userarr=array();
72 foreach($qlist as $qline)
73 {
74
75 $setstrarr=array();
76
77 $setstrarr[]="region='$qline->region'";
78 $setstrarr[]="unit='$qline->unit'";
79 $setstrarr[]="supervisor='$qline->supervisor'";
80 $setstrarr[]="region_head_name='$qline->region_head_name'";
81 $setstrarr[]="pbcode='$qline->pbcode'";
82 $setstrarr[]="cod_cust='$qline->cod_cust'";
83 $setstrarr[]="group_id='$qline->group_id'";
84 $setstrarr[]="total_connects='$qline->total_connects'";
85 $setstrarr[]="total_uniq_connects='$qline->total_uniq_connects'";
86 $setstrarr[]="crm_contact='$qline->crm_contact'";
87 $setstrarr[]="al_qm_opp='$qline->al_qm_opp'";
88 $setstrarr[]="al_upg_opp='$qline->al_upg_opp'";
89 $setstrarr[]="al_al_cnc_opp='$qline->al_al_cnc_opp'";
90 $setstrarr[]="al_pa_opp='$qline->al_pa_opp'";
91 $setstrarr[]="al_zip_opp='$qline->al_zip_opp'";
92 $setstrarr[]="al_called_opp='$qline->al_called_opp'";
93 $setstrarr[]="al_pitch='$qline->al_pitch'";
94 $setstrarr[]="al_lg='$qline->al_lg'";
95 $setstrarr[]="pl_10sec_opp='$qline->pl_10sec_opp'";
96 $setstrarr[]="pl_pa_opp='$qline->pl_pa_opp'";
97 $setstrarr[]="pl_pq_opp='$qline->pl_pq_opp'";
98 $setstrarr[]="bl_10sec_opp='$qline->bl_10sec_opp'";
99 $setstrarr[]="bl_pq_opp='$qline->bl_pq_opp'";
100 $setstrarr[]="pl_called_opp='$qline->pl_called_opp'";
101 $setstrarr[]="pl_pitch='$qline->pl_pitch'";
102 $setstrarr[]="pl_lg='$qline->pl_lg'";
103 $setstrarr[]="twl_pa_opp='$qline->twl_pa_opp'";
104 $setstrarr[]="twl_called_opp='$qline->twl_called_opp'";
105 $setstrarr[]="twl_pitch='$qline->twl_pitch'";
106 $setstrarr[]="twl_lg='$qline->twl_lg'";
107 $setstrarr[]="hl_bt_opp='$qline->hl_bt_opp'";
108 $setstrarr[]="hl_pq_opp='$qline->hl_pq_opp'";
109 $setstrarr[]="hl_called_opp='$qline->hl_called_opp'";
110 $setstrarr[]="hl_pitch='$qline->hl_pitch'";
111 $setstrarr[]="hl_lg='$qline->hl_lg'";
112 $setstrarr[]="gl_pitch='$qline->gl_pitch'";
113 $setstrarr[]="gl_lg='$qline->gl_lg'";
114 $setstrarr[]="las_opp='$qline->las_opp'";
115 $setstrarr[]="las_called_opp='$qline->las_called_opp'";
116 $setstrarr[]="las_pitch='$qline->las_pitch'";
117 $setstrarr[]="las_lg='$qline->las_lg'";
118 $setstrarr[]="lap_opp='$qline->lap_opp'";
119 $setstrarr[]="lap_called_opp='$qline->lap_called_opp'";
120 $setstrarr[]="lap_lg='$qline->lap_lg'";
121 $setstrarr[]="hsl_opp='$qline->hsl_opp'";
122 $setstrarr[]="hsl_called_opp='$qline->hsl_called_opp'";
123 $setstrarr[]="hsl_pitch='$qline->hsl_pitch'";
124 $setstrarr[]="cc_eli_new_opp='$qline->cc_eli_new_opp'";
125 $setstrarr[]="cc_called_opp='$qline->cc_called_opp'";
126 $setstrarr[]="cc_pitch='$qline->cc_pitch'";
127 $setstrarr[]="region='$qline->region'";
128 $setstrarr[]="region='$qline->region'";
129 $setstrarr[]="region='$qline->region'";
130 $setstrarr[]="region='$qline->region'";
131 $setstrarr[]="region='$qline->region'";
132 $setstrarr[]="region='$qline->region'";
133 $setstrarr[]="region='$qline->region'";
134 $setstrarr[]="region='$qline->region'";
135 $setstrarr[]="region='$qline->region'";
136 $setstrarr[]="region='$qline->region'";
137 $setstrarr[]="region='$qline->region'";
138 $setstrarr[]="region='$qline->region'";
139 $setstrarr[]="region='$qline->region'";
140 $setstrarr[]="region='$qline->region'";
141 $setstrarr[]="region='$qline->region'";
142 $setstrarr[]="region='$qline->region'";
143 $setstrarr[]="region='$qline->region'";
144 $setstrarr[]="region='$qline->region'";
145 $setstrarr[]="region='$qline->region'";
146 $setstrarr[]="region='$qline->region'";
147 $setstrarr[]="region='$qline->region'";
148 $setstrarr[]="region='$qline->region'";
149 $setstrarr[]="region='$qline->region'";
150 $setstrarr[]="region='$qline->region'";
151 $setstrarr[]="region='$qline->region'";
152 $setstrarr[]="region='$qline->region'";
153 $setstrarr[]="region='$qline->region'";
154 $setstrarr[]="region='$qline->region'";
155 $setstrarr[]="region='$qline->region'";
156 $setstrarr[]="region='$qline->region'";
157 $setstrarr[]="region='$qline->region'";
158 $setstrarr[]="region='$qline->region'";
159 $setstrarr[]="region='$qline->region'";
160 $setstrarr[]="region='$qline->region'";
161 $setstrarr[]="region='$qline->region'";
162 $setstrarr[]="region='$qline->region'";
163 $setstrarr[]="region='$qline->region'";
164 $setstrarr[]="region='$qline->region'";
165 $setstrarr[]="region='$qline->region'";
166 $setstrarr[]="region='$qline->region'";
167 $setstrarr[]="region='$qline->region'";
168 $setstrarr[]="region='$qline->region'";
169 $setstrarr[]="region='$qline->region'";
170 $setstrarr[]="region='$qline->region'";
171 $setstrarr[]="region='$qline->region'";
172 $setstrarr[]="region='$qline->region'";
173 $setstrarr[]="region='$qline->region'";
174 $setstrarr[]="region='$qline->region'";
175 $setstrarr[]="region='$qline->region'";
176 $setstrarr[]="region='$qline->region'";
177 $setstrarr[]="region='$qline->region'";
178 $setstrarr[]="region='$qline->region'";
179 $setstrarr[]="region='$qline->region'";
180 $setstrarr[]="region='$qline->region'";
181 $setstrarr[]="region='$qline->region'";
182 $setstrarr[]="region='$qline->region'";
183 $setstrarr[]="region='$qline->region'";
184 $setstrarr[]="region='$qline->region'";
185 $setstrarr[]="region='$qline->region'";
186 $setstrarr[]="region='$qline->region'";
187 $setstrarr[]="region='$qline->region'";
188 $setstrarr[]="region='$qline->region'";
189 $setstrarr[]="region='$qline->region'";
190 $setstrarr[]="region='$qline->region'";
191 $setstrarr[]="region='$qline->region'";
192 $setstrarr[]="region='$qline->region'";
193 $setstrarr[]="region='$qline->region'";
194 $setstrarr[]="region='$qline->region'";
195 $setstrarr[]="region='$qline->region'";
196 $setstrarr[]="region='$qline->region'";
197
198
199
200 $setstr=implode(",",$setstrarr);
201
202 DB::insert(DB::raw("insert into $p11086_cop_rlp_cust_base_uat set $setstr"));
203
204 }
205 DB::connection("conn")->disconnect();
206
207 }
208
209 }
210
211
212 }
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 rlppb_details extends Command {
17
18 /**
19 * The console command name.
20 *
21 * @var string
22 */
23 protected $signature = 'rlppb_details';
24
25 /**
26 * The console command description.
27 *
28 * @var string
29 */
30 protected $description = 'rlppb_details';
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 H:i:s')."\n";
41
42
43 $logdate=strtotime('0 day');
44
45 $tcol=0;$fieldsarr=array();$extrahdrarr=array();
46 $server_ip=env('app_ip');
47 $p11086_cop_rlp_pb_base_uat = "p11086_cop_rlp_pb_base_uat";
48 $central_ip=env('central_ip');
49
50 $conn = array(
51 'driver' => 'mysql',
52 'host' => $central_ip,
53 'database' => env('DB_DATABASE', 'kstych_flexydial'),
54 'username' => env('DB_USERNAME', 'root'),
55 'password' => env('DB_PASSWORD', ''),
56 'charset' => 'utf8',
57 'collation' => 'utf8_unicode_ci',
58 'prefix' => '',
59 'options' => array(
60 PDO::ATTR_TIMEOUT => 5,
61 ),
62 );
63 Config::set("database.connections.conn", $conn);
64
65
66 if(DB::connection("conn")->getDatabaseName())
67 {
68
69 $qlist=DB::connection("conn")->select(DB::raw("SELECT * from p11086_cop_rlp_pb_base_uat"));
70
71 $userarr=array();
72 foreach($qlist as $qline)
73 {
74
75 $setstrarr=array();
76
77 $setstrarr[]="region='$qline->region'";
78 $setstrarr[]="unit='$qline->unit'";
79 $setstrarr[]="supervisor='$qline->supervisor'";
80 $setstrarr[]="region_head_name='$qline->region_head_name'";
81 $setstrarr[]="pbcode='$qline->pbcode'";
82 $setstrarr[]="no_of_cod_cust='$qline->no_of_cod_cust'";
83 $setstrarr[]="no_of_grp_id='$qline->no_of_grp_id'";
84 $setstrarr[]="total_connects='$qline->total_connects'";
85 $setstrarr[]="total_uniq_connects='$qline->total_uniq_connects'";
86 $setstrarr[]="crm_contact='$qline->crm_contact'";
87 $setstrarr[]="varience='$qline->varience'";
88 $setstrarr[]="al_qm_opp='$qline->al_qm_opp'";
89 $setstrarr[]="al_upg_opp='$qline->al_upg_opp'";
90 $setstrarr[]="al_al_cnc_opp='$qline->al_al_cnc_opp'";
91 $setstrarr[]="al_pa_opp='$qline->al_pa_opp'";
92 $setstrarr[]="al_zip_opp='$qline->al_zip_opp'";
93 $setstrarr[]="al_called_opp='$qline->al_called_opp'";
94 $setstrarr[]="al_pitch='$qline->al_pitch'";
95 $setstrarr[]="al_pitch_with_opp='$qline->al_pitch_with_opp'";
96 $setstrarr[]="al_pitch_with_out_opp='$qline->al_pitch_with_out_opp'";
97 $setstrarr[]="al_lg='$qline->al_lg'";
98 $setstrarr[]="pl_10sec_opp='$qline->pl_10sec_opp'";
99 $setstrarr[]="pl_pa_opp='$qline->pl_pa_opp'";
100 $setstrarr[]="pl_pq_opp='$qline->pl_pq_opp'";
101 $setstrarr[]="bl_10sec_opp='$qline->bl_10sec_opp'";
102 $setstrarr[]="bl_pq_opp='$qline->bl_pq_opp'";
103 $setstrarr[]="pl_called_opp='$qline->pl_called_opp'";
104 $setstrarr[]="pl_pitch='$qline->pl_pitch'";
105 $setstrarr[]="pl_pitch_with_opp='$qline->pl_pitch_with_opp'";
106 $setstrarr[]="pl_pitch_with_out_opp='$qline->pl_pitch_with_out_opp'";
107 $setstrarr[]="pl_lg='$qline->pl_lg'";
108 $setstrarr[]="twl_pa_opp='$qline->twl_pa_opp'";
109 $setstrarr[]="twl_called_opp='$qline->twl_called_opp'";
110 $setstrarr[]="twl_pitch='$qline->twl_pitch'";
111 $setstrarr[]="twl_pitch_with_opp='$qline->twl_pitch_with_opp'";
112 $setstrarr[]="twl_pitch_with_out_opp='$qline->twl_pitch_with_out_opp'";
113 $setstrarr[]="twl_lg='$qline->twl_lg'";
114 $setstrarr[]="hl_pq_opp='$qline->hl_pq_opp'";
115 $setstrarr[]="hl_bt_opp='$qline->hl_bt_opp'";
116 $setstrarr[]="hl_called_opp='$qline->hl_called_opp'";
117 $setstrarr[]="hl_pitch='$qline->hl_pitch'";
118 $setstrarr[]="hl_pitch_with_opp='$qline->hl_pitch_with_opp'";
119 $setstrarr[]="hl_pitch_with_out_opp='$qline->hl_pitch_with_out_opp'";
120 $setstrarr[]="hl_lg='$qline->hl_lg'";
121 $setstrarr[]="gl_pitch='$qline->gl_pitch'";
122 $setstrarr[]="gl_lg='$qline->gl_lg'";
123 $setstrarr[]="las_opp='$qline->las_opp'";
124 $setstrarr[]="las_called_opp='$qline->las_called_opp'";
125 $setstrarr[]="las_pitch='$qline->las_pitch'";
126 $setstrarr[]="las_pitch_with_opp='$qline->las_pitch_with_opp'";
127 $setstrarr[]="las_pitch_with_out_opp='$qline->las_pitch_with_out_opp'";
128 $setstrarr[]="las_lg='$qline->las_lg'";
129 $setstrarr[]="lap_opp='$qline->lap_opp'";
130 $setstrarr[]="lap_called_opp='$qline->lap_called_opp'";
131 $setstrarr[]="lap_lg='$qline->lap_lg'";
132 $setstrarr[]="hsl_opp='$qline->hsl_opp'";
133 $setstrarr[]="hsl_called_opp='$qline->hsl_called_opp'";
134 $setstrarr[]="hsl_pitch='$qline->hsl_pitch'";
135 $setstrarr[]="hsl_pitch_with_opp='$qline->hsl_pitch_with_opp'";
136 $setstrarr[]="hsl_pitch_with_out_opp='$qline->hsl_pitch_with_out_opp'";
137 $setstrarr[]="cc_eli_new_opp='$qline->cc_eli_new_opp'";
138 $setstrarr[]="cc_called_opp='$qline->cc_called_opp'";
139 $setstrarr[]="cc_pitch='$qline->cc_pitch'";
140 $setstrarr[]="cc_pitch_with_opp='$qline->cc_pitch_with_opp'";
141 $setstrarr[]="cc_pitch_with_out_opp='$qline->cc_pitch_with_out_opp'";
142 $setstrarr[]="cc_lg='$qline->cc_lg'";
143 $setstrarr[]="cc_activation_opp='$qline->cc_activation_opp'";
144 $setstrarr[]="cc_activation_called_opp='$qline->cc_activation_called_opp'";
145 $setstrarr[]="li_opp='$qline->li_opp'";
146 $setstrarr[]="li_called_opp='$qline->li_called_opp'";
147 $setstrarr[]="fd_opp='$qline->fd_opp'";
148 $setstrarr[]="fd_called_opp='$qline->fd_called_opp'";
149 $setstrarr[]="fd_pitch='$qline->fd_pitch'";
150 $setstrarr[]="fd_pitch_with_opp='$qline->fd_pitch_with_opp'";
151 $setstrarr[]="fd_pitch_with_out_opp='$qline->fd_pitch_with_out_opp'";
152 $setstrarr[]="ltd_act_saving_opp='$qline->ltd_act_saving_opp'";
153 $setstrarr[]="ltd_act_saving_called_opp='$qline->ltd_act_saving_called_opp'";
154 $setstrarr[]="mb_opp='$qline->mb_opp'";
155 $setstrarr[]="mb_called_opp='$qline->mb_called_opp'";
156 $setstrarr[]="mb_pitch='$qline->mb_pitch'";
157 $setstrarr[]="mb_pitch_with_opp='$qline->mb_pitch_with_opp'";
158 $setstrarr[]="mb_pitch_with_out_opp='$qline->mb_pitch_with_out_opp'";
159 $setstrarr[]="nb_mb_lg='$qline->nb_mb_lg'";
160 $setstrarr[]="aadhaar_opp='$qline->aadhaar_opp'";
161 $setstrarr[]="aadhaar_called_opp='$qline->aadhaar_called_opp'";
162 $setstrarr[]="aadhaar_pitch='$qline->aadhaar_pitch'";
163 $setstrarr[]="aadhaar_pitch_with_opp='$qline->aadhaar_pitch_with_opp'";
164 $setstrarr[]="aadhaar_pitch_with_out_opp='$qline->aadhaar_pitch_with_out_opp'";
165 $setstrarr[]="aadhaar_activation='$qline->aadhaar_activation'";
166 $setstrarr[]="digi2_score_opp='$qline->digi2_score_opp'";
167 $setstrarr[]="digi2_score_called_opp='$qline->digi2_score_called_opp'";
168 $setstrarr[]="digi_physical_opp='$qline->digi_physical_opp'";
169 $setstrarr[]="digi_physical_called_opp='$qline->digi_physical_called_opp'";
170 $setstrarr[]="digi_billpay_opp='$qline->digi_billpay_opp'";
171 $setstrarr[]="digi_billpay_called_opp='$qline->digi_billpay_called_opp'";
172 $setstrarr[]="bill_pay_pitch='$qline->bill_pay_pitch'";
173 $setstrarr[]="digi_bill_pay_pitch_with_opp='$qline->digi_bill_pay_pitch_with_opp'";
174 $setstrarr[]="digi_bill_pay_pitch_with_out_opp='$qline->digi_bill_pay_pitch_with_out_opp'";
175 $setstrarr[]="digi_basic_banking_opp='$qline->digi_basic_banking_opp'";
176 $setstrarr[]="digi_basic_banking_called_opp='$qline->digi_basic_banking_called_opp'";
177 $setstrarr[]="digi_ecom_shopping_opp='$qline->digi_ecom_shopping_opp'";
178 $setstrarr[]="digi_ecom_shopping_called_opp='$qline->digi_ecom_shopping_called_opp'";
179 $setstrarr[]="digi_investment_opp='$qline->digi_investment_opp'";
180 $setstrarr[]="digi_investment_called_opp='$qline->digi_investment_called_opp'";
181 $setstrarr[]="invest_pitch='$qline->invest_pitch'";
182 $setstrarr[]="digi_investment_pitch_with_opp='$qline->digi_investment_pitch_with_opp'";
183 $setstrarr[]="digi_investment_pitch_with_out_opp='$qline->digi_investment_pitch_with_out_opp'";
184
185
186 $setstr=implode(",",$setstrarr);
187
188 DB::insert(DB::raw("insert into $p11086_cop_rlp_pb_base_uat set $setstr"));
189
190 }
191 DB::connection("conn")->disconnect();
192
193 }
194
195 }
196
197
198 }
No preview for this file type
No preview for this file type
No preview for this file type
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!