ÿØÿà JFIF ` ` ÿþxØ
| Server IP : 109.234.164.53 / Your IP : 216.73.216.110 Web Server : Apache System : Linux cervelle.o2switch.net 4.18.0-553.32.1.lve.el8.x86_64 #1 SMP Thu Dec 19 13:14:03 UTC 2024 x86_64 User : computer3 ( 1098) PHP Version : 7.1.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/computer3/litsolide.com/ODLDDD_2/cp-admin/ |
Upload File : |
<?php
include_once('includes/header.php');
$requete = $bdd->query("SELECT * FROM " . $GLOBALS['db_table']['products'] . " WHERE id = " . $_GET['id']);
$product = $requete->fetch();
// Suppression de la page.
if (isset($_GET['del']))
{
$id = $_GET['del'];
$requete = $bdd->query("SELECT * FROM " . $GLOBALS['db_table']['products_pictures'] . " WHERE id = " . $id);
$row = $requete->fetch();
unlink('../uploadfiles/products/mini/' . $row['picture']);
unlink('../uploadfiles/products/' . $row['picture']);
$bdd->exec("DELETE FROM " . $GLOBALS['db_table']['products_pictures'] . " WHERE id = " . $id);
echo '<script>';
echo 'window.location = "product_pictures.php?id=' . $product['id'] . '"';
echo '</script>';
}
?>
<script type="text/javascript">
$(document).ready(function() {
$("#sortlist").Sortable({
accept: 'dragDrop',
opacity: 0.6,
axis : 'vertically',
onchange : function ( sorted ) {
serial = $.SortSerialize ('sortlist');
// requète Ajax pour l'enregistrement des positions
$.ajax ( {
url : "includes/set_position.php?table=products_pictures",
type : "post",
data : serial.hash
});
}
});
});
</script>
<div class="container">
<div class="row">
<div class="span12">
<div class="page-header">
<h1>Gérer les Photos du produit "<?php echo stripcslashes($product['name']); ?>"
<div class="pull-right">
<a href="products.php" class="btn btn-primary"><i class="icon-arrow-left"></i> Retour</a>
<a href="add_product_pictures.php?id=<?php echo $_GET['id']; ?>" class="btn btn-primary"><i class="icon-plus"></i> Ajouter Photo(s)</a>
</div>
</h1>
</div>
</div>
</div>
<table id="sortlist" class="table table-bordered table-striped">
<thead>
<tr>
<th class="span3 center">Photos</th>
<th class="span1 center">Opérations</th>
</tr>
</thead>
<tbody>
<?php
$requete = $bdd->query("SELECT * FROM " . $GLOBALS['db_table']['products_pictures'] . " WHERE id_product = " . $_GET['id'] . " ORDER BY position");
if ($row = $requete->fetch()) {
do {
?>
<tr class="dragDrop" id="prd_<?php echo $row['id']; ?>" style="cursor: ns-resize;">
<td class="span1 font12 center">
<img src="../uploadfiles/products/mini/<?php echo $row['picture']; ?>">
</td>
<td class="span1 center" style="width: 71px;">
<a href="./product_pictures.php?id=<?php echo $product['id']; ?>&del=<?php echo $row['id']; ?>" onclick="return confirm('Êtes vous sur de vouloir supprimer cet élément ?');">
<img src="assets/img/delete.png" title="Supprimer la photo" />
</a>
<a class="fancybox" href="../uploadfiles/products/<?php echo $row['picture']; ?>">
<img title="Voir l'image" src="assets/img/view.png">
</a>
</td>
</tr>
<?php
}while ($row = $requete->fetch());
} else {
echo 'Aucune photo à afficher !!!';
}
?>
</tbody>
</table>
</div>
<?
include_once('includes/footer.php');
?>