outputreport.blade.php
4.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<?php
use App\Models\User;
if(Auth::user()->id=="1"){ ?>
<div class="container">
<div style="text-align:center">
<h2>Output Report</h2>
<p></p>
</div>
<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;">
<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>
</tr>
<tr>
<th>No.of Contacts</th>
<th><?php echo $data['noOfContacts']; ?>
<input type="hidden" name="noOfContacts" value="<?php echo $data['noOfContacts']; ?>">
</th>
</tr>
<tr>
<th>Unique Contacts</th>
<th><?php echo $data['uniqueContacts']; ?>
<input type="hidden" name="uniqueContacts" value="<?php echo $data['uniqueContacts']; ?>">
</th>
</tr>
<tr>
<th>Income Achievement</th>
<th><?php echo $data['totalIncome']; ?></th>
</tr>
<tr>
<th>Product</th>
<th>LG</th>
<th>Expected Amount(If Applicable)</th>
<th>LC</th>
<th>Amount(If Applicable)</th>
</tr>
</thead>
<tbody>
<?php
//include(resource_path().'/views/layout/module/virtualchannel/VirtualFieldsArray.php');
$i=1;
foreach ($data['products'] as $key => $value) {
//print_r($value);
//print_r($ProductType);
// foreach ($data['report'] as $key1 => $value1) {
//print_r($value1);
?>
<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>
</tr>
<?php
$i++;
} ?>
<tr>
<td><button type="submit" class="btn btn-primary" onclick='createOutputReport();return false;'>Save</button></td></tr>
</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>
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)
{
if(retstr.responseText.indexOf('Error')<0)
{
simpleNotification("success","topRight","User Created Successfully");
menuAction('outputreport/reportdata');
}
else
{
simpleNotification("error","topRight",retstr.responseText);
}
});
}
</script>
</div>
</div>
</div>
<?php } ?>