-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathservice_controller.php
61 lines (54 loc) · 1.27 KB
/
service_controller.php
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
53
54
55
56
57
58
59
60
61
<?php
/**
* Service_controller class
*
* @package munkireport
* @author AvB
**/
class Service_controller extends Module_controller
{
public function __construct()
{
$this->module_path = dirname(__FILE__) .'/';
$this->view_path = $this->module_path . 'views/';
}
/**
* Default method
*
* @author AvB
**/
public function index()
{
echo "You've loaded the service report module!";
}
/**
* Show detail information
*
* @author AvB
**/
public function show()
{
if (! $this->authorized()) {
redirect('auth/login');
}
$data['scripts'] = array("clients/client_list.js");
$data['page'] = '';
$obj = new View();
$obj->view('services', $data, $this->view_path);
}
/**
* Retrieve data in json format
*
* @return void
* @author
**/
public function get_data($serial_number = '')
{
$obj = new View();
if (! $this->authorized()) {
$obj->view('json', array('msg' => 'Not authorized'));
}
$service = new Service_model;
$obj->view('json', array('msg' => $service->retrieve_records($serial_number)));
}
} // END class Service_controller