Menu

[2eb2a2]: / docs_manage.php  Maximize  Restore  History

Download this file

91 lines (76 with data), 2.3 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
<?php session_start(); ?>
<html>
<head>
<title>deltasql - Documents</title>
<link rel="stylesheet" type="text/css" href="deltasql.css">
<link rel="shortcut icon" href="pictures/favicon.ico" />
</head>
<body>
<?php
include("head.inc.php");
include("utils/utils.inc.php");
include("utils/constants.inc.php");
include("conf/config.inc.php");
$scriptid = $_GET['id'];
$version = $_GET['version'];
$hasdocs = $_GET['hasdocs'];
if ($scriptid=="") exit;
$rights = $_SESSION["rights"];
if ($hasdocs==1) {
echo "<h3>Manage Documents for <a href=\"show_script.php?id=$scriptid&edit=1\">script $version</a></h3>";
mysql_connect($dbserver, $username, $password);
@mysql_select_db($database) or die("Unable to select database");
$query = "SELECT * FROM tbscriptdocument where script_id=$scriptid order by id desc";
mysql_query($query);
$result=mysql_query($query);
$num=mysql_num_rows($result);
echo "<table border='1'>";
echo "<tr>
<th>id</th>
<th>filename:</th>
<th>size</th>
<th>insert date</th>
<th>actions</th>
</tr>";
$i=0;
while ($i<$num) {
$id=mysql_result($result,$i,"id");
$name=mysql_result($result,$i,"name");
$size=mysql_result($result,$i,"size");
$insertdt=mysql_result($result,$i,"insert_dt");
echo "
<tr>
<td>$id</td>
<td><a href='upload/$name'>$name</a></td>
<td>$size</td>
<td>$insertdt</td>
<td>";
if ($rights>=1) {
echo "<a href=\"docs_delete_confirm.php?id=$id&version=$version\"><img alt=\"Delete\" src=\"icons/delete.png\"></a> ";
}
echo "
</td>
</tr>
";
$i++;
}
echo "</table>";
mysql_close();
} else {
echo "<h3>Add Documents for <a href=\"show_script.php?id=$scriptid&edit=1\">script $version</a></h3>";
}
?>
<hr>
<form action="docs_upload.php" method="post" enctype="multipart/form-data">
Select document to upload:
<input type="file" name="fileToUpload" id="fileToUpload">
<input type="submit" value="Upload File" name="submit">
<input type="hidden" value="<?php echo $scriptid; ?>" name="id">
<input type="hidden" value="<?php echo $version; ?>" name="version">
<input type="hidden" value="<?php echo $hasdocs; ?>" name="hasdocs">
</form>
<?php
include("bottom.inc.php");
?>
</body>
</html>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.