Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flexydial
/
hdfc-beu-v2
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
36b5f5c0
authored
2018-12-03 12:34:26 +0000
by
Manish Mihsra
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Added updated sms report file and created one more module to assign any role
1 parent
207e0cdb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
105 additions
and
0 deletions
application/app/Console/Commands/Smsreport.php
application/config/app.php
application/app/Console/Commands/Smsreport.php
0 → 100644
View file @
36b5f5c
<?php
namespace
App\Console\Commands
;
use
Illuminate\Console\Command
;
//use Mail;
use
DB
;
use
Config
;
use
App\Models\User
;
use
App\Models\Accesslog
;
use
App\Models\CRMCall
;
use
Schema
;
use
PDO
;
use
Illuminate\Database\Schema\Blueprint
;
class
Smsreport
extends
Command
{
/**
* The console command name.
*
* @var string
*/
protected
$signature
=
'Smsreport'
;
/**
* The console command description.
*
* @var string
*/
protected
$description
=
'App Main Daily Task for Smsreport'
;
/**
* Execute the console command.
*
* @return mixed
*/
public
function
handle
()
{
$nowts
=
time
();
$date
=
date
(
'F_Y'
);
echo
"
\n
"
.
date
(
'Y-m-d H:i:s'
)
.
"
\n
"
;
$logdate
=
strtotime
(
'0 day'
);
$tcol
=
0
;
$fieldsarr
=
array
();
$extrahdrarr
=
array
();
$central_ip
=
env
(
'central_ip'
);
$server_ip
=
env
(
'app_ip'
);
$calllog_report
=
"calllog_report_"
.
$date
;
$conn
=
array
(
'driver'
=>
'mysql'
,
'host'
=>
$central_ip
,
'database'
=>
env
(
'DB_DATABASE'
,
'kstych_flexydial'
),
'username'
=>
env
(
'DB_USERNAME'
,
'root'
),
'password'
=>
env
(
'DB_PASSWORD'
,
''
),
'charset'
=>
'utf8'
,
'collation'
=>
'utf8_unicode_ci'
,
'prefix'
=>
''
,
'options'
=>
array
(
PDO
::
ATTR_TIMEOUT
=>
5
,
),
);
Config
::
set
(
"database.connections.conn"
,
$conn
);
DB
::
connection
(
"conn"
)
->
getDatabaseName
();
$serverclist
=
DB
::
connection
(
"conn"
)
->
select
(
DB
::
raw
(
"select id from server_details where server_ip='
$server_ip
'"
));
$server_id
=
str_pad
(
$serverclist
[
0
]
->
id
,
2
,
'0'
,
STR_PAD_LEFT
);
$maxid
=
DB
::
connection
(
"conn"
)
->
select
(
DB
::
raw
(
"SELECT max(sms_id) as maxid from sms_report where server='
$server_id
'"
));
$maxids
=
$maxid
[
0
]
->
maxid
;
$alist
=
DB
::
select
(
DB
::
raw
(
"SELECT * from sms_log where id>'
$maxids
'"
));
$iii
=
0
;
$shortinsert
=
""
;
foreach
(
$alist
as
$aline
)
{
$iii
++
;
$server
=
$server_id
;
$sms_id
=
$aline
->
id
;
$created_at
=
$aline
->
created_at
;
$message_time
=
date
(
"Y-m-d H:i:s"
,
strtotime
(
$aline
->
created_at
)
+
330
*
60
);
$server_ip
=
$aline
->
server_ip
;
$call_id
=
$aline
->
call_id
;
$agent_name
=
$aline
->
agent_name
;
$subdispo
=
$aline
->
subdispo
;
$number
=
$aline
->
number
;
$message
=
$aline
->
message
;
$response
=
$aline
->
response
;
$shortinsert
.=
"('
$server
', '
$sms_id
','
$created_at
', '
$message_time
', '
$server_ip
', '
$call_id
', '
$agent_name
', '
$subdispo
', '
$number
', '
$message
', '
$response
'),"
;
if
(
$iii
%
50
==
0
||
$iii
==
count
(
$alist
)){
$shortinsert
=
substr
(
$shortinsert
,
0
,
-
1
);
DB
::
connection
(
"conn"
)
->
insert
(
DB
::
raw
(
"INSERT INTO sms_report (`server`, `sms_id`, `created_at`, `message_time`, `server_ip`, `call_id`, `agent_name`, `subdispo`, `number`, `message`, `response`) VALUES
$shortinsert
"
));
$shortinsert
=
""
;
}
}
echo
"
\n
"
.
date
(
'Y-m-d H:i:s'
)
.
"
\n
"
;
DB
::
connection
(
"conn"
)
->
disconnect
();
}
}
\ No newline at end of file
application/config/app.php
View file @
36b5f5c
...
...
@@ -121,6 +121,7 @@ return [
"Record"
=>
[
"disp"
=>
"Record"
,
"icon"
=>
"file"
,
"dash"
=>
""
,
"onclick"
=>
""
],
"User"
=>
[
"disp"
=>
"User"
,
"icon"
=>
"home"
,
"dash"
=>
""
,
"onclick"
=>
""
],
"Role"
=>
[
"disp"
=>
"Role"
,
"icon"
=>
"home"
,
"dash"
=>
""
,
"onclick"
=>
""
],
"Reports"
=>
[
"disp"
=>
"Report"
,
"icon"
=>
"home"
,
"dash"
=>
""
,
"onclick"
=>
""
],
"DialMode"
=>
[
"disp"
=>
"DialMode"
,
"icon"
=>
"home"
,
"dash"
=>
""
,
"onclick"
=>
""
],
"SupervisorModule"
=>
[
"disp"
=>
"SupervisorModule"
,
"icon"
=>
"globe"
,
"dash"
=>
""
,
"onclick"
=>
"menuAction('SupervisorModule');"
],
"Notes"
=>
[
"disp"
=>
"Notes"
,
"icon"
=>
"globe"
,
"dash"
=>
""
,
"onclick"
=>
"menuAction('notes');"
],
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment