1
0

1 Commits

Author SHA1 Message Date
mberard
ea34094d41 Reverse anim plane 2021-11-01 20:12:31 +01:00
9 changed files with 156 additions and 132 deletions

View File

@@ -10,22 +10,28 @@ $table = array("message", "expeMail", "expeKnown", "expeLang", "destLang", "star
$db = new db();
//$db->open();
foreach ($table as $var) {
if (getpost($var) != null) {
foreach ($table as $var)
{
if ( getpost( $var ) != null )
{
$r = getpost( $var );
/*if ( $r == "true")
{
$r = 1;
}elseif( $r ="false")*/
$db->$var = trim($r, ' \"');
} else {
}else
{
$erreur[] = $var;
}
}
if (!empty($erreur)) {
if (!empty ($erreur))
{
echo json_encode($erreur);
log_error("erreur lors de l'acquisition des données:" . EOLH . print_r($erreur, true));
} else {
}else
{
$db->newPlane();
}
$db->close();
?>

View File

@@ -197,3 +197,4 @@
}
}
$db->close();
?>

View File

@@ -165,7 +165,7 @@ class db
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);
$planes = $this->result->fetch_all(MYSQLI_ASSOC);
print json_encode($planes);
@@ -234,6 +234,3 @@ class db
return $this->avionJournalier;
}
}
?>

View File

@@ -13,6 +13,31 @@
<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="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 -->
d -200 200 -200 -200 200 -200 200 200
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 1000 tx -35 z 0 0 0 il 100 100)
</script>
<?php }
?>
<!-- Modal new plane-->
<div class="modal fade" id="newPlaneModal" tabindex="-1" role="dialog" aria-labelledby="newPlaneModal" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
@@ -54,13 +81,6 @@
<br>
<div class="form-control rounded-0" id="messageTextArea"></div>
</div>
<div class="form-group">
<label class="bold">Ajouter une piève jointe</label>
<div class="custom-file">
<input type="file" class="custom-file-input" id="attachmentPlane" aria-describedby="inputGroupFileAddon01">
<label class="custom-file-label" for="attachmentPlane"></label>
</div>
</div>
<div class="form-group">
<label class="bold" for="selectTime" id="flightTime">Temps de vol</label>
<select class="form-control" id="selectTime">

View File

@@ -336,7 +336,3 @@ a#navbarDropdownLang.nav-link.dropdown-toggle::after {
text-align: center;
}
}
.custom-file-label::after {
content: "Parcourir";
}

View File

@@ -18,12 +18,6 @@ $("#destMail").change(function() {
checkFormValid()
})
document.querySelector('.custom-file-input').addEventListener('change',function(e){
var fileName = document.getElementById("attachmentPlane").files[0].name;
var nextSibling = e.target.nextElementSibling
nextSibling.innerText = fileName
})
function checkFormValid(){
if(validExpeMail && validExpeLoc && validDestMail && validDestLoc){
$('#sendNewPlane').prop("disabled", false)

View File

@@ -303,12 +303,23 @@ loader.load(function(loader, resources) {
var queryString = window.location.search;
queryString = queryString.split('=')[1]
if(Number(queryString)==data.uid){
setTimeout(
function()
{
map.setView([data.currentPosition.geometry.coordinates[1],data.currentPosition.geometry.coordinates[0]], 15);
openPopup(marker)
}, 100);
/*
Activate anim place reverse
$("#back").attr("src","src/img/back-"+data.color+".jpg");
html = data.message;
var canvas1 = document.getElementById("blankCanvas1");
rasterizeHTML.drawHTML(html, canvas1,{zoom:0.7}).then(function success(renderResult) {
var canvas2 = document.getElementById("blankCanvas2");
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();
})
*/
}
}

View File

@@ -109,29 +109,7 @@ $("#sendNewPlane").on('click',function(){
var randomColor = getRandomColor()
var formData = new FormData()
var attachment = $("#attachmentPlane").prop('files')[0];
formData.append('file', attachment);
formData.append('message', encodeURIComponent(message));
formData.append('expeMail', $("#expeMail").val());
formData.append('expeKnown', expeKnown);
formData.append('expeLang', lang);
formData.append('destLang', $("#selectDestLang").val());
formData.append('startLat', expeLoc.center[1]);
formData.append('startLon', expeLoc.center[0]);
formData.append('startName', expeLoc.name);
formData.append('startTime', sentDate);
formData.append('startTZ', expeTimezone);
formData.append('destMail', $("#destMail").val());
formData.append('destLat', destLoc.center[1]);
formData.append('destLon', destLoc.center[0]);
formData.append('destName', destLoc.name);
formData.append('public', publicMessage, );
formData.append('color', randomColor);
formData.append('deliveryTime', deliveryDate);
formData.append('deliveryTZ', destTimezone);
formData.append('deliveryTimeServer', deliverySecondsServer);
formData.append('deliveryMethod', $("#selectTime").val());
console.log(message)
var data = {
'message':encodeURIComponent(message),
@@ -153,22 +131,39 @@ $("#sendNewPlane").on('click',function(){
'deliveryTime':deliveryDate,
'deliveryTZ':destTimezone,
'deliveryTimeServer':deliverySecondsServer,
'deliveryMethod':$("#selectTime").val(),
'deliveryMethod':$("#selectTime").val()
}
$.ajax({
url: 'avionpoeme.php',
data: formData,
processData: false,
contentType: false,
cache : false,
type: 'POST',
success: function(result){
var query = 'avionpoeme.php?'+
'message='+data.message+'&'+
'expeMail='+data.expeMail+'&'+
'expeKnown='+data.expeKnown+'&'+
'expeLang='+data.expeLang+'&'+
'destLang='+data.destLang+'&'+
'startLat='+data.startLat+'&'+
'startLon='+data.startLon+'&'+
'startName='+data.startName+'&'+
'startTime='+data.startTime+'&'+
'startTZ='+data.startTZ+'&'+
'destMail='+data.destMail+'&'+
'destLat='+data.destLat+'&'+
'destLon='+data.destLon+'&'+
'destName='+data.destName+'&'+
'public='+data.public+'&'+
'color='+data.color+'&'+
'deliveryTime='+data.deliveryTime+'&'+
'deliveryTZ='+data.deliveryTZ+'&'+
'deliveryTimeServer='+data.deliveryTimeServer+'&'+
'deliveryMethod='+data.deliveryMethod+'';
$.post(query, function(result) {
result = result.replace(/'/g, '"');
console.log(result)
result = $.parseJSON(result)
var planeId = Number(result.uid);
//selecting proper color for back
$("#back").attr("src","src/img/back-"+randomColor+".jpg");
$("#back").attr("src","src/img/back-"+data.color+".jpg");
// creating image for plane, need to link it to the inputs tog et entered values.
var message = quill.root.innerHTML
@@ -198,11 +193,14 @@ $("#sendNewPlane").on('click',function(){
},4400);
//reloading page (to change)
setInterval(function(){
window.location.href ='https://www.avion-poe.me/?avion='+planeId+'';
window.location.href ='https://avion-poe.me?avion='+planeId+'';
},5500);
})
}
});
})
})
});

View File

@@ -46,6 +46,7 @@ var dictionnary = []
function translateUI(l){
$.getJSON("lang/"+l+"", function(s){
console.log(s)
dictionnary = s
//if arabic : display left to right (ltr) + troubleshooting a lot of individual elements
if (lang == "ar"){