forked from gaza1994/SHOUTcast-Manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
notices.php
76 lines (64 loc) · 2.8 KB
/
notices.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
<?php
/*
* @author: Scottish Borders Design
* @script: SBD SHOUTcast Manager
* @function: Notices
* @website: http://scottishbordersdesign.co.uk/
*/
if (isset($_GET['edit'])) {
include ('header.php');
if (useraccess($_SESSION['username']) < "5") {
include ('header.php');
die('<div class="alert alert-danger alert-dismissable"><i class="fa fa-check"></i><button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><b>Error!</b> ACCESS DENIED - YOU DO NOT HAVE ACCESS TO NOTICE EDITOR</div>');
}
if (isset($_POST['removestring'])) {
$buildstring = "";
file_put_contents('notice.html', $buildstring);
echo '<div class="alert alert-success alert-dismissable">
<i class="fa fa-check"></i>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<b>Success!</b> Notice has been deleted. Use this form to enable it again.
</div>';
}
if (isset($_POST['issubmit'])) {
$titleofstring = $_POST['messagetitle'];
$contentstring = $_POST['messagecontent'];
$buildstring = "<div class='alert alert-info alert-dismissable'><i class='fa fa-info'></i><button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button><b>{$titleofstring}</b><br /> {$contentstring}</div>";
file_put_contents('notice.html', $buildstring);
echo '<div class="alert alert-success alert-dismissable">
<i class="fa fa-check"></i>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<b>Success!</b> Notice has been updated.
</div>';
}
$noticecontent = file_get_contents('notice.html');
?>
<form action="" method="post">
<div class="box-body">
<div class="form-group">
<h3>Preview</h3>
<?php echo $noticecontent; ?>
</div>
<div class="form-group">
<label for="messageTitle">Notice Title</label>
<input type="text" name="messagetitle" class="form-control" id="messageTitle" placeholder="Enter Title">
</div>
<div class="form-group">
<label>Notice Content</label>
<textarea class="form-control textarea" rows="8" name="messagecontent" placeholder="Your Notice ..."></textarea>
</div>
<div class="box-footer">
<button type="submit" name="issubmit" class="btn btn-primary">Submit</button>
<button type="submit" name="removestring" class="btn btn-primary">Remove Notice</button>
</div>
</div>
</form>
<script src="<?php echo $config['web_addr']; ?>/js/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js" type="text/javascript"></script>
<?php
include ('footer.php');
exit();
} else {
$notices = file_get_contents('notice.html');
echo ($notices);
}
?>