ÿØÿà 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/cp-admin/ |
Upload File : |
<?php
$requete = $bdd->query("SELECT * FROM " . $GLOBALS['db_table']['attribute'] . " WHERE id = " . $_GET['id']);
$attribute = $requete->fetch();
// Suppression de la page.
if (isset($_GET['del']))
{
$id = $_GET['del'];
$bdd->exec("DELETE FROM " . $GLOBALS['db_table']['attribute_values'] . " WHERE id = " . $id);
echo '<script>';
echo 'window.location = "details_attribute.php?id=' . $attribute['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=attribute_values&field=position",
type : "post",
data : serial.hash
});
}
});
});
</script>
<div class="container">
<div class="row">
<div class="span12">
<div class="page-header">
<h1>Gérer les Valeurs de l'attribut "<?php echo stripcslashes($attribute['name']); ?>"
<div class="pull-right">
<a href="attributes.php" class="btn btn-primary"><i class="icon-arrow-left"></i> Retour</a>
</div>
</h1>
</div>
<i>Vos attributs se gèrent dans votre caisse principale !</i> <br /><br />
</div>
</div>
<table id="sortlist" class="table table-bordered table-striped">
<thead>
<tr>
<th class="span3 center">Valeurs</th>
<th class="span1 center"></th>
</tr>
</thead>
<tbody>
<?php
$requete = $bdd->query("SELECT * FROM " . $GLOBALS['db_table']['attribute_values'] . " WHERE id_attribute = " . $_GET['id'] . " ORDER BY position");
if ($row = $requete->fetch()) {
do {
?>
<tr class="dragDrop" id="val_<?php echo $row['id']; ?>" style="cursor: ns-resize;">
<td class="span1 font12 center">
<b><?php echo stripcslashes($row['value']) ?></b>
</td>
<td class="span1 center" style="width: 71px;">
</td>
</tr>
<?php
}while ($row = $requete->fetch());
} else {
echo 'Aucune valeur à afficher !!!';
}
?>
</tbody>
</table>
</div>
<div class="modal hide fade" id="value_box" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" wi>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
<h3 id="value_title_box_box_header">Nouvelle valeur</h3>
</div>
<div class="modal-body" id="value_box_content">
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Fermer</button>
<button class="btn btn-primary" id="insert_new_value">Enregistrer</button>
</div>
</div>
<script type="text/javascript">
$('.new_value').live('click', function(event) {
event.preventDefault();
var id = $(this).attr('id');
var value = '';
$('#value_box').modal();
$('#value_box_content').html('<input type="hidden" id="id" value="'+id+'"><label for="value">Valeur :</label> <input type="text" id="value" value="'+value+'" style="width:95%;">');
});
$('#insert_new_value').live('click', function(event) {
event.preventDefault();
var id = $('#id').val();
var value = $('#value').val();
$.ajax({
type: 'POST',
data: 'id='+id+'&value='+value,
url: 'includes/listeners/insertNewValue.php',
success: function(msg) {
if(msg!='') alert(msg);
else window.location.reload();
}
});
});
</script>
<?
include_once('includes/footer.php');
?>