Quelques modifs

This commit is contained in:
2023-11-12 18:24:41 +01:00
parent d5d2298f06
commit 6feedc24c2
34 changed files with 22 additions and 14 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

8
app.js
View File

@@ -29,7 +29,7 @@ app.use('/css', express.static(__dirname + '/node_modules/bootstrap/dist/css'));
app.use(express.json()); app.use(express.json());
app.get("/", (req, res) => { app.get("/", (req, res) => {
db.query('SELECT c.id as "id", c.libelle as "libelle", c.prix, c.photo as "photo", c.lien, p.prenom as "demandeur", c.achete as "achete", p2.prenom as "responsable" FROM cadeau c LEFT OUTER JOIN participations pc on pc.cadeau = c.id LEFT OUTER JOIN participant p on p.id = pc.personne LEFT OUTER JOIN participant p2 on p2.id = pc.responsable', async (error, resultCadeaux) => { db.query('SELECT c.id as "id", c.libelle as "libelle", c.prix, c.photo as "photo", c.lien, p.prenom as "acheteur", c.achete as "achete", c.paye as "paye", p2.prenom as "responsable_achat" FROM cadeau c LEFT OUTER JOIN participations pc on pc.cadeau = c.id LEFT OUTER JOIN participant p on p.id = pc.offrant LEFT OUTER JOIN participant p2 on p2.id = pc.responsable_achat', async (error, resultCadeaux) => {
let message; let message;
if(error){ if(error){
@@ -50,9 +50,11 @@ app.get("/reserve", (req, res) => {
console.log(error); console.log(error);
} }
if (result.length > 0) { if (result.length > 0) {
db.query('SELECT id, prenom, FROM participant', async (error, selectOffrant) => {
db.query('SELECT id, prenom FROM participant', async (error, select) => { db.query('SELECT sum(c.prix) FROM cadeau c LEFT OUTER JOIN participations pc on pc.cadeau = c.id WHERE pc.offrant = ?', [], async (error, totalAchats) => {
res.render('reservation', { "id": result[0].id, "libelle": result[0].libelle, "photo": result[0].photo, "responsable": select } ); res.render('reservation', { "id": result[0].id, "libelle": result[0].libelle, "photo": result[0].photo, "offrant": selectOffrant, "totalDepenses": totalAchats } );
})
}) })
} }
}) })

BIN
node_modules/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/bootstrap/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/call-bind/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/chokidar/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/concat-map/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/define-data-property/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/function-bind/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/get-intrinsic/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/gopd/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/handlebars/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/has-property-descriptors/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/has-proto/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/has-symbols/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/iconv-lite/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/minimist/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/mysql/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/nodemon/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/nopt/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/object-inspect/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/pstree.remy/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/qs/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/readable-stream/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/semver/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/side-channel/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/simple-update-notifier/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/source-map/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/string_decoder/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/uglify-js/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/undefsafe/.DS_Store generated vendored Normal file

Binary file not shown.

BIN
node_modules/wordwrap/.DS_Store generated vendored Normal file

Binary file not shown.

View File

@@ -38,20 +38,29 @@
</li> </li>
<li>{{this.prix}} €</li> <li>{{this.prix}} €</li>
<li><a href="{{this.lien}}" target="_blank">Voir le produit</a></li> <li><a href="{{this.lien}}" target="_blank">Voir le produit</a></li>
<li>{{#if this.demandeur}}{{this.demandeur}} <li>{{#if this.acheteur}}{{this.acheteur}}
{{else}}<a href="/reserve?id={{this.id}}" class="btn btn-primary">Le réserver</a>{{/if}} {{else}}<a href="/reserve?id={{this.id}}" class="btn btn-primary">Le réserver</a>{{/if}}
</li> </li>
<li> <li>
<div class="form-check form-switch"> <div class="form-check form-switch">
{{#if this.achete}} {{#if this.achete}}
<input class="form-check-input" type="checkbox" id="flexSwitchCheckCheckedDisabled-{{this.id}}" checked disabled> <input class="form-check-input" type="checkbox" id="flexAcheteCheckedDisabled-{{this.id}}" checked disabled>
<label class="form-check-label" for="flexSwitchCheckCheckedDisabled-{{this.id}}">Déja acheté</label> <label class="form-check-label" for="flexAcheteCheckedDisabled-{{this.id}}">Déja acheté</label>
{{else}} {{else}}
<input class="form-check-input" type="checkbox" id="flexSwitchCheckDisabled-{{this.id}}" disabled> <input class="form-check-input" type="checkbox" id="flexAcheteDisabled-{{this.id}}" disabled>
<label class="form-check-label" for="flexSwitchCheckDisabled-{{this.id}}">A acheter</label> <label class="form-check-label" for="flexAcheteDisabled-{{this.id}}">A acheter</label>
{{/if}} {{/if}}
</div> </div>
<li>{{#if this.responsable}}{{this.responsable}}{{/if}}</li> <div class="form-check form-switch">
{{#if this.paye}}
<input class="form-check-input" type="checkbox" id="flexPayeCheckedDisabled-{{this.id}}" checked disabled>
<label class="form-check-label" for="flexPayeCheckedDisabled-{{this.id}}">Déja payé</label>
{{else}}
<input class="form-check-input" type="checkbox" id="flexPayeDisabled-{{this.id}}" disabled>
<label class="form-check-label" for="flexPayeDisabled-{{this.id}}">A payer</label>
{{/if}}
</div>
<li>{{#if this.responsable_achat}}{{this.responsable_achat}}{{/if}}</li>
</ul> </ul>
{{/each}} {{/each}}
</div> </div>

View File

@@ -46,7 +46,7 @@
</div> </div>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="responsable-reg" class="form-label">Qui doit s'en occuper ?</label> <label for="responsable-reg" class="form-label">Qui doit s'occuper de l'achat ?</label>
<select name="acheteur" id="acheteur-reg" class=""> <select name="acheteur" id="acheteur-reg" class="">
<option value="" disabled selected>Choisir dans la liste</option> <option value="" disabled selected>Choisir dans la liste</option>
{{#each responsable}} {{#each responsable}}
@@ -55,13 +55,10 @@
</select> </select>
</div> </div>
<button type="submit" class="btn btn-primary">Enregistrer</button> <button type="submit" class="btn btn-primary">Enregistrer</button>
<a href="/" class="btn btn-secondary">Retour aux cadeaux</a>
</form> </form>
</div> </div>
</div> </div>
</div> </div>
<div class="container mt-4">
<a href="/" class="btn btn-primary">Retour à la liste</a>
</div>
</body> </body>
</html> </html>