-
Notifications
You must be signed in to change notification settings - Fork 1
/
home.php
186 lines (154 loc) · 4.65 KB
/
home.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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<?php
include ("InicializaPagina.php");
require_once("Controller/Arquivos.php");
if (isset($_GET['solicitacao']))
{
$x = $_GET['solicitacao'];
if ($x == '1')
$sol = TRUE;
else
$sol = FALSE;
}
?>
<!-- Inicio do HTML -->
<?php
include ("header.php");
?>
<body>
<div class="container">
<div class="row-fluid span10">
<div class="row-fluid">
<?php
include ("topo.php");
?>
</div>
<div class="row-fluid">
<?php
include ("marcasLista.php");
?>
</div>
<?php
if (isset($sol))
{
echo "<div class='row-fluid span10'>";
if ($sol)
echo "<div class='alert alert-info'>
<button type='button' class='close' data-dismiss='alert'>×</button>
Solicitud enviada con éxito
</div>";
else
echo "<div class='alert alert-warning'>
<button type='button' class='close' data-dismiss='alert'>×</button>
Error al enviar solicitud
</div>";
echo "</div>";
}
?>
<div id="feed" class="container-fluid">
<div class="inline row-fluid span11" style="margin-left: 70px;">
<div class="box span5">
<p style="margin-left: 10px;">
<b>Top 10 - Archivos recentes</b>
</p>
<hr>
<div class="box-conteudo">
<?php
$arquivos = GetArquivosRecentes();
$n = count($arquivos);
if ($n == 0)
{
?>
<div class="row-fluid arquivo">
<div class="alert alert-info">
No se añadieron los archivos
</div>
</div>
<?php
}
for ($i = 0; $i < $n; $i++)
{
$img = GetImageFromType($arquivos[$i]);
list($_width, $_height, $type, $attr) = getimagesize($img);
$width = $_width * 0.2;
$height = $_height * 0.2;
?>
<div class="row-fluid arquivo">
<a href="Controller/Direciona.php?id=<?php echo $arquivos[$i]['id']; ?>&nome=arquivos"
style="text-decoration: none; color: black;">
<div class="span4">
<img src="thumbnails.php?file=<?php echo $img;?>&width=<?php echo $width; ?>&height=<?php echo $height; ?>" />
</div>
<div class="span8" style="padding-left: 5px;">
<span style="font-size: 15px;">
<b><?php echo $arquivos[$i]['nome']; ?></b>
</span>
<br>
<span style="font-size: 14px;">
<?php echo $arquivos[$i]['descricao']; ?>
</span>
</div>
</a>
</div>
<hr>
<?php
}
?>
</div>
</div>
<div class="box span5">
<p style="margin-left: 10px;">
<b>Top 10 - Archivos más bajados</b>
</p>
<hr>
<div class="box-conteudo">
<?php
$arquivos = GetArquivosMaisBaixados();
$n = count($arquivos);
if ($n == 0)
{
?>
<div class="row-fluid arquivo">
<div class="alert alert-info">
Ningún archivo se descargó hasta la fecha
</div>
</div>
<?php
}
for ($i = 0; $i < $n; $i++)
{
if ($arquivos[$i]['ndownloads'] == 0)
continue;
$img = GetImageFromType($arquivos[$i]);
list($_width, $_height, $type, $attr) = getimagesize($img);
$width = $_width * 0.2;
$height = $_height * 0.2;
?>
<div class="row-fluid arquivo">
<a href="Controller/Direciona.php?id=<?php echo $arquivos[$i]['id']; ?>&nome=arquivos"
style="text-decoration: none; color: black;">
<div class="span4">
<img src="thumbnails.php?file=<?php echo $img;?>&width=<?php echo $width; ?>&height=<?php echo $height; ?>" />
</div>
<div class="span8" style="padding-left: 5px;">
<span style="font-size: 15px;">
<b><?php echo $arquivos[$i]['nome']; ?></b>
</span>
<br>
<span style="font-size: 14px;">
<?php echo $arquivos[$i]['descricao']; ?>
</span>
</div>
</a>
</div>
<hr>
<?php
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>