This repository has been archived by the owner on Dec 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdcp.php
115 lines (115 loc) · 5.74 KB
/
dcp.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
if ($act == 'downloadscontrolpanel') {
if ($group_id != 1 || $access['downloadscontrolpanel'] = '0') {
redirect("failed.php?amp;id=2");
};
if ($group_id == 1 || $access['downloadscontrolpanel'] == '1') {
if ($action == 'overview') {
title("Downloads Control Panel");
print '<h1><center>Downloads Control Panel</center></h1>
<hr width="100%" align="center"/>
<table class="table" align="center"><tr><td><a href="?act=downloadscontrolpanel&action=new_file">Add a New File</a> | <a href="index.php?act=downloadscontrolpanel&action=create_new_file_category">Create New File Category</a></td></tr>
<tr><td>
Top 10 Downloads:<br />
<tr><td>';
$count = 1;
while ($row = mysql_fetch_array($find_top)) {
print '#'.$count.' <a href="?act=dldb&action=view&id='.$row[id].'">'.$row[name].'</a> '.$row[downloads].'<br />';
$count++;
};
print '</td></tr></table><br />';
print '<table class="table" align="center">
<tr>
<td><center><strong>Number</strong></center></td>
<td><center><strong>Name</strong></center></td>
<td><center><strong>Author</strong></center></td>
<td><center><strong>Downloads</strong></center></td>
<td><center><strong>Date Submit</strong></center></td>
<td><center><strong>View | Edit | Delete</strong></center></td>
</tr>';
while ($row = mysql_fetch_array($find_files_all)) {
print '<tr>
<td><center>'.$row[id].'</center></td>
<td>'.$row[name].'</td>
<td>'.$row[author].'</td>
<td align="center">'.$row[downloads].'</td>
<td>'.$row[date_submitted].'</td>
<td><a href="?act=dldb&action=view&id='.$row[id].'">View</a> | <a href="index.php?act=downloadscontrolpanel&action=edit_file">Edit</a> | <a href="index.php?act=downloadscontrolpanel&action=delete_file">Delete</a></td>
</tr>';
};
print '</table>';
};
if ($action == 'new_file') {
title("Add New File");
print '<h1><center>Add New File</center></h1>
<hr width="100%" align="center"/>
<table class="table" align="center"><tr><td><form action="?act=downloadscontrolpanel&action=save_file" method="POST">
Name: <input type="text" value="" name="name" /><br />
Author: <input type="text" value="" name="author" /><br />
Category:
<select name="category">
<option value="">Select:</option>';
while ($row = mysql_fetch_array($count_down)) {
print '<option value="'.$row[id].'">'.$row[name].'</option>';
};
print '</select>
<br />
File name: <input type="text" value="" name="file_name" /><br />
File size: <input type="text" value="" name="file_size" /> (bytes)<br />
File type: <input type="text" value="" name="file_type" /><br />
File path: <input type="text" value="/home/waf/public_html/downloads/" size="50" name="file_path" /> (on server)<br />
Rating: <input type="text" value="" name="rating" /> /10<br />
Description:<br />
<textarea rows="5" cols="50" name="text"></textarea>
<br />
Hidden: <input type="text" value="0" name="hidden" /><br />
Password: <input type="text" value="" name="password" /><br />
<input type="submit" value="Add File" name="submit" /><br />
</form></td></tr></table>';
};
if ($action == 'save_file') {
$file_id = rand(000000,999999);
print $_POST[file_name].' has been saved correctly';
};
if ($action == 'create_new_file_category') {
title("Create New File Category");
print '<h1><center>Create New File Category</center></h1>
<hr width="100%" align="center"/>
<table class="table" align="center">
<tr><td>
<form action="?act=downloadscontrolpanel&action=save_category" method="POST">
Name: <input type="text" value="" name="name" /><br />
Description: <input type="text" value="" name="text" /><br />
Hidden: <input type="text" value="" name="hidden" /><br />
Password: <input type="text" value="" name="password" /> Leave blank for none<br />
<input type="submit" name="submit" value="Create New Category" />
</form>
</td></tr></table>';
};
if ($action == 'delete_file') {
title("Delete File");
print '<h1><center>Delete File</center></h1>
<hr width="100%" align="center"/>
<table class="table" align="center">
<tr><td>
Delete File
</td></tr>
</table>';
};
if ($action == 'edit_file') {
title("Edit File");
print '<h1><center>Edit File</center></h1>
<hr width="100%" align="center"/>
<table class="table" align="center">
<tr><td>
Edit File
</td></tr>
</table>';
};
if ($action == 'save_category') {
print '<strong>'.$_POST[name].'</strong> has been saved correctly.';
};
print '</table>';
};
};
?>