Validation HTML

This commit is contained in:
2024-12-14 11:54:27 +01:00
parent bfda660a2f
commit ec0ab53cb2
13 changed files with 299 additions and 255 deletions

View File

@@ -1,50 +1,20 @@
<?php require ("3-protect.php");
include 'localize.php';
$domain = 'sentier';
localize($domain);
include 'functions.php';
$base = 'db_photo.sqlite3';
$conn = new PDO("sqlite:$base");
$msg = "";
if(!empty($_GET['message'])) {
$msg = "<h3 class='redstyle'>" . $_GET['message'] . "</h3>";
}
/*
// Suppression d'images
if (isset($_SESSION["user"])) {
if ((isset($_POST["suppress"])) && ($_POST["suppress"] == "suppress")) {
if (isset($_POST['coche']) && (! empty($_POST['coche']))) {
$rr = "";
foreach($_POST['coche'] as $key => $value) {
$r = "id = " . $value . " OR ";
$rr .= $r;
}
$req_delete = substr($rr, 0, strlen($rr)-4);
try {
$req = "DELETE FROM Photos WHERE (" . $req_delete . ")";
$stmt = $conn->prepare($req);
$stmt->execute();
$nb = $stmt->rowCount();
}
catch(PDOException $e) {
echo $e->getMessage();
}
$msg = (($nb > 0) ? "<h3 class='greenstyle'>" . $nb . gettext(' photos successfully deleted !') . "</h3>" : "");
$request_delete = $req;
}
else {
$msg = "<h3 class='redstyle'>" . gettext('Empty request !') . "</h3>" ;
}
}
}
<?php
require ("3-protect.php");
//session_start();
include 'i18n_setup.php';
/*include 'localize.php';
$domain = 'sentier';
localize($domain);
*/
include 'functions.php';
$base = 'db_photo.sqlite3';
$conn = new PDO("sqlite:$base");
$msg = "";
if(!empty($_GET['message'])) {
$msg = "<h3 class='redstyle'>" . $_GET['message'] . "</h3>";
}
?>
<!DOCTYPE html>
<html lang="en">
@@ -52,13 +22,23 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="description" content="Sur le sentier: admin">
<title><?php echo gettext('View photos in Sqlite base'); ?></title>
<meta name="msapplication-TileColor" content="#2b5797">
<meta name="msapplication-config" content="/icons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<link rel="apple-touch-icon" sizes="180x180" href="/icons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16x16.png">
<link rel="manifest" href="/icons/site.webmanifest">
<link rel="shortcut icon" href="/icons/favicon.ico">
<link rel="stylesheet" href="css/sls.css" />
<link rel='stylesheet' href='lc-lightbox/css/lc_lightbox.min.css' />
<link rel='stylesheet' href='lc-lightbox/css/open_close_fx.css' />
<link rel='stylesheet' href='lc-lightbox/skins/minimal.css' />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="css/sls.css">
<link rel='stylesheet' href='lc-lightbox/css/lc_lightbox.min.css'>
<link rel='stylesheet' href='lc-lightbox/css/open_close_fx.css'>
<link rel='stylesheet' href='lc-lightbox/skins/minimal.css'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer">
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
@@ -108,7 +88,7 @@ function showUser(column) {
<body onload="showUser('')">
<?php
echo '<h1>' . gettext('View database') . ': ' . $base . '</h1><br />';
echo '<h1>' . gettext('View database') . ': ' . $base . '</h1><br>';
echo $msg;
?>
@@ -177,7 +157,7 @@ function showUser(column) {
}
?>
<script type='text/javascript'>
<script>
$(document).ready(function() {
@@ -231,14 +211,14 @@ function showUser(column) {
</script>
<?php $logout = (isset($_SESSION["user"])) ? '<a class="" href="4-logout.php" role="button">' . gettext("Log out") . '</a></p>' : ''; ?>
<?php $logout = (isset($_SESSION["user"])) ? '<a class="" href="4-logout.php" role="button">' . gettext("Log out") . '</a>' : ''; ?>
<p class="navPage"><a href="index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="photo-du-mois.php" title="<?php echo gettext("Picture of the month"); ?>"><?php echo gettext("Picture of the month"); ?></a> | <a href="maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></a> | <a href="admin.php" title="<?php echo gettext("Admin page"); ?>"><?php echo gettext("Admin page"); ?></a> | <?php echo $logout; ?></p>
<p><em><small>&copy; 2013-<?php echo date('Y'); ?> sur-le-sentier.fr</small></em></p>
<script src='lc-lightbox/js/lc_lightbox.min.js' type='text/javascript'></script>
<script src='lc-lightbox/lib/AlloyFinger/alloy_finger.min.js' type='text/javascript'></script>
<script src='lc-lightbox/js/lc_lightbox.min.js'></script>
<script src='lc-lightbox/lib/AlloyFinger/alloy_finger.min.js'></script>
</body>
</html>