File: /home/barbeatleanalyti/public_html/manage.beatleanalytics.com/site/template/summery - Copy.php
<link href="http://fontawesome.io/assets/font-awesome/css/font-awesome.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="theme/black/css/profile.css">
<!-- RGraph CHART -->
<script src="<?php echo $curImagePath?>/js/RGraph.svg.common.core.js"></script>
<script src="<?php echo $curImagePath?>/js/RGraph.svg.line.js"></script>
<script src="<?php echo $curImagePath?>/js/RGraph.common.core.js"></script>
<script src="<?php echo $curImagePath?>/js/RGraph.line.js"></script>
<script src="<?php echo $curImagePath?>/js/RGraph.svg.common.tooltips.js"></script>
<script src="<?php echo $curImagePath?>/js/RGraph.svg.pie.js"></script>
<script src="<?php echo $curImagePath?>/js/RGraph.svg.hbar.js"></script>
<!-- Subscription Chart -->
<script src="<?php echo $curImagePath?>/js/pie-chart.js" type="text/javascript"></script>
<link href="http://www.jqueryscript.net/css/jquerysctipttop.css" rel="stylesheet" type="text/css">
<?php
// Declare new object
$objDashboard = object;
// Assing object
$objDashboard = $objDB->objController;
// Assign all variable's value
$pg = $objDashboard->pg;
$acn = $objDashboard->acn;
$Email = $objDashboard->Email;
$Password = $objDashboard->Password;
$error = $objDashboard->error;
$msg = $objDashboard->msg;
$p = $objDashboard->p;
$m = $objDashboard->m;
$y = $objDashboard->y;
// $FromDate = $objDashboard->FromDate;
// $ToDate = $objDashboard->ToDate;
$FromDate = date("Y-m-d");
$ToDate = date("Y-m-d");
$PageID = $objDashboard->PageID;
$PageConID = $objDashboard->PageConID;
$atype = $objDashboard->atype;
$BranchID = $objDashboard->BranchID;
$IndustryID = $objDashboard->IndustryID;
if(!method_exists($objDashboard,$acn)){
ReturnPostFormData($ValidateArr = array(),"error.html","<span class='error-msg'>Method <strong>".$acn."</strong> does not exist in <strong>".$pg."</strong> file !</span>",2);
}
?>
<?php
$rsOrgDetails = $objDashboard->FetchOrganizationName();
$orgType = $rsOrgDetails[0]['db_orgtype'];
$orgID = $rsOrgDetails[0]['OrgId'];
$OrgName = $rsOrgDetails[0]['db_Orgname'];
?>
<?php
$rsSubArr = $objDashboard->fetchSubscriptionDate();
?>
<div class="content-wrapper ">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1> <i class="fa fa-home"></i> <strong> <span style="font-size:16px !important;" id="org-name"><?php echo $OrgName; ?></span> </strong> </h1>
<ol class="breadcrumb">
<li><a href="dashboardma.html"><i class="fa fa-home"></i> Home</a></li>
<li class="active">Summery</li>
</ol>
</section>
<?php // Error or success message display
$objDB->NotificaitonForResult($msg,$error);
?>
<!-- Main content -->
<div class="main-summery-page">
<section class="content" >
<!-- Small boxes (Stat box) -->
<!--------
<div class="box box-primary card hovercard " style="border:none; border-top:2px solid #3c8dbc;">
<div class="card" id="festival-banner"></div>
<style>
.card{padding:5px;margin-top: 5px;}
</style>
<script>
$(window).load(function(){
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("festival-banner").innerHTML = this.responseText;
}
};
xhttp.open("GET", "runajax.php?acn=getFastivalBanner", true);
xhttp.send();
})
</script>
</div>-------->
<!-- DAILY REPORT START---->
<div class="col-md-12">
<div class="bx-box footer-box main-br">
<div class="box-header with-border">
<h3 class="box-title"> <i class="fa fa-sticky-note" aria-hidden="true"></i> Daily Report</h3>
</div>
<div class="box-body main">
<div class="row">
<div class="col-md-9 col-sm-9 col-xs-12">
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon" style="background: #00a2e8; color:#fff;">
<i class="fa fa-bar-chart" aria-hidden="true" style="line-height: 2;"></i>
</span>
<div class="info-box-content">
<span class="info-box-text">SCORE</span>
<div class=" pull-left right-border" style="width:50%">
<span class="info-box-text">TODAY</span>
<span class="info-box-number" id="avg-us">0.00</span>
</div>
<div class="pull-right" style="width:50%">
<span class="info-box-text">OVERALL</span>
<span class="info-box-number" id="avg-us">0.00</span>
</div>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<!-- /.col -->
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon " style="background: #ed1c24; color:#fff;">
<i class="fa fa-pencil-square-o" aria-hidden="true"style="line-height: 2;"></i>
</span>
<div class="info-box-content">
<span class="info-box-text">Feedback</span>
<div class=" pull-left right-border" style="width:50%">
<span class="info-box-text">TODAY</span>
<span class="info-box-number" id="avg-us">50</span>
</div>
<div class="pull-right" style="width:50%">
<span class="info-box-text">TOTAL</span>
<span class="info-box-number" id="avg-usxx">85</span>
</div>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<!-- /.col -->
<!-- fix for small devices only -->
<div class="clearfix visible-sm-block"></div>
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon" style="background: #22b14c; color:#fff;">
<i class="fa fa-star-o" aria-hidden="true" style="line-height: 2;"></i>
</span>
<div class="info-box-content">
<span class="info-box-text">Low Ratings</span>
<div class=" pull-left right-border" style="width:50%">
<span class="info-box-text">NEW</span>
<span class="info-box-number" id="avg-us">2</span>
</div>
<div class="pull-right" style="width:50%">
<span class="info-box-text">TOTAL</span>
<span class="info-box-number" id="avg-us">5</span>
</div>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<!-- /.col -->
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon " style="background: #880015; color:#fff;">
<i class="fa fa-user" aria-hidden="true" style="line-height: 2;"></i>
</span>
<div class="info-box-content">
<span class="info-box-text">CUSTOMERS</span>
<div class=" pull-left right-border" style="width:50%">
<span class="info-box-text">NEW</span>
<span class="info-box-number" id="avg-us">50</span>
</div>
<div class="pull-right" style="width:50%">
<span class="info-box-text">TOTAL</span>
<span class="info-box-number" id="avg-us">75</span>
</div>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon" style="background:#b97a57 !important; color:#fff;">
<i class="fa fa-bell-o" style="line-height: 2;"></i>
</span>
<div class="info-box-content">
<span class="info-box-text">TICKETS (COMING SOON)</span>
<span class="info-box-number" id="ticket">00</span>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon" style="background-color: #a349a4 !important; color:#fff;">
<i class="fa fa-users" aria-hidden="true" style="line-height: 2;"></i>
</span>
<div class="info-box-content">
<span class="info-box-text">USERS</span>
<span class="info-box-number" id="total-user">0</span>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
</div>
<div class="col-md-3 col-sm-3 col-xs-12 aa">
<div class="clock" style="margin-top:-8px;">
<div class="containerClock sidebar-form">
<div class="clock ClockDesign">
<ul class="text-gray" style="margin-top:-31px;">
<li id="hours">23</li>
<li id="point">:</li>
<li id="min">36</li>
</ul>
<div id="Date_Clock" style=" font-weight: bold; font-size: 20px;" class="text-gray">2<sup>nd</sup> November 2017, Thursday</div>
</div>
</div>
</div>
</div>
<!-- /.col -->
</div>
</div>
</div>
</div>
<!-- DAILY REPORT END---->
<!-- Monthly Reports -->
<div class="col-md-4">
<div class="bx-box footer-box" style="border:2px solid #d0c9c9 !important;">
<div class="box-header with-border box-header">
<h3 class="box-title"> <i class="fa fa-window-restore" aria-hidden="true"></i> Monthly Reports</h3>
</div>
<div class="box-body map" style="height:auto;">
<div class="news-manu skill-bar">
<div class="col-md-12">
<p>HIGH RATINGS</p>
<div class="container">
<div class="skills highrating" id="high-rating">0%</div>
</div>
<p>PERFORMANCE</p>
<div class="container">
<div class="skills score" id="score-percentage">0%</div>
</div>
<p>FURTHER RECOMMENDATIONS</p>
<div class="container">
<div class="skills furtherReco" id="further-reco">0%</div>
</div>
<p>GUEST FEEDBACK</p>
<div class="container">
<div class="skills guest-feedback-cls" id="guest-feedback">0%</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--// Monthly Reports-->
<!----Latest Comments start----->
<div class="col-md-4">
<div class="bx-box footer-box" style="border:2px solid #d0c9c9 !important;">
<div class="box-header with-border box-header">
<h3 class="box-title"> <i class="fa fa-comment" aria-hidden="true"></i> Latest Comments</h3>
<div class="box-tools pull-right" style="margin:8px 0px;">
<a href="reports.html"> <span class="label label-danger">View All</span></a>
</div>
</div>
<div class="box-body map" style="height:auto;">
<div class="news-manu skill-bar">
<?php
$rsLetestComments = $objDashboard->fetchLetestComments();
//echo "<pre>";
//print_r($rsLetestComments);
//echo "</pre>";
?>
<div class="col-md-12">
<?PHP if(count($rsLetestComments) > 0) { ?>
<marquee direction="up" scrolldelay="300" onmouseover="this.stop();" onmouseout="this.start();" style="height:220px;">
<ul class="products-list product-list-in-box" >
<?php for($c=0; $c < count($rsLetestComments); $c++) {
if($rsLetestComments[$c]['webprofileimage'] != "")
$ProfileImage = UPLOAD_WEBPROFILEIMAGE.$ProfileImage;
else
$ProfileImage = _IMAGEPATH_.'/noimage_responsive.png';
if(!fopen($ProfileImage,'r')){
$ProfileImage = _IMAGEPATH_.'/noimage_responsive.png';
}
?>
<li class="item">
<div class="product-img">
<img src="<?php echo $ProfileImage; ?>" alt="Profile Image">
</div>
<div class="product-info">
<a href="customers.html?v=list&cid=<?php echo $rsLetestComments[$c]['userId'];?>&tid=<?php echo $rsLetestComments[$c]['tokenid'];?>&Industrys=<?php echo $rsLetestComments[$c]['db_surveyIndId'];?>" class="product-title"><?php echo $rsLetestComments[$c]['db_phone'];?>
<span class="label label-success pull-right"><?php echo date("d/m/Y",strtotime($rsLetestComments[$c]['created_date']));?></span></a>
<b class="scor">SCORE :<span> 3.48</span></b> <b class="lr">LR :<span> 0</span> </b>
<span class="product-description" style="color:#222d32;">
<?php echo $rsLetestComments[$c]['db_surveyValue'];?>
</span>
</div>
</li>
<?php } ?>
</ul>
</marquee>
<?php } else {
echo "NO ANY COMMENT FOUND.";
}?>
</div>
</div>
</div>
</div>
</div>
<!----Latest Comments end----->
<!---Server Load start--->
<div class="col-md-4">
<div class="bx-box footer-box feedback live-chart" style="overflow: hidden; max-height: 286px; border: 2px solid #d0c9c9;">
<div class="box-header with-border box-header ">
<h3 class="box-title"><i class="fa fa-server" aria-hidden="true"></i> Server Load</h3>
</div>
<div class="box-body widget yellow span4 noMargin">
<div class="news-manu">
<!----------
<canvas id="cvs" style="width:100%" height="300px">
[No canvas support]
</canvas>---------------->
<canvas id="cvs" width="600" height="250">
[No canvas support]
</canvas>
</div>
</div>
</div>
</div>
<!--//-Server Load end---->
<div class="ft-footer-box">
<!--Weekly Performance start -->
<div class="col-md-4">
<div class="bx-box footer-box">
<div class="box-header with-border box-header">
<h3 class="box-title"><i class="fa fa-line-chart" aria-hidden="true"></i> Weekly Performance</h3>
</div>
<div class="box-body">
<div class="chart">
<div style="width: 100%; height: 250px" id="chart-container-c"></div>
</div>
</div>
</div>
</div>
<!--//---Weekly Performance end -->
<!-- Subscription Chart start -->
<div class="col-md-4 subscription-chart">
<div class="bx-box footer-box">
<div class="box-header with-border box-header">
<h3 class="box-title"><i class="fa fa-pie-chart" aria-hidden="true"></i> Subscription / Weekly Performance Chart</h3>
</div>
<div class="box-body">
<div class="round-chart" >
<!--- <div style="width: 100%; height: 250px" id="chart-container"></div>------>
<!---<center>
<h3 style="margin:0px; padding:0px; color:#fff"><span style="color:#dff022">Total days (<?php echo $rsSubArr['totalday']?>),</span> <span style="color:#1c27d2">Remain days (<?php echo $rsSubArr['totalday'] - $rsSubArr['used']?>)</span></h3>
</center>---------->
<!---<div id="chart-container1"></div>--->
<div class="progess-chart">
<div class="col-md-6">
<div class="left-round-chart">
<div class="heder-title"><h3>Subscription</h3></div>
<?php
$dayPer = (($rsSubArr['used'] * 100) / $rsSubArr['totalday']);
?>
<div id="demo-pie-3" class="pie-title-center" data-percent="<?php echo $dayPer; ?>"> <span class="pie-value"></span> </div>
<div class="footer-per"><p><?php echo $rsSubArr['totalday'] - $rsSubArr['used']; ?> Days / <?php echo $rsSubArr['totalday']?> Days</p></div>
</div>
</div>
<div class="col-md-6">
<div class="right-round-chart">
<div class="heder-title"><h3>Weekly Performance</h3></div>
<div id="demo-pie-2" class="pie-title-center" data-percent="10"> <span class="pie-value"></span> </div>
<div class="footer-per"><p id="wp-chart">0 Point / 4 Points</p></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--// Subscription Chart end -->
<!---News start-->
<div class="col-md-4">
<div class="bx-box footer-box">
<div class="box-header with-border box-header">
<h3 class="box-title"><i class="fa fa-newspaper-o" aria-hidden="true"></i> News</h3>
</div>
<div class="box-body">
<div class="news-manu" style="height: 250px; width:100%;" >
<?php
$rsNewsData = $objDashboard->fetchNewsData();
if(count($rsNewsData) > 0) {
echo '<marquee direction = "up" scrolldelay="300" onmouseover="this.stop();" onmouseout="this.start();" style="height:250px;">';
for($nz=0; $nz<count($rsNewsData); $nz++) { ?>
<ul class="news">
<li><strong><?php echo $rsNewsData[$nz]['title'];?></strong><br /> <em><?php echo $rsNewsData[$nz]['description'];?></em></li>
</ul>
<?php }
echo '</marquee>';
}else{ ?>
<p style="color:#fff; text-align:center;"><br /><br /><br /><br />NO ANY NEWS FOUND</p>
<?php }
?>
</div>
</div>
</div>
</div>
<!--//-News end-->
</div>
<div class="row">
<div class="col-md-12 form-group ">
<div class="col-sm-12">
<div class="row">
<?php
//echo "<pre>";
//print_r($_SERVER);
//echo "</pre>";
$link = "";
if(!empty($BranchID))
$link = "brnid=".$BranchID;
if(!empty($IndustryID))
$link = $link."&indid=".$IndustryID;
$linkDate = "FromDate={$FromDate}&ToDate={$ToDate}";
$link = $link."&".$linkDate;
$overAllAvg = array('us'=>"0.00","ind"=>"0.00");
$rsBranches = $objDashboard->fetchBranchesData($BranchID,$IndustryID);
$totalUser = $objDashboard->fetchTotalUser();
//echo "<pre>";
//print_r($_SESSION);
//print_r($rsBranches);
//die;
if(!empty($BranchID)){
$OrgName = $OrgName.' > '.$rsBranches[0]['db_branchName'];
}
$avgUSTotal = 0;
$avgUS = 0;
$avgInd = 0;
$avgFeedback = 0;
$avgLowRating = 0;
$totalFeedback = array();
$totalFeedback['count'] = 0;
$totalFeedback['guest_total'] = 0;
$totalFeedback['guest_count'] = 0;
$totalTotalCustomer = 0;
$ratingArr = array();
$ratingArr['total'] = 0;
$ratingArr['count'] = 0;
$furtherArr = array();
$furtherArr['yes'] = 0;
$furtherArr['no'] = 0;
$score = 0;
$performance = 0;
$weeklyPerformanceFinalArr = array();
for($i=0; $i<count($rsBranches); $i++) {
?>
<?php
$rsIndustryData = $objDashboard->fetchIndustryData($rsBranches[$i]['branchId'],$IndustryID);
//print_r($rsIndustryData);
if(count($rsIndustryData) > 0) {
//echo count($rsIndustryData);
//echo "<br />";
for($j=0; $j<count($rsIndustryData); $j++) {
$performanceArr = $objDashboard->fetchRatingForCurrentIndustry($rsIndustryData[$j]['IndId'],$rsBranches[$i]['branchId'],$rsOrgDetails[0]['OrgId'],'us',$FromDate,$ToDate);
//echo "<pre>";
//print_r($performanceArr);
//echo "</pre>";
$score = $score + $performanceArr['score'];
$performance = $performance + $performanceArr['performance'];
//echo "IND ID = ".$rsIndustryData[$j]['IndId'].", BRANCH ID = ".$rsBranches[$i]['branchId'].", ORG ID = ".$rsOrgDetails[0]['OrgId'];
//echo "<br />";
$days = "'".implode("','",$performanceArr['days'])."'";
$weeklyPerformanceFinalArr['us'][] = $performanceArr['weekly'];
//echo "<pre>";
//print_r($performanceArr);
//echo "</pre>";
$performanceINDArr = $objDashboard->fetchRatingForCurrentIndustry($rsIndustryData[$j]['IndId'],$rsBranches[$i]['branchId'],$rsOrgDetails[0]['OrgId'],'ind',$FromDate,$ToDate);
$weeklyPerformanceFinalArr['ind'][] = $performanceINDArr['weekly'];
//echo "<pre>";
//print_r($performanceINDArr);
//echo "</pre>";
//$avgUS = (float)$avgUS + (float)$avg1;
//$avgFeedback = $avgFeedback + $objDashboard->fetchAvgFeedback("us",$rsBranches[$i]['branchId'],$rsIndustryData[$j]['IndId'],$rsOrgDetails[0]['OrgId']);
$avgLowRating = $avgLowRating + $objDashboard->fetchAvgLowRating("us",$rsBranches[$i]['branchId'],$rsIndustryData[$j]['IndId'],$rsOrgDetails[0]['OrgId']);
$avgHighRating = $objDashboard->fetchHightRatingAndCount("us",$rsBranches[$i]['branchId'],$rsIndustryData[$j]['IndId'],$rsOrgDetails[0]['OrgId']);
$ratingArr['total'] = $ratingArr['total'] + $avgHighRating['total'];
$ratingArr['count'] = $ratingArr['count'] + $avgHighRating['count'];
$feddbackArr = $objDashboard->fetchTotalFeedback("us",$rsBranches[$i]['branchId'],$rsIndustryData[$j]['IndId'],$rsOrgDetails[0]['OrgId']);
//echo "<pre>";
//print_r($feddbackArr);
//echo "</pre>";
$totalFeedback['count'] = $totalFeedback['count'] + $feddbackArr['count'];
$totalFeedback['guest_total'] = $totalFeedback['guest_total'] + $feddbackArr['guest_total'];
$totalFeedback['guest_count'] = $totalFeedback['guest_count'] + $feddbackArr['guest_count'];
$totalTotalCustomer = $totalTotalCustomer + $objDashboard->FetchCustomerData($rsBranches[$i]['branchId'],$rsIndustryData[$j]['IndId'],$rsOrgDetails[0]['OrgId']);
$furtherTotalArr = $objDashboard->fetchFurtherRecommendation($rsIndustryData[$j]['IndId'],$rsBranches[$i]['branchId'],$rsOrgDetails[0]['OrgId'],'us',$FromDate,$ToDate);
$furtherArr['no'] = $furtherArr['no'] + $furtherTotalArr['no'];
$furtherArr['yes'] = $furtherArr['yes'] + $furtherTotalArr['yes'];
}
//$avgUS = number_format(($avgUS/$j),2);
//if($avgUS <= 0) $avgUS = "0.00";
//$avgUSTotal += $avgUS;
$score = number_format(($score/$j),2);
$performance = number_format(($performance/$j),2);
if($performance != 0)
$performance = number_format((($performance * 100) / 4),2);
//print_r($totalFeedback);
$cntTotalFeedabck = $totalFeedback['count'];
$avgFeedback = number_format(($feddbackArr['count']/$j),2);
//$avgLowRating = number_format(($avgLowRating/$j),2);
$furtherReco = number_format(($furtherReco/$j),2);
if($ratingArr['total'] != 0 ) {
$highRating = number_format(($ratingArr['count'] * 100 / $ratingArr['total']),0) ;
//$highRating = 100 - $highRating;
}
else
$highRating = 0;
//echo "<pre>";
//print_r($furtherArr);
//echo "</pre>";
if($furtherArr['yes'] != 0 )
$furtherReco = number_format(( ($furtherArr['yes'] * 100) / ($furtherArr['yes'] + $furtherArr['no'])),0);
else
$furtherReco = 0;
if($totalFeedback['guest_total'] != 0 )
$guestFeedback = number_format(($totalFeedback['guest_count'] * 100 / $totalFeedback['guest_total']),0);
else
$guestFeedback = 0;
}else{ ?>
<?php
}
?>
<?php } ?>
<?php
print_r($weeklyPerformanceFinalArr['us']);
$perforArr = array();
$perforArr['us'] = array(0,0,0,0,0,0,0);
$perforArr['ind'] = array(0,0,0,0,0,0,0);
$perforArr['wpus'] = array(0,0,0,0,0,0,0);
for($wpday = 0; $wpday < 7; $wpday++) {
$perforArr['us'][$wpday];
for($wp = 0; $wp<count($weeklyPerformanceFinalArr['us']); $wp++ ){
echo $perforArr['us'][$wpday] = $perforArr['us'][$wpday] + $weeklyPerformanceFinalArr['us'][$wp][$wpday];
$perforArr['wpus'][$wpday] = $perforArr['us'][$wpday] + $weeklyPerformanceFinalArr['us'][$wp][$wpday];
echo "<br />";
}
echo "<br /><br /><br />";
$perforArr['us'][$wpday] = $perforArr['us'][$wpday] / count($weeklyPerformanceFinalArr['us']);
$perforArr['us'][$wpday] = number_format((($perforArr['us'][$wpday] * 100)/4),2);
$perforArr['ind'][$wpday];
for($wp = 0; $wp<count($weeklyPerformanceFinalArr['ind']); $wp++ ){
$perforArr['ind'][$wpday] = $perforArr['ind'][$wpday] + $weeklyPerformanceFinalArr['ind'][$wp][$wpday];
}
$perforArr['ind'][$wpday] = $perforArr['ind'][$wpday] / count($weeklyPerformanceFinalArr['ind']);
$perforArr['ind'][$wpday] = number_format((($perforArr['ind'][$wpday] * 100)/4),2);
}
$perforArr['wpus'] = number_format((array_sum($perforArr['wpus'])/7),2);
$perforArr['wpus_percentage'] = number_format((($perforArr['wpus'] * 100)/4),2);
?>
<script>
document.getElementById("avg-us").innerHTML = '<?php echo $score;?>';
$("#avg-us").attr("title","<?php echo $score;?>");
//document.getElementById("avg-feedback").innerHTML = '<?php echo $avgFeedback;?>';
//$("#avg-feedback").attr("title","<?php echo $avgFeedback;?>");
//alert('<?php echo $avgLowRating;?>');
document.getElementById("avg_low_rating").innerHTML = '<?php echo $avgLowRating;?>';
$("#avg_low_rating").attr("title","<?php echo $avgLowRating;?>");
document.getElementById("total-feedback").innerHTML = '<?php echo $cntTotalFeedabck;?>';
$("#total-feedback").attr("title","<?php echo $totalFeedback;?>");
document.getElementById("total-customer").innerHTML = '<?php echo $totalTotalCustomer;?>';
$("#total-customer").attr("title","<?php echo $totalTotalCustomer;?>");
document.getElementById("total-user").innerHTML = '<?php echo $totalUser;?>';
$("#total-user").attr("title","<?php echo $totalUser;?>");
document.getElementById("high-rating").innerHTML = '<?php echo $highRating;?>%';
$("#high-rating").attr("title","<?php echo $highRating;?>%");
document.getElementById("further-reco").innerHTML = '<?php echo $furtherReco;?>%';
$("#further-reco").attr("title","<?php echo $furtherReco;?>%");
document.getElementById("guest-feedback").innerHTML = '<?php echo $guestFeedback;?>%';
$("#guest-feedback").attr("title","<?php echo $guestFeedback;?>%");
</script>
<?php
if($avgUSTotal == 0){
$avgUSTotal = "0";
}else{
$avgUSTotal = $avgUSTotal/count($rsBranches);
}
$avgUSTotal = number_format((($avgUSTotal/4) * 100),0) ;
$wpChart = array_sum($perforArr['us']);
?>
<script>
//document.getElementById("avg-us-head").innerHTML = '<?php echo "US. ".$avgUSTotal;?>';
document.getElementById("score-percentage").innerHTML = '<?php echo $performance;?>%';
$("#score-percentage").attr("title","<?php echo $performance;?>%");
document.getElementById("wp-chart").innerHTML = '<?php echo $perforArr['wpus'];?> point / 4 point';
$("#wp-chart").attr("title","<?php echo $perforArr['wpus'];?> point / 4 point");
document.getElementById("demo-pie-2").setAttribute('data-percent',<?php echo $perforArr['wpus_percentage'];?>);
</script>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
<!-- SERVER LOAD ---start--->
<script>
// Prefill the data array
for (i=0,data=[];i<600; ++i) data[i] = null;
/**
* Ths window.onload function initiates the AJAX request. The AJAX page is: http://www.rgraph.net/getdata.html
* If you view this in your browser you'll see that all it does is output a sequence of numbers.
*/
var line = new RGraph.Line({
id: 'cvs',
data: data,
options: {
labels: ['60','55','50','45','40','35'],
numxticks: 12,
backgroundGridAutofitNumvlines: 12,
ymax: 100,
gutterLeft: 35,
tickmarks: null,
shadow: null,
backgroundGridBorder: false,
backgroundGridVlines: false,
noaxes: true,
linewidth: 1,
backgroundGridColor: '#ddd',
backgroundGridVlines: false,
backgroundGridBorder: false,
shadow: false,
filled: true,
colors: ['#880015'],
}
}).draw();
/**
* This is the AJAX callback function. It adds the number retrieved via
* AJAX to the data array
*/
var last = RGraph.random(0,100);
function draw ()
{
last = RGraph.random(last - 5, last + 5);
last = Math.min(last, 100);
last = Math.max(last, 0);
// Set the data on the object
line.original_data[0].push(last);
line.original_data[0].shift();
// Clear the canvas
RGraph.clear(line.canvas);
line.draw();
setTimeout(draw, 0);
}
draw();
</script>
<!-- SERVER LOAD END -->
<!-- Weekly Sales Analysis START -->
<script>
var linex = new RGraph.SVG.Line({
id: 'chart-container-c',
data: [
[<?php echo implode(',',$perforArr['ind'])?>],
[<?php echo implode(',',$perforArr['us'])?>]
],
options: {
xaxisLabels: [<?php echo $days;?>],
yaxisUnitsPost: '%',
xaxisTextColor: '#333',
yaxisTextColor: '#333',
gutterLeft: 40,
gutterTop: 35,
gutterRight: 15,
gutterBottom: 50,
colors: ['#fff','#dff021'],
linewidth: 2,
shadow: true,
shadowBlur: 3,
shadowOpacity: 0.25,
spline: true
}
}).trace();
</script>
<!-- Weekly Sales Analysis END---->
<!-- Subscription Chart--START-->
<!----------
<script>
new RGraph.SVG.Pie({
id: 'chart-container',
data: [<?php echo $rsSubArr['used'];?>,<?php echo $rsSubArr['totalday'] - $rsSubArr['used'];?>],
options: {
exploded: 0,
donut: false,
title: "Total days (<?php echo $rsSubArr['totalday']?>), Remain days (<?php echo $rsSubArr['totalday'] - $rsSubArr['used']?>)",
tooltips: ['Days (<?php echo $rsSubArr['used'];?>)', 'Days (<?php echo $rsSubArr['totalday'] - $rsSubArr['used'];?>)'],
shadow: true,
colors: [
'Gradient(#fff:#fff:#fff:#d8d9db:#fff)',
'Gradient(#1c27d2:#1c27d2:#1c27d2:#3740d7:#1c27d2)'
]
}
}).roundRobin();
</script>
------>
<script type="text/javascript">
$(document).ready(function () {
$('#demo-pie-2').pieChart({
barColor: '#f3fbf3',
trackColor: '#80d180',
lineCap: 'butt',
lineWidth: 15,
onStep: function (from, to, percent) {
$(this.element).find('.pie-value').text(Math.round(percent) + '%');
}
});
$('#demo-pie-3').pieChart({
barColor: '#fffcf3',
trackColor: '#ffe286',
lineCap: 'square',
lineWidth: 15,
onStep: function (from, to, percent) {
$(this.element).find('.pie-value').text(Math.round(percent) + '%');
}
});
});
</script>
<!--Subscription Chart-END-->