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
2807c615
authored
2019-01-17 16:26:54 +0530
by
G Manojkumar
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Need some changes
1 parent
9a976df3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
80 deletions
application/app/Http/Controllers/OutputReportController.php
application/resources/views/layout/module/outputreport/outputreport.blade.php
application/app/Http/Controllers/OutputReportController.php
View file @
2807c61
...
...
@@ -96,7 +96,13 @@ class OutputReportController extends Controller
if
(
$id
==
"reportdata"
)
{
$data
=
array
();
$disabled
=
""
;
$dashboarduser
=
Auth
::
user
();
if
(
$dashboarduser
->
usertype
==
"Supervisor"
){
$disabled
=
"disabled"
;
}
//if($dashboarduser->usertype == "User"){
// output reports
$products
=
DB
::
table
(
'output_products'
)
...
...
@@ -136,7 +142,17 @@ class OutputReportController extends Controller
}
//print_r($usersarray);
$output
=
DB
::
table
(
'output_report'
)
->
whereIn
(
'user_id'
,
$usersarray
)
->
where
(
'date'
,
'='
,
date
(
"Y-m-d"
))
->
orderBy
(
'user_id'
)
->
get
();
return
view
(
"layout.module.outputreport.outputreport"
)
->
with
(
'data'
,
[
'products'
=>
$products
,
'totalIncome'
=>
$totalIncome
[
0
]
->
income
,
'noOfAttempts'
=>
$noOfAttempts
,
'noOfContacts'
=>
$noOfContacts
,
'uniqueContacts'
=>
$uniqueContacts
,
'output'
=>
$output
,
'report'
=>
$report
]);
$data
[
'disabled'
]
=
$disabled
;
$data
[
'products'
]
=
$products
;
$data
[
'totalIncome'
]
=
$totalIncome
[
0
]
->
income
;
$data
[
'noOfAttempts'
]
=
$noOfAttempts
;
$data
[
'noOfContacts'
]
=
$noOfContacts
;
$data
[
'uniqueContacts'
]
=
$uniqueContacts
;
$data
[
'output'
]
=
$output
;
$data
[
'report'
]
=
$report
;
return
view
(
"layout.module.outputreport.outputreport"
,
$data
);
// }
}
...
...
application/resources/views/layout/module/outputreport/outputreport.blade.php
View file @
2807c61
<?php
use
App\Models\User
;
if
(
Auth
::
user
()
->
id
==
"1
"
){
?>
if
(
Auth
::
user
()
->
id
==
"1"
||
Auth
::
user
()
->
id
==
"199
"
){
?>
<div
class=
"container"
>
<div
style=
"text-align:center"
>
<h2>
Output Report
</h2>
...
...
@@ -10,34 +9,33 @@ use App\Models\User;
<div
class=
"row"
>
<div
class=
"column"
>
<?php
if
(
Auth
::
user
()
->
usertype
==
"User"
){
?>
<form
class=
"form-horizontal"
id=
"output-report"
name=
"output-report"
>
<div
class=
"table-responsive"
style=
"background: #fff;"
>
<form
class=
"form-horizontal"
id=
"output-report"
name=
"output-report"
>
<div
class=
"table-responsive"
style=
"background: #fff;"
>
<table
class=
"table"
>
<thead>
<tr>
<th>
No.of Attempts
</th>
<th>
<?php
echo
$data
[
'noOfAttempts'
];
?>
<input
type=
"hidden"
name=
"noOfAttempts"
value=
"
<?php
echo
$data
[
'noOfAttempts'
];
?>
"
>
<th>
{{$noOfAttempts}}
<input
type=
"hidden"
name=
"noOfAttempts"
value=
"
{{$noOfAttempts}}
"
>
</th>
</tr>
<tr>
<th>
No.of Contacts
</th>
<th>
<?php
echo
$data
[
'noOfContacts'
];
?>
<input
type=
"hidden"
name=
"noOfContacts"
value=
"
<?php
echo
$data
[
'noOfContacts'
];
?>
"
>
<th>
{{$noOfContacts}}
<input
type=
"hidden"
name=
"noOfContacts"
value=
"
{{$noOfContacts}}
"
>
</th>
</tr>
<tr>
<th>
Unique Contacts
</th>
<th>
<?php
echo
$data
[
'uniqueContacts'
];
?>
<input
type=
"hidden"
name=
"uniqueContacts"
value=
"
<?php
echo
$data
[
'uniqueContacts'
];
?>
"
>
<th>
{{$uniqueContacts}}
<input
type=
"hidden"
name=
"uniqueContacts"
value=
"
{{$uniqueContacts}}
"
>
</th>
</tr>
<tr>
<th>
Income Achievement
</th>
<th>
<?php
echo
$data
[
'totalIncome'
];
?>
</th>
<th>
{{$totalIncome}}
</th>
</tr>
<tr>
...
...
@@ -51,88 +49,46 @@ use App\Models\User;
<tbody>
<?php
//include(resource_path().'/views/layout/module/virtualchannel/VirtualFieldsArray.php');
foreach
(
$report
as
$key1
=>
$value1
)
{
//print_r($key1);
$i
=
1
;
foreach
(
$data
[
'products'
]
as
$key
=>
$value
)
{
foreach
(
$products
as
$key
=>
$value
)
{
//print_r($value);
//print_r($ProductType);
// foreach ($data['report']
as $key1 => $value1) {
//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=
"
<?php
echo
$value
->
productId
;
?>
"
>
<input
type=
"hidden"
name=
"products[
<?=
$i
?>
][product]"
value=
"
<?php
echo
$value
->
name
;
?>
"
>
<?php
echo
$value
->
name
;
?>
</td>
<td><input
type=
"number"
name=
"products[
<?=
$i
?>
][lg]"
value=
"
<?php
//echo isset($value1)?$value1->lead_generated:"0"; ?>"></td>
<
td
><
input
type
=
"number"
min
=
"0"
step
=
"0.01"
name
=
"products[<?=
$i
?>][lgAmt]"
value
=
"<?php // echo isset(
$value1
)?
$value1->lead_generated_amount
:"
0
"; ?>"
></
td
>
<
td
><
input
type
=
"number"
name
=
"products[<?=
$i
?>][lc]"
value
=
"<?php // echo isset(
$value1
)?
$value1->lead_closed
:"
0
"; ?>"
></
td
>
<
td
><
input
type
=
"number"
min
=
"0"
step
=
"0.01"
name
=
"products[<?=
$i
?>][lcAmt]"
value
=
"<?php //echo isset(
$value1
)?
$value1->lead_closed_amount
:"
0
"; ?>"
></
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>
<?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>
</tr>
<?php
// }
$i
++
;
}
?>
}
}
?>
@if($disabled == "")
<tr>
<td><button type="
submit
"
class=
"btn btn-primary"
onclick=
'createOutputReport();return false;'
>
Save
</button></td></tr>
<td><button
type=
"submit"
class=
"btn btn-primary"
onclick=
'createOutputReport();return false;'
>
Save
</button></td>
</tr>
@endif
</tbody>
</table>
</div>
</form>
<?php
}
if
(
Auth
::
user
()
->
usertype
==
"Supervisor"
){
?>
<form
class=
"form-horizontal"
id=
"output-report-supervisor"
name=
"output-report-supervisor"
>
<div
class=
"table-responsive"
style=
"background: #fff;"
>
<?php
$supervisor
=
User
::
where
(
'supervisor'
,
'='
,
Auth
::
user
()
->
username
)
->
get
();
// foreach($supervisor as $super){
?>
<br>
RM Code:
<select
id=
"abc"
style=
"border:3px solid #efefef;"
>
<option>
All
</option>
<?php
foreach
(
$supervisor
as
$super
){
?>
<option
value=
"
<?php
echo
$super
->
username
;
?>
"
>
<?php
echo
$super
->
username
;
?>
</option>
<?php
}
?>
</select>
<table
class=
"table"
>
<thead>
<th></th>
<th>
Username
</th>
<!--<th>Date</th>-->
<th>
Call Attempts
</th>
<th>
Call Contacts
</th>
<th>
Call Unique Contacts
</th>
<th>
Income
</th>
<th>
Product Name
</th>
<th>
Lead Generated
</th>
<th>
Lead Generated Amount
</th>
<th>
Lead Closed
</th>
<th>
Lead Closed Amount
</th>
</thead>
<?php
$i
=
1
;
foreach
(
$data
[
'output'
]
as
$key
=>
$value
){
//print_r($value);
?>
<tr>
<td>
<?php
echo
$i
;
?>
</td>
<td>
<?php
echo
$value
->
user_name
;
?>
</td>
<td>
<?php
echo
$value
->
call_attempts
;
?>
</td>
<td>
<?php
echo
$value
->
call_contacts
;
?>
</td>
<td>
<?php
echo
$value
->
call_unique_contacts
;
?>
</td>
<td>
<?php
echo
$value
->
income
;
?>
</td>
<td>
<?php
echo
$value
->
product_name
;
?>
</td>
<td>
<?php
echo
$value
->
lead_generated
;
?>
</td>
<td>
<?php
echo
$value
->
lead_generated_amount
;
?>
</td>
<td>
<?php
echo
$value
->
lead_closed
;
?>
</td>
<td>
<?php
echo
$value
->
lead_closed_amount
;
?>
</td>
</tr>
<?php
$i
++
;
}
?>
</table>
</div>
</form>
<?php
}
?>
<script>
</form>
<script>
function
createOutputReport
()
{
function
createOutputReport
()
{
var
putdata
=
$
(
'#output-report'
).
serialize
();
//console.log("--->"+putdata);
doAjax
(
'outputreport?action=createOutputReport'
,
putdata
,
'__fake__div__'
,
'ajax_create_output_report'
,
'singlethis'
,
'POST'
,
function
(
retstr
)
...
...
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