Now using bootstrap

This commit is contained in:
naielv
2026-01-27 19:21:49 +01:00
parent c8b22da45f
commit 2e956575aa
28 changed files with 845 additions and 636 deletions

View File

@@ -7,30 +7,29 @@ if (strtoupper($_GET["p"]) != "ELPEPE") {
$APP_CODE = "club";
$APP_NAME = "La web del Club<sup>3</sup>";
$APP_TITLE = "La web del Club";
require_once "/var/www/_incl/pre-body.php"; ?>
<div class="card pad">
<h1>Subir fotos</h1>
<form id="upload" encType="multipart/form-data">
<fieldset class="card"
style="border: 2px solid black; border-radius: 6.5px; padding: 5px 25px; max-width: 500px;">
<label id="uploader0">
<b>Elegir los archivos a subir (max 10)</b>
<input type="file" name="file[]" multiple="true" id="uploaderfileinp" />
</label>
require_once "../../_incl/pre-body.php"; ?>
<div class="card">
<div class="card-body">
<h1 class="card-title">Subir fotos</h1>
<form id="upload" encType="multipart/form-data">
<div class="mb-3">
<label for="uploaderfileinp" class="form-label"><b>Elegir los archivos a subir (max 10)</b></label>
<input type="file" id="uploaderfileinp" name="file[]" multiple="true" class="form-control" />
</div>
<hr>
<span>
<b>Progreso:</b> <span id="alert">Por subir...</span>
</span>
<progress id="fileuploaderprog" max="100" value="0" style="width: 100%;">0%</progress>
<br>
<button type="submit" class="button">Subir fotos</button>
</fieldset>
</form>
<div class="mb-3">
<span><b>Progreso:</b> <span id="alert">Por subir...</span></span>
<div class="progress">
<div id="fileuploaderprog" class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" style="width: 0%;">0%</div>
</div>
</div>
<button type="submit" class="btn btn-primary">Subir fotos</button>
</form>
</div>
</div>
<script src="js/plugin/jquery-3.6.0.min.js"></script>
<script src="js/main.js"></script>
</div>
<?php require_once "/var/www/_incl/post-body.php"; ?>
<?php require_once "../../_incl/post-body.php"; ?>

View File

@@ -1,30 +1,26 @@
<?php ini_set("display_errors", "off");
<?php
$APP_CODE = "club";
$APP_NAME = "La web del Club<sup>3</sup>";
$APP_TITLE = "La web del Club";
require_once "/var/www/_incl/pre-body.php"; ?>
<div class="card pad">
<h1>Subir fotos</h1>
<form action="form.php" method="get">
<fieldset class="card" style="border: 2px solid black; border-radius: 6.5px; padding: 5px 25px; max-width: 500px;">
<label>
<b>Tu nombre:</b>
<input required type="text" name="n" value="<?php echo $_GET["n"] ?: "";?>" placeholder="Nombre...">
</label>
<br>
<label>
<b>Fecha:</b>
<input required type="date" name="f" value="<?php echo $_GET["f"] ?: "";?>" placeholder="Fecha...">
</label>
<br>
<label>
<b>La contraseña:</b>
<input required type="text" name="p" value="" placeholder="Contraseña...">
</label>
<br>
<button type="submit">Continuar...</button>
</fieldset>
</form>
require_once "../../_incl/pre-body.php"; ?>
<div class="card">
<div class="card-body">
<h1 class="card-title">Subir fotos</h1>
<form action="form.php" method="get">
<div class="mb-3">
<label for="n" class="form-label"><b>Tu nombre:</b></label>
<input required type="text" id="n" name="n" class="form-control" value="<?php echo $_GET["n"] ?: "";?>" placeholder="Nombre...">
</div>
<div class="mb-3">
<label for="f" class="form-label"><b>Fecha:</b></label>
<input required type="date" id="f" name="f" class="form-control" value="<?php echo $_GET["f"] ?: "";?>" placeholder="Fecha...">
</div>
<div class="mb-3">
<label for="p" class="form-label"><b>La contraseña:</b></label>
<input required type="text" id="p" name="p" class="form-control" value="" placeholder="Contraseña...">
</div>
<button type="submit" class="btn btn-primary">Continuar...</button>
</form>
</div>
</div>
<?php require_once "/var/www/_incl/post-body.php"; ?>
<?php require_once "../../_incl/post-body.php"; ?>

View File

@@ -40,7 +40,7 @@ $(document).ready(function() {
function Progress(current, total) {
var percent = ((current / total) * 100).toFixed(0) + "%";
document.getElementById('fileuploaderprog').value = ((current / total) * 100).toFixed(0);
document.getElementById('fileuploaderprog').style.width = percent;
document.getElementById('fileuploaderprog').innerText = percent;
}
@@ -51,9 +51,11 @@ function Finished() {
document.getElementById('uploaderfileinp').value = "";
document.getElementById('fileuploaderprog').innerText = "Subido!"
document.getElementById('fileuploaderprog').style.width = "100%";
setTimeout(function() {
document.getElementById('fileuploaderprog').innerText = "0%"
document.getElementById('fileuploaderprog').style.width = "0%";
location.href="../cal.php?f=" + urlParams.get("f")
}, 3000);

View File

@@ -1,5 +1,5 @@
<?php
ini_set("display_errors", 0);
ini_set("display_errors", 1);
$config = json_decode(file_get_contents("/DATA/club/config.json"), true);
if (strtoupper($_GET["pw"]) != $config["uploadpw"]) {
header("HTTP/1.1 401 Unauthorized");
@@ -33,9 +33,9 @@ for ($i = 0; $i < $file_count; $i++) {
// Generate thumbnail
require_once "../_incl/tools.photos.php";
$thumbnail_path = $location . ".thumbnail";
if (!file_exists($thumbnail_path)) {
generatethumbnail($location, $thumbnail_path, 240, 0);
}
#if (!file_exists($thumbnail_path)) {
# generatethumbnail($location, $thumbnail_path, 240, 0);
#}
header("HTTP/1.1 200 OK");
} else {
header("HTTP/1.1 500 Internal Server Error");