dans nouvelle visite ajoute des champs comme nom de la boutique , numéro de la boutique, produit vendu, montant encaissé, quantité et le bouton soumettre pour enregistré
Browse files- shop-visit.html +77 -5
shop-visit.html
CHANGED
|
@@ -109,12 +109,12 @@
|
|
| 109 |
<p>Vous êtes bien dans la boutique. Vous pouvez maintenant commencer votre visite.</p>
|
| 110 |
</div>
|
| 111 |
<div class="flex justify-end mt-4">
|
| 112 |
-
<
|
| 113 |
<i data-feather="arrow-right" class="w-4 h-4"></i>
|
| 114 |
<span>Commencer la visite</span>
|
| 115 |
-
</
|
| 116 |
</div>
|
| 117 |
-
|
| 118 |
|
| 119 |
<div id="location-failure" class="hidden mt-8 p-4 bg-red-50 text-red-800 rounded-lg">
|
| 120 |
<div class="flex items-center">
|
|
@@ -123,12 +123,84 @@
|
|
| 123 |
</div>
|
| 124 |
</div>
|
| 125 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
</main>
|
| 127 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
<script>
|
| 129 |
feather.replace();
|
| 130 |
-
|
| 131 |
-
|
| 132 |
// Reset the form and show the location verification section
|
| 133 |
document.getElementById('selected-shop').innerHTML = `
|
| 134 |
<p class="text-gray-600">Aucune boutique sélectionnée</p>
|
|
|
|
| 109 |
<p>Vous êtes bien dans la boutique. Vous pouvez maintenant commencer votre visite.</p>
|
| 110 |
</div>
|
| 111 |
<div class="flex justify-end mt-4">
|
| 112 |
+
<button type="button" id="start-visit" class="px-4 py-2 bg-primary hover:bg-primary-600 text-white rounded-lg flex items-center space-x-2">
|
| 113 |
<i data-feather="arrow-right" class="w-4 h-4"></i>
|
| 114 |
<span>Commencer la visite</span>
|
| 115 |
+
</button>
|
| 116 |
</div>
|
| 117 |
+
</div>
|
| 118 |
|
| 119 |
<div id="location-failure" class="hidden mt-8 p-4 bg-red-50 text-red-800 rounded-lg">
|
| 120 |
<div class="flex items-center">
|
|
|
|
| 123 |
</div>
|
| 124 |
</div>
|
| 125 |
</div>
|
| 126 |
+
|
| 127 |
+
<!-- Visit Form (hidden by default) -->
|
| 128 |
+
<div id="visit-form" class="hidden bg-white rounded-xl shadow-md p-6 mt-6">
|
| 129 |
+
<h2 class="text-xl font-semibold text-gray-800 mb-6">Nouvelle Visite</h2>
|
| 130 |
+
<form id="visitForm" class="space-y-6">
|
| 131 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
| 132 |
+
<div>
|
| 133 |
+
<label for="shop-name" class="block text-sm font-medium text-gray-700 mb-1">Nom de la boutique</label>
|
| 134 |
+
<input type="text" id="shop-name" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-primary focus:border-primary" required>
|
| 135 |
+
</div>
|
| 136 |
+
<div>
|
| 137 |
+
<label for="shop-number" class="block text-sm font-medium text-gray-700 mb-1">Numéro de la boutique</label>
|
| 138 |
+
<input type="text" id="shop-number" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-primary focus:border-primary" required>
|
| 139 |
+
</div>
|
| 140 |
+
<div>
|
| 141 |
+
<label for="product-name" class="block text-sm font-medium text-gray-700 mb-1">Produit vendu</label>
|
| 142 |
+
<input type="text" id="product-name" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-primary focus:border-primary" required>
|
| 143 |
+
</div>
|
| 144 |
+
<div>
|
| 145 |
+
<label for="product-quantity" class="block text-sm font-medium text-gray-700 mb-1">Quantité</label>
|
| 146 |
+
<input type="number" id="product-quantity" min="1" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-primary focus:border-primary" required>
|
| 147 |
+
</div>
|
| 148 |
+
<div>
|
| 149 |
+
<label for="amount" class="block text-sm font-medium text-gray-700 mb-1">Montant encaissé (€)</label>
|
| 150 |
+
<input type="number" id="amount" min="0" step="0.01" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-primary focus:border-primary" required>
|
| 151 |
+
</div>
|
| 152 |
+
</div>
|
| 153 |
+
|
| 154 |
+
<div class="flex justify-end space-x-4">
|
| 155 |
+
<button type="button" id="cancel-visit" class="px-4 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50">
|
| 156 |
+
Annuler
|
| 157 |
+
</button>
|
| 158 |
+
<button type="submit" class="px-6 py-2 bg-primary hover:bg-primary-600 text-white rounded-lg flex items-center space-x-2">
|
| 159 |
+
<i data-feather="save" class="w-4 h-4"></i>
|
| 160 |
+
<span>Enregistrer la visite</span>
|
| 161 |
+
</button>
|
| 162 |
+
</div>
|
| 163 |
+
</form>
|
| 164 |
+
</div>
|
| 165 |
</main>
|
| 166 |
</div>
|
| 167 |
+
|
| 168 |
+
<script>
|
| 169 |
+
// Show visit form when "Commencer la visite" is clicked
|
| 170 |
+
document.getElementById('start-visit').addEventListener('click', function() {
|
| 171 |
+
document.getElementById('visit-form').classList.remove('hidden');
|
| 172 |
+
document.getElementById('location-success').classList.add('hidden');
|
| 173 |
+
});
|
| 174 |
+
|
| 175 |
+
// Hide visit form when "Annuler" is clicked
|
| 176 |
+
document.getElementById('cancel-visit').addEventListener('click', function() {
|
| 177 |
+
document.getElementById('visit-form').classList.add('hidden');
|
| 178 |
+
document.getElementById('visitForm').reset();
|
| 179 |
+
});
|
| 180 |
+
|
| 181 |
+
// Form submission handler
|
| 182 |
+
document.getElementById('visitForm').addEventListener('submit', function(e) {
|
| 183 |
+
e.preventDefault();
|
| 184 |
+
|
| 185 |
+
// Get form values
|
| 186 |
+
const shopName = document.getElementById('shop-name').value;
|
| 187 |
+
const shopNumber = document.getElementById('shop-number').value;
|
| 188 |
+
const productName = document.getElementById('product-name').value;
|
| 189 |
+
const quantity = document.getElementById('product-quantity').value;
|
| 190 |
+
const amount = document.getElementById('amount').value;
|
| 191 |
+
|
| 192 |
+
// In a real app, you would send this data to your backend
|
| 193 |
+
alert(`Visite enregistrée pour ${shopName} (${shopNumber}): ${quantity}x ${productName} pour ${amount}€`);
|
| 194 |
+
|
| 195 |
+
// Reset form and hide it
|
| 196 |
+
this.reset();
|
| 197 |
+
document.getElementById('visit-form').classList.add('hidden');
|
| 198 |
+
});
|
| 199 |
+
</script>
|
| 200 |
<script>
|
| 201 |
feather.replace();
|
| 202 |
+
|
| 203 |
+
document.getElementById('new-visit-btn').addEventListener('click', function() {
|
| 204 |
// Reset the form and show the location verification section
|
| 205 |
document.getElementById('selected-shop').innerHTML = `
|
| 206 |
<p class="text-gray-600">Aucune boutique sélectionnée</p>
|