forked from grimelinse/FOS-Streaming
-
Notifications
You must be signed in to change notification settings - Fork 0
/
streams.php
84 lines (64 loc) · 1.82 KB
/
streams.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
include('config.php');
logincheck();
$message = [];
$title = "All Streams";
if (isset($_GET['start'])){
start_stream($_GET['start']);
$message['type'] = "success";
$message['message'] = "stream started";
} else if (isset($_GET['stop'])) {
stop_stream($_GET['stop']);
$message['type'] = "success";
$message['message'] = "stream stopped";
}
if(isset($_GET['delete'])) {
$stream = Stream::find($_GET['delete']);
$stream->delete();
$message['type'] = "success";
$message['message'] = "Stream deleted";
}
if(isset($_POST['mass_delete'])) {
if (isset($_POST['mselect'])) {
foreach($_POST['mselect'] as $streamids) {
$stream = Stream::find($streamids);
$stream->delete();
}
}
$message['type'] = "success";
$message['message'] = "Streams deleted";
}
if(isset($_POST['mass_start'])) {
if (isset($_POST['mselect'])) {
foreach($_POST['mselect'] as $streamids) {
start_stream($streamids);
}
}
$message['type'] = "success";
$message['message'] = "Streams started";
}
if(isset($_POST['mass_stop'])) {
if (isset($_POST['mselect'])) {
foreach($_POST['mselect'] as $streamids) {
stop_stream($streamids);
}
}
$message['type'] = "success";
$message['message'] = "Streams stopped";
}
if (isset($_GET['running']) && $_GET['running'] == 1) {
$title = "Running Streams";
$stream = Stream::where('status', '=', 1)->get();
}
else if (isset($_GET['running']) && $_GET['running'] == 2) {
$title = "Stopped Streams";
$stream = Stream::where('status', '=', 2)->get();
} else {
$stream = Stream::all();
}
echo $template->view()->make('streams')
->with('streams', $stream)
->with('message', $message)
->with('title', $title)
->render();
?>