Compare commits
12 Commits
add-attach
...
add-htacce
Author | SHA1 | Date | |
---|---|---|---|
a5a934a108 | |||
876a925f79 | |||
5b06af2026 | |||
d8070b6260 | |||
ca9d3b2d98 | |||
92c26dab45 | |||
4da327413c | |||
8d8ea7adf3 | |||
ea34094d41 | |||
8f7e94e482 | |||
952121b1d2 | |||
5cb0055bee |
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.DS_Store
|
||||||
|
.history/
|
@ -0,0 +1,9 @@
|
|||||||
|
RewriteEngine On
|
||||||
|
|
||||||
|
# browser requests PHP
|
||||||
|
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^\ ]+)\.php
|
||||||
|
RewriteRule ^/?(.*)\.php$ /$1 [L,R=301]
|
||||||
|
|
||||||
|
# check to see if the request is for a PHP file:
|
||||||
|
RewriteCond %{REQUEST_FILENAME}\.php -f
|
||||||
|
RewriteRule ^/?(.*)$ /$1.php [L]
|
18
cron.php
18
cron.php
@ -16,7 +16,9 @@
|
|||||||
peripeties();
|
peripeties();
|
||||||
print "Envoi des arrivées" . EOLH;
|
print "Envoi des arrivées" . EOLH;
|
||||||
arrivee();
|
arrivee();
|
||||||
|
anonymisation();
|
||||||
|
|
||||||
|
################################### FONCTIONS #################################""
|
||||||
function peripetieDatee()
|
function peripetieDatee()
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
@ -130,7 +132,7 @@
|
|||||||
$query = "SELECT * FROM avionpoeme WHERE atteri = 0 AND TIMEDIFF(CONCAT_WS(' ',CURDATE(),CURTIME()),deliveryTimeServer) > '00:00'";
|
$query = "SELECT * FROM avionpoeme WHERE atteri = 0 AND TIMEDIFF(CONCAT_WS(' ',CURDATE(),CURTIME()),deliveryTimeServer) > '00:00'";
|
||||||
$db->query($query);
|
$db->query($query);
|
||||||
$avionArrive = $db->result->fetch_all(MYSQLI_ASSOC);
|
$avionArrive = $db->result->fetch_all(MYSQLI_ASSOC);
|
||||||
var_dump($avionArrive);
|
//var_dump($avionArrive);
|
||||||
foreach ($avionArrive as $avion)
|
foreach ($avionArrive as $avion)
|
||||||
{
|
{
|
||||||
print "avion poème n° " . $avion['idAvion'] . "a atterri" . EOLH;
|
print "avion poème n° " . $avion['idAvion'] . "a atterri" . EOLH;
|
||||||
@ -196,4 +198,18 @@
|
|||||||
print json_last_error_msg() .EOLH;
|
print json_last_error_msg() .EOLH;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function anonymisation()
|
||||||
|
{
|
||||||
|
global $db;
|
||||||
|
$query = "SELECT idAvion FROM avionpoeme WHERE atteri = 1 AND public = 0 AND DATEDIFF(CONCAT_WS(' ',CURDATE(),CURTIME()),deliveryTimeServer) > '7'";
|
||||||
|
$db->query($query);
|
||||||
|
$avionArrive = $db->result->fetch_all(MYSQLI_ASSOC);
|
||||||
|
//print_r($avionArrive);
|
||||||
|
foreach($avionArrive as $avion)
|
||||||
|
{
|
||||||
|
$query = "UPDATE avionpoeme SET message='', expeMail='', destMail='' WHERE idAvion='" . $avion['idAvion'] ."'";
|
||||||
|
$db->query($query);
|
||||||
|
}
|
||||||
|
}
|
||||||
$db->close();
|
$db->close();
|
||||||
|
@ -67,15 +67,22 @@ function verifPeripetieAvion()
|
|||||||
$db->query($query);
|
$db->query($query);
|
||||||
$avions = $db->result->fetch_all(MYSQLI_ASSOC);
|
$avions = $db->result->fetch_all(MYSQLI_ASSOC);
|
||||||
$avionsId = array_column($avions, 'expeMail', 'idAvion');
|
$avionsId = array_column($avions, 'expeMail', 'idAvion');
|
||||||
print_r($avionsId);
|
//print_r($avionsId);
|
||||||
|
$flag = false;
|
||||||
foreach($peripeties as $peripetie)
|
foreach($peripeties as $peripetie)
|
||||||
{
|
{
|
||||||
print "Péripétie " . $peripetie["idAP"] . EOLH;
|
//print "Péripétie " . $peripetie["idAP"] . EOLH;
|
||||||
$idAvion = $peripetie["idAvion"];
|
$idAvion = $peripetie["idAvion"];
|
||||||
if ( empty($avionsId[$idAvion]) )
|
if ( empty($avionsId[$idAvion]) )
|
||||||
{
|
{
|
||||||
print "Péripétie " . $peripetie["idAP"] . " n'a pas d'avion poème idAvion=>" . $idAvion . EOLH;
|
print "Péripétie " . $peripetie["idAP"] . " n'a pas d'avion poème idAvion=>" . $idAvion . EOLH;
|
||||||
|
$flag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if ( ! $flag )
|
||||||
|
{
|
||||||
|
print "Aucune erreur détectée";
|
||||||
}
|
}
|
||||||
$db->close();
|
$db->close();
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
<a href="stats.php">Statistiques</a><br>
|
||||||
<a href="lang.php">Générer les fichiers de langue</a><br>
|
<a href="lang.php">Générer les fichiers de langue</a><br>
|
||||||
<a href="logs.php">Lire les logs</a><br>
|
<a href="logs.php">Lire les logs</a><br>
|
||||||
<a href="gestionDB.php">Vérifier la base de données</a><br>
|
<a href="gestionDB.php">Vérifier la base de données</a><br>
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
$result = $db->result->fetch_assoc();
|
$result = $db->result->fetch_assoc();
|
||||||
return $result['Auto_increment']-1;
|
return $result['Auto_increment']-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
function total() //nombre d'avions poèmes présents dans la base
|
function total() //nombre d'avions poèmes présents dans la base
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
@ -27,26 +28,42 @@
|
|||||||
function totalenvol() //nombre d'avions poèmes en vol
|
function totalenvol() //nombre d'avions poèmes en vol
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
$query = "SELECT COUNT(*) as n FROM avionpoeme WHERE public!=2";
|
$query = "SELECT COUNT(*) as n FROM avionpoeme WHERE atteri!=1";
|
||||||
$db->query($query);
|
$db->query($query);
|
||||||
$result = $db->result->fetch_assoc();
|
$result = $db->result->fetch_assoc();
|
||||||
return $result["n"];
|
return $result["n"];
|
||||||
}
|
}
|
||||||
|
|
||||||
function alea()
|
function alea($nAvionEnvoye)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
$query = "SELECT COUNT(*) as nAvion FROM avionpoeme WHERE ";
|
$query = "SELECT DISTINCT deliveryMethod FROM avionpoeme";
|
||||||
|
$db->query($query);
|
||||||
|
$result = $db->result->fetch_all(MYSQLI_ASSOC);
|
||||||
|
//var_dump($result);
|
||||||
|
foreach ( $result as $method )
|
||||||
|
{
|
||||||
|
$query = "SELECT COUNT(*) as nAvion FROM avionpoeme WHERE deliveryMethod='" . $method["deliveryMethod"] . "'";
|
||||||
$db->query($query);
|
$db->query($query);
|
||||||
$result = $db->result->fetch_assoc();
|
$result = $db->result->fetch_assoc();
|
||||||
return $result["n"];
|
echo "Méthode => " . $method["deliveryMethod"] . " nombre d'avion poèmes => " . $result["nAvion"] . " => " . round($result["nAvion"]/$nAvionEnvoye*100,2) . "%" . EOLH;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function anonymous() //nombre d'avions poèmes envoyés anonymement
|
function anonymous() //nombre d'avions poèmes envoyés anonymement
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
$query = "SELECT COUNT(*) as n FROM avionpoeme WHERE expemail=''";
|
$query = "SELECT COUNT(*) as n FROM avionpoeme WHERE expeknown='0'";
|
||||||
|
$db->query($query);
|
||||||
|
$result = $db->result->fetch_assoc();
|
||||||
|
return $result["n"];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function deleted()
|
||||||
|
{
|
||||||
|
global $db;
|
||||||
|
$query = "SELECT COUNT(*) as n FROM avionpoeme WHERE public='2'";
|
||||||
$db->query($query);
|
$db->query($query);
|
||||||
$result = $db->result->fetch_assoc();
|
$result = $db->result->fetch_assoc();
|
||||||
return $result["n"];
|
return $result["n"];
|
||||||
@ -63,11 +80,14 @@
|
|||||||
echo "Nombre total d'avions-poème : " . $nAvionEnvoye . EOLH;
|
echo "Nombre total d'avions-poème : " . $nAvionEnvoye . EOLH;
|
||||||
$total = total();
|
$total = total();
|
||||||
$avionSupp = $nAvionEnvoye-$total;
|
$avionSupp = $nAvionEnvoye-$total;
|
||||||
echo "Nombre d'avion supprimés : " . $avionSupp . " => " . round($avionSupp/$nAvionEnvoye*100,3) . "%" . EOLH;
|
echo "Nombre d'avion supprimés : " . $avionSupp . " => " . round($avionSupp/$nAvionEnvoye*100,2) . "%" . EOLH;
|
||||||
$nAvionenvol = totalenvol();
|
$nAvionenvol = totalenvol();
|
||||||
echo "Nombre d'avions-poème en vol : " . $nAvionenvol . " => " . round($nAvionenvol/$nAvionEnvoye*100) . "%" . EOLH;
|
echo "Nombre d'avions-poème en vol : " . $nAvionenvol . " => " . round($nAvionenvol/$nAvionEnvoye*100,2) . "%" . EOLH;
|
||||||
$anonymous = anonymous();
|
$anonymous = anonymous();
|
||||||
echo "Nombre d'envois anonymes : " . $anonymous . " => " . round($anonymous/$nAvionEnvoye*100) . "%" . EOLH;
|
echo "Nombre d'envois anonymes : " . $anonymous . " => " . round($anonymous/$nAvionEnvoye*100,2) . "%" . EOLH;
|
||||||
|
$deleted = deleted();
|
||||||
|
echo "Nombre d'avions anonymisés(effacés) : " . $deleted . " => " . round($deleted/$nAvionEnvoye*100,2) . "%" . EOLH;
|
||||||
|
alea($nAvionEnvoye);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,12 +20,10 @@ $site = "Avion Poème";
|
|||||||
$dossier = "/www";
|
$dossier = "/www";
|
||||||
$basedir = dirname($_SERVER['DOCUMENT_ROOT']) . $dossier;
|
$basedir = dirname($_SERVER['DOCUMENT_ROOT']) . $dossier;
|
||||||
|
|
||||||
$base_url = "http://avion-poe.me";
|
$base_url = "https://avion-poe.me";
|
||||||
$base_path = "/flex/storage/avion-poe.me/site/www/";
|
$base_path = "/flex/storage/avion-poe.me/site/www/";
|
||||||
$url_admin = $base_url . "/gestion";
|
$url_admin = $base_url . "/gestion";
|
||||||
$accueil = $base_url . "/index.html";
|
$accueil = $base_url . "/index.html";
|
||||||
if (empty( $_SERVER["PHP_AUTH_USER"]))
|
if (empty($_SERVER["PHP_AUTH_USER"])) {
|
||||||
{
|
|
||||||
$_SERVER["PHP_AUTH_USER"] = 'script';
|
$_SERVER["PHP_AUTH_USER"] = 'script';
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
@ -98,6 +98,11 @@ class db
|
|||||||
function newPlane() //return 0 on error
|
function newPlane() //return 0 on error
|
||||||
{
|
{
|
||||||
global $base_url;
|
global $base_url;
|
||||||
|
if (round($this->startLat,3,PHP_ROUND_HALF_DOWN)==round($this->destLat,3,PHP_ROUND_HALF_DOWN) && round($this->startLon,3,PHP_ROUND_HALF_DOWN)==round($this->destLon,3,PHP_ROUND_HALF_DOWN))
|
||||||
|
{
|
||||||
|
$this->destLon+=0.001;
|
||||||
|
$this->destLat+=0.001;
|
||||||
|
}
|
||||||
$query = "INSERT INTO avionpoeme VALUES ('0','";
|
$query = "INSERT INTO avionpoeme VALUES ('0','";
|
||||||
$query .= $this->protect($this->message) . "', '";
|
$query .= $this->protect($this->message) . "', '";
|
||||||
$query .= $this->protect($this->expeMail) . "', ";
|
$query .= $this->protect($this->expeMail) . "', ";
|
||||||
@ -165,7 +170,7 @@ class db
|
|||||||
|
|
||||||
function getCurrentPlanes()
|
function getCurrentPlanes()
|
||||||
{
|
{
|
||||||
$query = "SELECT idAvion as uid, UNIX_TIMESTAMP(deliveryTime) as deliveryTime, deliveryTZ, destLat, destLon, destName, UNIX_TIMESTAMP(startTime) as startTime, startTZ, startLon, startLat, startName, color FROM avionpoeme WHERE deliveryTimeServer>NOW()";
|
$query = "SELECT idAvion as uid, UNIX_TIMESTAMP(deliveryTime) as deliveryTime, deliveryTZ, destLat, destLon, destName, message, UNIX_TIMESTAMP(startTime) as startTime, startTZ, startLon, startLat, startName, color, message FROM avionpoeme WHERE deliveryTimeServer>NOW()";
|
||||||
$this->query($query);
|
$this->query($query);
|
||||||
$planes = $this->result->fetch_all(MYSQLI_ASSOC);
|
$planes = $this->result->fetch_all(MYSQLI_ASSOC);
|
||||||
print json_encode($planes);
|
print json_encode($planes);
|
||||||
@ -234,6 +239,3 @@ class db
|
|||||||
return $this->avionJournalier;
|
return $this->avionJournalier;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
31
index.php
31
index.php
@ -13,6 +13,31 @@
|
|||||||
<canvas id="blankCanvas2" width="400" height="400" style="border:1px solid #d3d3d3; display:none"></canvas>
|
<canvas id="blankCanvas2" width="400" height="400" style="border:1px solid #d3d3d3; display:none"></canvas>
|
||||||
<img style="display:none;" id="front" src="src/img/front.jpg" />
|
<img style="display:none;" id="front" src="src/img/front.jpg" />
|
||||||
<img style="display:none;" id="back" src="src/img/back-FF5555.jpg" />
|
<img style="display:none;" id="back" src="src/img/back-FF5555.jpg" />
|
||||||
|
<?php
|
||||||
|
if (isset($_GET['avionpoeme']) && $_GET['avionpoeme'] !== '') { ?>
|
||||||
|
<script id="planeFoldScript.txt" type="not-javascript"> <!-- From https://github.com/RemiKoutcherawy/OriSim3D-JS was fun to code -->
|
||||||
|
d -200 200 -200 -200 200 -200 200 200
|
||||||
|
c 0 1 c 0 3 c 0 2 c 1 3
|
||||||
|
c 0 8 c 8 3 c 0 4 c 4 1
|
||||||
|
c 6 0 c 6 1 c 6 2 c 6 3
|
||||||
|
iad t 0 ty 6 tx -3)
|
||||||
|
t 0 r 48 -179.99 21 0 10 r 55 -179.99 17 3 19 )
|
||||||
|
t 0 r 43 160 1 4 0 21 24 12 11 13 9 10)
|
||||||
|
t 0 ty -80)
|
||||||
|
t 0 tx -60)
|
||||||
|
t 0 r 27 -80 3 19 5 22 2 a 3)
|
||||||
|
t 0 r 23 -80 0 21 4 24 1 a 0)
|
||||||
|
t 500 r 23 80 0 21 4 24 1 a 0)
|
||||||
|
t 0 r 23 -90 0 a 0)
|
||||||
|
t 500 r 27 80 3 19 5 22 2 a 3)
|
||||||
|
t 0 r 27 -90 3 a 3)
|
||||||
|
t 700 tx 60)
|
||||||
|
t 700 ty 80)
|
||||||
|
t 750 r 43 -160 1 4 0 21 24 12 11 13 9 10)
|
||||||
|
t 750 r 48 179.99 21 0 10 r 55 179.99 17 3 19 )
|
||||||
|
iad t 1200 ty -6 tx 3)
|
||||||
|
</script>
|
||||||
|
<?php } else { ?>
|
||||||
<script id="planeFoldScript.txt" type="not-javascript"> <!-- From https://github.com/RemiKoutcherawy/OriSim3D-JS was fun to code -->
|
<script id="planeFoldScript.txt" type="not-javascript"> <!-- From https://github.com/RemiKoutcherawy/OriSim3D-JS was fun to code -->
|
||||||
d -200 200 -200 -200 200 -200 200 200
|
d -200 200 -200 -200 200 -200 200 200
|
||||||
c 0 1 c 0 3 c 0 2 c 1 3
|
c 0 1 c 0 3 c 0 2 c 1 3
|
||||||
@ -26,6 +51,8 @@
|
|||||||
t 500 r 23 -80 0 21 4 24 1 a 0)
|
t 500 r 23 -80 0 21 4 24 1 a 0)
|
||||||
t 1000 tx -35 z 0 0 0 il 100 100)
|
t 1000 tx -35 z 0 0 0 il 100 100)
|
||||||
</script>
|
</script>
|
||||||
|
<?php }
|
||||||
|
?>
|
||||||
<!-- Modal new plane-->
|
<!-- Modal new plane-->
|
||||||
<div class="modal fade" id="newPlaneModal" tabindex="-1" role="dialog" aria-labelledby="newPlaneModal" aria-hidden="true">
|
<div class="modal fade" id="newPlaneModal" tabindex="-1" role="dialog" aria-labelledby="newPlaneModal" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-lg" role="document">
|
<div class="modal-dialog modal-lg" role="document">
|
||||||
@ -55,10 +82,10 @@
|
|||||||
<div class="form-control rounded-0" id="messageTextArea"></div>
|
<div class="form-control rounded-0" id="messageTextArea"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="bold">Ajouter une piève jointe</label>
|
<label class="bold" id="labelAttachment"></label>
|
||||||
<div class="custom-file">
|
<div class="custom-file">
|
||||||
<input type="file" class="custom-file-input" id="attachmentPlane" aria-describedby="inputGroupFileAddon01">
|
<input type="file" class="custom-file-input" id="attachmentPlane" aria-describedby="inputGroupFileAddon01">
|
||||||
<label class="custom-file-label" for="attachmentPlane"></label>
|
<label class="custom-file-label" for="attachmentPlane" id="attachmentPlaneLabel"></label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
@ -74,3 +74,5 @@ AvionPoeme_epuise|100 avions-poèmes ont déjà été lancés aujourd'hui, veuil
|
|||||||
NB_AvionPoeme_restant|$NB_avion_poeme avions-poèmes peuvent encore être lancés aujourd'hui! A votre plume!|$NB_avion_poeme flight-poems can still be launched today! Get out your pens!|$NB_avion_poeme Gedichte-Flieger können noch heute losgeschickt werden! An Ihrem Stift!|$NB_avion_poeme самолет–поеми могат да стартират днес! Хващайте писалката!|$NB_avion_poeme 詩作紙飞机今天仍然可发送 。拿起笔來吧!|$NB_avion_poeme 今日も飛行機の詩を飛ばしていただくことができます!あなたが書いたものを!|$NB_avion_poeme aviones-poemas todavía se pueden lanzar hoy. ¡En tu pluma!|$NB_avion_poeme aviões-poemas ainda podem ser lançados hoje! Na sua caneta!|لا يزال من الممكن إطلاق $NB_avion_poeme الطائرات-القصائد اليوم! أحضروا أقلامكم
|
NB_AvionPoeme_restant|$NB_avion_poeme avions-poèmes peuvent encore être lancés aujourd'hui! A votre plume!|$NB_avion_poeme flight-poems can still be launched today! Get out your pens!|$NB_avion_poeme Gedichte-Flieger können noch heute losgeschickt werden! An Ihrem Stift!|$NB_avion_poeme самолет–поеми могат да стартират днес! Хващайте писалката!|$NB_avion_poeme 詩作紙飞机今天仍然可发送 。拿起笔來吧!|$NB_avion_poeme 今日も飛行機の詩を飛ばしていただくことができます!あなたが書いたものを!|$NB_avion_poeme aviones-poemas todavía se pueden lanzar hoy. ¡En tu pluma!|$NB_avion_poeme aviões-poemas ainda podem ser lançados hoje! Na sua caneta!|لا يزال من الممكن إطلاق $NB_avion_poeme الطائرات-القصائد اليوم! أحضروا أقلامكم
|
||||||
Soutenez_avionpoeme|Offrez-nous un verre de vin |Offer us a beer |Schenken Sie uns ein Bier!|Почерпете ни с ракия!|请给我们倒茶|お酒をください|¡Ofrécenos una cerveza! |Ofereça-nos uma cerveja|من فضلك اعطنا الشاي
|
Soutenez_avionpoeme|Offrez-nous un verre de vin |Offer us a beer |Schenken Sie uns ein Bier!|Почерпете ни с ракия!|请给我们倒茶|お酒をください|¡Ofrécenos una cerveza! |Ofereça-nos uma cerveja|من فضلك اعطنا الشاي
|
||||||
AvionPoeme_free_independent|Avion-poe.me est gratuit, libre (open source) et indépendant|Avion-poe.me is free (as in freedom), free (as in free beer) and independent|Avion-poe.me ist kostenlos, frei (open source) und unabhängig |Avion-poe.me е безплатен, свободен (с отворен код) и независим |Avion-poe.me 是免费、开源和独立的 |Avion-poe.me は無料で、オープンソースで独立しています |Avion-poe.me es gratuito, libre (de código abierto) e independiente |Avion-poe.me é gratuito, libre (de código aberto) e independente |عملنا مجاني وحر (مفتوح المصدر) ومستقل
|
AvionPoeme_free_independent|Avion-poe.me est gratuit, libre (open source) et indépendant|Avion-poe.me is free (as in freedom), free (as in free beer) and independent|Avion-poe.me ist kostenlos, frei (open source) und unabhängig |Avion-poe.me е безплатен, свободен (с отворен код) и независим |Avion-poe.me 是免费、开源和独立的 |Avion-poe.me は無料で、オープンソースで独立しています |Avion-poe.me es gratuito, libre (de código abierto) e independiente |Avion-poe.me é gratuito, libre (de código aberto) e independente |عملنا مجاني وحر (مفتوح المصدر) ومستقل
|
||||||
|
PJ_Parcourir|Parcourir|Browse|Durchsuchen|Прегледаване|浏览|ブラウズ |Navegar|Navegar|تصفح
|
||||||
|
PJ_Ajouter|Ajouter un pièce jointe (max. 2 Mo)|Attach file (2 MB max.)|Datei anhängen (2 MB max.)|Прикачване на файл (2 MB макс.)|附加文件 (最大 2 MB )|ファイルを添付する (最大2MB)|Adjuntar archivo (2 MB máx. )|Anexar arquivo (2 MB máx.)|إرفق ملف (2MB max)
|
||||||
|
Can't render this file because it contains an unexpected character in line 37 and column 114.
|
@ -299,13 +299,13 @@ a#navbarDropdownLang.nav-link.dropdown-toggle::after {
|
|||||||
content: "\f0fc";
|
content: "\f0fc";
|
||||||
}
|
}
|
||||||
|
|
||||||
#donationElt #donationButton .btn.ar:before,
|
#donationElt #donationButton .btn.ar:before {
|
||||||
#donationElt #donationButton .btn.bg:before {
|
|
||||||
content: "\f875";
|
content: "\f875";
|
||||||
}
|
}
|
||||||
|
|
||||||
#donationElt #donationButton .btn.zh:before,
|
#donationElt #donationButton .btn.zh:before,
|
||||||
#donationElt #donationButton .btn.ja:before {
|
#donationElt #donationButton .btn.ja:before,
|
||||||
|
#donationElt #donationButton .btn.bg:before {
|
||||||
content: "\f7a0";
|
content: "\f7a0";
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
@ -338,5 +338,5 @@ a#navbarDropdownLang.nav-link.dropdown-toggle::after {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.custom-file-label::after {
|
.custom-file-label::after {
|
||||||
content: "Parcourir";
|
content: attr(data-after);
|
||||||
}
|
}
|
||||||
|
@ -1,31 +1,43 @@
|
|||||||
var validExpeMail = false
|
var validExpeMail = false;
|
||||||
var validExpeLoc = false //turned to true in geocoder.js
|
var validExpeLoc = false; //turned to true in geocoder.js
|
||||||
var validDestMail = false
|
var validDestMail = false;
|
||||||
var validDestLoc = false //turned to true in geocoder.js
|
var validDestLoc = false; //turned to true in geocoder.js
|
||||||
|
|
||||||
function validateEmail(email) { //from https://stackoverflow.com/questions/46155/how-to-validate-an-email-address-in-javascript
|
function validateEmail(email) {
|
||||||
const re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
//from https://stackoverflow.com/questions/46155/how-to-validate-an-email-address-in-javascript
|
||||||
|
const re =
|
||||||
|
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||||||
return re.test(String(email).toLowerCase());
|
return re.test(String(email).toLowerCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#expeMail").change(function () {
|
$("#expeMail").change(function () {
|
||||||
validExpeMail = validateEmail($("#expeMail").val())
|
validExpeMail = validateEmail($("#expeMail").val());
|
||||||
checkFormValid()
|
checkFormValid();
|
||||||
})
|
});
|
||||||
|
|
||||||
$("#destMail").change(function () {
|
$("#destMail").change(function () {
|
||||||
validDestMail = validateEmail($("#destMail").val())
|
validDestMail = validateEmail($("#destMail").val());
|
||||||
checkFormValid()
|
checkFormValid();
|
||||||
})
|
});
|
||||||
|
|
||||||
document.querySelector('.custom-file-input').addEventListener('change',function(e){
|
document
|
||||||
var fileName = document.getElementById("attachmentPlane").files[0].name;
|
.querySelector(".custom-file-input")
|
||||||
var nextSibling = e.target.nextElementSibling
|
.addEventListener("change", function (e) {
|
||||||
nextSibling.innerText = fileName
|
const file = e.target.files[0];
|
||||||
})
|
const fileName = file.name;
|
||||||
|
var nextSibling = e.target.nextElementSibling;
|
||||||
|
nextSibling.innerText = fileName;
|
||||||
|
|
||||||
|
const filesize = (file.size / 1024 / 1024).toFixed(4); // MB
|
||||||
|
if (filesize >= 2.2) {
|
||||||
|
e.target.classList.add("is-invalid");
|
||||||
|
} else {
|
||||||
|
e.target.classList.remove("is-invalid");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
function checkFormValid() {
|
function checkFormValid() {
|
||||||
if (validExpeMail && validExpeLoc && validDestMail && validDestLoc) {
|
if (validExpeMail && validExpeLoc && validDestMail && validDestLoc) {
|
||||||
$('#sendNewPlane').prop("disabled", false)
|
$("#sendNewPlane").prop("disabled", false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
20
src/map.js
20
src/map.js
@ -303,12 +303,20 @@ loader.load(function(loader, resources) {
|
|||||||
var queryString = window.location.search;
|
var queryString = window.location.search;
|
||||||
queryString = queryString.split('=')[1]
|
queryString = queryString.split('=')[1]
|
||||||
if(Number(queryString)==data.uid){
|
if(Number(queryString)==data.uid){
|
||||||
setTimeout(
|
$("#back").attr("src","src/img/back-"+data.color+".jpg");
|
||||||
function()
|
html = data.message;
|
||||||
{
|
var canvas1 = document.getElementById("blankCanvas1");
|
||||||
map.setView([data.currentPosition.geometry.coordinates[1],data.currentPosition.geometry.coordinates[0]], 15);
|
rasterizeHTML.drawHTML(html, canvas1,{zoom:0.7}).then(function success(renderResult) {
|
||||||
openPopup(marker)
|
var canvas2 = document.getElementById("blankCanvas2");
|
||||||
}, 100);
|
var ctx = canvas2.getContext("2d");
|
||||||
|
ctx.fillStyle = "#" + data.color;
|
||||||
|
ctx.fillRect(0,0,400,400);
|
||||||
|
ctx.drawImage(canvas1, 0, 0,400,400)
|
||||||
|
ctx.font = "9px Courier";
|
||||||
|
$("#front").attr('src',document.getElementById("blankCanvas2").toDataURL())
|
||||||
|
$("#canvas3d").css('display','block')
|
||||||
|
animePlane();
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,173 +1,185 @@
|
|||||||
// Default lang
|
// Default lang
|
||||||
var lang = 'en'
|
var lang = "en";
|
||||||
|
|
||||||
// Lang by session
|
// Lang by session
|
||||||
var langSession = sessionStorage.getItem('lang');
|
var langSession = sessionStorage.getItem("lang");
|
||||||
// Lang by navigator config
|
// Lang by navigator config
|
||||||
var userLang = navigator.userLanguage || navigator.language;
|
var userLang = navigator.userLanguage || navigator.language;
|
||||||
|
|
||||||
if (langSession) {
|
if (langSession) {
|
||||||
lang = langSession.substring(0,2)
|
lang = langSession.substring(0, 2);
|
||||||
} else if (userLang) {
|
} else if (userLang) {
|
||||||
lang = userLang.substring(0,2)
|
lang = userLang.substring(0, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
//loading the lang.json file
|
//loading the lang.json file
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
translateUI(lang)
|
translateUI(lang);
|
||||||
$.getJSON("lang/lang.json", function (data) {
|
$.getJSON("lang/lang.json", function (data) {
|
||||||
//creating dropdown list of languages in navbar
|
//creating dropdown list of languages in navbar
|
||||||
for (var key in data) {
|
for (var key in data) {
|
||||||
$("#langChoices").append( '<a class="dropdown-item langSelect" value="'+key+'" href="#">'+data[key]+'</a>' )
|
$("#langChoices").append(
|
||||||
$("#selectDestLang").append( '<option value="'+key+'" href="#">'+data[key]+'</option>' )
|
'<a class="dropdown-item langSelect" value="' +
|
||||||
|
key +
|
||||||
|
'" href="#">' +
|
||||||
|
data[key] +
|
||||||
|
"</a>"
|
||||||
|
);
|
||||||
|
$("#selectDestLang").append(
|
||||||
|
'<option value="' + key + '" href="#">' + data[key] + "</option>"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
//setting the user lang
|
//setting the user lang
|
||||||
if (data[lang]) {
|
if (data[lang]) {
|
||||||
//$("#navbarDropdownLang").html(data[lang])
|
//$("#navbarDropdownLang").html(data[lang])
|
||||||
translateUI(lang)
|
translateUI(lang);
|
||||||
}
|
}
|
||||||
//or english if not in list
|
//or english if not in list
|
||||||
else {
|
else {
|
||||||
//$("#navbarDropdownLang").html("English")
|
//$("#navbarDropdownLang").html("English")
|
||||||
translateUI('en')
|
translateUI("en");
|
||||||
}
|
}
|
||||||
$(".langSelect").on('click',function(e){
|
$(".langSelect").on("click", function (e) {
|
||||||
lang = e.currentTarget.attributes[1].value
|
lang = e.currentTarget.attributes[1].value;
|
||||||
sessionStorage.setItem('lang', lang);
|
sessionStorage.setItem("lang", lang);
|
||||||
translateUI(lang)
|
translateUI(lang);
|
||||||
//$("#navbarDropdownLang").html($(this).html())
|
//$("#navbarDropdownLang").html($(this).html())
|
||||||
})
|
});
|
||||||
}).fail(function (error) {
|
}).fail(function (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
var dictionnary = []
|
var dictionnary = [];
|
||||||
|
|
||||||
function translateUI(l) {
|
function translateUI(l) {
|
||||||
$.getJSON("lang/" + l + "", function (s) {
|
$.getJSON("lang/" + l + "", function (s) {
|
||||||
dictionnary = s
|
dictionnary = s;
|
||||||
//if arabic : display left to right (ltr) + troubleshooting a lot of individual elements
|
//if arabic : display left to right (ltr) + troubleshooting a lot of individual elements
|
||||||
if (lang == "ar") {
|
if (lang == "ar") {
|
||||||
//navbar
|
//navbar
|
||||||
$("nav").css('direction','rtl')
|
$("nav").css("direction", "rtl");
|
||||||
$(".nav-menus").removeClass('mr-auto')
|
$(".nav-menus").removeClass("mr-auto");
|
||||||
$(".nav-button").addClass('mr-auto')
|
$(".nav-button").addClass("mr-auto");
|
||||||
//form
|
//form
|
||||||
// $(".ql-container").css('direction','rtl')
|
// $(".ql-container").css('direction','rtl')
|
||||||
// $(".ql-container").css('float','right')
|
// $(".ql-container").css('float','right')
|
||||||
// $(".ql-editor").css('float','right')
|
// $(".ql-editor").css('float','right')
|
||||||
// $(".ql-editor p").css('float','right')
|
// $(".ql-editor p").css('float','right')
|
||||||
$(".modal-content").css('direction','rtl')
|
$(".modal-content").css("direction", "rtl");
|
||||||
$(".bold").css('float','right')
|
$(".bold").css("float", "right");
|
||||||
$("#public").css('margin-left','5px')
|
$("#public").css("margin-left", "5px");
|
||||||
$("#prive").css('margin-left','5px')
|
$("#prive").css("margin-left", "5px");
|
||||||
$("#newPlaneModalAnonyme").css('margin-right','25px')
|
$("#newPlaneModalAnonyme").css("margin-right", "25px");
|
||||||
$("#newPlaneModalCancel").css('margin-left','8px')
|
$("#newPlaneModalCancel").css("margin-left", "8px");
|
||||||
$("#closeModal").css('margin-left','0px')
|
$("#closeModal").css("margin-left", "0px");
|
||||||
$("#closeModal").css('padding-left','0px')
|
$("#closeModal").css("padding-left", "0px");
|
||||||
//anthology
|
//anthology
|
||||||
$("#anthology").css('direction','rtl')
|
$("#anthology").css("direction", "rtl");
|
||||||
$("#anthologyDisclaimer").css('float','right')
|
$("#anthologyDisclaimer").css("float", "right");
|
||||||
|
} else {
|
||||||
}
|
|
||||||
else{
|
|
||||||
//navbar
|
//navbar
|
||||||
$("nav").css('direction','ltr')
|
$("nav").css("direction", "ltr");
|
||||||
$(".nav-menus").addClass('mr-auto')
|
$(".nav-menus").addClass("mr-auto");
|
||||||
$(".nav-button").removeClass('mr-auto')
|
$(".nav-button").removeClass("mr-auto");
|
||||||
//form
|
//form
|
||||||
// $(".ql-container").css('direction','ltr')
|
// $(".ql-container").css('direction','ltr')
|
||||||
// $(".ql-container").css('float','left')
|
// $(".ql-container").css('float','left')
|
||||||
// $(".ql-editor").css('float','left')
|
// $(".ql-editor").css('float','left')
|
||||||
// $(".ql-editor p").css('float','none')
|
// $(".ql-editor p").css('float','none')
|
||||||
$(".modal-content").css('direction','ltr')
|
$(".modal-content").css("direction", "ltr");
|
||||||
$(".bold").css('float','left')
|
$(".bold").css("float", "left");
|
||||||
$("#public").css('margin-left','0px')
|
$("#public").css("margin-left", "0px");
|
||||||
$("#prive").css('margin-left','0px')
|
$("#prive").css("margin-left", "0px");
|
||||||
$("#newPlaneModalAnonyme").css('margin-right','0px')
|
$("#newPlaneModalAnonyme").css("margin-right", "0px");
|
||||||
$("#newPlaneModalCancel").css('margin-left','0px')
|
$("#newPlaneModalCancel").css("margin-left", "0px");
|
||||||
//anthology
|
//anthology
|
||||||
$("#anthology").css('direction','ltr')
|
$("#anthology").css("direction", "ltr");
|
||||||
$("#anthologyDisclaimer").css('float','left')
|
$("#anthologyDisclaimer").css("float", "left");
|
||||||
}
|
}
|
||||||
|
|
||||||
//changing all strings
|
//changing all strings
|
||||||
//main page
|
//main page
|
||||||
$('head title', window.parent.document).text(s.avionpoeme);
|
$("head title", window.parent.document).text(s.avionpoeme);
|
||||||
$("#navTitle").html(s.avionpoeme)
|
$("#navTitle").html(s.avionpoeme);
|
||||||
$("#buttonAnthology").html(s.anthologie)
|
$("#buttonAnthology").html(s.anthologie);
|
||||||
$("#buttonAbout").html(s.apropos)
|
$("#buttonAbout").html(s.apropos);
|
||||||
if (typeof nbPlane !== 'undefined') {
|
if (typeof nbPlane !== "undefined") {
|
||||||
$("#buttonNewPlane").val(s.lancer_avion+" "+nbPlane+"/100")
|
$("#buttonNewPlane").val(s.lancer_avion + " " + nbPlane + "/100");
|
||||||
} else {
|
} else {
|
||||||
$("#buttonNewPlane").on('click', () => {
|
$("#buttonNewPlane").on("click", () => {
|
||||||
window.location.replace("/");
|
window.location.replace("/");
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
//new plane form
|
//new plane form
|
||||||
$("#newPlaneModalTitle").html(s.lancer_avion)
|
$("#newPlaneModalTitle").html(s.lancer_avion);
|
||||||
$("#newPlaneModalMessage").html(s.message)
|
$("#newPlaneModalMessage").html(s.message);
|
||||||
$("#newPlaneModalPrive").html(s.prive)
|
$("#newPlaneModalPrive").html(s.prive);
|
||||||
$("#newPlaneModalPublic").html(s.public)
|
$("#newPlaneModalPublic").html(s.public);
|
||||||
$("#flightTime").html(s.temps_de_vol)
|
$("#labelAttachment").html(s.PJ_Ajouter);
|
||||||
$("#newPlaneModalRandom").html(s.aléatoire)
|
console.log(s);
|
||||||
$("#newPlaneModal3j").html(s.trois_jours)
|
$("#attachmentPlaneLabel").attr("data-after", s.PJ_Parcourir);
|
||||||
$("#newPlaneModal7j").html(s.sept_jours)
|
$("#flightTime").html(s.temps_de_vol);
|
||||||
$("#newPlaneModal30j").html(s.trente_jours)
|
$("#newPlaneModalRandom").html(s.aléatoire);
|
||||||
$("#newPlaneModal365j").html(s.unan_jours)
|
$("#newPlaneModal3j").html(s.trois_jours);
|
||||||
$("#newPlaneModalExpediteur").html(s.expediteur)
|
$("#newPlaneModal7j").html(s.sept_jours);
|
||||||
$("#newPlaneModalDestinataire").html(s.destinataire)
|
$("#newPlaneModal30j").html(s.trente_jours);
|
||||||
$("#newPlaneModalAnonyme").html(s.anonyme)
|
$("#newPlaneModal365j").html(s.unan_jours);
|
||||||
$("#newPlaneModalCancel").html(s.annuler)
|
$("#newPlaneModalExpediteur").html(s.expediteur);
|
||||||
$("#sendNewPlane").html(s.lancer)
|
$("#newPlaneModalDestinataire").html(s.destinataire);
|
||||||
$("#destLang").html(s.langue_destinataire)
|
$("#newPlaneModalAnonyme").html(s.anonyme);
|
||||||
$("#expeMail").attr("placeholder", s.expeMail_placeholder)
|
$("#newPlaneModalCancel").html(s.annuler);
|
||||||
$("#expeGeocoderPhoton").attr("placeholder", s.expeLoc_placeholder)
|
$("#sendNewPlane").html(s.lancer);
|
||||||
$("#destMail").attr("placeholder", s.destMail_placeholder)
|
$("#destLang").html(s.langue_destinataire);
|
||||||
$("#destGeocoderPhoton").attr("placeholder", s.destLoc_placeholder)
|
$("#expeMail").attr("placeholder", s.expeMail_placeholder);
|
||||||
$('#anonymeTooltip').attr("title", s.anonyme_tooltip).tooltip("_fixTitle");
|
$("#expeGeocoderPhoton").attr("placeholder", s.expeLoc_placeholder);
|
||||||
$('#publicTooltip').attr("title", s.public_tooltip).tooltip("_fixTitle");
|
$("#destMail").attr("placeholder", s.destMail_placeholder);
|
||||||
|
$("#destGeocoderPhoton").attr("placeholder", s.destLoc_placeholder);
|
||||||
|
$("#anonymeTooltip").attr("title", s.anonyme_tooltip).tooltip("_fixTitle");
|
||||||
|
$("#publicTooltip").attr("title", s.public_tooltip).tooltip("_fixTitle");
|
||||||
|
|
||||||
$('#selectDestLang option[value="'+lang+'"]').prop('selected', true); //selecting by default recipient language same as interface
|
$('#selectDestLang option[value="' + lang + '"]').prop("selected", true); //selecting by default recipient language same as interface
|
||||||
//Anthology
|
//Anthology
|
||||||
displayAnthology()
|
displayAnthology();
|
||||||
$("#anthologyTitle").html(s.anthologie)
|
$("#anthologyTitle").html(s.anthologie);
|
||||||
$("#anthologyDisclaimer").html(s.suppr_message_public)
|
$("#anthologyDisclaimer").html(s.suppr_message_public);
|
||||||
$("#closeAnthologyAbout").html(s.retour_carte)
|
$("#closeAnthologyAbout").html(s.retour_carte);
|
||||||
|
|
||||||
//About
|
//About
|
||||||
$("#aboutTitle").html(s.apropos)
|
$("#aboutTitle").html(s.apropos);
|
||||||
$("#librairies").html(s.librairies)
|
$("#librairies").html(s.librairies);
|
||||||
$("#mapSources").html(s.source_carte)
|
$("#mapSources").html(s.source_carte);
|
||||||
$("#mapBackground").html(s.map_background)
|
$("#mapBackground").html(s.map_background);
|
||||||
$("#clouds").html(s.clouds)
|
$("#clouds").html(s.clouds);
|
||||||
$.getJSON("lang/about.json", function (e) {
|
$.getJSON("lang/about.json", function (e) {
|
||||||
if(lang !== 'en' && lang !== 'fr' && lang !== 'de'){
|
if (lang !== "en" && lang !== "fr" && lang !== "de") {
|
||||||
$("#aboutText").html(e[0].en)
|
$("#aboutText").html(e[0].en);
|
||||||
|
} else {
|
||||||
|
$("#aboutText").html(e[0][lang]);
|
||||||
}
|
}
|
||||||
else{
|
$("#donationText").html(s.AvionPoeme_free_independent);
|
||||||
$("#aboutText").html(e[0][lang])
|
$("#donationButtonText").html(s.Soutenez_avionpoeme);
|
||||||
}
|
$("#donationButtonText").addClass(lang);
|
||||||
$("#donationText").html(s.AvionPoeme_free_independent)
|
});
|
||||||
$("#donationButtonText").html(s.Soutenez_avionpoeme)
|
|
||||||
$("#donationButtonText").addClass(lang)
|
|
||||||
})
|
|
||||||
|
|
||||||
//plane limit tooltip
|
//plane limit tooltip
|
||||||
if (typeof nbPlane !== 'undefined') {
|
if (typeof nbPlane !== "undefined") {
|
||||||
if (nbPlane > 99) {
|
if (nbPlane > 99) {
|
||||||
$("#planeLimitTooltip").attr("title", s.AvionPoeme_epuise).tooltip("_fixTitle");
|
$("#planeLimitTooltip")
|
||||||
}
|
.attr("title", s.AvionPoeme_epuise)
|
||||||
else{
|
.tooltip("_fixTitle");
|
||||||
|
} else {
|
||||||
var remainingPlanes = 100 - nbPlane;
|
var remainingPlanes = 100 - nbPlane;
|
||||||
s.NB_AvionPoeme_restant = s.NB_AvionPoeme_restant.replace('$NB_avion_poeme',remainingPlanes)
|
s.NB_AvionPoeme_restant = s.NB_AvionPoeme_restant.replace(
|
||||||
$("#planeLimitTooltip").attr("title", s.NB_AvionPoeme_restant).tooltip("_fixTitle");
|
"$NB_avion_poeme",
|
||||||
|
remainingPlanes
|
||||||
|
);
|
||||||
|
$("#planeLimitTooltip")
|
||||||
|
.attr("title", s.NB_AvionPoeme_restant)
|
||||||
|
.tooltip("_fixTitle");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}).always(function (callback) {
|
||||||
})
|
|
||||||
.always(function(callback) {
|
|
||||||
//console.log( callback );
|
//console.log( callback );
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -179,5 +191,3 @@ $( "#navbarDropdownLang" ).mouseenter(function() {
|
|||||||
$("#navbarDropdownLang").mouseleave(function () {
|
$("#navbarDropdownLang").mouseleave(function () {
|
||||||
$("#langIcon").attr("src", "src/img/lang.png");
|
$("#langIcon").attr("src", "src/img/lang.png");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user