@ -0,0 +1 @@ |
||||
.directory |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
@ -1,242 +1,303 @@ |
||||
<?php require "options.inc.php"; ?> |
||||
<?php require "config.inc.php"; ?> |
||||
<!-- |
||||
_____ _ _ _ _____ ______ |
||||
| __ \ // // | | | | | | | _ || ___ \ |
||||
| | \/ ___ _ __ ___ _ __ __ _ | |_ ___ _ _ _ __ __| | ___ ___ ___ __| | ___ ___ | | | || |_/ / |
||||
| | __ / _ \| '_ \ / _ \| '__| / _` || __| / _ \| | | || '__| / _` | / _ \ / __| / _ \ / _` | / _ \/ __| | | | || / |
||||
| |_\ \| __/| | | || __/| | | (_| || |_ | __/| |_| || | | (_| || __/ | (__ | (_) || (_| || __/\__ \ \ \/' /| |\ \ |
||||
\____/ \___||_| |_| \___||_| \__,_| \__| \___| \__,_||_| \__,_| \___| \___| \___/ \__,_| \___||___/ \_/\_\\_| \_| |
||||
|
||||
Version 1.2.0dev |
||||
Créé par Miraty et diffusé sous AGPLv3+ |
||||
Code source : https://code.antopie.org/miraty/qr |
||||
_ _ _ ___ ____ |
||||
| | (_| |__ _ __ ___ / _ \| _ \ |
||||
| | | | '_ \| '__/ _ | | | | |_) | |
||||
| |___| | |_) | | | __| |_| | _ < |
||||
|_____|_|_.__/|_| \___|\__\_|_| \_\ |
||||
|
||||
LibreQR version 1.2.0 |
||||
Créé par Miraty et diffusé sous AGPLv3+ |
||||
Code source : https://code.antopie.org/miraty/qr |
||||
|
||||
Ce fichier fait partie de LibreQR. |
||||
|
||||
LibreQR est un logiciel libre ; vous pouvez le redistribuer ou le modifier |
||||
suivant les termes de la GNU Affero General Public License |
||||
telle que publiée par la Free Software Foundation ; soit la version 3 |
||||
de la licence, soit (à votre gré) toute version ultérieure. |
||||
|
||||
LibreQR est distribué dans l'espoir qu'il sera utile, |
||||
mais SANS AUCUNE GARANTIE ; sans même la garantie tacite de |
||||
QUALITÉ MARCHANDE ou d'ADÉQUATION à UN BUT PARTICULIER. |
||||
Consultez la GNU Affero General Public License pour plus de détails. |
||||
|
||||
Vous devez avoir reçu une copie de la GNU Affero General Public License |
||||
en même temps que LibreQR ; si ce n'est pas le cas, |
||||
consultez <https://www.gnu.org/licenses/>. |
||||
|
||||
--> |
||||
|
||||
<!DOCTYPE HTML> |
||||
<?php |
||||
|
||||
function badQuery() { // Check if browser must be redirected |
||||
|
||||
// Check if parameters are set |
||||
if (!isset($_GET['txt'])) |
||||
return true; |
||||
else if (!isset($_GET['size'])) |
||||
return true; |
||||
else if (!isset($_GET['redondancy'])) |
||||
return true; |
||||
else if (!isset($_GET['margin'])) |
||||
return true; |
||||
else if (!isset($_GET['bgColor'])) |
||||
return true; |
||||
else if (!isset($_GET['mainColor'])) |
||||
return true; |
||||
|
||||
// Check parameters's types |
||||
else if (!is_numeric($_GET['size'])) |
||||
return true; |
||||
else if (!is_string($_GET['redondancy'])) |
||||
return true; |
||||
else if (!is_numeric($_GET['margin'])) |
||||
return true; |
||||
else if (!is_string($_GET['bgColor'])) |
||||
return true; |
||||
else if (!is_string($_GET['mainColor'])) |
||||
return true; |
||||
|
||||
// Check if redondancy value is correct |
||||
else if ($_GET['redondancy'] != "L" AND $_GET['redondancy'] != "M" AND $_GET['redondancy'] != "Q" AND $_GET['redondancy'] != "H") |
||||
return true; |
||||
|
||||
else |
||||
return false; |
||||
} |
||||
|
||||
if (badQuery()) { |
||||
|
||||
parse_str(parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY), $params); |
||||
|
||||
if (!isset($params['txt'])) |
||||
$params['txt'] = ""; |
||||
|
||||
if (!isset($params['redondancy']) OR !is_string($params['redondancy']) OR ($params['redondancy'] != "L" AND $params['redondancy'] != "M" AND $params['redondancy'] != "Q" AND $params['redondancy'] != "H")) |
||||
$params['redondancy'] = "H"; |
||||
|
||||
if (!isset($params['margin']) OR !is_numeric($params['margin'])) |
||||
$params['margin'] = 2; |
||||
|
||||
if (!isset($params['size']) OR !is_numeric($params['size'])) |
||||
$params['size'] = 4; |
||||
|
||||
if (!isset($params['bgColor']) OR !is_string($params['bgColor'])) |
||||
$params['bgColor'] = "#FFFFFF"; |
||||
|
||||
if (!isset($params['mainColor']) OR !is_string($params['mainColor'])) |
||||
$params['mainColor'] = "#000000"; |
||||
|
||||
header('Location: ' . $instPath . "?" . http_build_query($params)); |
||||
exit; |
||||
} |
||||
|
||||
?> |
||||
|
||||
<!DOCTYPE html> |
||||
<html lang="fr"> |
||||
<head> |
||||
<meta charset="UTF-8"> |
||||
<title>Générateur de codes QR</title> |
||||
<meta name="description" content="Générez des codes QR librement. Choisissez le contenu, la taille, la couleur..."> |
||||
<meta name="theme-color" content="<?php echo $variablesTheme['fond']; ?>">
|
||||
<meta name="theme-color" content="<?php echo $variablesTheme['bg']; ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"> |
||||
<link rel="manifest" href="manifest.php"> |
||||
<link rel="search" type="application/opensearchdescription+xml" title="Générer un code QR" href="opensearch.php"> |
||||
|
||||
<style> |
||||
<link rel="search" type="application/opensearchdescription+xml" title="Générer un code QR" href="opensearch.php?redondancy=<?= $_GET['redondancy'] ?>&margin=<?= $_GET['margin'] ?>&size=<?= $_GET['size'] ?>&bgColor=<?= urlencode($_GET['bgColor']) ?>&mainColor=<?= urlencode($_GET['mainColor']) ?>">
|
||||
<?php |
||||
require "lessphp/lessc.inc.php"; |
||||
$less = new lessc; |
||||
$less->setVariables($variablesTheme); // Rends ces couleurs utilisables dans style.less |
||||
|
||||
// If style.min.css exists |
||||
if (file_exists("style.min.css")) |
||||
// And if it's older than the theme config |
||||
if (filemtime("themes/" . $theme . "/theme.php") > filemtime("style.min.css")) |
||||
// Then delete it |
||||
unlink("style.min.css"); |
||||
|
||||
if ($env == "prod") { // En production : minimise et met en cache style.less dans style.css |
||||
$less->setFormatter("compressed"); |
||||
$less->checkedCompile("style.less", "style.css"); |
||||
echo file_get_contents("ubuntu/ubuntu.min.css") . file_get_contents("style.css"); // Inclus toutes les CSS dans le document HTML (= moins de requêtes HTTP) |
||||
|
||||
} else if ($env == "dev") { // En développement : compile style.less à chaque chargement de page |
||||
echo file_get_contents("ubuntu/ubuntu.min.css") . $less->compileFile("style.less"); |
||||
// Compile, minimise et met en cache style.less dans style.min.css |
||||
$less->setFormatter("compressed"); |
||||
$less->checkedCompile("style.less", "style.min.css"); |
||||
?> |
||||
<link type="text/css" rel="stylesheet" href="style.min.css"> |
||||
<link type="text/css" rel="stylesheet" href="ubuntu/ubuntu.min.css"> |
||||
|
||||
} else { |
||||
echo "Erreur : $env doit valoir prod ou dev dans options.inc.php"; |
||||
} ?> |
||||
</style> |
||||
<?php |
||||
|
||||
foreach($themeDimensionsFavicons as $dimFav) { // Indique toutes les dimensions de favicons |
||||
echo ' <link rel="icon" type="image/png" href="themes/' . $theme . '/favicons/' . $dimFav . '.png" sizes="' . $dimFav . 'x' . $dimFav . '">' . "\n"; |
||||
} ?> |
||||
foreach($themeDimensionsIcons as $dimFav) { // Indique toutes les dimensions d'icones |
||||
echo ' <link rel="icon" type="image/png" href="themes/' . $theme . '/icons/' . $dimFav . '.png" sizes="' . $dimFav . 'x' . $dimFav . '">' . "\n"; |
||||
} ?> |
||||
|
||||
</head> |
||||
|
||||
<body lang="fr"> |
||||
<body> |
||||
|
||||
<div class="center"> |
||||
|
||||
<header> |
||||
<a href="<?php echo $cheminInstall; ?>"><img id="logo" src="themes/<?php echo $theme; ?>/favicons/48.png" alt="Logo de code QR"> <h1>Générateur de codes QR</h1></a>
|
||||
<a id="lienTitres" href="./"> |
||||
<img id="logo" src="themes/<?php echo $theme; ?>/icons/64.png" alt="Code QR stylisé">
|
||||
<div id="titres"> |
||||
<h1>LibreQR</h1> |
||||
<h2>Générateur de codes QR</h2> |
||||
</div> |
||||
</a> |
||||
</header> |
||||
|
||||
<?php if (!isset($_GET["texte"])) { // Si OpenSearch n'a pas été utilisé ?>
|
||||
|
||||
<form method="post"> |
||||
|
||||
<div class="param"> |
||||
<label for="texte">Texte à encoder</label> |
||||
<span class="conteneurAide"> |
||||
<span class="boutonAide"><?php include "aide.svg"; ?></span>
|
||||
<span class="contenuAide">Vous pouvez encoder ce que vous voulez sous forme de texte.</span> |
||||
</span> |
||||
<br> |
||||
<textarea rows="8" required="" id="texte" placeholder="Entrez le texte à encoder dans le code QR" name="texte"><?php |
||||
|
||||
if (isset($_POST['texte'])) { |
||||
echo $_POST['texte']; |
||||
} |
||||
|
||||
?></textarea> |
||||
</div> |
||||
<form method="get" action="./"> |
||||
|
||||
<div id="firstWrapper"> |
||||
|
||||
<div id="couleurs"> |
||||
|
||||
<div class="param"> |
||||
<label for="couleurFond">Couleur de fond</label> |
||||
<span class="conteneurAide"> |
||||
<span class="boutonAide"><?php include "aide.svg"; ?></span>
|
||||
<span class="contenuAide">Par combien les dimensions de l'image seront-elles multipliées ?</span> |
||||
</span> |
||||
<br> |
||||
<div class="conteneurInputColor"> |
||||
<input type="color" name="couleurFond" id="couleurFond" value="<?php if (isset($_POST['couleurFond'])) {echo $_POST['couleurFond'];} else {echo "#FFFFFF";} ?>">
|
||||
</div> |
||||
</div> |
||||
|
||||
<div class="param"> |
||||
<label for="couleurPrincipale">Couleur de premier plan</label> |
||||
<span class="conteneurAide"> |
||||
<span class="boutonAide"><?php include "aide.svg"; ?></span>
|
||||
<span class="contenuAide">Nombre de pixels des bandes blanches autour du code QR.</span> |
||||
</span> |
||||
<br> |
||||
<div class="conteneurInputColor"> |
||||
<input type="color" name="couleurPrincipale" id="couleurPrincipale" value="<?php if (isset($_POST['couleurPrincipale'])) {echo $_POST['couleurPrincipale'];} else {echo "#000000";} ?>">
|
||||
</div> |
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
|
||||
<div id="menusDeroulants"> |
||||
<div class="param"> |
||||
<label for="taille">Taille de l'image</label> |
||||
<label for="txt">Texte à encoder</label> |
||||
<span class="conteneurAide"> |
||||
<span class="boutonAide"><?php include "aide.svg"; ?></span>
|
||||
<span class="contenuAide">Par combien les dimensions de l'image seront-elles multipliées ?</span> |
||||
<span class="boutonAide" tabindex="0"><?php include "aide.svg"; ?></span>
|
||||
<span class="contenuAide"> |
||||
Vous pouvez encoder ce que vous voulez sous forme de texte.<br> |
||||
Les logiciels qui décodent ces codes QR pourraient proposer de les ouvrir avec un logiciel dédié, en fonction de leur <a href="https://fr.wikipedia.org/wiki/Sch%C3%A9ma_d%27URI">schéma d'URI</a>.<br><br> |
||||
Par exemple, pour ouvrir une page Web :<br> |
||||
https://www.domaine.tld/<br><br> |
||||
Pour envoyer un mail :<br> |
||||
mailto:contact@domaine.tld<br><br> |
||||
Pour partager des coordonnées géographique :<br> |
||||
geo:48.867564,2.364057<br><br> |
||||
Pour appeler un numéro de téléphone :<br> |
||||
tel:0639981871 |
||||
</span> |
||||
</span> |
||||
<br> |
||||
<select id="taille" name="taille"> |
||||
<option <?php if (isset($_POST['taille']) AND ($_POST['taille'] == 1)) {echo 'selected="" ';} ?>value="1">1</option>
|
||||
<option <?php if (isset($_POST['taille']) AND ($_POST['taille'] == 2)) {echo 'selected="" ';} ?>value="2">2</option>
|
||||
<option <?php if (isset($_POST['taille']) AND ($_POST['taille'] == 3)) {echo 'selected="" ';} ?>value="3">3</option>
|
||||
<option <?php if ((isset($_POST['taille']) AND ($_POST['taille'] == 4)) OR (!isset($_POST['taille']))) {echo 'selected="" ';} ?>value="4">4 - par défaut</option>
|
||||
<option <?php if (isset($_POST['taille']) AND ($_POST['taille'] == 5)) {echo 'selected="" ';} ?>value="5">5</option>
|
||||
<option <?php if (isset($_POST['taille']) AND ($_POST['taille'] == 6)) {echo 'selected="" ';} ?>value="6">6</option>
|
||||
<option <?php if (isset($_POST['taille']) AND ($_POST['taille'] == 7)) {echo 'selected="" ';} ?>value="7">7</option>
|
||||
<option <?php if (isset($_POST['taille']) AND ($_POST['taille'] == 8)) {echo 'selected="" ';} ?>value="8">8</option>
|
||||
<option <?php if (isset($_POST['taille']) AND ($_POST['taille'] == 10)) {echo 'selected="" ';} ?>value="10">10</option>
|
||||
<option <?php if (isset($_POST['taille']) AND ($_POST['taille'] == 15)) {echo 'selected="" ';} ?>value="15">15</option>
|
||||
<option <?php if (isset($_POST['taille']) AND ($_POST['taille'] == 20)) {echo 'selected="" ';} ?>value="20">20</option>
|
||||
</select> |
||||
<textarea rows="8" required="" id="txt" placeholder="Entrez le texte à encoder dans le code QR" name="txt"><?php |
||||
|
||||
if (isset($_GET['txt'])) { |
||||
echo htmlspecialchars($_GET['txt']); |
||||
} |
||||
|
||||
?></textarea> |
||||
</div> |
||||
|
||||
<div class="param"> |
||||
<label for="redondance">Taux de redondance</label> |
||||
<span class="conteneurAide"> |
||||
<span class="boutonAide"><?php include "aide.svg"; ?></span>
|
||||
<span class="contenuAide">La redondance est le "doublement" des informations dans le code QR afin de corriger les erreurs lors du décodage. Un taux plus élevé produira un code QR plus grand, mais aura plus de chance d'être décodé correctement.</span> |
||||
</span> |
||||
<br> |
||||
<select id="redondance" name="redondance"> |
||||
<option <?php if (isset($_POST['redondance']) AND ($_POST['redondance'] == "L")) {echo 'selected="" ';} ?>value="L">L - 7% de redondance</option>
|
||||
<option <?php if (isset($_POST['redondance']) AND ($_POST['redondance'] == "M")) {echo 'selected="" ';} ?>value="M">M - 15% de redondance</option>
|
||||
<option <?php if (isset($_POST['redondance']) AND ($_POST['redondance'] == "Q")) {echo 'selected="" ';} ?>value="Q">Q - 25% de redondance</option>
|
||||
<option <?php if ((isset($_POST['redondance']) AND ($_POST['redondance'] == "H")) OR (!isset($_POST['redondance']))) {echo 'selected="" ';} ?>value="H">H - 30% de redondance</option>
|
||||
</select> |
||||
<div id="menusDeroulants"> |
||||
|
||||
<div class="param"> |
||||
<label for="redondancy">Taux de redondance</label> |
||||
<span class="conteneurAide"> |
||||
<span class="boutonAide" tabindex="0"><?php include "aide.svg"; ?></span>
|
||||
<span class="contenuAide">La redondance est le "doublement" des informations dans le code QR afin de corriger les erreurs lors du décodage. Un taux plus élevé produira un code QR plus grand, mais aura plus de chance d'être décodé correctement.</span> |
||||
</span> |
||||
<br> |
||||
<select id="redondancy" name="redondancy"> |
||||
<option <?php if (isset($_GET['redondancy']) AND ($_GET['redondancy'] == "L")) {echo 'selected="" ';} ?>value="L">L - 7% de redondance</option>
|
||||
<option <?php if (isset($_GET['redondancy']) AND ($_GET['redondancy'] == "M")) {echo 'selected="" ';} ?>value="M">M - 15% de redondance</option>
|
||||
<option <?php if (isset($_GET['redondancy']) AND ($_GET['redondancy'] == "Q")) {echo 'selected="" ';} ?>value="Q">Q - 25% de redondance</option>
|
||||
<option <?php if ((isset($_GET['redondancy']) AND ($_GET['redondancy'] == "H")) OR (!isset($_GET['redondancy']) OR empty($_GET['redondancy']))) {echo 'selected="" ';} ?>value="H">H - 30% de redondance</option>
|
||||
</select> |
||||
</div> |
||||
|
||||
<div class="param"> |
||||
<label for="margin">Taille de la marge</label> |
||||
<span class="conteneurAide"> |
||||
<span class="boutonAide" tabindex="0"><?php include "aide.svg"; ?></span>
|
||||
<span class="contenuAide">Nombre de pixels des bandes blanches autour du code QR.</span> |
||||
</span> |
||||
<br> |
||||
<select id="margin" name="margin"> |
||||
<option <?php if (isset($_GET['margin']) AND ($_GET['margin'] == "0")) {echo 'selected="" ';} ?>value="0">0</option>
|
||||
<option <?php if (isset($_GET['margin']) AND ($_GET['margin'] == "1")) {echo 'selected="" ';} ?>value="1">1</option>
|
||||
<option <?php if ((isset($_GET['margin']) AND ($_GET['margin'] == "2")) OR (!isset($_GET['margin']) OR empty($_GET['margin']))) {echo 'selected="" ';} ?>value="2">2 - par défaut</option>
|
||||
<option <?php if (isset($_GET['margin']) AND ($_GET['margin'] == "3")) {echo 'selected="" ';} ?>value="3">3</option>
|
||||
<option <?php if (isset($_GET['margin']) AND ($_GET['margin'] == "4")) {echo 'selected="" ';} ?>value="4">4</option>
|
||||
<option <?php if (isset($_GET['margin']) AND ($_GET['margin'] == "5")) {echo 'selected="" ';} ?>value="5">5</option>
|
||||
<option <?php if (isset($_GET['margin']) AND ($_GET['margin'] == "8")) {echo 'selected="" ';} ?>value="8">8</option>
|
||||
<option <?php if (isset($_GET['margin']) AND ($_GET['margin'] == "10")) {echo 'selected="" ';} ?>value="10">10</option>
|
||||
</select> |
||||
</div> |
||||
|
||||
<div class="param"> |
||||
<label for="size">Taille de l'image</label> |
||||
<span class="conteneurAide"> |
||||
<span class="boutonAide" tabindex="0"><?php include "aide.svg"; ?></span>
|
||||
<span class="contenuAide">Par combien les dimensions de l'image seront-elles multipliées ?</span> |
||||
</span> |
||||
<br> |
||||
<select id="size" name="size"> |
||||
<option <?php if (isset($_GET['size']) AND ($_GET['size'] == 1)) {echo 'selected="" ';} ?>value="1">1</option>
|
||||
<option <?php if (isset($_GET['size']) AND ($_GET['size'] == 2)) {echo 'selected="" ';} ?>value="2">2</option>
|
||||
<option <?php if (isset($_GET['size']) AND ($_GET['size'] == 3)) {echo 'selected="" ';} ?>value="3">3</option>
|
||||
<option <?php if ((isset($_GET['size']) AND ($_GET['size'] == 4)) OR (!isset($_GET['size']) OR empty($_GET['size']))) {echo 'selected="" ';} ?>value="4">4 - par défaut</option>
|
||||
<option <?php if (isset($_GET['size']) AND ($_GET['size'] == 5)) {echo 'selected="" ';} ?>value="5">5</option>
|
||||
<option <?php if (isset($_GET['size']) AND ($_GET['size'] == 6)) {echo 'selected="" ';} ?>value="6">6</option>
|
||||
<option <?php if (isset($_GET['size']) AND ($_GET['size'] == 8)) {echo 'selected="" ';} ?>value="8">8</option>
|
||||
<option <?php if (isset($_GET['size']) AND ($_GET['size'] == 10)) {echo 'selected="" ';} ?>value="10">10</option>
|
||||
<option <?php if (isset($_GET['size']) AND ($_GET['size'] == 15)) {echo 'selected="" ';} ?>value="15">15</option>
|
||||
<option <?php if (isset($_GET['size']) AND ($_GET['size'] == 20)) {echo 'selected="" ';} ?>value="20">20</option>
|
||||
</select> |
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
<div id="colors"> |
||||
|
||||
<div class="param"> |
||||
<label for="marge">Taille de la marge</label> |
||||
<span class="conteneurAide"> |
||||
<span class="boutonAide"><?php include "aide.svg"; ?></span>
|
||||
<span class="contenuAide">Nombre de pixels des bandes blanches autour du code QR.</span> |
||||
</span> |
||||
<br> |
||||
<select id="marge" name="marge"> |
||||
<option <?php if (isset($_POST['marge']) AND ($_POST['marge'] == "0")) {echo 'selected="" ';} ?>value="0">0</option>
|
||||
<option <?php if (isset($_POST['marge']) AND ($_POST['marge'] == "1")) {echo 'selected="" ';} ?>value="1">1</option>
|
||||
<option <?php if ((isset($_POST['marge']) AND ($_POST['marge'] == "2")) OR (!isset($_POST['marge']))) {echo 'selected="" ';} ?>value="2">2 - par défaut</option>
|
||||
<option <?php if (isset($_POST['marge']) AND ($_POST['marge'] == "3")) {echo 'selected="" ';} ?>value="3">3</option>
|
||||
<option <?php if (isset($_POST['marge']) AND ($_POST['marge'] == "5")) {echo 'selected="" ';} ?>value="5">5</option>
|
||||
<option <?php if (isset($_POST['marge']) AND ($_POST['marge'] == "10")) {echo 'selected="" ';} ?>value="10">10</option>
|
||||
</select> |
||||
<label for="bgColor">Couleur de fond</label> |
||||
<div class="conteneurInputColor"> |
||||
<input type="color" name="bgColor" id="bgColor" value="<?php if (!empty($_GET['bgColor'])) {echo htmlspecialchars($_GET['bgColor']);} else {echo "#FFFFFF";} ?>">
|
||||
</div> |
||||
</div> |
||||
|
||||
<div class="param"> |
||||
<label for="mainColor">Couleur de premier plan</label> |
||||
<div class="conteneurInputColor"> |
||||
<input type="color" name="mainColor" id="mainColor" value="<?php if (!empty($_GET['mainColor'])) {echo htmlspecialchars($_GET['mainColor']);} else {echo "#000000";} ?>">
|
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<br> |
||||
|
||||
<div class="centrer"> |
||||
<input type="submit" class="bouton" value="Générer" /> |
||||
<input class="bouton" type="submit" value="Générer" /> |
||||
</div> |
||||
<br> |
||||
<br> |
||||
|
||||
|
||||
</form> |
||||
|
||||
<?php |
||||
|
||||
if (isset($_POST['texte']) AND isset($_POST['taille']) AND isset($_POST['redondance']) AND isset($_POST['marge']) AND isset($_POST['couleurFond']) AND isset($_POST['couleurPrincipale'])) { |
||||
require "phpqrcode.php"; |
||||
<?php |
||||
|
||||
$cheminImage = "temp/" . generateRandomString(50) . ".png"; |
||||
if (!empty($_GET['txt']) AND !empty($_GET['size']) AND !empty($_GET['redondancy']) AND !empty($_GET['margin']) AND !empty($_GET['bgColor']) AND !empty($_GET['mainColor'])) { |
||||
if (isset($_GET['txt']) AND isset($_GET['size']) AND isset($_GET['redondancy']) AND isset($_GET['margin']) AND isset($_GET['bgColor']) AND isset($_GET['mainColor'])) { |
||||
require "phpqrcode.php"; |
||||
|
||||
|
||||
QRcode::png($_POST['texte'], $cheminImage, $_POST['redondance'], $_POST['taille'], $_POST['marge'], false, hexdec($_POST['couleurFond']), hexdec($_POST['couleurPrincipale'])); ?> |
||||
$cheminImage = "temp/" . generateRandomString($fileNameLenght) . ".png"; |
||||
QRcode::png($_GET['txt'], $cheminImage, $_GET['redondancy'], $_GET['size'], $_GET['margin'], false, hexdec($_GET['bgColor']), hexdec($_GET['mainColor'])); |
||||
?> |
||||
<div class="centrer"> |
||||
<a href="<?php echo $cheminImage; ?>" class="bouton" download="<?php echo htmlspecialchars($_GET['txt']); ?>.png">Télécharger ce code QR</a>
|
||||
</div> |
||||
|
||||
<div class="centrer"> |
||||
<a href="<?php echo $cheminImage; ?>" class="bouton" download="<?php echo htmlspecialchars($_POST['texte']); ?>.png">Télécharger ce code QR</a>
|
||||
</div> |
||||
<br><br> |
||||
<div class="centrer"> |
||||
<a title="Cliquez pour afficher uniquement ce code QR" href="<?php echo $cheminImage; ?>"><img alt='Un code QR contenant "<?php echo htmlspecialchars($_POST['texte']); ?>"' id="codeQR" src="<?php echo $cheminImage; ?>"/></a>
|
||||
</div> |
||||
<?php |
||||
<div class="centrer" id="showOnlyQR"> |
||||
<a title="Cliquez pour afficher uniquement ce code QR" href="<?php echo $cheminImage; ?>"><img alt='Un code QR contenant "<?php echo htmlspecialchars($_GET['txt']); ?>"' id="qrCode" src="<?php echo $cheminImage; ?>"/></a>
|
||||
</div> |
||||
<?php |
||||
} |
||||
} |
||||
?> |
||||
|
||||
<?php } else if (isset($_GET["texte"])) { // Si OpenSearch a été utilisé
|
||||
|
||||
if (empty($_GET["texte"])) { // Si rien n'a été recherché ?> |
||||
|
||||
<span style="font-size: 30px;">Erreur : vous ne pouvez pas générer un code QR vide ! |
||||
|
||||
<?php } else { |
||||
|
||||
require "phpqrcode.php"; |
||||
$cheminImage = "temp/" . generateRandomString(50) . ".png"; |
||||
|
||||
QRcode::png($_GET['texte'], $cheminImage, "H", 4, 2); ?> |
||||
|
||||
<br> |
||||
|
||||
Vous avez créé un code QR contenant : |
||||
<div class="contenuQR"><?php echo htmlspecialchars($_GET['texte']); ?></div>
|
||||
|
||||
<br> |
||||
|
||||
<div class="centrer"> |
||||
<a href="<?php echo $cheminImage; ?>" class="bouton" download="<?php echo htmlspecialchars($_GET['texte']); ?>.png">Télécharger ce code QR</a>
|
||||
</div> |
||||
<br><br> |
||||
<div class="centrer"> |
||||
<a title="Cliquez pour afficher uniquement ce code QR" href="<?php echo $cheminImage; ?>"><img alt='Un code QR contenant "<?php echo htmlspecialchars($_GET['texte']); ?>"' id="codeQR" src="<?php echo $cheminImage; ?>"/></a>
|
||||
</div> |
||||
|
||||
|
||||
?> |
||||
|
||||
<?php } } ?> |
||||
</div> |
||||
|
||||
<section class="info"> |
||||
<strong>Qu'est-ce qu'un code QR ?</strong><br> |
||||
Un code QR est une image en 2 dimensions dans laquelle est inscrite en binaire des informations textuelles.<br> |
||||
Un pixel blanc représente un 0 et un pixel noir représente un 1.<br> |
||||
<a href="https://fr.wikipedia.org/wiki/Code_QR">Code QR sur Wikipédia</a> |
||||
</section> |
||||
<div id="metaTexts"> |
||||
|
||||
<footer> |
||||
<a class="topRight" href="https://code.antopie.org/miraty/qr/">Code source</a> |
||||
</footer> |
||||
<section id="info" class="metaText"> |
||||
<h3>Qu'est-ce qu'un code QR ?</h3> |
||||
Un code QR est un code-barres en 2 dimensions dans lequel est inscrit en binaire du texte. Il peut être décodé avec un appareil muni d'un capteur photo et d'un logiciel adéquat. |
||||
<a href="https://fr.wikipedia.org/wiki/Code_QR">Code QR sur Wikipédia</a> |
||||
</section> |
||||
|
||||
<footer class="metaText"> |
||||
LibreQR 1.2.0 est un logiciel libre dont le <a href="https://code.antopie.org/miraty/qr/">code source</a> est disponible |
||||
selon les termes de l'<abbr title="GNU Affero General Public License version 3 ou toute version ultérieure"><a href="LICENSE.html">AGPLv3</a>+</abbr>. |
||||
</footer> |
||||
|
||||
</div> |
||||
|
||||
</body> |
||||
</html> |
||||
|
@ -1,15 +1,15 @@ |
||||
<?php require "options.inc.php"; ?> |
||||
<?php require "config.inc.php"; ?> |
||||
<?xml version="1.0" encoding="UTF-8" ?> |
||||
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> |
||||
<ShortName>Générer un code QR</ShortName> |
||||
<Description>Générez des codes QR depuis votre barre de recherche ou d'adresse</Description> |
||||
<?php |
||||
foreach($themeDimensionsFavicons as $dimFav) { |
||||
echo ' <Image height="' . $dimFav . '" width="' . $dimFav . '" type="image/png">' . $cheminInstall . 'themes/' . $theme . '/favicons/' . $dimFav . '.png</Image>' . "\n"; |
||||
echo ' <Image height="' . $dimFav . '" width="' . $dimFav . '" type="image/png">' . $instPath . 'themes/' . $theme . '/icons/' . $dimFav . '.png</Image>' . "\n"; |
||||
} |
||||
?> |
||||
<Language>fr</Language> |
||||
<InputEncoding>UTF-8</InputEncoding> |
||||
<Url type="text/html" template="<?php echo $cheminInstall; ?>?texte={searchTerms}"/>
|
||||
<Url type="application/opensearchdescription+xml" rel="self" template="<?php echo $cheminInstall; ?>opensearch.php" />
|
||||
<Url type="text/html" template="<?php echo $instPath; ?>?txt={searchTerms}&redondancy=<?php if (isset($_GET['redondancy'])) { echo $_GET['redondancy']; } ?>&margin=<?= $_GET['margin'] ?>&size=<?= $_GET['size'] ?>&bgColor=<?= urlencode($_GET['bgColor']) ?>&mainColor=<?= urlencode($_GET['mainColor']) ?>"/>
|
||||
<Url type="application/opensearchdescription+xml" rel="self" template="<?php echo $instPath; ?>opensearch.php" />
|
||||
</OpenSearchDescription> |
||||
|
@ -0,0 +1 @@ |
||||
*{font-family:"Ubuntu", sans-serif;scrollbar-color:#d5f3ff #157097;scrollbar-width:auto;}a{color:#d5f3ff;text-decoration:underline;}a:hover{text-decoration:none;}#firstWrapper{display:flex;flex-direction:row;}#menusDeroulants{text-align:center;margin-left:20px;}#qrCode{max-width:480px;}.centrer{text-align:center;}.bouton{padding:3px 10px 3px 10px;text-decoration:none;}form{display:block;margin-bottom:30px;}.center{display:flex;flex-direction:column;justify-content:center;margin-left:auto;margin-right:auto;width:814px;}body{margin:18px;background-color:#157097;color:#d5f3ff;font-weight:normal;font-size:20px;}body h1{color:#d5f3ff;text-decoration:none;}label{font-size:20px;}header{text-align:center;padding:0px;margin:0px;height:64px;}#logo{width:64px;height:64px;}#titres{margin-left:20px;}h1,h2,h3,h4,h5,h6{margin:0px;font-weight:normal;}h1{padding:auto;font-size:33px;}h2{font-size:22px;}#lienTitres{text-align:left;justify-content:center;text-decoration:none;display:flex;flex-direction:row;}#showOnlyQR{margin-top:30px;}.param{padding:10px;padding-left:0px;margin-left:0px;padding-right:0px;margin-right:0px;}.conteneurInputColor{display:flex;flex-direction:row;justify-content:center;}::selection{color:#157097;background-color:#d5f3ff;}label[for=txt]{padding-left:22px;}#colors{display:flex;flex-direction:row;justify-content:space-between;text-align:center;}#colors .param{text-align:center;display:flex;justify-content:center;flex-direction:column;width:100%;}.metaText{color:#65b7da;text-align:left;transition:color 0.12s cubic-bezier(0.42,0.0,1.0,1.0);position:fixed;width:400px;}.metaText a:link{transition:color 0.12s cubic-bezier(0.42,0.0,1.0,1.0);color:#65b7da;text-decoration:underline;}.metaText:hover,.metaText:hover a:link{color:#d5f3ff;}footer{font-size:14px;bottom:20px;left:20px;}#info{font-size:16px;bottom:20px;right:20px;margin:0px;}#info h3{font-size:20px;font-weight:normal;padding-bottom:10px;}#redondancy,#margin,#txt,#size,input[type=color],input[type=submit],.bouton{border:2px #48aed9 solid;border-radius:10px;font-size:20px;padding-left:10px;font-weight:normal;color:#d5f3ff;transition:border 0.1s linear;background-color:#2794c2;margin-top:8px;}#redondancy:hover,#margin:hover,#txt:hover,#size:hover,input[type=color]:hover,input[type=submit]:hover,.bouton:hover{border:2px #87d1f1 solid;}#redondancy:focus,#margin:focus,#txt:focus,#size:focus,input[type=color]:focus,input[type=submit]:focus,.bouton:focus{border:2px #e2f6ff solid;outline:none;}#redondancy,#size,#margin{background-color:#2794c2;width:250px;height:40px;}#txt{background-color:#2794c2;color:#d5f3ff;padding:10px;margin:10px;width:500px;scrollbar-color:#d5f3ff #2794c2;scrollbar-width:auto;}input[type=submit]{font-size:28px;padding:10px;padding-left:14px;padding-right:14px;}#txt::placeholder{color:#65b7da;opacity:1;font-family:"Ubuntu", sans-serif;font-weight:normal;font-size:1em;}input[type=color]{height:60px;width:84px;padding:5px;border:2px #48aed9 solid;}svg{width:20px;height:20px;margin-bottom:-3px;margin-left:5px;}.boutonAide{height:0px;width:0px;color:#d5f3ff;cursor:help;}.conteneurAide .contenuAide{position:absolute;transform:scale(0) rotate(-12deg);color:#d5f3ff;background:#118abe;padding:15px;border-radius:10px;box-shadow:0 0 10px rgba(0,0,0,0.5);margin-top:23px;margin-left:-35px;transition:all .25s;opacity:0;max-width:500px;font-size:20px;text-align:left;}@media (max-width: 500px){.conteneurAide .contenuAide{width:300px;}}.conteneurAide:hover .contenuAide,.conteneurAide:focus-within .contenuAide{transform:scale(1) rotate(0);opacity:1;}@media (max-width: 1400px){.metaText{width:250px;}}@media (max-width: 1050px){#metaTexts{display:flex;flex-direction:row;}.metaText{width:100%;position:static;font-size:20px;}footer{margin-top:50px;}#info{color:#d5f3ff;margin-bottom:20px;padding-top:30px;}#info a:link{color:#d5f3ff;}}@media (max-width: 850px){#metaTexts{flex-direction:column;width:480px;justify-content:center;margin-left:auto;margin-right:auto;}.center{width:auto;}#firstWrapper{flex-direction:column;}body{margin:10px;}#txt{width:92%;}}@media (max-width: 500px){#metaTexts{width:auto;}#colors{flex-direction:column;}h1{font-size:28px;padding-top:6px;}#txt{width:85%;}#qrCode{max-width:94%;}}@media (max-width: 415px){h1{padding:0px;}} |
@ -0,0 +1 @@ |
||||
|
Before Width: | Height: | Size: 392 B |
Before Width: | Height: | Size: 401 B |
After Width: | Height: | Size: 612 B |
After Width: | Height: | Size: 433 B |
After Width: | Height: | Size: 760 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 480 B |
After Width: | Height: | Size: 1.3 KiB |