Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 87630c8444 | |||
| 8170066056 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,5 @@
|
||||
**/vendor
|
||||
**/vendor.old
|
||||
**/certs/*
|
||||
.env
|
||||
helm-old
|
||||
|
||||
@ -28,11 +28,12 @@ services:
|
||||
|
||||
mariadb:
|
||||
image: mariadb:10.11.7
|
||||
#image: mariadb:lts-ubi9
|
||||
# platform: linux/amd64,linux/arm64
|
||||
volumes:
|
||||
- 'mariadb:/var/lib/mysql:z'
|
||||
env_file:
|
||||
- ./docker/mariadb/.env
|
||||
- ./docker/mariadb/.env
|
||||
|
||||
phpmyadmin:
|
||||
image: phpmyadmin
|
||||
|
||||
@ -30,4 +30,4 @@ function checkindex($user,$password,$host,$index)
|
||||
curl_close($curl);
|
||||
|
||||
}
|
||||
return checkindex($es_user,$es_password,$es_host,$es_index)
|
||||
return checkindex($es_user,$es_password,$es_host,$es_index);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"require": {
|
||||
"elasticsearch/elasticsearch": "^8.18"
|
||||
"elasticsearch/elasticsearch": "^8.19"
|
||||
}
|
||||
}
|
||||
|
||||
16
src/composer.lock
generated
16
src/composer.lock
generated
@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "9ed50e8752b44f2433986b7a2af1554b",
|
||||
"content-hash": "80b524071699e69b978519d908dedf04",
|
||||
"packages": [
|
||||
{
|
||||
"name": "elastic/transport",
|
||||
@ -66,20 +66,20 @@
|
||||
},
|
||||
{
|
||||
"name": "elasticsearch/elasticsearch",
|
||||
"version": "v8.18.0",
|
||||
"version": "v8.19.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/elastic/elasticsearch-php.git",
|
||||
"reference": "df8ee73046c688ee9ce2d69cb5c54a03ca38cc5c"
|
||||
"reference": "1771284cb43a7b653634d418b6f5f0ec84ff8a6d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/df8ee73046c688ee9ce2d69cb5c54a03ca38cc5c",
|
||||
"reference": "df8ee73046c688ee9ce2d69cb5c54a03ca38cc5c",
|
||||
"url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/1771284cb43a7b653634d418b6f5f0ec84ff8a6d",
|
||||
"reference": "1771284cb43a7b653634d418b6f5f0ec84ff8a6d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"elastic/transport": "^8.10",
|
||||
"elastic/transport": "^8.11",
|
||||
"guzzlehttp/guzzle": "^7.0",
|
||||
"php": "^7.4 || ^8.0",
|
||||
"psr/http-client": "^1.0",
|
||||
@ -117,9 +117,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/elastic/elasticsearch-php/issues",
|
||||
"source": "https://github.com/elastic/elasticsearch-php/tree/v8.18.0"
|
||||
"source": "https://github.com/elastic/elasticsearch-php/tree/v8.19.0"
|
||||
},
|
||||
"time": "2025-05-02T10:38:56+00:00"
|
||||
"time": "2025-08-06T16:58:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/guzzle",
|
||||
|
||||
16
src/connect-db.php
Normal file
16
src/connect-db.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
function connexionDB($host,$db,$user,$pass) {
|
||||
$dsn = "mysql:host=$host;dbname=$db;charset=UTF8";
|
||||
|
||||
try {
|
||||
$pdo = new PDO($dsn, $user, $pass, [
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, // Mode erreur
|
||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, // Mode de récupération
|
||||
PDO::ATTR_EMULATE_PREPARES => false, // Préparation réelle des requêtes
|
||||
]);
|
||||
return $pdo;
|
||||
} catch (PDOException $e) {
|
||||
die("Erreur de connexion : " . $e->getMessage());
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,15 +0,0 @@
|
||||
<?php
|
||||
require_once 'config.php';
|
||||
function connect($host, $db, $user, $password)
|
||||
{
|
||||
$dsn = "mysql:host=$host;dbname=$db;charset=UTF8";
|
||||
|
||||
try {
|
||||
$options = [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION];
|
||||
|
||||
return new PDO($dsn, $user, $password, $options);
|
||||
} catch (PDOException $e) {
|
||||
die($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
require_once 'config.php';
|
||||
// conection db
|
||||
$conn = require 'connect.php';
|
||||
require_once 'connect-db.php';
|
||||
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
@ -17,6 +18,8 @@ $conn = require 'connect.php';
|
||||
<?php echo $site_copyright; echo "<hr>"; ?>
|
||||
<?php
|
||||
|
||||
$conn=connexionDB($host, $db, $user, $password);
|
||||
//echo $conn;
|
||||
// sql to create table
|
||||
$sql = "CREATE TABLE IF NOT EXISTS $table (
|
||||
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
|
||||
@ -26,7 +29,6 @@ email VARCHAR(50) UNIQUE,
|
||||
reg_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
mod_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
)";
|
||||
|
||||
try {
|
||||
$conn->query($sql);
|
||||
echo "<p>Table <b>".$table."</b> created successfully</p>";
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
require_once 'config.php';
|
||||
// conection db
|
||||
$conn = require 'connect.php';
|
||||
require_once 'connect-db.php';
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
@ -16,6 +16,10 @@ $conn = require 'connect.php';
|
||||
<h2><?php echo $db_site_title ?></h2>
|
||||
<?php echo $site_copyright; echo "<hr>"; ?>
|
||||
<?php
|
||||
|
||||
// connect to DB
|
||||
$conn=connexionDB($host, $db, $user, $password);
|
||||
|
||||
// sql to create table
|
||||
$sql = "DROP TABLE IF EXISTS $table;";
|
||||
|
||||
|
||||
@ -84,3 +84,4 @@ echo "<h3>MariaDB</h3>";
|
||||
<?php echo "Nous sommes le $date, il est $time.\n"?></h6>
|
||||
</body>
|
||||
</html>
|
||||
<img src='http://gmoadm.gmolab.net:8085/images/trash.svg' alt='pen' />
|
||||
@ -2,7 +2,8 @@
|
||||
echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n";
|
||||
require_once 'config.php';
|
||||
// conection db
|
||||
$conn=require 'connect.php';
|
||||
require_once 'connect-db.php';
|
||||
$conn=connexionDB($host, $db, $user, $password);
|
||||
|
||||
$defaultAction='add';
|
||||
$defaultModCre=false; // display or not created/modified date
|
||||
@ -295,7 +296,7 @@ if (isset($_POST['displaymore'])) {
|
||||
"<input type='hidden' name='email' value='".$email."'>".
|
||||
"<input type='hidden' name='flagAction' value='modify'>".
|
||||
"<input type='hidden' name='id' value='".$id."'>".
|
||||
"<button type='submit' name='modify' title='Modify'><img src='images/pen.svg' alt='pen' /></button> ".
|
||||
"<button type='submit' name='modify' title='Modify'><img src='./images/pen.svg' alt='pen' /></button> ".
|
||||
"<button onclick='return validate(\"".$firstname." ".$lastname." (".$email.")\");' type='submit' name='delete' title='Delete'><img src='images/trash.svg' alt='trash' /></button>".
|
||||
"</td></form></tr>";
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user