class-zvc-admin-reports.php
2.52 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php
/**
* Class Reports
*
* @author Deepen
* @since 2.0.0
*/
class Zoom_Video_Conferencing_Reports {
private static $instance;
public function __construct() {
}
static function getInstance() {
if ( null === static::$instance ) {
static::$instance = new static();
}
return static::$instance;
}
/**
* Zoom Rerports View
*
* @since 1.0.0
* @changes in CodeBase
* @author Deepen Bajracharya <dpen.connectify@gmail.com>
*/
public static function zoom_reports() {
wp_enqueue_script( 'jquery-ui-datepicker' );
wp_enqueue_script( 'video-conferencing-with-zoom-api-js' );
$active_tab = isset( $_GET['tab'] ) ? $_GET['tab'] : 'zoom_daily_report';
//Get Template
require_once ZVC_PLUGIN_VIEWS_PATH . '/live/tpl-reports.php';
}
/**
* Generate daily report
*
* @author Deepen
* @return array|bool|mixed|null|object|string
*/
public function get_daily_report_html() {
$return_result = false;
$months = array(
1 => 'January',
2 => 'February',
3 => 'March',
4 => 'April',
5 => 'May',
6 => 'June',
7 => 'July',
8 => 'August',
9 => 'September',
10 => 'October',
11 => 'November',
12 => 'December'
);
if ( isset( $_POST['zoom_check_month_year'] ) ) {
$zoom_monthyear = $_POST['zoom_month_year'];
if ( $zoom_monthyear == null || $zoom_monthyear == "" ) {
$return_result = __( "Date field cannot be Empty !!", "video-conferencing-with-zoom-api" );
} else {
$exploded_data = explode( ' ', $zoom_monthyear );
foreach ( $months as $key => $month ) {
if ( $exploded_data[0] == $month ) {
$month_int = $key;
}
}
$year = $exploded_data[1];
$result = zoom_conference()->getDailyReport( $month_int, $year );
$return_result = json_decode( $result );
}
}
return $return_result;
}
/**
* Generate Account Report
*
* @author Deepen
* @return array|mixed|null|object|string
*/
public function get_account_report_html() {
$return_result = false;
if ( isset( $_POST['zoom_account_from'] ) && isset( $_POST['zoom_account_to'] ) ) {
$zoom_account_from = $_POST['zoom_account_from'];
$zoom_account_to = $_POST['zoom_account_to'];
if ( $zoom_account_from == null || $zoom_account_to == null ) {
$return_result = __( "The fields cannot be Empty !!", "video-conferencing-with-zoom-api" );
} else {
$result = zoom_conference()->getAccountReport( $zoom_account_from, $zoom_account_to );
$return_result = json_decode( $result );
}
}
return $return_result;
}
}