-
Notifications
You must be signed in to change notification settings - Fork 0
/
m_arch.php
77 lines (70 loc) · 2.95 KB
/
m_arch.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
<?php
include('core/linchub.class.php');
$web->validarRol(array("Cliente"));
$web->validarPermiso(array("Almacenar"));
include ('header.php');
$carpeta=$web->queryArray("Select idarchivo as ID, archivo as 'Nombre archivo', tamano as Tamano, atributo as Atributo from carpetadetalle join archivo using (idarchivo) join atributo using (idatributo) where idusuario=1");
print_r($carpeta);
$tipoarchivo = $web->queryArray('Select tipoarchivo from tipoarchivo');
if (isset($_POST['subir'])){
print_r($carpeta );
$size=$web->getfilesize($_FILES['archivo']['size']);
echo $size;
}
//die();
?>
<section>
<hr class="featurette-divider">
<div class="row">
<div class="col-sm-5">
<form method="post" action="m_arch.php" enctype="multipart/form-data">
<div class="form-group">
<input type="file" class="form-control" name="archivo" id="" lang="es">
</div>
<div class="form-group">
<label for=""></label>
<input type="submit"
name="subir" value="Subir Archivo" id="" class="btn btn-primary" placeholder="" aria-describedby="helpId">
<small id="helpId" class="text-muted">Archivos Permitidos: <?php foreach ($tipoarchivo as $index => $value) {
echo $value['tipoarchivo'].", ";
} ?> </small>
</div>
</form>
</div>
</div>
<hr class="featurette-divider">
<table class="table table-hover table-dark">
<thead>
<tr>
<th scope="col">#</th>
<?php foreach (array_keys($carpeta[0]) as $index => $array_key) {
echo '<th>'.$array_key.'</th>';
}?>
</tr>
</thead>
<tbody>
<tr>
<?php $i=1;
foreach ($carpeta as $key => $value) {
echo '<tr>';
echo "<th scope=\"row\">$i</th>";
$j=0;
foreach ($value as $key => $item) {
print_r($value);
if ($j==2)
echo '<td>'.$web->getfilesize($item).'</td>';
else
echo '<td>'.$item.'</td>';
$j++;
}
echo "<td><a href=\"archivo.descargar.php?idarchivo=".$value['ID']."\" class=\"btn btn-outline-warning\">Descargar</a></td>";
echo "<td><a href=\"archivo.eliminar.php?idarchivo=".$value['ID']."\" class=\"btn btn-outline-danger\">Eliminar</a></td>";
echo '</tr>';
$i++;
}?>
</tr>
</tbody>
</table>
<hr class="featurette-divider">
</section>
<?php include ('footer.php'); ?>