1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Dashboard extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
$this->load->model('Dashboard_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url('Login'));
}
}
public function index() {
$template['page'] = 'Dashboard/Dashboard';
$template['page_desc'] = "Control Panel";
$template['page_title'] = "Dashboard";
$template['bookingCount'] = $this->Dashboard_model->getBookingCount();
$template['shopCount'] = $this->Dashboard_model->getMechShpCount();
$template['completeBukngCnt'] = $this->Dashboard_model->getCompletedBookingCount();
$template['pendingBukngCnt'] = $this->Dashboard_model->getPendingBookingCount();
$template['mobileVendors'] = $this->Dashboard_model->getMbleVndrsCount();
$template['mobileMechanics'] = $this->Dashboard_model->getMbleMchnsCount();
$template['customerCount'] = $this->Dashboard_model->getCustomerCount();
$template['productCount'] = $this->Dashboard_model->getProductCount();
$template['productSold'] = $this->Dashboard_model->getProductSoldCount();
$this->load->view('template',$template);
}
public function getOrderSalesReportCount(){
$result = $this->Dashboard_model->getSalesReportCount();
if(count($result) > 0){
echo $result;
}else{
echo 1;
}
}
public function getBookingReportCount(){
$result = $this->Dashboard_model->getBookingReportCount();
if(count($result) > 0){
echo $result;
}else{
echo 1;
}
}
}
?>