-
Notifications
You must be signed in to change notification settings - Fork 0
/
footer.php
73 lines (62 loc) · 2.21 KB
/
footer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<script type="text/javascript">
function findActiveTab() {
var full_path = window.location.pathname;
$("#navbar-ul li").each(function() {
var path_li = $(this).children('a').attr('href');
if (path_li == full_path) {
$(this).attr("class", "active");
}
});
}
function ajouterMagasin(button) {
var id_magasin = $(button).attr("id").substring(11);
$.ajax({
url: '/<?php echo $project_name; ?>/ajout-magasin.php',
type: 'POST',
data: { id_magasin : id_magasin },
success: function(result) {
$("#empty-div-magasin").html(result);
}
})
.done(function() {
alert("Magasin ajouté");
location.reload();
});
}
function ajouterProduitPanier(button) {
var id = $(button).attr("id");
var id_modal = id.substring(0, 5);
if (id_modal == "modal") {
var id_produit = id.substring(12);
var quantite = $("#modal-qte-"+id_produit).val();
}
else {
var id_produit = id.substring(6);
var quantite = $("#qte-"+id_produit).val();
}
if (quantite <= 0 || quantite == null) {
quantite = 0;
alert("Aucun produit à ajouté");
}
else {
$.ajax({
url: "/<?php echo $project_name; ?>/panier/ajout-produit-panier.php",
type: "POST",
data: { id_produit : id_produit, quantite : quantite },
dataType: "html",
success: function(result) {
$("#empty-div").html(result);
}
})
.done(function() {
alert("Produit ajouté");
});
}
}
$(document).ready(function() {
findActiveTab();
$('[data-toggle="tooltip"]').tooltip();
});
</script>
</body>
</html>