MINI Sh3ll
<div class="col-md-9">
<div class="card animated zoomIn" >
<div class="card-header bg-transeperent header-elements-inline border-bottom-teal border-bottom-2 text-dark">
<h5 class="card-title">Today's Operatorwise Summary</h5>
<div class="card-header-right pt-0">
Last Updated : <span id="lblLastUpdated"></span>
</div>
</div>
<div class="table-responsive mt-2">
<div class="chart p-5 d-flex justify-content-center align-items-center" id="nodata1386589293" style="display:none !important;/*height:393px;*/"></div>
<div id="loader1386589293" style="padding: 20px 0px; text-align: center; display: none;">
<i class="icon-spinner6 spinner mr-2"></i>Loading Table...
</div>
<table class="table table-bordered table-xxs">
<thead class="bg-teal " >
<tr>
<th class="text-center" nowrap="">Operator</th>
<th class="text-center" nowrap="">Requests</th>
<th class="text-center" nowrap="">%</th>
<th class="text-center" nowrap="">Buying</th>
<th class="text-center" nowrap="">Selling</th>
<th class="text-center" nowrap="">Earnings</th>
<th class="text-center" nowrap="">Last Message At</th>
</tr>
</thead>
<tbody id="tsummData">
</tbody>
</table>
</div>
</div>
</div>
<script type="text/javascript">
function updateTodaysSummary() {
$.get("<?=SITE_ROOT_URL?>api/getTodaysSummary", function(data){
var html = '';
$.each(data.summary, function(k, v){
var rowcls = parseFloat(v.earnings) > 0 ? 'bg-success' : 'bg-danger';
html += '<tr>'+
'<td class="text-left">'+v.operator+'</td>'+
'<td class="text-right">'+v.requests+'</td>'+
'<td class="text-right">'+v.percentage+'</td>'+
'<td class="text-right">'+v.buyings+'</td>'+
'<td class="text-right">'+v.sellings+'</td>'+
'<td class="text-right '+rowcls+'">'+v.earnings+'</td>'+
'<td class="text-center">-</td>'+
'</tr>';
});
$.each(data.jiosummary, function(k, v){
html += '<tr>'+
'<td class="text-left">'+v.operator+'</td>'+
'<td class="text-right">'+v.requests+'</td>'+
'<td class="text-right">'+v.percentage+'</td>'+
'<td class="text-right">'+v.buyings+'</td>'+
'<td class="text-right">'+v.sellings+'</td>'+
'<td class="text-right">'+v.earnings+'</td>'+
'<td class="text-center">-</td>'+
'</tr>';
});
$("#tsummData").html(html);
$("#lblLastUpdated").html(data.last_updated);
$("#todays_earnings").html(data.todays_earnings);
$("#months_earnings").html(data.months_earnings);
$("#todays_earnings").removeClass('text-danger');
$("#todays_earnings").removeClass('text-success');
$("#todays_earnings").addClass(data.todays_earnings_text_class);
$("#months_earnings").removeClass('text-danger');
$("#months_earnings").removeClass('text-success');
$("#months_earnings").addClass(data.months_earnings_text_class);
$("#today_icon_circle").removeClass('bg-danger');
$("#today_icon_circle").removeClass('bg-success');
$("#month_icon_circle").removeClass('bg-danger');
$("#month_icon_circle").removeClass('bg-success');
$("#today_icon_circle").addClass(data.todays_earnings_bg_class);
$("#month_icon_circle").addClass(data.months_earnings_bg_class);
$("#todays_footer").removeClass('bg-danger');
$("#todays_footer").removeClass('bg-success');
$("#months_footer").removeClass('bg-danger');
$("#months_footer").removeClass('bg-success');
$("#todays_footer").addClass(data.todays_earnings_bg_class);
$("#months_footer").addClass(data.months_earnings_bg_class);
$("#today_icon").removeClass('fa-thumbs-o-up');
$("#today_icon").removeClass('fa-thumbs-o-down');
$("#month_icon").removeClass('fa-thumbs-o-up');
$("#month_icon").removeClass('fa-thumbs-o-down');
$("#today_icon").addClass(data.todays_earnings_thumb_class);
$("#month_icon").addClass(data.months_earnings_thumb_class);
});
}
function updateMonthsSummary() {
$.get("<?=SITE_ROOT_URL?>api/getMonthsSummary", function(data){
$("#todays_earnings").html(data.total_earnings);
});
}
updateTodaysSummary();
//updateMonthsSummary();
//setTimeout(updateSummaryTable, 3000);
</script>
OHA YOOOO