| 16664 |
naman |
1 |
<script>
|
|
|
2 |
$(document).ready(function(){
|
|
|
3 |
$('.appinstalls').click(function(){
|
|
|
4 |
var date= $(this).data('date');
|
|
|
5 |
// console.log(date);
|
|
|
6 |
$.ajax({
|
|
|
7 |
method: "GET",
|
|
|
8 |
url: "/user_app_installs/getDateInstalls/"+date,
|
|
|
9 |
},'json')
|
|
|
10 |
.done(function( msg ) {
|
|
|
11 |
$("#"+date+" .panel-body").empty();
|
| 16711 |
naman |
12 |
$("#"+date+" .panel-body").append("<div class = 'row' style='font-weight:bold;'><div class='col-xs-4'>App Name</div><div class='col-xs-4'>Installation number</div><div class='col-xs-4'>Amount</div></div>");
|
| 16664 |
naman |
13 |
$("#"+date+" .panel-body").append("<div class = 'row'>");
|
|
|
14 |
jQuery.each(msg['installs'], function(i, val) {
|
|
|
15 |
var html = "<div class='col-xs-4'>"+i+"</div><div class='col-xs-4'>"+val['installs']+"</div><div class='col-xs-4'>"+val['amount']+ "</div>";
|
|
|
16 |
$("#"+date+" .panel-body").append(html);
|
|
|
17 |
});
|
|
|
18 |
$("#"+date+" .panel-body").append("</div>");
|
|
|
19 |
});
|
|
|
20 |
});
|
|
|
21 |
|
|
|
22 |
});
|
|
|
23 |
</script>
|
| 16711 |
naman |
24 |
|
|
|
25 |
|
| 13993 |
anikendra |
26 |
<div class="container pendingcashbacks">
|
| 16784 |
anikendra |
27 |
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true" style="margin-bottom:5px;">
|
|
|
28 |
<div class="panel panel-default">
|
|
|
29 |
<div class="panel-heading" role="tab" id="headingOne">
|
|
|
30 |
<h4 class="panel-title">
|
|
|
31 |
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
|
|
|
32 |
<div class="row">
|
|
|
33 |
<div class="col-xs-10">Pending<br/>
|
|
|
34 |
<?php if($pendingAmount!=0):?>
|
|
|
35 |
<span class="cashbackrupee"></span><?php echo $pendingAmount;?> pending for order delivery
|
|
|
36 |
<?php else:?>
|
|
|
37 |
No Pending Cashbacks
|
|
|
38 |
<?php endif;?>
|
|
|
39 |
</div>
|
|
|
40 |
<div class="col-xs-2">
|
|
|
41 |
<i class="glyphicon glyphicon-plus"></i>
|
|
|
42 |
</div>
|
|
|
43 |
</div>
|
|
|
44 |
</a>
|
|
|
45 |
</h4>
|
| 13993 |
anikendra |
46 |
</div>
|
| 16784 |
anikendra |
47 |
<div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
|
|
|
48 |
<div class="panel-body">
|
|
|
49 |
<?php if(!empty($pendingOrders)):?>
|
|
|
50 |
<?php foreach ($pendingOrders as $key => $suborder):?>
|
|
|
51 |
<?php echo $this->element('suborder',array('suborder'=>$suborder,'activestores'=>$activestores,'storemapping'=>$storemapping));?>
|
|
|
52 |
<?php //echo $this->element('suborder',array('suborder'=>$suborder));?>
|
|
|
53 |
<?php endforeach;?>
|
|
|
54 |
<?php endif;?>
|
|
|
55 |
</div>
|
| 13993 |
anikendra |
56 |
</div>
|
|
|
57 |
</div>
|
| 16784 |
anikendra |
58 |
<div class="panel panel-default">
|
|
|
59 |
<div class="panel-heading" role="tab" id="headingTwo">
|
|
|
60 |
<h4 class="panel-title">
|
|
|
61 |
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
|
|
|
62 |
<div class="row">
|
|
|
63 |
<div class="col-xs-10">Approved<br/>
|
|
|
64 |
<?php if(!empty($pendingCashbacks) && $pendingCashbacks['amount']!=0):?>
|
|
|
65 |
<span class="cashbackrupee"></span><?php echo $pendingCashbacks['amount'];?> will be credited on <?php echo date('d M',strtotime($pendingCashbacks['nextCredit']));?>
|
|
|
66 |
<?php else:?>
|
|
|
67 |
No Approved Cashbacks
|
|
|
68 |
<?php endif;?>
|
|
|
69 |
</div>
|
|
|
70 |
<div class="col-xs-2">
|
|
|
71 |
<i class="glyphicon glyphicon-plus"></i>
|
|
|
72 |
</div>
|
|
|
73 |
</div>
|
|
|
74 |
</a>
|
|
|
75 |
</h4>
|
| 13993 |
anikendra |
76 |
</div>
|
| 16784 |
anikendra |
77 |
<div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
|
|
|
78 |
<div class="panel-body">
|
|
|
79 |
<?php if(!empty($approvedOrders)):?>
|
|
|
80 |
<?php foreach ($approvedOrders as $key => $suborder):?>
|
|
|
81 |
<?php echo $this->element('suborder',array('suborder'=>$suborder));?>
|
|
|
82 |
<?php endforeach;?>
|
|
|
83 |
<?php endif;?>
|
|
|
84 |
</div>
|
|
|
85 |
</div>
|
| 13993 |
anikendra |
86 |
</div>
|
| 16784 |
anikendra |
87 |
<?php if(!isset($noappcashback)):?>
|
| 16664 |
naman |
88 |
<!-- tabs for app installs -->
|
|
|
89 |
<!-- Approved Tab Start-->
|
| 16681 |
anikendra |
90 |
<div class="panel panel-default" style="margin-bottom:5px;">
|
| 16664 |
naman |
91 |
<div class="panel-heading" role="tab" id="headingFour">
|
|
|
92 |
<h4 class="panel-title">
|
|
|
93 |
<a data-toggle="collapse" data-parent="#accordion" href="#collapseFour" aria-expanded="true" aria-controls="collapseFour">
|
|
|
94 |
<div class="row">
|
| 16681 |
anikendra |
95 |
<div class="col-xs-10">Approved (apps)<br/>
|
| 16784 |
anikendra |
96 |
<?php if(isset($cashBacks['Approved']) && $cashBacks['Approved']['amount']!=0):?>
|
|
|
97 |
<span class="cashbackrupee"></span><?php echo $cashBacks['Approved']['amount'];?> will be credited on
|
| 16711 |
naman |
98 |
<?php
|
|
|
99 |
// echo $cashBacks['approved']['fortnightofYear'];
|
| 16784 |
anikendra |
100 |
$monthNum = $cashBacks['Approved']['fortnightOfYear'];
|
|
|
101 |
if ($monthNum%2 == 1){echo "07-"; $monthNum = $monthNum+1;}
|
| 16711 |
naman |
102 |
else{echo "22-";}
|
| 16784 |
anikendra |
103 |
$monthName = date('F', mktime(0, 0, 0, floor($monthNum/2)+1));
|
| 16711 |
naman |
104 |
echo $monthName;
|
|
|
105 |
?>
|
| 16664 |
naman |
106 |
<?php else:?>
|
| 16681 |
anikendra |
107 |
No Approved Cashbacks
|
| 16664 |
naman |
108 |
<?php endif;?>
|
|
|
109 |
</div>
|
|
|
110 |
<div class="col-xs-2">
|
|
|
111 |
<i class="glyphicon glyphicon-plus"></i>
|
|
|
112 |
</div>
|
|
|
113 |
</div>
|
|
|
114 |
</a>
|
|
|
115 |
</h4>
|
|
|
116 |
</div>
|
|
|
117 |
<div id="collapseFour" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
|
|
|
118 |
<div class="panel-body">
|
|
|
119 |
|
| 16784 |
anikendra |
120 |
<?php foreach (array_reverse($cashBacks['Approved']['installs']) as $key => $value):?>
|
| 16664 |
naman |
121 |
|
| 16711 |
naman |
122 |
<div class="panel panel-default" style ="padding:0px;margin:1px">
|
|
|
123 |
<div class="panel-heading appinstalls" role="tab" id="headingApproved" data-date="<?php echo $key;?>" style ="padding:0px;margin:0px;">
|
| 16664 |
naman |
124 |
<h4 class="panel-title">
|
|
|
125 |
<a data-toggle="collapse" data-parent="#accordion" data-date="<?php echo $key;?>" href="#<?php echo $key?>" aria-expanded="true" aria-controls="collapseIOne">
|
|
|
126 |
<div class="row">
|
|
|
127 |
<div class="col-xs-4"><?php echo $key?></div>
|
|
|
128 |
<div class="col-xs-2"><?php print_r($value['amount']);?></div>
|
|
|
129 |
<div class="col-xs-4"><?php print_r($value['installs']);?></div>
|
|
|
130 |
<div class="col-xs-2">
|
|
|
131 |
<i class="glyphicon glyphicon-plus"></i>
|
|
|
132 |
</div>
|
|
|
133 |
</div>
|
|
|
134 |
</a>
|
|
|
135 |
</h4>
|
|
|
136 |
</div>
|
|
|
137 |
<div id="<?php echo $key?>" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
|
| 16711 |
naman |
138 |
<div class="panel-body" style="background:#f9fafb; padding:0px;">
|
| 16664 |
naman |
139 |
|
|
|
140 |
<!-- Approved Content -->
|
|
|
141 |
</div>
|
|
|
142 |
</div>
|
|
|
143 |
</div>
|
|
|
144 |
|
|
|
145 |
|
| 16681 |
anikendra |
146 |
<?php endforeach;?>
|
| 16664 |
naman |
147 |
|
|
|
148 |
|
|
|
149 |
</div>
|
|
|
150 |
</div>
|
|
|
151 |
</div>
|
|
|
152 |
<!-- Approved Tab closes -->
|
|
|
153 |
|
| 16784 |
anikendra |
154 |
<?php endif;?>
|
| 16664 |
naman |
155 |
<div class="panel panel-default">
|
| 16784 |
anikendra |
156 |
<div class="panel-heading" role="tab" id="headingThree">
|
|
|
157 |
<h4 class="panel-title">
|
|
|
158 |
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
|
|
|
159 |
<div class="row">
|
|
|
160 |
<div class="col-xs-10">Credited<br/>
|
|
|
161 |
<span class="cashbackrupee"></span><?php echo $creditedAmount;?> in wallet
|
|
|
162 |
</div>
|
|
|
163 |
<div class="col-xs-2">
|
|
|
164 |
<i class="glyphicon glyphicon-plus"></i>
|
|
|
165 |
</div>
|
|
|
166 |
</div>
|
|
|
167 |
</a>
|
|
|
168 |
</h4>
|
|
|
169 |
</div>
|
|
|
170 |
<div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree">
|
|
|
171 |
<div class="panel-body">
|
|
|
172 |
<?php if(!empty($creditedCashbacks)):?>
|
|
|
173 |
<ul class="list-unstyled ">
|
|
|
174 |
<li class="row card">
|
|
|
175 |
<div class="col-xs-3">Date</div>
|
|
|
176 |
<div class="col-xs-3">Type</div>
|
|
|
177 |
<div class="col-xs-4">Amount</div>
|
|
|
178 |
<div class="col-xs-2"> </div>
|
|
|
179 |
</li>
|
|
|
180 |
</ul>
|
|
|
181 |
<?php foreach ($creditedCashbacks['data'] as $key => $value):?>
|
|
|
182 |
<ul class="list-unstyled ">
|
|
|
183 |
<li class="row">
|
|
|
184 |
<div class="creditedcashbacks card row">
|
|
|
185 |
<div class="col-xs-3">
|
|
|
186 |
<?php echo date('d M',strtotime($value['timestamp']));?>
|
|
|
187 |
</div>
|
|
|
188 |
<div class="col-xs-3">
|
|
|
189 |
<?php echo isset($value['type'])?$value['timestamp']:'Order';?>
|
|
|
190 |
</div>
|
|
|
191 |
<div class="col-xs-4">
|
|
|
192 |
<span class="cashbackrupee"></span><?php echo $value['userAmount'];?>
|
|
|
193 |
</div>
|
|
|
194 |
<div class="col-xs-2">
|
|
|
195 |
<i class="glyphicon glyphicon-plus"></i>
|
|
|
196 |
</div>
|
|
|
197 |
</div>
|
|
|
198 |
<div class="suborders hidden">
|
|
|
199 |
<?php if(!empty($creditedOrders[$value['batch']])):?>
|
|
|
200 |
<?php foreach ($creditedOrders[$value['batch']]['data'] as $key => $value):?>
|
|
|
201 |
<?php foreach ($value['subOrders'] as $key => $suborder):?>
|
| 16664 |
naman |
202 |
|
| 16784 |
anikendra |
203 |
<?php $suborder['storeId'] = $value['storeId'];?>
|
|
|
204 |
<?php $suborder['merchantOrderId'] = $value['merchantOrderId'];?>
|
|
|
205 |
<?php echo $this->element('suborder',array('suborder'=>$suborder,'activestores'=>$activestores,'storemapping'=>$storemapping));?>
|
|
|
206 |
<?php endforeach;?>
|
|
|
207 |
<?php endforeach;?>
|
|
|
208 |
<?php endif;?>
|
|
|
209 |
</div>
|
|
|
210 |
</li>
|
|
|
211 |
</ul>
|
|
|
212 |
<?php endforeach;?>
|
|
|
213 |
<?php endif;?>
|
|
|
214 |
</div>
|
| 16664 |
naman |
215 |
</div>
|
|
|
216 |
</div>
|
|
|
217 |
</div>
|
| 13993 |
anikendra |
218 |
</div>
|
| 16711 |
naman |
219 |
|
| 13993 |
anikendra |
220 |
<?php
|
|
|
221 |
// if(!function_exists('formatOrderDate')){
|
|
|
222 |
function formatOrderDate($date,$storeId,$type='od'){
|
|
|
223 |
if($type=='od'){
|
|
|
224 |
switch($storeId){
|
|
|
225 |
case 2:
|
|
|
226 |
$dateParts = explode(' ', $date);
|
|
|
227 |
$formatteddate = substr($dateParts[1],0,3).' '.$dateParts[0].', '.$dateParts[3].' '.$dateParts[4];
|
|
|
228 |
break;
|
|
|
229 |
case 3:
|
|
|
230 |
$dateParts = explode(' ', $date);
|
| 14856 |
anikendra |
231 |
if(count($dateParts)>4){
|
|
|
232 |
$formatteddate = $dateParts[0].' '.substr($dateParts[1],0,2).', '.$dateParts[3].' '.$dateParts[4];
|
|
|
233 |
}else{
|
|
|
234 |
$formatteddate = substr($dateParts[2],0,-1).' '.$dateParts[1];
|
|
|
235 |
}
|
| 13993 |
anikendra |
236 |
break;
|
|
|
237 |
default:
|
|
|
238 |
case 1:
|
| 14669 |
anikendra |
239 |
$formatteddate = date('M d',strtotime($date));
|
| 13993 |
anikendra |
240 |
break;
|
|
|
241 |
}
|
|
|
242 |
}else{
|
|
|
243 |
switch($storeId){
|
|
|
244 |
case 1:
|
| 16632 |
anikendra |
245 |
case 3:
|
| 13993 |
anikendra |
246 |
$dateParts = explode(' - ', $date);
|
| 14669 |
anikendra |
247 |
if(sizeof($dateParts)>1){
|
|
|
248 |
$formatteddate = date('M d',strtotime($dateParts[1]));
|
|
|
249 |
}else{
|
|
|
250 |
$formatteddate = date('M d',strtotime($dateParts[0]));
|
|
|
251 |
}
|
| 13993 |
anikendra |
252 |
break;
|
|
|
253 |
default:
|
| 14669 |
anikendra |
254 |
$formatteddate = date('M d',strtotime($date));
|
| 13993 |
anikendra |
255 |
break;
|
|
|
256 |
}
|
|
|
257 |
}
|
|
|
258 |
return $formatteddate;
|
|
|
259 |
}
|
| 14068 |
anikendra |
260 |
?>
|
|
|
261 |
<script type="text/javascript" src="/js/profittill.js?v=<?php echo $staticversion;?>"></script>
|