HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.52.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 15 06:39:08 EDT 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: /home/barbeatleanalyti/www/manage.beatleanalytics.com/site/template/dashboardma.php 14-12-2018
<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">



<!---
<script src="<?php echo $curImagePath?>/js/RGraph.common.core.js"></script>
<script src="<?php echo $curImagePath?>/js/RGraph.common.dynamic.js"></script>
<script src="<?php echo $curImagePath?>/js/RGraph.common.tooltips.js"></script>
<script src="<?php echo $curImagePath?>/js/RGraph.common.effects.js"></script>
<script src="<?php echo $curImagePath?>/js/RGraph.line.js"></script>-->

 
<script>
	$(document).ready(function(){
		$("#FromDate").datepicker({format:'dd-mm-yyyy'});
		$("#ToDate").datepicker({format:'dd-mm-yyyy'});
	});

	function validateDate(){

		var D1 = document.getElementById("ToDate");
		var D2 = document.getElementById("FromDate");

		if(D1.value.trim() == ""){
			D1.style.border = "1px solid red";
			return false;
		}

		if(D2.value.trim() == ""){
			D2.style.border = "1px solid red";
			return false;
		}
	}
</script>
<?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;

$PageID		= $objDashboard->PageID;
$PageConID	= $objDashboard->PageConID;
$atype		= $objDashboard->atype;


$BranchID 	= $objDashboard->BranchID;
$IndustryID 	= $objDashboard->IndustryID;

$NoData = $objDashboard->NoData;

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'];

?>

<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> <small id="avg-us-head"></small> <!---  <small id="avg-ind-head">INDUSTRY <?php //echo $overAvgIndustry = $objDashboard->fetchRatingForOhterIndustry($orgID,$orgType,'ind',$FromDate,$ToDate); ?> </small> ----> </strong> </h1>
		<ol class="breadcrumb">
			<li><a href="dashboardma.html"><i class="fa fa-home"></i> Home</a></li>
			<li class="active">Dashboard <?php //echo "data ".$NoData; ?></li>
		</ol>
	</section>
  <?php // Error or success message display
  $objDB->NotificaitonForResult($msg,$error);
  ?>

  
  
  
  <!-- Main content -->
  
  
  
  <section class="content dashboardma-page" > 
  	<!-- 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>
    <br />
-->


<!---monthly report-------->




<div class="box box-primary search">
			<div class="box-header with-border">
				<!---  <h3 class="box-title">Select Date</h3>-->
<div class="panel-body--">

					<div class="col-sm-2 col-md-1 col-lg-1 date_search" style="text-align: right;"><h3 class="box-title" style="line-height:2.4;">Select Date</h3></div>

					<div class="col-sm-10 col-md-11 col-lg-11 select-date">
						<form name="dateSearch" class="bs-example form-horizontal ng-pristine ng-valid" method="post" action="dashboardma.html" enctype="multipart/form-data"  >
							<input type="hidden" name="acn"  value="FetchAllUserInfo" id="acn"   />
							<input type="hidden" name="v"  value="list" id="v"   />
							<input type="hidden" name="pg"  value="dashboardma" id="pg"   />

							<div class="form-group" style="margin-bottom:0px;">
								<label class=" col-sm-3 col-md-1 col-lg-1 control-label">From date: </label>
								<div class="col-sm-3 col-md-2 col-lg-2 ">
									<input type="text" readonly="readonly" style="background:#fff;" class="form-control" name="FromDate" id="FromDate" value="<?php echo $FromDate; ?>">
								</div>
								<label class="col-sm-3 col-md-1 col-lg-1 control-label">Till date: </label>
								<div class=" col-sm-3 col-md-2 col-lg-2">
									<input type="text" readonly="readonly" style="background:#fff;margin-bottom: 4px;" class="form-control" name="ToDate" id="ToDate" value="<?php echo $ToDate; ?>">
								</div>
								<!--<div class="clear clear-m"></div>-->
								<!--<div class="col-sm-3 "></div>-->

								<div class=" col-xs-6 col-sm-3 col-md-2 col-lg-1 load_date ">
									<button type="submit" onclick="javascript: return validateDate()" class="btn btn-block btn-success "> <i class="fa fa-long-arrow-left" aria-hidden="true"></i> Load</button>
								</div>

								<div class="col-xs-6 col-sm-3 col-md-2 col-lg-1 reset_date">
									<a href="dashboardma.html" class="btn btn-block btn-primary"> <i class="fa fa-refresh" aria-hidden="true"></i> Reset</a>
								</div>


			 <!---<div class="col-md-1 col-xs-12 converter_per pull-right pre-btn">
				

			 <button class="btn_per tooltip"  type="button" id="btnPer" style="background: none;
				border: none;"> % <span class="tooltiptext">View Percentage</span></button>
				
			</div>--->
			
	
			<?php if(!empty($BranchID)) {?>
              <!--<div class="col-lg-1 col-sm-2">
                <a href="<?php echo $_SERVER['HTTP_REFERER'];?>" class="btn btn-block btn-warning">BACK</a>
            </div> -->
        <?php } ?>


    </div>
</form>
</div>

</div>
				

</div>

</div>

<div class="main-summery-page ">
	<div class="col-md-12 no-padding normal dashboardma">
		

<div class="bx-box footer-box main-br">

	<div class="box-header with-border">
		<h3 class="box-title">  <i class="fa fa-window-restore" aria-hidden="true"></i> Monthly 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">
					<a href="summery.html">
						<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">US</span>
									<span class="info-box-number"  id="avg-us-today">0.00</span>
								</div>
								<div class="pull-right" style="width:50%">
									<span class="info-box-text">OTHERS</span>
									<span class="info-box-number" id="avg-us-ove">0.00</span>
								</div>

							</div>

						</div>
					</a>

				</div>

				<div class="col-md-4 col-sm-6 col-xs-12">
					<a href="reports.html">
						<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>

								<span class="info-box-number feedback" id="total-feedback-ove">00</span>   
			   <!--<div class=" pull-left right-border" style="width:50%">
			   <span class="info-box-text">TODAY</span>
              <span class="info-box-number" id="total-feedback">0</span>
			  </div>
			   <div class="pull-right" style="width:50%">
			    <span class="info-box-text">TOTAL</span>
              <span class="info-box-number" id="total-feedback-ove">00</span>
          </div> -->

      </div>

  </div>
</a>

</div>



<div class="clearfix visible-sm-block"></div>

<div class="col-md-4 col-sm-6 col-xs-12">
	<a href="reports.html">
		<div class="info-box">
			<span class="info-box-icon" style="background: #22b14c; color:#fff;">
				<i class="fa fa-frown-o"  aria-hidden="true" style="line-height: 2;"></i>			
			</span>

			<div class="info-box-content">
				<span class="info-box-text">Low Ratings</span>
				<span class="info-box-number low-ratings" id="avg_low_rating">0/0</span>     
			</div>

		</div>
		<a/>

	</div>

	<div class="col-md-4 col-sm-6 col-xs-12">
		
		<a href="customers.html">
			<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="total-customer">0</span>
					</div>
					<div class="pull-right" style="width:50%">
						<span class="info-box-text">TOTAL</span>
						<span class="info-box-number" id="total-customer-ove">0</span>
					</div>
				</div>

			</div>
		</a>

	</div>

	<div class="col-md-4 col-sm-6 col-xs-12">
		<a href="tickets.html?v=list">
			<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 </span>
					<span class="info-box-number feedback" id="total-feedback-ove"><?php echo fetch_ticket_for_tabbing('','');?></span>   
				</div>

			</div>
		</a>

	</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-university" 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> -->
          <div class="info-box-content">
          	<span class="info-box-text">ORGANIZATION</span>

          	<div class=" pull-left right-border" style="width:50%">
          		<span class="info-box-text">BRANCH</span>
          		<span class="info-box-number"  id="total-branch">0</span>
          	</div>
          	<div class="pull-right" style="width:50%">
          		<span class="info-box-text">INDUSTRY</span>
          		<span class="info-box-number" id="total-inustry">0</span>
          	</div>
          </div>

      </div>


  </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"></li>
					<li id="point">:</li>
					<li id="min"></li>
				</ul>
				<div id="Date_Clock" style=" font-weight: bold; font-size: 20px;" class="text-gray clocktime"><sup></sup> </div>
			</div>
		</div>
	</div>

</div>

</div>

</div>

</div>
</div>


<!--start-->
<div class="col-md-12 no-padding percentageaa dashboardma" style="display:none">
	<div class="box box-primary search">
		<div class="box-header with-border">
			<!---  <h3 class="box-title">Select Date</h3>-->

			

</div>



</div>

<div class="bx-box footer-box main-br">
	<div class="box-header with-border">
		<h3 class="box-title">  <i class="fa fa-window-restore" aria-hidden="true"></i> Monthly 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">
					<a href="summery.html">
						<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">US</span>
									<span class="info-box-number"  id="avg-us-today1">0.00</span>
								</div>
								<div class="pull-right" style="width:50%">
									<span class="info-box-text">OTHERS</span>
									<span class="info-box-number" id="avg-us-ove1">0.00</span>
								</div>

							</div>

						</div>
					</a>

				</div>

				<div class="col-md-4 col-sm-6 col-xs-12">
					<a href="reports.html">
						<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>

								<span class="info-box-number feedback" id="total-feedback-ove1">00</span>   
			   <!--<div class=" pull-left right-border" style="width:50%">
			   <span class="info-box-text">TODAY</span>
              <span class="info-box-number" id="total-feedback">0</span>
			  </div>
			   <div class="pull-right" style="width:50%">
			    <span class="info-box-text">TOTAL</span>
              <span class="info-box-number" id="total-feedback-ove">00</span>
          </div> -->

      </div>

  </div>
</a>

</div>



<div class="clearfix visible-sm-block"></div>

<div class="col-md-4 col-sm-6 col-xs-12">
	<a href="reports.html">
		<div class="info-box">
			<span class="info-box-icon" style="background: #22b14c; color:#fff;">
				<i class="fa fa-frown-o"  aria-hidden="true" style="line-height: 2;"></i>			
			</span>

			<div class="info-box-content">
				<span class="info-box-text">Low Ratings</span>
				<span class="info-box-number low-ratings" id="avg_low_rating1">0/0</span>     
			</div>

		</div>
		<a/>

	</div>

	<div class="col-md-4 col-sm-6 col-xs-12">
		
		<a href="customers.html">
			<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="total-customer1">0</span>
					</div>
					<div class="pull-right" style="width:50%">
						<span class="info-box-text">TOTAL</span>
						<span class="info-box-number" id="total-customer-ove1">0</span>
					</div>
				</div>

			</div>
		</a>

	</div>

	<div class="col-md-4 col-sm-6 col-xs-12">
		<a href="tickets.html?v=list">
			<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 </span>
					<span class="info-box-number feedback" id="total-feedback-ove"><?php echo fetch_ticket_for_tabbing('','');?></span>   
				</div>

			</div>
		</a>

	</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-university" 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> -->
          <div class="info-box-content">
          	<span class="info-box-text">ORGANIZATION</span>

          	<div class=" pull-left right-border" style="width:50%">
          		<span class="info-box-text">BRANCH</span>
          		<span class="info-box-number"  id="total-branch1">0</span>
          	</div>
          	<div class="pull-right" style="width:50%">
          		<span class="info-box-text">INDUSTRY</span>
          		<span class="info-box-number" id="total-inustry1">0</span>
          	</div>
          </div>

      </div>


  </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="hoursa"></li>
					<li id="pointa">:</li>
					<li id="mina"></li>


				</ul>
				<div id="Date_Clocka" style=" font-weight: bold; font-size: 20px;" class="text-gray clocktime"><sup></sup> </div>
			</div>
		</div>
	</div>


	

</div>

</div>

</div>

</div>
</div>
<!--end -->		   

</div>



<div class="row search_branch">
	<div class="col-md-12 search_branch_sub form-group ">


		<div class="col-sm-12">
			<div class="row">

				<?php 

			########################################################################
			//$text = fetchZeroFeedbackDays($orgID,$BranchID,$IndustryID,$FromDate,$ToDate);
			// echo $text;
			########################################################################
			/*echo "<pre>";
			print_r($text);
			echo "</pre>";*/
			//echo $BranchID." and ".$IndustryID;
			$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);
			
			//echo count($rsBranches);
			//die;
			
			//$totalUser = fetchTotalUser();
			

			if(!empty($BranchID)){
				$OrgName = 	$OrgName.' > '.$rsBranches[0]['db_branchName'];
			}
			
			$avgUSTotal = 0;
			$totalIndustry = 0;

			$avgFeedback = 0;
			$avgLowRating = 0;
			
			
			$totalFeedback = array();
			$totalFeedback['count'] = 0;
			$totalFeedback['guest_total'] = 0;
			$totalFeedback['guest_count'] = 0;
			
			$totalCustomers = 0;
			$todaysCustomer = 0;
			
			$ratingArr  = array();
			$ratingArr['total'] = 0;
			$ratingArr['count'] = 0;
			
			//$furtherArr  = array();
			//$furtherArr['yes'] = 0;
			//$furtherArr['no'] = 0;
			
			$score = 0;
			$performance = 0;
			$performance_ove = 0;
			$performanceIND = 0;
			
			
			$today_lowrating = 0;
			$ove_lowrating = 0;
			

			for($i=0; $i<count($rsBranches); $i++) {
				?>
				<!-- <div class="col-md-4 col-sm-6 col-xs-12">-->
					<div class="col-md-6 col-sm-12 col-xs-12 col-lg-4 sub3Normal ser_branch" style="border: none !IMPORTANT; padding-right: 8px; padding-left: 1px;">
						<article class="head-article">


							<a href="#" onclick="javascript: window.location.href='dashboardma.html?data=<?php echo base64_encode('atype=oa&brnid='.$rsBranches[$i]['branchId'].'&'.$linkDate)?>'">

								<h2 style="background:#222d32" title="<?php echo $rsBranches[$i]['db_branchName'];?>" class="block bg-info"><div class="branch-logo"></div><?php echo "Branch - <strong>".$rsBranches[$i]['db_branchName']; 
								if($_SERVER['HTTP_HOST'] == 'localhost' || $_SERVER['HTTP_HOST'] == '192.168.2.105' || $_SERVER['HTTP_HOST'] == 'kalpeshpc' ){
						//echo " #[".$rsBranches[$i]['branchId']."]";
								}?>
							</strong>
							<span class="pull-right text-bold" id="ind-avg-<?php echo $rsBranches[$i]['branchId'];?>" style="margin-left:13px;font-size: 18px;line-height: 2.3;"></span>
							<span class="pull-right text-bold" id="us-avg-<?php echo $rsBranches[$i]['branchId'];?>" style="font-size: 18px;line-height: 2.3;" ></span>
						</h2>

					</a>

					<div class="inner-article">


						<?php 
						$rsIndustryData = $objDashboard->fetchIndustryData($rsBranches[$i]['branchId'],$IndustryID);

						$totalIndustry = $totalIndustry + count($rsIndustryData);

						if(!empty($IndustryID)){
							$OrgName = 	$OrgName.' > '.$rsIndustryData[0]['db_industry'];
						}					
					// echo "<pre>";
					// print_r($rsIndustryData);
					// echo "</pre>";
						if(count($rsIndustryData) > 0) {

							$avgUS = 0;
							$avgInd = 0;						
							for($j=0; $j<count($rsIndustryData); $j++) {

								if(!empty($BranchID)){
									$linkD = "brnid=".$BranchID."&indid=".$rsIndustryData[$j]['IndId']."&FromDate={$FromDate}&ToDate={$ToDate}";	
								}
								else{
									$linkD = "brnid=".$rsBranches[$i]['branchId']."&indid=".$rsIndustryData[$j]['IndId']."&FromDate={$FromDate}&ToDate={$ToDate}";
								}


								?>
								<div class="branch-icon branch-icon-<?php echo $j?>"></div>

								<p title="<?php echo $rsIndustryData[$j]['db_industry'];?>" style="cursor:pointer;" onclick="javascript: window.location.href='dashboardma.html?data=<?php echo base64_encode($linkD);?>'">  <?php echo $rsIndustryData[$j]['db_industry'];

								if($_SERVER['HTTP_HOST']=='localhost' || $_SERVER['HTTP_HOST']=='kalpeshpc' || $_SERVER['HTTP_HOST']=='192.168.1.3' || $_SERVER['HTTP_HOST']=='192.168.1.5') 
								{ 
						//echo " [".$rsIndustryData[$j]['IndId']."] &nbsp; [".$rsIndustryData[$j]['db_IndLoginId']."]";
								} ?>

								<!-- code to calculate and set industry average -->

								<?php 
						//$performanceINDArr = fetchRatingForCurrentIndustry($rsIndustryData[$j]['IndId'],$rsBranches[$i]['branchId'],$rsOrgDetails[0]['OrgId'],'ind',$FromDate,$ToDate); 
								$performanceINDArr = fetchRatingForCurrentIndustry($rsIndustryData[$j]['IndId'],$rsBranches[$i]['branchId'],$rsOrgDetails[0]['OrgId'],'ind',$FromDate,$ToDate,$BranchID,$IndustryID); 
								$avgInd =  (float)$avgInd + (float)$performanceINDArr['avgValueDB'];

								?>
								<span title="<?php echo $performanceINDArr['avgValueDB'];?>" style="color:black;margin-left:24px; font-weight:bold;">
									<?php echo $performanceINDArr['avgValueDB'];?>
								</span>

								<?php 


								$performanceArr = fetchRatingForCurrentIndustry($rsIndustryData[$j]['IndId'],$rsBranches[$i]['branchId'],$rsOrgDetails[0]['OrgId'],'us',$FromDate,$ToDate,$BranchID,$IndustryID);
								$avgUS =  (float)$avgUS + (float)$performanceArr['avgValueDB']; 

								?>                    
								<!-- code to calculate and set us average -->
								<span title="<?php echo $performanceArr['avgValueDB'];?>" style="color:black; margin-left:24px; font-weight:bold;">
									<?php echo $performanceArr['avgValueDB'];?>
								</span>
							</p>
							<?php 
						//echo "<pre>";
						//print_r($performanceArr);
						//echo "</pre>";

							$score = $score + $performanceArr['score'];

							$performance = $performance + $performanceArr['performance'];
							
							$performanceIND = $performanceIND + $performanceINDArr['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'];

							$avgLowRatingArr = fetchAvgLowRating("us",$rsBranches[$i]['branchId'],$rsIndustryData[$j]['IndId'],$rsOrgDetails[0]['OrgId'],$FromDate,$ToDate); 



							$today_lowrating = $today_lowrating + $avgLowRatingArr['today_lowrating'];
							$ove_lowrating = $ove_lowrating + $avgLowRatingArr['ove_lowrating'];


						//$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  = fetchTotalFeedback("us",$rsBranches[$i]['branchId'],$rsIndustryData[$j]['IndId'],$rsOrgDetails[0]['OrgId'],$FromDate,$ToDate);




						//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'];




							$totalCustomers = $totalCustomers + FetchCustomerData($rsBranches[$i]['branchId'],$rsIndustryData[$j]['IndId'],$rsOrgDetails[0]['OrgId'],'N',$FromDate,$ToDate);
							$todaysCustomer = $todaysCustomer + FetchCustomerData($rsBranches[$i]['branchId'],$rsIndustryData[$j]['IndId'],$rsOrgDetails[0]['OrgId'],'Y',$FromDate,$ToDate);

						//$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'];

						}



					//// NEW START 
						$score = $score/$j;

						$performance = $performance/$j;

					//$performance_ove = $performance;
						$performanceIND = $performanceIND/$j;

					//if($performance != 0)
					//$performance = number_format((($performance * 100) / 4),2);
					//if($performanceIND != 0)
					//$performanceIND = number_format((($performanceIND * 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;
					
					
					////// NEW END


				//////// OLD START
					$avgInd  = number_format(($avgInd/$j),2);
					if($avgInd <= 0) $avgInd = "0.00";

					$avgUS  = number_format(($avgUS/$j),2);
					if($avgUS <= 0) $avgUS = "0.00";

					$avgUSTotal += $avgUS;
					$avgINDTotal += $avgInd;
				///////// OLD END

					?>
					<script>
						document.getElementById("ind-avg-<?php echo $rsBranches[$i]['branchId'];?>").innerHTML = '<?php echo $avgInd;?>';
						document.getElementById("us-avg-<?php echo $rsBranches[$i]['branchId'];?>").innerHTML = '<?php echo $avgUS;?>';
						$("#ind-avg-<?php echo $rsBranches[$i]['branchId'];?>").attr("title","<?php echo $avgInd;?>");
						$("#us-avg-<?php echo $rsBranches[$i]['branchId'];?>").attr("title","<?php echo $avgUS;?>");

					</script>
					<?php 
				}else{
					//echo "No Industry Found !";?>
					<span style="color:sky; margin-left:24px;">0.00</span>
					<?php
				}  
				
				$overAllAvg['ind'] = $avgInd;
				$overAllAvg['us'] = $avgUS;


					//echo $performance." # ".count($rsBranches);

				?>
			</div>
		</article>
	</div>


<?php }

for($i=0; $i<count($rsBranches); $i++) {
	?>
	<!--start per-->
	<!-- <div class="col-md-4 col-sm-6 col-xs-12">-->
		<div class="col-md-6 col-sm-12 col-xs-12 col-lg-4 sub3Per" style="border: none !IMPORTANT; padding-right: 8px; padding-left: 1px; display:none;">
			<article class="head-article">


				<a href="#" onclick="javascript: window.location.href='dashboardma.html?data=<?php echo base64_encode('atype=oa&brnid='.$rsBranches[$i]['branchId'].'&'.$linkDate)?>'">

					<h2 style="background:#222d32" title="<?php echo $rsBranches[$i]['db_branchName'];?>" class="block bg-info"><div class="branch-logo"></div><?php echo "Branch - <strong>".$rsBranches[$i]['db_branchName']; 
					if($_SERVER['HTTP_HOST'] == 'localhost' || $_SERVER['HTTP_HOST'] == '192.168.2.105' || $_SERVER['HTTP_HOST'] == 'kalpeshpc' ){
						//echo " #[".$rsBranches[$i]['branchId']."]";
					}?>
				</strong>
				<span class="pull-right text-bold" id="ind-avg1-<?php echo $rsBranches[$i]['branchId'];?>" style="margin-left:13px;font-size: 18px;line-height: 2.3;"></span>
				<span class="pull-right text-bold" id="us-avg1-<?php echo $rsBranches[$i]['branchId'];?>" style="font-size: 18px;line-height: 2.3;" ></span>
			</h2>

		</a>

		<div class="inner-article">


			<?php 
			$rsIndustryData1 = $objDashboard->fetchIndustryData($rsBranches[$i]['branchId'],$IndustryID);

			$totalIndustry1 = $totalIndustry1 + count($rsIndustryData1);

			if(!empty($IndustryID)){
				$OrgName1 = 	$OrgName1.' > '.$rsIndustryData1[0]['db_industry'];
			}			

				//echo "count: ".count($rsIndustryData1);
					//echo "<pre>";
					//print_r($rsIndustryData);
					//echo "</pre>";
			if(count($rsIndustryData1) > 0) {

				$avgUS1 = 0;
				$avgInd1 = 0;						
				for($j=0; $j<count($rsIndustryData1); $j++) {

					if(!empty($BranchID)){
						$linkD1 = "brnid=".$BranchID."&indid=".$rsIndustryData1[$j]['IndId']."&FromDate={$FromDate}&ToDate={$ToDate}";	
					}
					else{
						$linkD1 = "brnid=".$rsBranches[$i]['branchId']."&indid=".$rsIndustryData1[$j]['IndId']."&FromDate={$FromDate}&ToDate={$ToDate}";
					}
					
					
					?>
					<div class="branch-icon branch-icon-<?php echo $j?>"></div>
					<p title="<?php echo $rsIndustryData1[$j]['db_industry'];?>" style="cursor:pointer;" onclick="javascript: window.location.href='dashboardma.html?data=<?php echo base64_encode($linkD1);?>'">  <?php echo $rsIndustryData1[$j]['db_industry'];

					if($_SERVER['HTTP_HOST']=='localhost' || $_SERVER['HTTP_HOST']=='kalpeshpc' || $_SERVER['HTTP_HOST']=='192.168.1.3' || $_SERVER['HTTP_HOST']=='192.168.1.5') 
					{ 
						//echo " [".$rsIndustryData[$j]['IndId']."] &nbsp; [".$rsIndustryData[$j]['db_IndLoginId']."]";
					} ?>

					<!-- code to calculate and set industry average -->

					<?php 
					$performanceINDArr1 = fetchRatingForCurrentIndustry($rsIndustryData1[$j]['IndId'],$rsBranches[$i]['branchId'],$rsOrgDetails[0]['OrgId'],'ind',$FromDate,$ToDate,$BranchID,$IndustryID); 

					$avgInd1 =  (float)$avgInd1 + (float)$performanceINDArr1['avgValueDB'];

					?>
					<span title="<?php echo $performanceINDArr1['avgValueDB'];?>" style="color:black;margin-left:24px; font-weight:bold;">
						<?php echo ($performanceINDArr1['avgValueDB']*100)/5 .'%';?>
					</span>
					
					<?php 
					$performanceArr1 = fetchRatingForCurrentIndustry($rsIndustryData1[$j]['IndId'],$rsBranches[$i]['branchId'],$rsOrgDetails[0]['OrgId'],'us',$FromDate,$ToDate,$BranchID,$IndustryID);
					$avgUS1 =  (float)$avgUS1 + (float)$performanceArr1['avgValueDB']; 

					?>                    
					<!-- code to calculate and set us average -->
					<span title="<?php echo $performanceArr1['avgValueDB'];?>" style="color:black; margin-left:24px; font-weight:bold;">
						<?php echo ($performanceArr1['avgValueDB']*100)/5 .'%';?>
					</span>
				</p>
				<?php 
						//echo "<pre>";
						//print_r($performanceArr);
						//echo "</pre>";

				$score1 = $score1 + $performanceArr1['score'];

				$performance1 = $performance1 + $performanceArr1['performance'];

				$performanceIND1 = $performanceIND1 + $performanceINDArr1['performance'];


						//echo "IND ID = ".$rsIndustryData[$j]['IndId'].", BRANCH ID = ".$rsBranches[$i]['branchId'].", ORG ID = ".$rsOrgDetails[0]['OrgId'];
						//echo "<br />";
				$days1 = "'".implode("','",$performanceArr1['days'])."'";
				$weeklyPerformanceFinalArr1['us'][] = $performanceArr1['weekly'];

				$avgLowRatingArr1 = fetchAvgLowRating("us",$rsBranches[$i]['branchId'],$rsIndustryData1[$j]['IndId'],$rsOrgDetails[0]['OrgId'],$FromDate,$ToDate); 



				$today_lowrating1 = $today_lowrating1 + $avgLowRatingArr1['today_lowrating'];
				$ove_lowrating1 = $ove_lowrating1 + $avgLowRatingArr1['ove_lowrating'];


						//$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'];

				$feddbackArr1  = fetchTotalFeedback("us",$rsBranches[$i]['branchId'],$rsIndustryData1[$j]['IndId'],$rsOrgDetails[0]['OrgId'],$FromDate,$ToDate);




						//echo "<pre>";
						//print_r($feddbackArr);
						//echo "</pre>";

				$totalFeedback1['count'] = $totalFeedback1['count'] + $feddbackArr1['count'];
				$totalFeedback1['guest_total'] = $totalFeedback1['guest_total'] + $feddbackArr1['guest_total'];
				$totalFeedback1['guest_count'] = $totalFeedback1['guest_count'] + $feddbackArr1['guest_count'];




				$totalCustomers1 = $totalCustomers1 + FetchCustomerData($rsBranches[$i]['branchId'],$rsIndustryData1[$j]['IndId'],$rsOrgDetails[0]['OrgId'],'N',$FromDate,$ToDate);
				$todaysCustomer1 = $todaysCustomer1 + FetchCustomerData($rsBranches[$i]['branchId'],$rsIndustryData1[$j]['IndId'],$rsOrgDetails[0]['OrgId'],'Y',$FromDate,$ToDate);

						//$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'];
				
			}



					//// NEW START 
			$score1 = $score1/$j;

			$performance1 = $performance1/$j;
					//$performance_ove = $performance;
			$performanceIND1 = $performanceIND1/$j;

					//if($performance != 0)
					//$performance = number_format((($performance * 100) / 4),2);
					//if($performanceIND != 0)
					//$performanceIND = number_format((($performanceIND * 100) / 4),2);


					//print_r($totalFeedback);

			$cntTotalFeedabck1 = $totalFeedback1['count'];

			$avgFeedback1 = number_format(($feddbackArr1['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($totalFeedback1['guest_total'] != 0 )
						$guestFeedback1 = number_format(($totalFeedback1['guest_count'] * 100 / $totalFeedback1['guest_total']),0);
					else
						$guestFeedback1 = 0;
					
					
					////// NEW END


				//////// OLD START
					$avgInd1  = number_format(($avgInd1/$j),2);
					if($avgInd1 <= 0) $avgInd1 = "0.00";
				//echo $avgUS;
					$avgUS1  = number_format(($avgUS1/$j),2);
					if($avgUS1 <= 0) $avgUS1 = "0.00";

					$avgUSTotal1 += $avgUS1;
					$avgINDTotal1 += $avgInd1;
				///////// OLD END

					?>
					<script>
						document.getElementById("ind-avg1-<?php echo $rsBranches[$i]['branchId'];?>").innerHTML = '<?php echo ($avgInd1*100)/5 .'%';?>';
						document.getElementById("us-avg1-<?php echo $rsBranches[$i]['branchId'];?>").innerHTML = '<?php echo ($avgUS1*100)/5 .'%';?>';
						$("#ind-avg1-<?php echo $rsBranches[$i]['branchId'];?>").attr("title","<?php echo ($avgInd1*100)/5 .'%';?>");
						$("#us-avg1-<?php echo $rsBranches[$i]['branchId'];?>").attr("title","<?php echo ($avgUS1*100)/5 .'%';?>");

					</script>
					<?php 
				}else{
					//echo "No Industry Found !";?>
					<span style="color:sky; margin-left:24px;">0.00</span>
					<?php
				}  
				
				$overAllAvg1['ind'] = $avgInd1;
				$overAllAvg1['us'] = $avgUS1;


					//echo $performance." # ".count($rsBranches);

				?>
			</div>
		</article>
	</div>
	<!--end per-->
<?php }

		// DIVIDE BY BRANCHES
$score = number_format(($score/count($rsBranches)),2);


$performance = number_format(($performance/count($rsBranches)),2);

$performanceIND = number_format(($performanceIND/count($rsBranches)),2);		


if($avgUSTotal == 0){
	$avgUSTotal = "0";
}else{
	$avgUSTotal = $avgUSTotal/count($rsBranches);
}

$avgUSTotal = number_format((($avgUSTotal/5) * 100),0) ;


$wpChart = array_sum($perforArr['us']);


				//echo "<pre>";
				//print_r($perforArr);
				//echo "</pre>";


?>
<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>

				<?php  // } // ?>


			</div>
		</div>

		<script>
			document.getElementById("avg-us-today").innerHTML = '<?php echo $performance;?>';
			$("#avg-us-today").attr("title","<?php echo $performance;?>");
			document.getElementById("avg-us-ove").innerHTML = '<?php echo $performanceIND;?>';
			$("#avg-us-ove").attr("title","<?php echo $performanceIND;?>");

			document.getElementById("avg-us-today1").innerHTML = '<?php echo ($performance*100)/5 .'%';?>';
			$("#avg-us-today1").attr("title","<?php echo $performance;?>");
			document.getElementById("avg-us-ove1").innerHTML = '<?php echo ($performanceIND*100)/5 .'%';?>';
			$("#avg-us-ove1").attr("title","<?php echo $performanceIND;?>");




					//document.getElementById("avg-us-today").innerHTML = '<?php echo $score;?>';
					//$("#avg-us-today").attr("title","<?php echo $score;?>");
					
					//document.getElementById("avg-us-ove").innerHTML = '<?php echo $performance_ove;?>';
					//$("#avg-us-ove").attr("title","<?php echo $performance_ove;?>");
					
					document.getElementById("avg_low_rating").innerHTML = '<?php echo $today_lowrating."/".$ove_lowrating;?>';
					$("#avg_low_rating").attr("title","<?php echo $today_lowrating;?>");
					
					//document.getElementById("avg_low_rating_ove").innerHTML = '<?php echo $ove_lowrating;?>';
					//$("#avg_low_rating_ove").attr("title","<?php echo $ove_lowrating;?>");
					
					//document.getElementById("total-feedback").innerHTML = '<?php echo $cntTotalFeedabck;?>';
					//$("#total-feedback").attr("title","<?php echo $totalFeedback;?>");
					
					document.getElementById("total-feedback-ove").innerHTML = '<?php echo $totalFeedback['guest_total'];?>';
					$("#total-feedback-ove").attr("title","<?php echo $totalFeedback['guest_total'];?>");
					
					document.getElementById("total-customer").innerHTML = '<?php echo $todaysCustomer;?>';
					$("#total-customer").attr("title","<?php echo $todaysCustomer;?>");
					
					document.getElementById("total-customer-ove").innerHTML = '<?php echo $totalCustomers;?>';
					$("#total-customer-ove").attr("title","<?php echo $totalCustomers;?>");
					
					document.getElementById("avg_low_rating1").innerHTML = '<?php echo $today_lowrating."/".$ove_lowrating;?>';
					$("#avg_low_rating1").attr("title","<?php echo $today_lowrating;?>");
					
					document.getElementById("total-feedback-ove1").innerHTML = '<?php echo $totalFeedback['guest_total'];?>';
					$("#total-feedback-ove1").attr("title","<?php echo $totalFeedback['guest_total'];?>");
					
					document.getElementById("total-customer1").innerHTML = '<?php echo $todaysCustomer;?>';
					$("#total-customer1").attr("title","<?php echo $todaysCustomer;?>");
					
					document.getElementById("total-customer-ove1").innerHTML = '<?php echo $totalCustomers;?>';
					$("#total-customer-ove1").attr("title","<?php echo $totalCustomers;?>");
					
					//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;?>%");
					
					document.getElementById("total-branch").innerHTML = '<?php echo count($rsBranches);?>';
					document.getElementById("total-branch1").innerHTML = '<?php echo count($rsBranches);?>';
					//$("#total-branch").attr("title","<?php echo count($rsBranches);?>");
					
					document.getElementById("total-inustry").innerHTML = '<?php echo $totalIndustry;?>';
					document.getElementById("total-inustry1").innerHTML = '<?php echo $totalIndustry;?>';
					//$("#total-inustry").attr("title","<?php echo $totalIndustry;?>");
				</script>
				<?php //echo count($rsBranches)." # ".$totalIndustry ?>
				 

			<?php if(!empty($BranchID)) {?>
				<div class="row col-md-12"><div>&nbsp;</div></div>	
				<div class="col-sm-12 avgNormal">
					<div class="row">
						<div class="col-lg-2 col-md-3 col-sm-4 col-xs-6">
							<article class="innerart">
								<a href="dashboardma.html?data=<?php echo base64_encode('atype=oa&'.$link);?>"><h3  <?php if($atype == 'oa') echo 'class="tree_one activate-new"'; ?>>Overall Average  <span class="down-arrow"></span></h3>

									<div class="maininner">
										<div class="newinner left <?php if($atype == 'oa') echo 'activate'; ?>">
											<p>Us</p>
											<span><?php echo $overAllAvg['us'];?></span>
										</div>
										<div class="newinner <?php if($atype == 'oa') echo 'activate'; ?>">
											<p>Industry</p>
											<span><?php echo $overAllAvg['ind'];?></span>
										</div>
									</div>
								</a>
							</article>
						</div>

						<div class="col-lg-2 col-md-3 col-sm-4 col-xs-6">
							<article class="innerart">
								<!--<a href="dashboardma.html?data=<?php echo base64_encode('atype=af&'.$link);?>">-->
									<h3 <?php if($atype == 'af') echo 'class="activate-new"'; ?> style="section.content.dashboardma-page article.innerart h3:hover {
										background: none;
										color: #222d32;
									}">Average Feedback  <span class="down-arrow"><img src="theme/black/images/down-arrow-a.png"></span></h3>
									<div class="maininner">
										<div class="newinner left <?php if($atype == 'af') echo 'activate'; ?>">
											<p>Us</p>
											<span><?php echo $objDashboard->fetchAvgFeedback("us",$BranchID,$IndustryID,$orgID);?></span>
										</div>
										<div class="newinner <?php if($atype == 'af') echo 'activate'; ?>">
											<p>Industry</p>
											<span><?php echo $objDashboard->fetchAvgFeedback("ind",$BranchID,$IndustryID,$orgID);?></span>
										</div>
									</div>

								</article>
							</div>
		    <!--<div class="col-lg-2 col-md-3 col-sm-4 col-xs-6">
        <article class="innerart">
              <a ui-sref="#"><h3>Average Tickets</h3></a>
              <div class="maininner">
              <div class="newinner ">
              <p>Us</p>
              <span>2.5</span>
              </div>
              <div class="newinner">
              <p>Industry</p>
              <span>2.5</span>
              </div>
              </div>
            </article>
        </div> -->
        <?php  
			// fetch total content details.
        $rsPagesDetails = $objDashboard->fetchContentDetails($BranchID,$IndustryID); 

        $averageLowRatingUS = $objDashboard->fetchAvgLowRating("us",$BranchID,$IndustryID,$orgID); 
				//$averageLowRatingUS = number_format($averageLowRatingUS / count($rsPagesDetails),2);

        $averageLowRatingIND = $objDashboard->fetchAvgLowRating("ind",$BranchID,$IndustryID,$orgID);
				//$averageLowRatingIND = number_format($averageLowRatingIND / count($rsPagesDetails),2);

        ?>

        <div class="col-lg-2 col-md-3 col-sm-4 col-xs-6">
        	<article class="innerart">
        		<!--<a href="dashboardma.html?data=<?php echo base64_encode('atype=alr&'.$link);?>">--->


        			<h3 <?php if($atype == 'alr') echo 'class="activate-new"'; ?>>Average Low Rating  <span class="down-arrow"><img src="theme/black/images/down-arrow-a.png"></span></h3>
        			<div class="maininner">
        				<div class="newinner left <?php if($atype == 'alr') echo 'activate'; ?>">
        					<p>Count</p>
        					<span><?php echo $averageLowRatingUS; ?></span>
        				</div>
        				<div class="newinner <?php if($atype == 'alr') echo 'activate'; ?>">
        					<p>Percentage</p>
        					<span><?php echo number_format(($today_lowrating *100)/ $ove_lowrating,2)."%"; //$averageLowRatingIND; ?></span>
        				</div>
        			</div>

        		</article>
        	</div>



        	<!--<div class="col-lg-2 col-md-3 col-sm-4 col-xs-6">
        <article class="innerart">
              <a ui-sref="#"><h3>Trouble Shooting</h3></a>
              <div class="maininner">
              <div class="newinner ">
              <p>Us</p>
              <span>2.5</span>
              </div>
              <div class="newinner">
              <p>Industry</p>
              <span>2.5</span>
              </div>
              </div>
            </article>
        </div> -->
        	<!--<div class="col-lg-2 col-md-3 col-sm-4 col-xs-6">
        <article class="innerart">
              <a ui-sref="#"><h3>Total</h3></a>
              <div class="maininner">
              <div class="newinner ">
              <p>Us</p>
              <span>2.5</span>
              </div>
              <div class="newinner">
              <p>Industry</p>
              <span>2.5</span>
              </div>
              </div>
            </article>
        </div> -->
    </div>


</div>  
<!--start per-->
<div class="col-sm-12 avgPer" style= "display:none;">
	<div class="row">
		<div class="col-lg-2 col-md-3 col-sm-4 col-xs-6">
			<article class="innerart">
				<a href="dashboardma.html?data=<?php echo base64_encode('atype=oa&'.$link);?>"><h3 <?php if($atype == 'oa') echo 'class="tree_one activate-new"'; ?>>Overall Average  <span class="down-arrow"><!--<img src="theme/black/images/down-arrow-a.png">--></span></h3>

					<div class="maininner">
						<div class="newinner left <?php if($atype == 'oa') echo 'activate'; ?>">
							<p>Us</p>
							<span><?php echo ($overAllAvg['us']*100)/5 .'%'; ?></span>
						</div>
						<div class="newinner <?php if($atype == 'oa') echo 'activate'; ?>">
							<p>Industry</p>
							<span><?php echo ($overAllAvg['ind']*100)/5 .'%';?></span>
						</div>
					</div>
				</a>
			</article>
		</div>

		<div class="col-lg-2 col-md-3 col-sm-4 col-xs-6">
			<article class="innerart">
				<!--<a href="dashboardma.html?data=<?php echo base64_encode('atype=af&'.$link);?>">-->
					<h3 <?php if($atype == 'af') echo 'class="activate-new"'; ?>>Average Feedback<span class="down-arrow">
						<img src="theme/black/images/down-arrow-a.png"></span></h3>
						<div class="maininner">
							<div class="newinner left <?php if($atype == 'af') echo 'activate'; ?>">
								<p>Us</p>
								<span><?php echo $objDashboard->fetchAvgFeedback("us",$BranchID,$IndustryID,$orgID);?></span>
							</div>
							<div class="newinner <?php if($atype == 'af') echo 'activate'; ?>">
								<p>Industry</p>
								<span><?php echo $objDashboard->fetchAvgFeedback("ind",$BranchID,$IndustryID,$orgID);?></span>
							</div>
						</div>

					</article>
				</div>

				<?php  
			// fetch total content details.
				$rsPagesDetails = $objDashboard->fetchContentDetails($BranchID,$IndustryID); 
				
				$averageLowRatingUS = $objDashboard->fetchAvgLowRating("us",$BranchID,$IndustryID,$orgID); 
				//$averageLowRatingUS = number_format($averageLowRatingUS / count($rsPagesDetails),2);
				
				$averageLowRatingIND = $objDashboard->fetchAvgLowRating("ind",$BranchID,$IndustryID,$orgID);
				//$averageLowRatingIND = number_format($averageLowRatingIND / count($rsPagesDetails),2);
				
				?>

				<div class="col-lg-2 col-md-3 col-sm-4 col-xs-6">
					<article class="innerart">
						<!--<a href="dashboardma.html?data=<?php echo base64_encode('atype=alr&'.$link);?>">--->


							<h3 <?php if($atype == 'alr') echo 'class="activate-new"'; ?>>Average Low Rating  <span class="down-arrow"><img src="theme/black/images/down-arrow-a.png"></span></h3>
							<div class="maininner">
								<div class="newinner left <?php if($atype == 'alr') echo 'activate'; ?>">
									<p>Count</p>
									<span><?php echo $averageLowRatingUS?></span>
								</div>
								<div class="newinner <?php if($atype == 'alr') echo 'activate'; ?>">
									<p>Percentage</p>
									<span><?php echo number_format(($today_lowrating * 100)/$ove_lowrating,2)."%";//($averageLowRatingIND*100)/4 .'%';?></span>
								</div>
							</div>

						</article>
					</div>

				</div>


			</div>
			<!--end per-->	

			<!-- FOR GRAPH STRAT -->
			<?php

			if(!empty($atype)){

				if($atype == 'oa'){
					$OrgName = $OrgName.' > Overall Average';
				}else if($atype == 'af'){
					$OrgName = $OrgName.' > Average Feedback';
				}else if($atype == 'alr'){
					$OrgName = $OrgName.' > Average Low Rating';
				}

			}

	//$finalAvgArr = $objDashboard->fetchGraphDetailsGeneral($atype,$orgID,$BranchID,$IndustryID);

	/*
	echo "<pre>";
	print_r($finalAvgArr);
	echo "</pre>";
	*/
	
	?>


	<!-- FOR GRAPH END -->

<?php } ?>

<?php
$link = $link."&atype=".$atype;

?>

<?php if(!empty($IndustryID)) {?>

	<!-- <div class="row col-md-12"><div>&nbsp;</div></div>--->
	<div class="next_line_box">
		<hr style="background: #4cbe4c; height: 3px; margin-bottom: 26px;
		margin-top:2px; width:100%;"> </hr>

		<div class="down_arrow"><img src="theme/black/images/down-arrow-a.png"></div>
	</div>
	<div class="col-sm-12 sub1Normal">
		<div class="row">

			<?php 
			$html = '';



				//echo "<pre>";
				//print_r($rsPagesDetails);
				//echo "</pre>";

			for($i=0; $i<count($rsPagesDetails); $i++) { 

				if(!empty($PageID) && $PageID==$rsPagesDetails[$i]['pageId']){
					$OrgName = 	$OrgName.' > '.$rsPagesDetails[$i]['db_pagename'];
				}
				


				$averageLowRatingUS1 = $objDashboard->fetchIndustryWiseAverage($atype,$orgID,$BranchID,$IndustryID,'us',$rsPagesDetails[$i]['pageId']); 
				//$averageLowRatingUS1 = number_format($averageLowRatingUS1 / count($rsPagesDetails),2);
				
				$averageLowRatingIND1 = $objDashboard->fetchIndustryWiseAverage($atype,$orgID,$BranchID,$IndustryID,'ind',$rsPagesDetails[$i]['pageId']);
				//$averageLowRatingIND1 = number_format($averageLowRatingIND1 / count($rsPagesDetails),2);
				
				
				?>
				<div class="col-lg-2 col-md-3 col-sm-4 col-xs-6">
					<article class="innerart">
						<a href="dashboardma.html?data=<?php echo base64_encode($link."&pgid=".$rsPagesDetails[$i]['pageId']); ?>" ><h3 class="tree_two <?php if($PageID==$rsPagesDetails[$i]['pageId']) echo 'activate-new'; ?>"><?php echo $rsPagesDetails[$i]['db_pagename']." ";
						if($_SERVER['HTTP_HOST'] == 'localhost' || $_SERVER['HTTP_HOST'] == '127.0.0.1' ){
							echo "[".$rsPagesDetails[$i]['pageId']."]";
						}

						?>   <span class="down-arrow"><img src="theme/black/images/down-arrow.png"></span></h3>
						<div class="maininner">
							<div class="newinner left <?php if($PageID==$rsPagesDetails[$i]['pageId']) echo 'activate'; ?>">
								<p>Us</p>
								<span><?php echo $averageLowRatingUS1;?></span>
							</div>
							<div class="newinner <?php if($PageID==$rsPagesDetails[$i]['pageId']) echo 'activate'; ?>">
								<p>Industry</p>
								<span><?php echo $averageLowRatingIND1;?></span>
							</div>
						</div>
					</a>
				</article>
			</div>


		<?php } 



		?> 
	</div>	
</div>
<!--start per-->
<div class="col-sm-12 sub1Per" style= "display:none;">
	<div class="row">

		<?php 
		$html = '';



				//echo "<pre>";
				//print_r($rsPagesDetails);
				//echo "</pre>";

		for($i=0; $i<count($rsPagesDetails); $i++) { 

			if(!empty($PageID) && $PageID==$rsPagesDetails[$i]['pageId']){
				$OrgName = 	$OrgName.' > '.$rsPagesDetails[$i]['db_pagename'];
			}

			$averageLowRatingUS1 = $objDashboard->fetchIndustryWiseAverage($atype,$orgID,$BranchID,$IndustryID,'us',$rsPagesDetails[$i]['pageId']); 
				//$averageLowRatingUS1 = number_format($averageLowRatingUS1 / count($rsPagesDetails),2);

			$averageLowRatingIND1 = $objDashboard->fetchIndustryWiseAverage($atype,$orgID,$BranchID,$IndustryID,'ind',$rsPagesDetails[$i]['pageId']);
				//$averageLowRatingIND1 = number_format($averageLowRatingIND1 / count($rsPagesDetails),2);


			?>
			<div class="col-lg-2 col-md-3 col-sm-4 col-xs-6">
				<article class="innerart">
					<a href="dashboardma.html?data=<?php echo base64_encode($link."&pgid=".$rsPagesDetails[$i]['pageId']); ?>" ><h3 class="tree_two <?php if($PageID==$rsPagesDetails[$i]['pageId']) echo 'activate-new'; ?>"><?php echo $rsPagesDetails[$i]['db_pagename']." ";
					if($_SERVER['HTTP_HOST'] == 'localhost' || $_SERVER['HTTP_HOST'] == '127.0.0.1' ){
						echo "[".$rsPagesDetails[$i]['pageId']."]";
					}

					?>   <span class="down-arrow"><img src="theme/black/images/down-arrow.png"></span></h3>
					<div class="maininner">
						<div class="newinner left <?php if($PageID==$rsPagesDetails[$i]['pageId']) echo 'activate'; ?>">
							<p>Us</p>
							<span><?php echo ($averageLowRatingUS1*100)/5 .'%';?></span>
						</div>
						<div class="newinner <?php if($PageID==$rsPagesDetails[$i]['pageId']) echo 'activate'; ?>">
							<p>Industry</p>
							<span><?php echo ($averageLowRatingIND1*100)/5 .'%';?></span>
						</div>
					</div>
				</a>
			</article>
		</div>


	<?php } 



	?> 
</div>	
</div>
<!--end per-->
<?php
if(!empty($PageID)){
	$SQL = "SELECT pageConId, db_pageConTitle FROM beatle_pagecontent WHERE db_pageid = ".$PageID;
	$rsPageContent = $objDB->sql_query($SQL);
	$link = $link."&pgid=".$PageID;
	?>

	<hr style="background:#4cbe4c; height:3px;margin-bottom: 26px;
	margin-top:2px; width:100%;"></hr>
	<!---<div class="row col-md-12"><div>&nbsp;</div></div>	---->
	<div class="col-sm-12 sub2Normal">
		<div class="row">

		<?php for($pgs=0; $pgs<count($rsPageContent); $pgs++){ 

				if(!empty($PageConID) && $PageConID == $rsPageContent[$pgs]['pageConId']){
					$OrgName = 	$OrgName.' > '.$rsPageContent[$pgs]['db_pageConTitle'];
				}

				?>
				<div class="col-lg-2 col-md-3 col-sm-4 col-xs-6">
					<article class="innerart">
						<a href="dashboardma.html?data=<?php echo base64_encode($link.'&pgcid='.$rsPageContent[$pgs]['pageConId'])?>" ><h3 class="tree_three <?php if($PageConID==$rsPageContent[$pgs]['pageConId']) echo 'activate-new'; ?>"><?php echo $rsPageContent[$pgs]['db_pageConTitle']." ";
						if($_SERVER['HTTP_HOST'] == 'localhost' || $_SERVER['HTTP_HOST'] == '127.0.0.1' ){
							echo " [".$rsPageContent[$pgs]['pageConId']."]";
						}
						?></h3>

						<div class="maininner">
							<div class="newinner left <?php if($PageConID==$rsPageContent[$pgs]['pageConId']) echo 'activate'; ?>">
								<p>Us </p>
								<span title="<?php echo $objDashboard->fetchIndustryWiseAverageName($objDashboard->fetchIndustryWiseAverage($atype,$orgID,$BranchID,$IndustryID,'us',$PageID,$rsPageContent[$pgs]['pageConId']),$rsPageContent[$pgs]['pageConId']) ?>"><?php echo $objDashboard->fetchIndustryWiseAverage($atype,$orgID,$BranchID,$IndustryID,'us',$PageID,$rsPageContent[$pgs]['pageConId'])?></span>
							</div>
							<div class="newinner <?php if($PageConID==$rsPageContent[$pgs]['pageConId']) echo 'activate'; ?>">
								<p>Industry</p>
								<span><?php echo $objDashboard->fetchIndustryWiseAverage($atype,$orgID,$BranchID,$IndustryID,'ind',$PageID,$rsPageContent[$pgs]['pageConId'])?></span>
							</div>
						</div>
					</a>
				</article>
			</div>

		<?php } ?>
	</div>
</div>	
<!--start per-->
<div class="col-sm-12 sub2Per" style= "display:none;">
	<div class="row">

		<?php					for($pgs=0; $pgs<count($rsPageContent); $pgs++){ 

			if(!empty($PageConID) && $PageConID == $rsPageContent[$pgs]['pageConId']){
				$OrgName = 	$OrgName.' > '.$rsPageContent[$pgs]['db_pageConTitle'];
			}

			?>
			<div class="col-lg-2 col-md-3 col-sm-4 col-xs-6">
				<article class="innerart">
					<a href="dashboardma.html?data=<?php echo base64_encode($link.'&pgcid='.$rsPageContent[$pgs]['pageConId'])?>" ><h3 class="tree_three <?php if($PageConID==$rsPageContent[$pgs]['pageConId']) echo 'activate-new'; ?>"><?php echo $rsPageContent[$pgs]['db_pageConTitle']." ";
					if($_SERVER['HTTP_HOST'] == 'localhost' || $_SERVER['HTTP_HOST'] == '127.0.0.1' ){
						echo " [".$rsPageContent[$pgs]['pageConId']."]";
					}
					?></h3>

					<div class="maininner">
						<div class="newinner left <?php if($PageConID==$rsPageContent[$pgs]['pageConId']) echo 'activate'; ?>">
							<p>Us</p>
							<span title="<?php echo $objDashboard->fetchIndustryWiseAverageName($objDashboard->fetchIndustryWiseAverage($atype,$orgID,$BranchID,$IndustryID,'us',$PageID,$rsPageContent[$pgs]['pageConId']),$rsPageContent[$pgs]['pageConId']) ?>"><?php echo ($objDashboard->fetchIndustryWiseAverage($atype,$orgID,$BranchID,$IndustryID,'us',$PageID,$rsPageContent[$pgs]['pageConId'])*100)/5 .'%';?></span>
						</div>
						<div class="newinner <?php if($PageConID==$rsPageContent[$pgs]['pageConId']) echo 'activate'; ?>">
							<p>Industry</p>
							<span><?php echo ($objDashboard->fetchIndustryWiseAverage($atype,$orgID,$BranchID,$IndustryID,'ind',$PageID,$rsPageContent[$pgs]['pageConId'])*100)/5 .'%';?></span>
						</div>
					</div>
				</a>
			</article>
		</div>

	<?php } ?>
</div>
</div>	
<!--end per-->				

<?php	} 
?>

<?php echo $html; 
} 

	//$finalAvgArr = $objDashboard->fetchGraphDetailsGeneral($atype,$orgID,$BranchID,$IndustryID,$PageID,$PageConID);

	///echo "<pre>";
	//print_r($finalAvgArr);
	//echo "</pre>";


?>
<div class="row">
	<div class="col-md-12">
		<div class="box box-solid">

		</div>
	</div>
</div>


<section class="content">
	<div class="row">
		<!-----filter-------->
<!-----
<div class="filter">

<div class="col-md-1"></div>

<div class="ft col-md-10">

<dl class="dropdown col-md-4">
  
    <dt>
    <a href="#">
      <span class="hida">Select</span>    
      <p class="multiSel"></p>  
    </a>
    </dt>
  
    <dd>
        <div class="mutliSelect" >
            <ul style="display:none;">
			
			  <li>
                    <input type="checkbox" value="All" id="checkAll" >Select All</li>
                
                <li>
                    <input type="checkbox" class="checkItem" value="prahlad nagar" />prahlad nagar</li>
                <li>
                    <input type="checkbox" class="checkItem" value="iscon" />iscon</li>
                <li>
                    <input type="checkbox" class="checkItem" value="Bhuyangdev" />Bhuyangdev</li>
                <li>
                    <input type="checkbox" class="checkItem" value="Sola" />Sola</li>
                <li>
                    <input type="checkbox" class="checkItem" value="Vatyrapur" />Vatyrapur</li>
                <li>
                    <input type="checkbox" class="checkItem" value="Sivrajani" />Sivrajani</li>
					<li>
                    <input type="checkbox" class="checkItem" value="syamal" />syamal</li>
                <li>
                    <input type="checkbox" class="checkItem" value="nahrunagar" />nahrunagar</li>
                <li>
                    <input type="checkbox" class="checkItem" value="panchavati" />panchavati</li>
                <li>
                    <input type="checkbox" class="checkItem" value="Motera" />Motera</li>
               
               
            </ul>
        </div>
    </dd>
	
</dl>




<dl class="col-md-4 graph-filter">
<select class="form-control input-md ind_flt " id="state_list" name="Industrys" >
                                            <option value="0"> Select Industry </option> 
                                                                                        <option value="13">Gym Prahladnagar</option>
                                            
                                                                                        <option value="12">Restaurant</option>
                                            
</select>

</dl>

<dl class="col-md-2">
										<button>Filter</button>
										</dl>										
										
</div>

<div class="col-md-1"></div>
</div>
------------>
<!----// filter-------->
<div class="col-md-12 no-padding performance_chart">
	<!-- AREA CHART -->

	<div class=" chart-top ">
		<div class="box-header with-border">
			<h3 class="box-title">Overall Performance<?php //echo " FromDate=".$objDashboard->FromDate."&ToDate=".$objDashboard->ToDate."&atype=".$atype."&pgid=".$PageID."&pgcid=".$PageConID."&brnid=".$BranchID."&indid=".$IndustryID."&orgid=".$orgID; ?></h3>


		</div>
		<div class="box-body chart-bottom">
			<div class="chart">

				<!---  <canvas id="areaChart" style="height:250px"></canvas>-->
				<!---- <div style="width: 100%; height: 300px; background-color: #32373a; box-shadow: 3px 3px 3px #ccc" id="chart-container-30"></div>---->
				<!---<div class="chart-tooltip"><canvas id="cvs" width="1200" height="250"  style="background-color: #32373a;">[No canvas support]</canvas></div> --->
				<?php
			//echo $objDashboard->data."##";
			//if(empty($objDashboard->data)){
				$lnkiFrame = "acn=fetchGraphiFrame&FromDate=".$objDashboard->FromDate."&ToDate=".$objDashboard->ToDate."&atype=".$atype."&pgid=".$PageID."&pgcid=".$PageConID."&brnid=".$BranchID."&indid=".$IndustryID."&orgid=".$orgID;
			//}
				?>
				<iframe src="<?php echo SERVER_ROOT;?>runajax.php?<?php echo $lnkiFrame; ?>" height="350" width="100%" sandbox="allow-same-origin allow-scripts allow-forms" scrolling="no" style="overflow: scroll;"></iframe>





			</div>
		</div>
		<!-- /.box-body -->
	</div>
	<!-- /.box -->
</div>

</div>
<!-- /.row -->

</section>


</div>
</div>











</section>

<?php if(fetchPercentageViewCheckedData() == "checked"){
	echo "<script>
	$(document).ready(function(){
		$('.percentageaa').show();
		$('.normal').hide();
		$('.avgPer').show();
		$('.avgNormal').hide();
		$('.sub1Per').show();
		$('.sub1Normal').hide();
		$('.sub2Per').show();
		$('.sub2Normal').hide();
		$('.sub3Per').show();
		$('.sub3Normal').hide();
	});
	</script>";
}else{
	echo "<script>
	$(document).ready(function(){
		$('.percentageaa').hide();
		$('.normal').show();
		$('.avgPer').hide();
		$('.avgNormal').show();
		$('.sub1Per').hide();
		$('.sub1Normal').show();
		$('.sub2Per').hide();
		$('.sub2Normal').show();
		$('.sub3Per').hide();
		$('.sub3Normal').show();
	});
	</script>";
}?>

</div>
   


<script>
	document.getElementById("org-name").innerHTML = '<?php echo $OrgName;?>';
</script>


<script>
	$(window).load(function(e) {


	// Get context with jQuery - using jQuery's .get() method.
	var areaChartCanvas = $("#areaChart").get(0).getContext("2d");
    // This will get the first returned node in the jQuery collection.
    var areaChart = new Chart(areaChartCanvas);

    var areaChartData = {
    	labels: [<?php echo implode(",",$finalAvgArr[0]); ?>],
    	datasets: [
    	{
    		label: "US",
    		fillColor: "#178000",
    		strokeColor: "#178000",
    		pointColor: "#178000",
    		pointStrokeColor: "#178000",
    		pointHighlightFill: "#FFF",
    		pointHighlightStroke: "#178000",


    		data: [<?php echo implode(",",$finalAvgArr[2]); ?>]
    	},
    	{
    		label: "IND",
    		fillColor: "#ff0000",
    		strokeColor: "#ff0000",
    		pointColor: "#ff0000",
    		pointStrokeColor: "#ff0000",
    		pointHighlightFill: "#FFF",
    		pointHighlightStroke: "#ff0000",

    		data: [<?php echo implode(",",$finalAvgArr[1]); ?>]
    	}
    	]
    };

    var areaChartOptions = {
      //Boolean - If we should show the scale at all
      showScale: true,
      //Boolean - Whether grid lines are shown across the chart
      scaleShowGridLines: true,
      //String - Colour of the grid lines
      scaleGridLineColor: "#DDD",
      //Number - Width of the grid lines
      scaleGridLineWidth: 1,
      //Boolean - Whether to show horizontal lines (except X axis)
      scaleShowHorizontalLines: true,
      //Boolean - Whether to show vertical lines (except Y axis)
      scaleShowVerticalLines: true,
      //Boolean - Whether the line is curved between points
      bezierCurve: true,
      //Number - Tension of the bezier curve between points
      bezierCurveTension: 0.3,
      //Boolean - Whether to show a dot for each point
      pointDot: true,
      //Number - Radius of each point dot in pixels
      pointDotRadius: 4,
      //Number - Pixel width of point dot stroke
      pointDotStrokeWidth: 1,
      //Number - amount extra to add to the radius to cater for hit detection outside the drawn point
      pointHitDetectionRadius: 20,
      //Boolean - Whether to show a stroke for datasets
      datasetStroke: true,
      //Number - Pixel width of dataset stroke
      datasetStrokeWidth: 2,
      //Boolean - Whether to fill the dataset with a color
      datasetFill: false,








      
	  //String - A legend template
	  
	  legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].lineColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>", 
	  
      //Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
      maintainAspectRatio: true,
      //Boolean - whether to make the chart responsive to window resizing
      responsive: true
  };

    //Create the line chart
    areaChart.Line(areaChartData, areaChartOptions);









    /* ChartJS
     * -------
     * Here we will create a few charts using ChartJS
     */

    //--------------
    //- AREA CHART -
    //--------------



});

</script>






<!--

 <script>
    new RGraph.SVG.Line({
        id: 'chart-container-30',
        data:  [
           
            [<?php echo implode(",",$finalAvgArr[2]); ?>],
			 [<?php echo implode(",",$finalAvgArr[1]); ?>]
        ],
		       
   options: {
            hmargin: 0,
			 textColor: 'white',
            gutterLeft: 30,
            gutterRight:40,
            gutterBottom: 50,
			gutterTop: 20,
            linewidth: 3,
			 yaxis: false,
            xaxis: false,
			//yaxisUnitsPost: 'm',
            //yaxisUnitsPre: '$',
			tickmarksStyle: 'circle',
			tickmarksFill: 'black',
			spline: true,
            tickmarksLinewidth: 2,
            tickmarksSize: 3,
            backgroundGridVlinesCount: 11,
            colors: ['#dff022','#fff'],
			
            filled: false,
            filledOpacity: 0.15,
			textSize: 10,
			//filledColors: ['rgba(25,51,74,0.75)'],
            xaxisLabels: [<?php echo implode(",",$finalAvgArr[0]); ?>  ],
            title: '',
            titleSize: 12
        }
    }).trace();
</script>
	
-->

   <!--
   
   <script>
    window.onload = function ()
    {
        var dataset1 =  [<?php echo implode(",",$finalAvgArr[2]); ?>];
        var dataset2 =  [<?php echo implode(",",$finalAvgArr[1]); ?>];
		
		


        var line = new RGraph.Line({
            id: 'cvs',
            data: [dataset1, dataset2],
            options: {
                spline: true,
                linewidth: 3,
                hmargin: 5,
                labels: [<?php echo implode(",",$finalAvgArr[0]); ?>  ],
                tooltips: ['Mon','Tue','Wed','Thu','Fri','Sat','Sun','Mon','Tue','Wed','Thu','Fri','Sat','Mon','Tue','Wed','Thu','Fri','Sat','Sun','Mon','Tue','Wed','Thu','Fri','Sat','Mon','Tue','Wed','Thu','Fri','Sat',
				'11','12','13','14','15','16','17','11','12','13','14','15','16','11','12','13','14','15','16','15','16','11','12','13','14','15','16','15','16' ],
                tickmarks: 'circle',
                ticksize: 5,
				 textColor: 'white',
				 textColor: 'white',
				 axisColor: 'white',
                 colors: ['#dff022','#fff'],
				  titleSize: 12,
				  textSize: 7,
                textAccessible: true
            }
        }).trace2();
    };
</script>-->





<!---filter--start--->
<script>

	$('#checkAll').click(function () {    
		$(':checkbox.checkItem').prop('checked', this.checked);    
	});
</script>
<script>


	$(".dropdown dt a").on('click', function() {
		$(".dropdown dd ul").slideToggle('fast');
	});

	$(".dropdown dd ul li a").on('click', function() {
		$(".dropdown dd ul").hide();
	});

	function getSelectedValue(id) {
		return $("#" + id).find("dt a span.value").html();
	}

	$(document).bind('click', function(e) {
		var $clicked = $(e.target);
		if (!$clicked.parents().hasClass("dropdown")) $(".dropdown dd ul").hide();
	});

	$('.mutliSelect input[type="checkbox"]').on('click', function() {

		var title = $(this).closest('.mutliSelect').find('input[type="checkbox"]').val(),
		title = $(this).val() + ",";

		if ($(this).is(':checked')) {
			var html = '<span title="' + title + '">' + title + '</span>';
			$('.multiSel').append(html);
			$(".hida").hide();
		} else {
			$('span[title="' + title + '"]').remove();
			var ret = $(".hida");
			$('.dropdown dt a').append(ret);

		}
	});


</script>
<!---filter--end-->
<script>

	$(document).ready(function(){
		$('[data-toggle="popover"]').popover();   
	});
</script>



<!------------------------------------------------------------------------------>


<style>

.head-article { background-color: #fff;padding-bottom: 15px;width: 100%;margin: 0 auto; }
.inner-article{border-left: 2px solid #23b7e5;margin-left: 15px;	}
.head-article p {font-size: 15px;color: #1c2a33;margin: 0;margin-top: 10px;margin-left: 10px;margin-right: 10px;}
.head-article .datespan {float: none;text-align: right;display: block;margin-right: 15px;	}
.head-article span {float: right;}
.head-article h2 {	width: 100%;color: #fff; padding: 12px 10px 5px; font-size: 20px;}
.bg-info {color: #dcf2f8;background-color: #23b7e5;}
	
.innerart {text-align: center;background-color: #3c8dbc;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;}
.innerart h3 
{font-size: 18px;padding: 7px 0;margin: 0;	font-weight: 400;color: #fff;border-top-left-radius: 5px;border-top-right-radius: 5px;}
.maininner {display: inline-block;width: 100%;}
.maininner > .newinner > .activate {background-color: #36bc01;} 
.newinner {float: left;background-color: #D9EDF7;width: 50%;border: 5px solid #fff;border-bottom: none;border-left: none;}
.newinner p {font-size: 16px;margin: 0;}
.newinner span {font-size: 20px;color: #000;}
.newinner:last-child {	border-right: none;}
.newinner.activate {background-color: #96bcdd;color:#000;}
.activate-new{background-color: #042a4b !important;}
button#hide img {width: 39px;}
button#hide {background: none;border: none;}
.select2-container--default.select2-container--focus .select2-selection--multiple{border:1px solid !important;}
.connectedSortable{min-height:inherit !important;}
iframe{border:0;}
button[data-widget="remove"] {display:none;}

canvas {
	-moz-user-select: none;
	-webkit-user-select: none;
	-ms-user-select: none;
}
	</style>