<style>

body{

      background: #f1f1f1;

}

.ulp-flot {

    width: 100%;

    height: 300px;

}

.ulp-green-box{

  background-color: #1fb5ac !important;

  color: #fff;

}

</style>

<div class="ulp-dashboard-title">

		Ultimate Learning Pro -	<span class="second-text"><?php _e('Dashboard Overall', 'ulp');?></span>

</div>

<div style="width: 97%;">

    <div class="row">

      	<div class="col-xs-3">

      		<div class="ulp-dashboard-top-box ulp-dashboard-students-top-box">

      			<i class="fa-ulp fa-dashboard-students-ulp"></i>

      			<div class="stats">

      				<h4><?php echo $data['total_students'];?></h4>

      				<?php _e('Total Students', 'ulp');?>

      			</div>

      		</div>

      	</div>



      	<div class="col-xs-3">

      		<div class="ulp-dashboard-top-box ulp-dashboard-instructors-top-box">

      			<i class="fa-ulp fa-dashboard-instructors-ulp"></i>

      			<div class="stats">

      				<h4><?php echo $data['total_instructors'];?></h4>

      				<?php _e('Total Instructors', 'ulp');?>

            </div>

      		</div>

      	</div>



      	<div class="col-xs-3">

      		<div class="ulp-dashboard-top-box ulp-dashboard-earnings-top-box">

      			<i class="fa-ulp fa-dashboard-earnings-ulp"></i>

      			<div class="stats">

      				<h4><?php echo $data ['total_earnings'];?></h4>

      				<?php _e('Total Earnings', 'ulp');?>

            </div>

      		</div>

      	</div>



      	<div class="col-xs-3">

      		<div class="ulp-dashboard-top-box ulp-dashboard-course-top-box">

      			<i class="fa-ulp fa-dashboard-top-course-ulp"></i>

      			<div class="stats">

      				<h4 style="font-size: 16px;"><?php echo $data['top_course'];?></h4>

              <?php _e('Top course', 'ulp');?>

            </div>

      		</div>

       	</div>

    </div>



    <div class="row-fluid" style="height: 380px;">



      <div class="col-xs-12">

        <div class="ulp-dashboard-top-box">

            <div><?php _e('Total Students per Course', 'ulp');?></div>

          <?php if ($data ['student_per_course']): ?>

            <div id="ulp-chart-1" class='ulp-flot'></div>

          <?php else :?>

            <div><h3><?php _e('Not enough data available.', 'ulp');?></h3></div>

          <?php endif;?>

        </div>

      </div>



    </div>



    <div class="row">

      <div class="col-xs-6">

        <div class="ulp-dashboard-top-box ulp-green-box">

            <h3><?php _e('Last 5 enrolled students', 'ulp');?></h3>

            <?php if ($data ['last_five_enrolled_students']):?>

                <ol>

                <?php foreach ($data ['last_five_enrolled_students'] as $object):?>

                    <li>

                        <strong><?php echo $object->user_login . ' @'. $object->user_email . '';?></strong>

                        <div><?php echo __('Register on ', 'ulp') . ulp_print_date_like_wp($object->user_registered);?></div>

                    </li>

                <?php endforeach;?>

                </ol>

            <?php else:?>

                <?php _e('No students yet!', 'ulp');?>

            <?php endif;?>

        </div>

      </div>

      <div class="col-xs-6">

        <div class="ulp-dashboard-top-box">

            <h3><?php _e('Last 5 orders', 'ulp');?></h3>

            <?php if ($data ['last_five_orders']):?>

                <ol>

                <?php foreach ($data ['last_five_orders'] as $object):?>

                    <li>

                        <strong><?php echo $object->user;?></strong>

                        <div><?php echo __('Payment on ', 'ulp') . ulp_print_date_like_wp($object->post_date);?></div>

                    </li>

                <?php endforeach;?>

                </ol>

            <?php else:?>

                <?php _e('No orders yet!', 'ulp');?>

            <?php endif;?>

        </div>

      </div>

    </div>



</div>

<script>

<?php if ($data ['student_per_course']):?>

  if (jQuery("#ulp-chart-1").length > 0) {

    var ulp_ticks = [];

    var ulp_chart_stats = [];

  <?php

  $i = 0;

  foreach ($data ['student_per_course'] as $k=>$v){

    echo 'ulp_ticks['.$i.']=['.$i.', "'.$k.'"];';

    echo 'ulp_chart_stats['.$i.']={0:'.$i.',1:'.$v.'};';

    $i++;

  }

  if (count($data ['student_per_course'])<10){

    for($j=count($data ['student_per_course']);$j<11;$j++){

    echo 'ulp_ticks['.$i.']=['.$i.', ""];';

    echo 'ulp_chart_stats['.$i.']={0:'.$i.',1:0};';

    $i++;

    }

  }

  ?>

  var options = {

      bars: { show: true, barWidth: 0.75, fillColor: '#7ebffc', lineWidth: 0 },

      grid: { hoverable: false, backgroundColor: "#fff", minBorderMargin: 0,  borderWidth: {top: 0, right: 0, bottom: 1, left: 1}, borderColor: "#aaa" },

      xaxis: { ticks: ulp_ticks, tickLength:0 },

      yaxis: { tickDecimals: 0, tickColor: "#eee"},

      legend: {

          show: true,

          position: "ne",

          }

      };

    jQuery.plot(jQuery("#ulp-chart-1"), [ {

      color: "#669ccf",

      data: ulp_chart_stats,

    } ], options

    );

  }



<?php endif;?>



</script>


<?php
