forked from cj13579/tvmonkey
-
Notifications
You must be signed in to change notification settings - Fork 0
/
edit_tvmon.php
101 lines (95 loc) · 2.76 KB
/
edit_tvmon.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
session_start() ;
if(isset($_SESSION['myusername']))
{
}
else
{
header("location:main_login.php");
}
?>
<script>
function showonlyone(thechosenone) {
$('div[name|="newboxes"]').each(function(index) {
if ($(this).attr("id") == thechosenone) {
$(this).show(200);
}
else {
$(this).hide(600);
}
});
}
</script>
<html>
<head>
<title>TVMonkey Web Interface</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div id="container">
<div id="logo">
<h1><span class="blue">TV</span>Monkey</h1>
</div>
<!--<div id="search">
<form method="post" action="#">
<input type="text" value="" size="15" />
<button>search</button>
</form>
</div>-->
<div class="br"></div>
<div id="navlist">
<ul>
<li><a id="link1home" href="./index.php">Home</a></li>
<li><a href="config.php">Config</a></li>
<li><a href="run.php">app</a></li>
<!--<li><a href="#">Link</a></li> -->
<!--<li><a href="#">Link</a></li> -->
</ul>
</div>
<div id="content">
<br />
<?php
// set file to read
$filename = "../tvmonkey.config";
$newdata = $_POST['newd'];
if(isset($_POST['submit1']))
{
header("location:config.php");
}
if ($newdata != '')
{
$fw = fopen($filename, 'w') or die('Insufficent permissions to open file with write access!');
$fb = fwrite($fw,stripslashes($newdata)) or die('Could not write to file');
fclose($fw);
$command= 'fromdos ../tvmonkey.config' ;
system($command);
}
$fh = fopen($filename, "r") or die("Could not open file!");
$data = fread($fh, filesize($filename)) or die("Could not read file!");
fclose($fh);
echo "<h3>Contents of File</h3> ";
if(isset($newdata))
{
echo "<p>";
echo "Changes saved successfully";
echo "</p>";
}
echo "<form method=\"post\" action=\"$_SERVER[php_self]\">";
echo "<input type=\"submit\" value=\"Change\"> ";
echo "<input type=\"hidden\" name=\"cancel\" value=\"cancel\">";
echo "<input type=\"submit\" name=\"submit1\"value=\"Cancel/Done\">";
echo "<textarea name='newd' cols='100%' rows='50'>$data</textarea> ";
echo "<input type='submit' value='Change'> ";
echo "<input type=\"hidden\" name=\"cancel\" value=\"cancel\">";
echo "<input type=\"submit\" name=\"submit1\"value=\"Cancel/Done\">";
echo "</form>";
?>
</div>
<div class="br"></div>
<div id="footer">
<p class="center">Copyright © <a href="index.php">cj13579.dyndns-server.com</a> | <a href="http://www.leadbon.se">Design by Leadbon</a></p>
</div>
</div>
</body>
</html>