@@ -28,9 +34,12 @@ ob_start();
|
+ |
+
+
|
-
+
|
@@ -43,14 +52,7 @@ ob_start();
Liste d'articles
-
- Nom |
- Quantité |
- Prix |
- Code Barre |
- Image |
- Actions |
-
+ = $tableHeader ?>
diff --git a/assets/css/stock.css b/assets/css/stock.css
index a535a22..b1eeccc 100644
--- a/assets/css/stock.css
+++ b/assets/css/stock.css
@@ -3,12 +3,25 @@ table {
margin-bottom: 20px;
}
-.name-column {
- width : 30%;
+.quantity-column, .price-column {
+ width: 150px;
}
.code-column {
- width: 20%;
+ width: 200px;
+}
+
+.type-column {
+ width: 200px;
+ overflow-x: auto;
+}
+
+.image-column {
+ width: 150px;
+}
+
+.actions-column {
+ width: 100px;
}
.stock-container {
@@ -16,10 +29,7 @@ table {
margin: 50px auto auto auto;
}
-.actions-column {
- width: 100px;
+#stockTable tr {
+ border-bottom: 1px solid #dedede;
}
-.image-column {
- width: 150px;
-}
diff --git a/assets/js/stock.js b/assets/js/stock.js
index bfacfb2..ff4ff9c 100644
--- a/assets/js/stock.js
+++ b/assets/js/stock.js
@@ -1,9 +1,17 @@
+let defaultTypes = [
+ 'Nouveau',
+ 'Alimentaire',
+ 'Boissons',
+ 'Utilitaires'
+];
+
let defaultStock = [
{
name: 'Granola',
quantity: '2',
price: '1.3',
code: '7622210601988',
+ image : 'https://cookieandkate.com/images/2015/10/granola-mixed-in-bowl.jpg',
type: [
'Alimentaire',
]
@@ -15,6 +23,7 @@ let currentDataset = [];
$(document).ready(function () {
currentDataset = defaultStock;
generateTable(currentDataset);
+ generateTypeCheckboxes();
});
@@ -24,7 +33,6 @@ function generateTable(dataset) {
}
}
-
function generateLine(item) {
$.selector_cache('#stockTable').append(
' |