File: /home/barbeatleanalyti/public_html/manage.beatleanalytics.com/site/template/cusers.php
<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
$objCustomer = object;
// Assing object
$objCustomer = $objDB->objController;
// Assign all variable's value
$pg = $objCustomer->pg;
$acn = $objCustomer->acn;
$v = $objCustomer->v;
$State = $objCustomer->State;
$ReligionName = $objCustomer->ReligionName;
$sort = $objCustomer->sort;
$ReligionID = $objCustomer->ReligionID;
$field = $objCustomer->field;
$error = $objCustomer->error;
$msg = $objCustomer->msg;
$perpage = $objCustomer->perpage;
$start = $objCustomer->start;
$limit = $objCustomer->limit;
$SearchValue = $objCustomer->SearchValue;
$s = $objCustomer->s;
$CustomerID = $objCustomer->CustomerID;
$SurveyID = $objCustomer->SurveyID;
$TokenID = $objCustomer->TokenID;
$OrgID = $objCustomer->OrgID;
$BranchID = $objCustomer->BranchID;
$IndustryID = $objCustomer->IndustryID;
$FromDate = $objCustomer->FromDate;
$ToDate = $objCustomer->ToDate;
$rsCustomerInfo = $objCustomer->FetchCustomerData("All");
if($start == 1)
$limit = 0;
else if($start == 2)
$limit = $perpage;
else
$limit = ($start-1) * $perpage;
$objCustomer->limit = $limit;
$nume = count($rsCustomerInfo);
$totalpage = @ceil(count($rsCustomerInfo)/$perpage);
$rsCustomerInfo = $objCustomer->FetchCustomerData();
if($sort == '0'){
$sort = '1';
}
else{
$sort = '0';
}
$link = "";
if( $start != "" && $start != 0 ){
$link .= "&start={$start}";
}
if( $perpage != "" && $perpage != 0 ){
$link .= "&perpage={$perpage}";
}
if(trim($s) != ""){
$link .= "&s={$s}";
}
?>
<div class="content-wrapper">
<?php
if( strtolower($v)=='add'|| strtolower($v)=='edit')
{
if( strtolower($v)=='edit'){}
?>
<section class="content-header">
<?php if(strtolower($v) == 'add'){ ?>
<h1><i class="fa fa-plus-square"></i> Add new religions</h1>
<ol class="breadcrumb">
<li><a href="index.html"><i class="fa fa-home"></i> Home</a></li>
<li><a href="cusers.html?v=add"><i class="fa fa-external-link"></i>Other</a></li>
<li><a href="cusers.html?v=add"><i class="fa fa-tree"></i>Religions</a></li>
<li class="active">Add new Religions</li>
</ol>
<?php }else if(strtolower($v) == 'edit'){ ?>
<h1><i class="fa fa-edit"></i> Edit religions</h1>
<ol class="breadcrumb">
<li><a href="index.html"><i class="fa fa-home"></i> Home</a></li>
<li><a href="cusers.html?v=add"><i class="fa fa-external-link"></i>Other</a></li>
<li><a href="cusers.html?v=add"><i class="fa fa-tree"></i>Religions</a></li>
<li class="active">Edit Religions</li>
</ol>
<?php } ?>
</section>
<div class="col-md-12">
<?php
// Error or success message display
$objDB->NotificaitonForResult($msg,$error)
?>
</div>
<section class="content">
<div class="row">
<div class="col-md-12">
<div class="box box-primary">
<div class="box-header">
<div class="col-md-12 col-xs-12 no-padding">
<div class="form-group col-md-1 col-xs-3 pull-left no-padding">
<a class="btn btn-info btn-sm" href="cusers.html"> <i class="fa fa-long-arrow-left"></i> Back </a>
</div>
<form action="manage.php" name="frmLogin" method="post" onSubmit="javascript: return ValidateForm(this);" >
<input type="hidden" name="pg" value="users" id="pg"/>
<?php
if( strtolower($v) == 'edit' ){ ?>
<input type="hidden" name="acn" value="EditReligionData" id="acn"/>
<input type="hidden" name="v" value="Edit" id="v"/>
<input type="hidden" name="ReligionID" value="<?php echo $ReligionID?>" id="ReligionID"/>
<? }else if( strtolower($v) == 'add' ){ ?>
<input type="hidden" name="acn" value="AddUserInfo" id="acn"/>
<input type="hidden" name="v" value="add" id="v"/>
<? }else{ ?>
<? }
?>
<div class="row">
<div class="col-md-12 col-xs-12 col-sm-12 no-padding">
<label class="col-md-4 col-sm-4 control-label text-sm-left text-xl-right text-md-right">Name of Religion<span class="text-red">*</span> :</label>
<div class="col-md-5 col-xs-12 col-sm-5 form-group">
<input type="text" re-required="true" id="Religion" name="ReligionName" placeholder="Religion Name (required)" class="form-control" value="<?php echo $ReligionName?>" >
<div class="error-div" id="err-EmpID"> </div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 col-xs-12 col-sm-12 no-padding">
<label class="col-md-4 col-sm-4 control-label text-sm-left text-xl-right text-md-right">Is Active :</label>
<div class="col-md-3 col-sm-3 col-xs-12 form-group">
<label class="control-label"><input type="radio" re-required="true" id="IsActive" name="IsActive" checked="checked" <?php if($ReligionActive == 'Y') echo 'checked="checked"';?> value="Y" > Yes</label>
<label class="control-label"><input type="radio" re-required="true" id="IsActive" name="IsActive" value="N" > No</label>
</div>
</div>
</div>
<div id="captcha" class="row">
<div class="col-md-12 col-sm-12 no-padding">
<div class="col-md-8 col-md-offset-4 col-sm-8 col-sm-offset-4">
<input class="btn bg-navy" type="submit" value="<?php echo ucfirst($v); ?> Now" />
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</section>
<?php
}
else if($v=='list'){ ?>
<section class="content-header">
<?php if(strtolower($v) == 'list'){?>
<?php if(empty($CustomerID)) {?>
<h1> Records list</h1>
<ol class="breadcrumb">
<li><a href="index.html"><i class="fa fa-home"></i> Home</a></li>
<li class="active">Record list</li>
</ol>
<?php }else{ ?>
<h1> Record details </h1>
<ol class="breadcrumb">
<li><a href="index.html"><i class="fa fa-home"></i> Home</a></li>
<li><a href="cusers.html?v=list"><i class="fa fa-user"></i> Record</a></li>
<li class="active">Details</li>
</ol>
<?php } ?>
<?php } ?>
</section>
<?php
// Error or success message display
$objDB->NotificaitonForResult($msg,$error);
$back = 'dashboardma.html';
if(isset($objCustomer->back) && !empty($objCustomer->back)){
$back = $objCustomer->back.'.html?v=list&back=tab_3';
}
?>
<section class="content">
<div class="row">
<div class="col-md-12">
<div class="box box-primary" style="border:none; border-top:2px solid #3c8dbc;">
<div class="box-header">
<div class="col-md-12 col-xs-12 no-padding">
<?php if(empty($CustomerID) && empty($SurveyID)) {?>
<div class="row search-filter">
<div class="col-md-12">
<form name="frmSearch" id="frmSearch" action="cusers.html?pg=cusers&acn=FetchCustomerData&v=list" method="post" enctype="multipart/form-data">
<div class="row col-md-12 search">
<div class="col-md-2 col-xs-6 form-group" style="margin: 0px;">
<input type="text" readonly="readonly" id="FromDate" name="FromDate" placeholder="Start date.." class="form-control input-md" value="<?php echo $objCustomer->fdate;?>">
</div>
<div class="col-md-2 col-xs-6 form-group"style="margin: 0px;">
<input type="text" readonly="readonly" id="ToDate" name="ToDate" placeholder="End date.." class="form-control input-md" value="<?php echo $objCustomer->tdate;?>">
</div>
<?php $rsOrganization = $objCustomer->fetchOrganization(); ?>
<div class="col-md-2 col-xs-6 form-group" style="margin: 0px;">
<!-- onchange="javascript: getBranchData(this.value)" -->
<select class="form-control input-md" id="org_list" name="Organization">
<option value="0">Select Organization</option>
<?php if(count($rsOrganization) > 0) { for($b=0; $b<count($rsOrganization); $b++) { ?>
<option <?php if($objCustomer->orgid === $rsOrganization[$b]['OrgId']) echo 'selected="selected"'; ?> value="<?php echo $rsOrganization[$b]['OrgId']?>"><?php echo $rsOrganization[$b]['db_Orgname']?></option>
<?php }
}else{ ?>
<option value="0">No any org. found</option>
<?php } ?>
</select>
</div>
<?php $rsBranches = $objCustomer->fetchBranches(); ?>
<div class="col-md-2 col-xs-6 form-group" style="margin: 0px;">
<select class="form-control input-md" name="branch" id="branch">
<option value="0"> Select Location </option>
<?php if(count($rsBranches) > 0) { for($b=0; $b<count($rsBranches); $b++) { ?>
<option <?php if($objCustomer->brnid === $rsBranches[$b]['branchId']) echo 'selected="selected"'; ?> value="<?php echo $rsBranches[$b]['branchId']?>"><?php echo $rsBranches[$b]['db_branchName']?></option>
<?php }
}else{ ?>
<option value="0">No any location found</option>
<?php } ?>
</select>
</div>
<!--// type equal to industry -->
<?php $rsIndustrys = $objCustomer->fetchIndustrys($OrgID,$BranchID,$IndustryID); ?>
<div class="col-md-2 col-xs-6 form-group" style="margin: 0px;">
<select class="form-control input-md" onchange="javascript: getBranchData(this.value)" name="industry" id="industry">
<option value="0"> Select Type <!-- type --> </option>
<?php if(count($rsIndustrys) > 0) { for($b=0; $b<count($rsIndustrys); $b++) { ?>
<option <?php if($objCustomer->indid === $rsIndustrys[$b]['IndId']) echo 'selected="selected"'; ?> value="<?php echo $rsIndustrys[$b]['IndId']?>"><?php echo $rsIndustrys[$b]['db_industry']?></option>
<?php }
}else{ ?>
<option value="0">No any type found</option>
<?php } ?>
</select>
</div>
<div class="col-md-1 col-xs-6 form-group" style="margin: 0px;">
<input type="submit" class="btn btn-sm btn-danger pull-left text-left filter-visit " value="Search"/>
</div>
<div class="col-md-1 col-xs-6 form-group" style="margin: 0px;">
<a href="" class="btn btn-sm btn-success pull-left text-left filter-visit ">Reset</a>
</div>
</div>
</form>
</div>
</div>
<div class="row">
<div class="col-md-12">
<!-- Custom Tabs -->
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
<li <?php if($objCustomer->tab == 'tab_1') echo 'class="active"';?>><a href="#tab_1" data-toggle="tab"><span class="glyphicon glyphicon-file"></span> My Visits</a></li>
<li <?php if($objCustomer->tab == 'tab_2') echo 'class="active"';?>><a href="#tab_2" data-toggle="tab"> <span class="glyphicon glyphicon-shopping-cart" style="margin-right: 10px;"></span>My orders</a></li>
</ul>
<div class="tab-content" style="padding:3px;">
<div class="tab-pane <?php if($objCustomer->tab == 'tab_1') echo 'active';?>" id="tab_1">
<p><?php
if(count($rsCustomerInfo) > 0 ) {
//echo pagination_log($s,$perpage,$start,$nume,$totalpage,$pg,$v);
}
?>
<div class="col-md-12 no-padding">
<div class="table-responsive">
<table class="table table-striped table-bordered table-fixed ">
<thead>
<tr class=" table-heder">
<th class="col-sm-3 text-center">Date</th>
<th class="col-sm-2 text-center">Organization</th>
<th class="col-sm-3 text-center">Location</th>
<th class="col-sm-2 text-center">Type</th>
<th class="col-sm-2 text-center">Rating</th>
</tr>
</thead>
<tbody>
<?php
//print_r($_SESSION);
//echo "<pre>";
//print_r($rsCustomerInfo);
//echo "</pre>";
if(count($rsCustomerInfo)>0){
if(!empty($FromDate))
$lnk = "&FromDate=".$FromDate;
if(!empty($ToDate))
$lnk .= "&ToDate=".$ToDate;
for ($i=0;$i< count($rsCustomerInfo);$i++)
{
if($i%2)
$bgclass='altrow';
else
$bgclass='oddrow';
?>
<tr class="<?php echo $bgclass;?>" >
<td class="col-sm-3 text-center"><?php echo date("d/m/Y H:i A",strtotime($rsCustomerInfo[$i]['created_date'])); ?></td>
<td class="col-sm-2 text-center"><?php echo $objCustomer->FetchOrganizationName($rsCustomerInfo[$i]['orgid']); ?></td>
<td class="col-sm-3 text-center"><?php echo $objCustomer->FetchBranchName($rsCustomerInfo[$i]['db_surveyBranchid']); ?></td>
<td class="col-sm-2 text-center"><?php echo $objCustomer->FetchIndustryName($rsCustomerInfo[$i]['db_surveyIndId']); ?></td>
<td class="col-sm-2 text-center rating-cust"><a href='cusers.html?back=profilenew&v=list&cid=<?php echo $rsCustomerInfo[$i]['db_surveyUserid']."&tid=".$rsCustomerInfo[$i]['tokenid']."&Industrys=".$rsCustomerInfo[$i]['db_surveyIndId'].$lnk;?>'><?php echo $objCustomer->fetchCustomerRating($rsCustomerInfo[$i]['db_surveyUserid'],$rsCustomerInfo[$i]['tokenid']); ?></a></td>
</tr>
<?php }
}else{
?>
<tr class="altrow" > <td colspan="6" align="center"> No any record found. </td> </tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<?php
if(count($rsCustomerInfo) > 0 ) {
//echo pagination_log($s,$perpage,$start,$nume,$totalpage,$pg,$v);
}
?></p>
<span> </span>
</div>
<!-- /.tab-pane -->
<div class="tab-pane <?php if($objCustomer->tab == 'tab_2') echo 'active';?>" id="tab_2">
<div class="row">
<?php
$rsOrderData = $objCustomer->fetchOrderDetails();
if(count($rsOrderData) > 0 ) {
//echo pagination_log($s,$perpage,$start,$nume,$totalpage,$pg,$v);
}
?>
<div class="col-md-12">
<div class="table-responsive">
<table class="table table-striped table-bordered">
<tbody>
<tr>
<th class="text-center">Order ID</th>
<th class="text-center">Product Name</th>
<th class="text-center">Image</th>
<th class="text-center">Quantity</th>
<th class="text-center">Status</th>
<th class="text-center">Created Date</th>
</tr>
<?php
//print_r($_SESSION);
//echo "<pre>";
//print_r($rsCustomerInfo);
//echo "</pre>";
if(count($rsOrderData)>0){
for ($i=0;$i< count($rsOrderData);$i++)
{
if($i%2)
$bgclass='altrow';
else
$bgclass='oddrow';
?>
<tr class="<?php echo $bgclass;?>" >
<td class="text-center"><label name="Organization Name"><?php echo $rsOrderData[$i]['orderuid']; ?></label></td>
<td class="text-center"><label name="Branch Name"><?php echo $rsOrderData[$i]['productname']; ?></label></td>
<td class="text-center">
<?php
$SQL = "SELECT prod_image FROM beatle_products WHERE productid = ".$rsOrderData[$i]['productid'];
$rsProdImage = $objDB->sql_query($SQL);
if($_SERVER['HTTP_HOST']=='localhost' || $_SERVER['HTTP_HOST']=='kalpeshpc' ) {
echo '<img height="50" width="50" src="http://'.$_SERVER['HTTP_HOST'].'/newdemo.beatleanalytics.com/assets/products/'.$rsProdImage[0]['prod_image'].'">';
}else{
if(SUBDOMAIN_NAME == 'owner'){
echo '<img height="50" width="50" src="http://newdemo.beatleanalytics.com/assets/products/'.$rsProdImage[0]['prod_image'].'">';
}else if(SUBDOMAIN_NAME == 'manage'){
echo '<img height="50" width="50" src="http://manage.beatleanalytics.com/assets/products/'.$rsProdImage[0]['prod_image'].'">';
}
}
?>
</td>
<td class="text-center"><label name="Date"><?php echo $rsOrderData[$i]['quantity']; ?></label></td>
<td class="text-center"><label name="Date"><?php echo $rsOrderData[$i]['status']; ?></label></td>
<td class="text-center"><label name="Date"><?php echo date("d/m/Y H:i A",strtotime($rsOrderData[$i]['created_date'])); ?></label></td>
</tr>
<?php }
}else{
?>
<tr class="altrow" > <td colspan="10" align="center"> No any data found. </td> </tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<?php
if(count($rsCustomerInfo) > 0 ) {
//echo pagination_log($s,$perpage,$start,$nume,$totalpage,$pg,$v);
}
?>
</div>
</div>
<!-- /.tab-pane -->
</div>
<!-- /.tab-content -->
</div>
<!-- nav-tabs-custom -->
</div>
</div>
<?php } else{ ?>
<style>
.main-title {
background: #f6f8f8;
}
.main-sub {
background: #fff;
color: BLACK;
}
.box {
border: 1px solid #DDD;
}
.box-body.box-profile IMG {
FLOAT: LEFT;
}
.box-body.main-sub.box-spt{
margin-right: 5px;
}
.title-box {
background: #8c8585;
padding: 6px 10px;
border-radius: 9px;
color: white;
margin: 11px 5px;
}
.row.col-md-3.spt {
margin-top: 15px;
}
h3.box-title.title-box {
margin-bottom: 7px;
}
.box.box-primary {
background: #fffcf7;
}
.panel-body {
padding: 0PX !important;
}
.panel-body {
MARGIN: 0PX;
PADDING: 0PX;
}
table.table.table-bordered TD {
WIDTH: 71PX;
}
table.table.table-bordered td {
margin: 0px !IMPORTANT;
padding: 0px;
}
.box-body.main-sub .panel-body p {
margin: 0px;
}
.box-body.main-sub .panel-body {
margin-bottom: 7px;
}
.bg-success {
color: #c6efd0;
background-color: #27c24c;
}
.box.retings {
border: 1pxsolid #DDD;
float: left;
}
.row.col-lg-4.col-md-6.spt SPAN {
BORDER-RADIUS: 3PX !important;
}
.box-body.main-sub.box-spt {
padding: 0px !IMPORTANT;
}
p.widthp {
width: 70%;
}
p.widthp {
MARGIN: 0 0 6px 0;
}
p.widthp {
FONT-FAMILY: "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #58666e;
}
body.sidebar-mini.skin-blue.pace-done{ color: #58666e;}
.box-header.rating-title.main-title H3 {
FONT-WEIGHT: 700;
FONT-SIZE: 17PX;
}
.panel-body P {
FONT-SIZE: 15PX !important;
FONT-FAMILY: "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.row.col-lg-4.col-md-6.spt {
PADDING: 30px;
}
.row.col-md-3.spt {
width: 33.33%;
}
h3.box-title.title-box {
background: #7266ba !IMPORTANT;
}
.row.col-md-3.spt span {
border-radius: 3px;
}
h3.box-title.title-box {
background: #7266ba !IMPORTANT;
border-radius: 3px;
FONT-SIZE: 12PX;
FONT-WEIGHT: 700 !important;
}
.row.col-md-3.spt {
padding: 0 45px;
}
body.ng-scope {
font-family: "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif !IMPORTANT;
font-size: 14px;
-webkit-font-smoothing: antialiased !IMPORTANT;
line-height: 1.42857143 !IMPORTANT;;
color: #58666e !IMPORTANT;
}
.col-md-12.MAIN-PART-retings {
WIDTH: 98%;
MARGIN: 0 AUTO;
FLOAT: NONE;
}
.content-wrapper {
MIN-HEIGHT: 1101px!important;
}
</style>
<div class="row">
<div class="col-md-12">
<form method="post" action="cusers.html" name="frmSearch" id="frmSearch">
<input type="hidden" name="start" id="start" value="<?php echo $start?>" />
<input type="hidden" name="perpage" id="perpage" value="<?php echo $perpage?>" />
<input type="hidden" name="cid" id="cid" value="<?php echo $CustomerID?>" />
<div class="col-md-1 col-xs-3 col-sm-2 pull-left form-group no-padding ">
<a class="btn btn-info btn-sm" href="<?php echo $back;?>"> <i class="fa fa-long-arrow-left"></i> Back </a>
</div>
<div class="col-md-6 col-xs-6 form-group text-bold" style="margin-top:-15px;">
<h3 style="color:green;"><?php echo date("d/m/Y H:i A (l)",strtotime($rsCustomerInfo[0]['created_date']));?></h3>
<!--<input type="text" readonly="readonly" style="background:#fff;" id="FromDate" name="FromDate" placeholder="Start date.." class="form-control input-md" value="<?php echo $FromDate;?>"> -->
</div>
<!--<div class="col-md-1 col-xs-6 form-group">
<input type="text" readonly="readonly" style="background:#fff;" id="ToDate" name="ToDate" placeholder="End date.." class="form-control input-md" value="<?php echo $ToDate;?>">
</div> -->
<!--<div class="col-md-1 col-xs-12">
<div class="input-group input-group-sm">
<!--<input type="text" id="s" name="s" placeholder="Search content here .." class="form-control" value=""> -->
<!-- <span class="input-group-btn">
<button class="btn btn-block btn-success btn-md no-padding" type="submit"><i class="fa fa-search" aria-hidden="true"></i> Go!</button>
</span>
</div>
</div> -->
<div class="col-md-1 col-xs-3 col-sm-2 pull-right text-right form-group no-padding">
<a class="btn btn-sm btn-danger " href="cusers.html"> <i class="fa fa-refresh"></i> Reset </a>
</div>
<!--<div class="col-md-2 col-xs-6 col-sm-4 form-group "><a class="btn btn-sm btn-success col-xs-12" href="cusers.html?v=add"> <i class="fa fa-plus"></i> Add Religions </a>
</div> -->
</form>
</div>
</div>
<div class="row">
<div class="col-md-12 MAIN-PART-retings">
<!--<div class="col-lg-5 col-md-6 col-sm-12">
<div class="box-body box-profile">
<img class="profile-user-img img-responsive img-circle" src="theme/black/images/blank_man.png" alt="User profile picture">
<h3 class="profile-username text-center"> Welcome</h3>
<h3 class="profile-username text-center"><i class="fa fa-mobile-phone" style="font-size:25px;" aria-hidden="true"></i> <?php echo $rsCustomerInfo[0]['db_phone'];?></h3>
</div>
</div> -->
<div class="col-lg-6 col-md-6 col-sm-12">
<div class="box" style="min-height:170px !important;">
<div class="box-header rating-title main-title">
<h3 class="box-title"><i class="fa fa-hand-o-right" aria-hidden="true"></i> Q & A </h3>
</div>
<?php
$rsQuestionData = $objCustomer->fetchContentDetails($CustomerID,'question');
?>
<div class="box-body main-sub">
<div class="panel-body">
<?php if(count($rsQuestionData) > 0) {
for($i=0; $i<count($rsQuestionData); $i++) { ?>
<p><?php echo $objCustomer->SelectPageContentName($rsQuestionData[$i]['db_surveyContentId']);?> : <strong><?php echo $rsQuestionData[$i]['db_surveyValue'];?></strong></p>
<?php }
} else{ ?>
<p>No any data found.</p>
<?php }?>
</div>
</div>
<!-- /.box-body -->
</div>
</div>
<?php $rsSummeray = $objCustomer->fetchContentAboutISay($CustomerID); ?>
<div class="col-lg-6 col-md-6 col-sm-12">
<div class="box" style="min-height:170px !important;">
<div class="box-header rating-title main-title">
<h3 class="box-title"> <i class="fa fa-hand-o-right" aria-hidden="true"></i> <?php echo $rsSummeray[0]; ?> </h3>
</div>
<div class="box-body main-sub">
<div class="slimScrollDiv">
<div class="media">
<?php echo $rsSummeray[1];?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 MAIN-PART-retings">
<div class="box retings">
<div class="box-header main-title">
<h3 class="box-title"><i class="fa fa-share fa-fw m-r-xs" aria-hidden="true"></i> Ratings</h3><br>
</div>
<!-- /.box-header -->
<?php
$rsContentData = $objCustomer->fetchContentDetails($CustomerID,'content');
//$rsQA = $objCustomer->fetchCustomersQA($CustomerID,'question',$rsPages[0]['PageIDS']);
if(!empty($rsContentData[0]['PageIDS']))
$ContentArr = explode(',',$rsContentData[0]['PageIDS']);
else $ContentArr = array();
if(count($ContentArr ) > 0) {
for($i=0; $i<count($ContentArr); $i++) {
?>
<div class="row col-lg-4 col-md-6 spt">
<h3 class="box-title title-box"><?php echo $pname = $objCustomer->SelectPageName($ContentArr[$i]);?></h3>
<span id="rating-<?php echo $pname;?>" class="badge"></span>
<div class="box-body">
<?php
$rsPageCon = $objCustomer->fetchCustomersQA($CustomerID,'content',$ContentArr[$i]);
if(count($rsPageCon) > 0) {
$avgSum = 0;
for($j=0; $j<count($rsPageCon); $j++ ) {
$avgSum = $avgSum + $rsPageCon[$j]['db_surveyValue'];
?>
<div class="box-body main-sub box-spt ">
<p class=" widthp"><?php echo $objCustomer->SelectPageContentName($rsPageCon[$j]['db_surveyContentId']);?>
<strong>
<span class="badge bg-<?php if($rsPageCon[$j]['db_surveyValue'] <= 2) echo 'red'; else echo 'green';?> pull-right"><?php echo $rsPageCon[$j]['db_surveyValue'];?></span>
</strong>
</p>
</div>
<?php }
$avgSum = round($avgSum/$j,2); ?>
<script>
var avgSum = '<?php echo $avgSum;?>';
document.getElementById("rating-<?php echo $pname?>").innerHTML = '<?php echo $avgSum;?>';
if( parseFloat(avgSum) <= 2){
$("#rating-<?php echo $pname?>").addClass("bg-red");
}else{
$("#rating-<?php echo $pname?>").addClass("bg-green");
}
</script>
<?php }else{ ?>
No any data found.
<?php }
?>
</div>
</div>
<?php }
}else {
echo "No any data found";
} ?>
<!-- /.box-body -->
</div>
</div>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
<? } ?>
</section>
</div>