-
Notifications
You must be signed in to change notification settings - Fork 0
/
documents.php
155 lines (133 loc) · 4.74 KB
/
documents.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<?php
session_start();
error_reporting(0);
if (empty($_SESSION['login_user'])){
header("location: home.php");
exit();
}
?>
<!doctype html>
<html lang="en">
<head>
<title>Documents</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300,400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/reset.css"> <!-- CSS reset -->
<link rel="stylesheet" href="css/style.css"> <!-- Resource style -->
<link rel="stylesheet" href="css/media.css">
<script src="js/modernizr.js"></script> <!-- Modernizr -->
<link href="css/jquery.fileuploader.css" media="all" rel="stylesheet">
<link href="css/jquery.fileuploader-theme-dragdrop.css" media="all" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="js/jquery.fileuploader.min.js" type="text/javascript"></script>
<script src="js/custom.js" type="text/javascript"></script>
</head>
<body onload="check()">
<script type="text/javascript">
function check(){
$("span#msgcount").load("msg-counter.php");
}
function suggestions(){
var input = $(".search").val();
var url = "users.php?keyword="+input;
$("datalist#searches").load(url);
}
function searched(){
var name = $(".search").val();
window.open("profile.php?user="+name,'_self');
}
</script>
<header class="cd-main-header">
<a href="profile.php" class="cd-logo"><img src="images/somaiya.png" alt="Logo"></a>
<div class="cd-search is-hidden">
<input list="searches" class="search" placeholder="Search..." onkeyup="suggestions()" onchange="searched()">
<datalist id="searches">
</datalist>
</div> <!-- cd-search -->
<a href="#" class="cd-nav-trigger">Menu<span></span></a>
<nav class="cd-nav">
<ul class="cd-top-nav">
<!--<li><a href="#">Privacy Policy</a></li>-->
<li class="has-children account">
<a href="#">
<img src="<?php echo $_SESSION['dp_url'];?>">
Account
</a>
<ul>
<li><a href="settings.php">Edit Account</a></li>
<li><a href="logout.php">Logout</a></li>
</ul>
</li>
</ul>
</nav>
</header> <!-- .cd-main-header -->
<main class="cd-main-content">
<nav class="cd-side-nav">
<ul>
<li class="nav-dp"><a class="dp"><img src="<?php echo $_SESSION['dp_url'];?>"></a></li>
<li class="nav-name"><h1>@<?php echo $_SESSION['user_name'];?></h1></li>
<li class="cd-label">Main</li>
<li class="profile">
<a href="profile.php?user=<?php echo $_SESSION['login_user'];?>">Profile</a>
</li>
<li class="messages">
<a href="inbox.php">Messages<span class="count" id="msgcount"></span></a>
</li>
<li class="documents active">
<a href="documents.php">Documents</a>
</li>
</ul>
<ul>
<li class="cd-label">Secondary</li>
<li class="jobs">
<a href="jobportal">Jobs</a>
</li>
<li class="settings">
<a href="settings.php">Settings</a>
</li>
</ul>
<ul>
<li class="cd-label">Action</li>
<li class="action-btn"><a href="#">Report Bug</a></li>
</ul>
<br/><br/>
<ul>
<center>
<iframe width="140px" height="60px" scrolling="no" src="clock.html"></iframe>
</center>
</ul>
</nav>
<h2 style="font-size: 25px; margin-left: 105px; padding-bottom: 80px">Download Files</h2>
<center> <h1 style="font-size: 25px; margin-left: 105px; padding-bottom: 80px">Download Files</h1> </center>
<ul>
<?php
// get the name of the folder from url, escape space with %20
$isFolder = is_dir("images/".$projekt."/");
// folder name on server
$folder = "docs/".$url."/";
if($isFolder){
$data = scandir($folder);
}
if($data){
foreach ($data as $dat) {
$info = pathinfo($folder."/".$dat);
// get image size
$size = ceil(filesize($folder."/".$dat)/1024);
if ($dat != "." && $dat != ".." && $dat != "_notes" && $info['extension'] != "") {
?>
<li style="margin-left: 15px;background-color: white; max-width: auto; padding: 10px 20px; border: 1px solid rgb(235,235,235); border-left: 2px solid green;"><a href="<?php echo $info['dirname']."/".$info['basename'];?>" title="Download" download><?php echo $info['filename']; ?></a><br><?php echo $info['extension']; ?> | <?php echo $size ; ?> kb </li><br>
<?php
};
};
}else{
// this folder is not available
echo "<p>Folder not found.</p>";
}
?>
</ul>
</main> <!-- .cd-main-content -->
<script src="js/jquery.menu-aim.js"></script>
<script src="js/profile.js"></script> <!-- Resource jQuery -->
</body>
</html>