modified pdf1 and tabeldescription
This commit is contained in:
+59
-8
@@ -13,8 +13,14 @@ if (isset($_GET["certtype"])) {
|
||||
if (isset($_GET["tempcode"])) {
|
||||
$tempcode = $_GET["tempcode"];
|
||||
}
|
||||
if (isset($_GET["previousrepnumber"])) {
|
||||
if (isset($_POST["previousrepnumber"])) {
|
||||
$previousrepnumber = $_POST["previousrepnumber"];
|
||||
} elseif (isset($_POST["previousrepnumber"])) {
|
||||
$previousrepnumber = $_POST["previousrepnumber"];
|
||||
} elseif (isset($_GET["previousrepnumber"])) {
|
||||
$previousrepnumber = $_GET["previousrepnumber"];
|
||||
} elseif (isset($_GET["previousreportnumber"])) {
|
||||
$previousrepnumber = $_GET["previousreportnumber"];
|
||||
} else {
|
||||
$previousrepnumber = "";
|
||||
}
|
||||
@@ -44,11 +50,6 @@ if (isset($_GET["notificatedorganismname"])) {
|
||||
} else {
|
||||
$notificatedorganismname = "";
|
||||
}
|
||||
if (isset($_GET["previousrepnumber"])) {
|
||||
$previousrepnumber = $_GET["previousrepnumber"];
|
||||
} else {
|
||||
$previousrepnumber = "";
|
||||
}
|
||||
if (isset($_GET["renewdate"])) {
|
||||
$renewdate = $_GET["renewdate"];
|
||||
} else {
|
||||
@@ -1066,13 +1067,23 @@ include('include/trfqueryscript.php'); ?>
|
||||
success: function(data) {
|
||||
$('#uploadForm')[0].reset();
|
||||
$('#uploadStatus').html('<span style="color:#28A74B;">Images uploaded successfully.<span>');
|
||||
$('.gallery').html(data);
|
||||
// data = HTML dell'immagine restituita da upload.php
|
||||
$('.gallery').html(
|
||||
'<div class="uploaded-wrap">' + data +
|
||||
' <a href="#" id="delPhoto" title="Delete"><i class="fas fa-trash-alt text-danger font-16"></i></a></div>'
|
||||
);
|
||||
|
||||
// $('#cont_photoupload').html(data);
|
||||
$('#delPhoto').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
deleteMainPhoto(<?php echo (int)$trfnumberfinal->getColumnVal("idtrfdetails"); ?>);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
// File type validation
|
||||
$("#fileInput").change(function() {
|
||||
var fileLength = this.files.length;
|
||||
@@ -1091,6 +1102,29 @@ include('include/trfqueryscript.php'); ?>
|
||||
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
function deleteMainPhoto(idtrf) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'deletephotomain.php',
|
||||
data: {
|
||||
idtrf: idtrf
|
||||
},
|
||||
beforeSend: function() {
|
||||
$('#uploadStatus').html('<img src="../images/uploading.gif"/>');
|
||||
},
|
||||
success: function(resp) {
|
||||
// svuota galleria e stato
|
||||
$('.gallery').html('');
|
||||
$('#uploadStatus').html('<span style="color:#28A74B;">Photo removed.<span>');
|
||||
},
|
||||
error: function() {
|
||||
$('#uploadStatus').html('<span style="color:#EA4335;">Delete failed.<span>');
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(".upload-image").click(function() {
|
||||
@@ -1101,6 +1135,23 @@ include('include/trfqueryscript.php'); ?>
|
||||
$('#form').parsley();
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
// FUNZIONE già indicata al punto 2: deve stare PRIMA di questo blocco
|
||||
// function deleteMainPhoto(idtrf){ ... }
|
||||
|
||||
$(function() {
|
||||
// Se la pagina si apre con un'immagine già presente, aggiungi subito il cestino
|
||||
if ($('.gallery img').length && !$('#delPhotoMain').length) {
|
||||
$('.gallery').append(
|
||||
' <a href="#" id="delPhotoMain" title="Delete"><i class="fas fa-trash-alt text-danger font-16"></i></a>'
|
||||
);
|
||||
$('#delPhotoMain').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
deleteMainPhoto(<?php echo (int)$trfnumberfinal->getColumnVal("idtrfdetails"); ?>);
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user