Mise-à-jour sur-le-sentier.fr
version 2
This commit is contained in:
99
requests.php
99
requests.php
@@ -1,3 +1,9 @@
|
||||
<?php //require ("3-protect.php");
|
||||
|
||||
include 'functions.php';
|
||||
$domain = 'sentier';
|
||||
localize($domain);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
@@ -5,28 +11,16 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title><?php gettext('View photos in Sqlite base'); ?></title>
|
||||
<title><?php echo gettext('View photos in Sqlite base'); ?></title>
|
||||
|
||||
<link rel="stylesheet" href="css/sls.css" />
|
||||
<link rel='stylesheet' href='css/lc_lightbox.min.css' />
|
||||
<link rel='stylesheet' href='css/open_close_fx.css' />
|
||||
<link rel='stylesheet' href='css/minimal.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" />
|
||||
|
||||
<?php include 'functions.php';
|
||||
session_start();
|
||||
if($_SESSION['Active'] == false){ /* Redirects user to login.php if not logged in */
|
||||
header("location:admin/login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$domain = 'sentier';
|
||||
localize($domain);
|
||||
?>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -37,6 +31,49 @@
|
||||
|
||||
$base = 'db_photo.sqlite3';
|
||||
|
||||
_pr($_POST);
|
||||
/*
|
||||
(
|
||||
[model] => Canon EOS 7D
|
||||
)
|
||||
*/
|
||||
//if ((isset($_POST)) and (! empty($_POST))) {
|
||||
if (! empty($_POST)){
|
||||
echo "info dispo";
|
||||
$key = key($_POST);
|
||||
$val = $_POST["$key"];
|
||||
$_POST = array();
|
||||
|
||||
$page = 1;
|
||||
|
||||
//echo $key . " - " . $val;
|
||||
$req = "SELECT * FROM photos WHERE " . $key . " = '" . $val . "'";
|
||||
echo $req;
|
||||
|
||||
$conn2 = new PDO("sqlite:db_photo.sqlite3");
|
||||
$conn2->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
|
||||
$limit = 13;
|
||||
$offset = $limit * ($page -1);
|
||||
|
||||
$stmt = $conn2->prepare($req);
|
||||
//$stmt->execute(array($limit, $offset));
|
||||
$stmt->execute();
|
||||
|
||||
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$rowcount = count($result);
|
||||
echo $rowcount;
|
||||
|
||||
}
|
||||
else {
|
||||
echo "non dispo";
|
||||
}
|
||||
|
||||
_pr($_POST);
|
||||
|
||||
echo '<a href="requests.php">requests</a>';
|
||||
|
||||
|
||||
$conn = new PDO("sqlite:db_photo.sqlite3");
|
||||
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
|
||||
@@ -124,12 +161,12 @@ https://www.csscodelab.com/pure-css-custom-select-box-dropdown-styling/
|
||||
?>
|
||||
|
||||
<div class="myForm">
|
||||
<form id="keywordSelect" name="keywordSelect" action="index.php" method="get" >
|
||||
<form id="keywordSelect" name="keywordSelect" action="requests.php" method="post" >
|
||||
<select name="keyword" id="keyword" class="classic">
|
||||
<option value=""><?php echo gettext('keywords'); ?></option>
|
||||
<?php
|
||||
for( $i = 0; $i < count($select[4]); $i++) {
|
||||
echo '<option value="">' . $select[4]["$i"] . '</option>';
|
||||
echo '<option value="' . $select[4]["$i"] . '">' . $select[4]["$i"] . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
@@ -138,12 +175,12 @@ https://www.csscodelab.com/pure-css-custom-select-box-dropdown-styling/
|
||||
</div>
|
||||
|
||||
<div class="myForm">
|
||||
<form name="modelSelect" action="index.php" method="get" >
|
||||
<form name="modelSelect" action="requests.php" method="post" >
|
||||
<select name="model" id="model" class="classic">
|
||||
<option value=""><?php echo gettext('model'); ?></option>
|
||||
<?php
|
||||
for( $i = 0; $i < count($select[1]); $i++) {
|
||||
echo '<option value="">' . $select[1]["$i"] . '</option>';
|
||||
echo '<option value="' . $select[1]["$i"] . '">' . $select[1]["$i"] . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
@@ -151,25 +188,25 @@ https://www.csscodelab.com/pure-css-custom-select-box-dropdown-styling/
|
||||
</form>
|
||||
</div>
|
||||
<div class="myForm">
|
||||
<form name="lensSelect" action="index.php" method="get" >
|
||||
<form name="lensSelect" action="requests.php" method="post" >
|
||||
<select name="lens" id="lens" class="classic">
|
||||
<option value=""><?php echo gettext('lens'); ?></option>
|
||||
<?php
|
||||
for( $i = 0; $i < count($select[0]); $i++) {
|
||||
echo '<option value="">' . $select[0]["$i"] . '</option>';
|
||||
echo '<option value="' . $select[0]["$i"] . '">' . $select[0]["$i"] . '</option>';
|
||||
}
|
||||
?>
|
||||
?>
|
||||
</select>
|
||||
<button type="submit" class="myButton">Ok</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="myForm">
|
||||
<form name="isoSelect" action="index.php" method="get" >
|
||||
<form name="isoSelect" action="requests.php" method="post" >
|
||||
<select name="iso" id="iso" class="classic">
|
||||
<option value=""><?php echo gettext('iso'); ?></option>
|
||||
<?php
|
||||
for( $i = 0; $i < count($select[2]); $i++) {
|
||||
echo '<option value="">' . $select[2]["$i"] . '</option>';
|
||||
echo '<option value="' . $select[2]["$i"] . '">' . $select[2]["$i"] . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
@@ -177,12 +214,12 @@ https://www.csscodelab.com/pure-css-custom-select-box-dropdown-styling/
|
||||
</form>
|
||||
</div>
|
||||
<div class="myForm">
|
||||
<form name="speedSelect" action="index.php" method="get" >
|
||||
<form name="speedSelect" action="requests.php" method="get" >
|
||||
<select name="speed" id="speed" class="classic">
|
||||
<option value=""><?php echo gettext('speed'); ?></option>
|
||||
<?php
|
||||
for( $i = 0; $i < count($select[3]); $i++) {
|
||||
echo '<option value="">' . $select[3]["$i"] . '</option>';
|
||||
echo '<option value="' . $select[3]["$i"] . '">' . $select[3]["$i"] . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
@@ -190,12 +227,12 @@ https://www.csscodelab.com/pure-css-custom-select-box-dropdown-styling/
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<p class="navPage"><a href="index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></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="admin/index.php" title="<?php echo gettext("Admin"); ?>"><?php echo gettext("Admin"); ?></a></p>
|
||||
<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></p>
|
||||
|
||||
<p><em><small>© 2013-<?php echo date('Y'); ?> sur-le-sentier.fr</small></em></p>
|
||||
<p><em><small>© 2013-<?php echo date('Y'); ?> sur-le-sentier.fr</small></em></p>
|
||||
|
||||
<script src='js/lc_lightbox.min.js' type='text/javascript'></script>
|
||||
<script src='js/alloy_finger.min.js' type='text/javascript'></script>
|
||||
<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>
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user