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
a6cf55d5
authored
2019-01-17 18:53:52 +0530
by
prami
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
modified output report
1 parent
2807c615
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
22 deletions
application/app/Http/Controllers/OutputReportController.php
application/resources/views/layout/module/outputreport/outputreport.blade.php
application/app/Http/Controllers/OutputReportController.php
View file @
a6cf55d
...
...
@@ -57,10 +57,11 @@ class OutputReportController extends Controller
$outputReport
=
OutputReport
::
firstOrCreate
(
array
(
'product_id'
=>
$value
[
'productId'
]
'product_id'
=>
$value
[
'productId'
],
'user_id'
=>
Auth
::
user
()
->
id
)
);
$outputReport
->
user_id
=
Auth
::
user
()
->
id
;
//
$outputReport->user_id = Auth::user()->id;
$outputReport
->
user_name
=
Auth
::
user
()
->
username
;
$outputReport
->
date
=
date
(
"Y-m-d"
);
$outputReport
->
call_attempts
=
$request
->
input
(
'noOfAttempts'
);
...
...
@@ -113,6 +114,26 @@ class OutputReportController extends Controller
$report
=
DB
::
table
(
'output_report'
)
->
where
(
'user_id'
,
Auth
::
user
()
->
id
)
->
get
();
$outputReport
=
array
();
foreach
(
$products
as
$pkey
=>
$pvalue
)
{
$outputReport
[
$pvalue
->
productId
]
=
array
(
'name'
=>
$pvalue
->
name
,
'productId'
=>
$pvalue
->
productId
);
foreach
(
$report
as
$key
=>
$value
)
{
if
(
$value
->
product_id
==
$pvalue
->
productId
){
$outputReport
[
$value
->
product_id
][
'lead_generated'
]
=
$value
->
lead_generated
;
$outputReport
[
$value
->
product_id
][
'lead_generated_amount'
]
=
$value
->
lead_generated_amount
;
$outputReport
[
$value
->
product_id
][
'lead_closed'
]
=
$value
->
lead_closed
;
$outputReport
[
$value
->
product_id
][
'lead_closed_amount'
]
=
$value
->
lead_closed_amount
;
}
}
}
// total income
$totalIncome
=
DB
::
select
(
"select sum(income) as income from output_report where user_id="
.
Auth
::
user
()
->
id
);
...
...
@@ -144,7 +165,7 @@ class OutputReportController extends Controller
$output
=
DB
::
table
(
'output_report'
)
->
whereIn
(
'user_id'
,
$usersarray
)
->
where
(
'date'
,
'='
,
date
(
"Y-m-d"
))
->
orderBy
(
'user_id'
)
->
get
();
$data
[
'disabled'
]
=
$disabled
;
$data
[
'products'
]
=
$
products
;
$data
[
'products'
]
=
$
outputReport
;
$data
[
'totalIncome'
]
=
$totalIncome
[
0
]
->
income
;
$data
[
'noOfAttempts'
]
=
$noOfAttempts
;
$data
[
'noOfContacts'
]
=
$noOfContacts
;
...
...
application/resources/views/layout/module/outputreport/outputreport.blade.php
View file @
a6cf55d
...
...
@@ -48,32 +48,20 @@ if(Auth::user()->id=="1" || Auth::user()->id == "199"){ ?>
</thead>
<tbody>
<?php
//include(resource_path().'/views/layout/module/virtualchannel/VirtualFieldsArray.php');
foreach
(
$report
as
$key1
=>
$value1
)
{
//print_r($key1);
$i
=
1
;
foreach
(
$products
as
$key
=>
$value
)
{
//print_r($value);
//print_r($ProductType);
//foreach ($report as $key1 => $value1) {
//print_r($value1);
//if($value1->product_name != $value->name)continue;
?>
<tr>
<td>
<input
type=
"hidden"
name=
"products[
<?=
$i
?>
][productId]"
value=
"{{$value->productId}}"
>
<input
type=
"hidden"
name=
"products[
<?=
$i
?>
][product]"
value=
"{{ $value->name }} "
>
{{ $value->name }}
</td>
<?php
//foreach ($report as $key1 => $value1) {
//print_r($value1);
?>
<td><input
type=
"number"
name=
"products[
<?=
$i
?>
][lg]"
value=
"{{isset($value1->lead_generated)?$value1->lead_generated:'0'}}"
$
disabled
></td>
<td><input
type=
"number"
min=
"0"
step=
"0.01"
name=
"products[
<?=
$i
?>
][lgAmt]"
value=
"{{isset($value1->lead_generated_amount)?$value1->lead_generated_amount:'0'}}"
$
disabled
></td>
<td><input
type=
"number"
name=
"products[
<?=
$i
?>
][lc]"
value=
"{{isset($value1->lead_closed)?$value1->lead_closed:'0'}}"
$
disabled
></td>
<td><input
type=
"number"
min=
"0"
step=
"0.01"
name=
"products[
<?=
$i
?>
][lcAmt]"
value=
"{{isset($value1->lead_closed_amount)?$value1->lead_closed_amount:'0'}}"
$
disabled
></td>
<td>
<input
type=
"hidden"
name=
"products[
<?=
$i
?>
][productId]"
value=
"{{$value['productId']}}"
>
<input
type=
"hidden"
name=
"products[
<?=
$i
?>
][product]"
value=
"{{ $value['name'] }} "
>
{{ $value['name'] }}
</td>
<td><input
type=
"number"
name=
"products[
<?=
$i
?>
][lg]"
value=
"{{isset($value['lead_generated'])?$value['lead_generated']:'0'}}"
$
disabled
></td>
<td><input
type=
"number"
min=
"0"
step=
"0.01"
name=
"products[
<?=
$i
?>
][lgAmt]"
value=
"{{isset($value['lead_generated_amount'])?$value['lead_generated_amount']:'0'}}"
$
disabled
></td>
<td><input
type=
"number"
name=
"products[
<?=
$i
?>
][lc]"
value=
"{{isset($value['lead_closed'])?$value['lead_closed']:'0'}}"
$
disabled
></td>
<td><input
type=
"number"
min=
"0"
step=
"0.01"
name=
"products[
<?=
$i
?>
][lcAmt]"
value=
"{{isset($value['lead_closed_amount'])?$value['lead_closed_amount']:'0'}}"
$
disabled
></td>
</tr>
<?php
// }
$i
++
;
}
}
?>
}
?>
@if($disabled == "")
<tr>
...
...
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