  	
	<html>
	 <style type="text/css">
    .nodata{
          padding-top: 100px;
    padding-left: 400px;
    padding-bottom: 100px;
    }

   </style>
		
    
    <script src="https://charts.iscripts.com/ChartJs/chart.js"></script>

<!--     <script src="<?php echo BASE_URL; ?>public/js/library/app.js" type="text/javascript"></script>
 -->		<body>	


      
			<div class="comm_div">
				<div class="comm_content_block">
					<h3>Site Hit Rate</h3>

					<div class="comm_content_block_items">
                                        <!-- <?php
                                        //$this->graph->renderchart();
                                        ////graph::renderchart(); 
                                        ?>
                                          -->
             


<?php if(isset($this->noVisits)){ ?>
             <div>
              <p class="nodata">No data to display.</p>
             </div> 
<?php }else{
    
     if($this->arrSize==1){

      $label_dat = $this->datarrLbl[0];
      $data_val  = $this->datarrVal[0];
      $label_dat = array(" ",$label_dat," ");
      
      $label_dat = '"'.implode('","', $label_dat).'"';
     
      $data_val  = array(NaN,$data_val,NaN);
      $data_val  = implode(',',$data_val);
      

    }else{
     $label_dat = $this->labels;
     $data_val = $this->values;

    }

  ?>
              <canvas id= "myChartd" height=250 width=500> </canvas>      
<?php } ?>
                                           
					</div>
				</div>
			</div>

			<div class="comm_div">
				<div class="home_block1">
					<div class="comm_content_block">
          <h3 style="text-transform: capitalize;">Latest Ads</h3>
					<div class="comm_content_block_items">
						<table class="list_table" cellpadding="0" cellspacing="1" border="0" width="100%">

						<tr>
						<th align="center" valign="top" width="10%">#</th>
               <?php
                  for($i=0;$i<sizeof($this->listFields)-1;$i++)
                       {
                        echo '<th align="left" valign="top" width="70%" >'.substr($this->listFields[$i],0,30).'</th>';
                       }
                                               
                 ?>
						</tr>
                <?php
                         $counter=1;
                         foreach($this->listArray as $lArray)
                          {
                 ?>
						<tr class="row_color1">
						<td align="center" valign="top"><?php echo $counter++;?></td>
						<td align="left" valign="top"><a target="_blank" href="<?php echo ConfigUrl::base();?>index/viewlisting/<?php echo $lArray->nBusId; ?>/"><?php echo $lArray->Title; ?></a></td>
                                              
						</tr>
                                                <?php } ?>

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

				<div class="home_block2">
					<div class="comm_content_block">
					<h3 style="text-transform: capitalize;">Top Categories</h3>
					<div class="comm_content_block_items">
					<table class="list_table" cellpadding="0" cellspacing="1" border="0" width="100%">

						<tr>
						<th align="center" valign="top" width="10%"># </th>
						<th align="left" valign="top" width="60%" >Title</th>
						<th align="center" valign="top" width="30%">No. of Listings</th>
						</tr>
                                                <?php
                                                $counter =1;
                                                foreach ($this->catArray as $cat)
                                                {

                                                ?>
                                                <tr class="row_color1">
						<td align="center" valign="top"><?php echo $counter++; ?></td>
						<td align="left" valign="top"><a target="_blank" href="<?php echo ConfigUrl::base('default');?>index/listing/<?php echo $cat->nCategoryId; ?>"><?php echo $cat->vCategoryDesc; ?></a></td>
						<td align="center" valign="top"><?php echo $cat->count; ?></td>
						</tr>
                                                <?php } ?>
						</table>
					</div>
				</div>

				</div>
			<div class="clear"></div>
			</div>
		</body>
</html>
<script type="text/javascript">


var ctx1 = document.getElementById('myChartd').getContext('2d');

var myChart = new Chart(ctx1, {
     type: 'line',
     
    data: {
        labels: [<?php echo $label_dat; ?>],
       // labels: ["uu","ll","uu","ll","uu","ll","uu","ll"],
        datasets: [{
           
           data: [<?php echo $data_val; ?>],
           // data: [2,3,5,6,9,8,5,8],
            label: "Visits",
            lineTension: 0.3,
            fill: false,
            borderColor: '#007790',
            backgroundColor: 'transparent',
           // pointBorderColor: 'red',
            pointBackgroundColor: '#007790',
            pointRadius: 1,
            pointHoverRadius: 5,
            pointHitRadius: 8,
            pointBorderWidth: 2,
            pointStyle: 'circle',
           
            borderWidth: 1
        }]
    },
     options: {

      title: {
            display: true,
            text: 'User Visit Statistics'
        },
        layout: {
            padding: {
                left: 20,
                right: 0,
                top: 30,
                bottom: 0
            }
        },
        legend: {

      display: false,
      position: 'bottom',
      labels: {
       
       usePointStyle: true,
           
      }
      },
        // tooltips: {
        //      mode: 'dataset'
        // },
         tooltips: {
      mode: 'index',
      intersect: false
   },
   hover: {
      mode: 'index',
      intersect: false
   },
        scales: {
            yAxes: [{
                ticks: {
                    beginAtZero:true
                },
                scaleLabel: {
        display: true,
        labelString: "Count",
        fontColor:'black'
      }
            }],
            xAxes: [{
                 scaleLabel: {
        display: true,
        labelString: 'Last 6 Months',
        fontColor:'black'
      }

            }]
        }
    }
});

</script>