<?php

class dashboard {

    var $counter = 0;
    var $limit = 10;
    var $param = array();
    var $configObj;
    var $dbObj;
    var $height = "overflow:auto";

    function dashboard($configObj) {
        $this->configObj = $configObj;
        $this->dbObj = $configObj->glDbObj;
    }

   

  
     function get_newzletter() {
       $sql = "SELECT *,DATE_FORMAT(dt_createdate,'".DEFAULT_DATEFORMAT."') as Date,time(dt_createdate) as Time,var_email,int_glcode from " . DB_PREFIX . "newsletterleads WHERE chr_delete = 'N' order by int_glcode desc limit 0,5 ";
        $rs = $this->configObj->glDbObj->query($sql);
        return $rs;
    }
    
    function get_pagehitsdata() {
        $sql = "SELECT  int_pagehits ,var_pagename  FROM " . DB_PREFIX . "pages where chr_delete='N' order  by int_pagehits desc limit 0,5";
        $data = $this->configObj->glDbObj->query($sql);
        return $data;
    }
    
    function Countnewzlettersdata() {
      $sql = "SELECT  count(1) as total  FROM " . DB_PREFIX . "newsletterleads where chr_delete = 'N'";
      $rs = $this->configObj->glDbObj->get_sql_row($sql);
     return $rs['total'];
    }

  
    
      function Countcontacthitsdata() {
        $sql = "SELECT  count(1) as total  FROM " . DB_PREFIX . "contactdetails where chr_delete = 'N'";
        $rs = $this->configObj->glDbObj->get_sql_row($sql);
        return $rs['total'];
    }
    
     function countBookdata() {
        $sql = "SELECT  count(1) as total  FROM " . DB_PREFIX . "appointmentleads where chr_delete = 'N'";
        $rs = $this->configObj->glDbObj->get_sql_row($sql);
        return $rs['total'];
    }
    
    function get_Bookdata() {
       $sql = "SELECT *,DATE_FORMAT(dt_createdate,'".DEFAULT_DATEFORMAT."') as Date,time(dt_createdate) as Time,var_email,int_glcode from " . DB_PREFIX . "appointmentleads WHERE chr_delete = 'N' order by int_glcode desc limit 0,5 ";
        $rs = $this->configObj->glDbObj->query($sql);
        return $rs;
    }

    function get_contacthitsdata() {
        $sql = "SELECT DATE_FORMAT(dt_createddate,'".DEFAULT_DATEFORMAT."') as Date,int_glcode,time(dt_createddate) as Time,var_email,var_name from " . DB_PREFIX . "contactdetails where chr_delete='N' order  by int_glcode desc limit 0,5";
        $data = $this->configObj->glDbObj->query($sql);
        return $data;
    }


}

?>