def listerReservations(): tarifRepas = modeleResanet.getTarifRepas(session['numeroCarte']) soldeCarte = modeleResanet.getSolde(session['numeroCarte']) solde = '%.2f' % (soldeCarte, ) aujourdhui = datesResanet.getDateAujourdhuiISO() datesPeriodeISO = datesResanet.getDatesPeriodeCouranteISO() datesResas = modeleResanet.getReservationsCarte(session['numeroCarte'], datesPeriodeISO[0], datesPeriodeISO[-1]) joursF = modeleResanet.getJoursFeries() dates = [] for uneDateISO in datesPeriodeISO: uneDate = {} uneDate['iso'] = uneDateISO uneDate['fr'] = datesResanet.convertirDateISOversFR(uneDateISO) if uneDateISO <= aujourdhui: uneDate['verrouillee'] = True else: uneDate['verrouillee'] = False if uneDateISO in datesResas: uneDate['reservee'] = True else: uneDate['reservee'] = False if soldeCarte < tarifRepas and uneDate['reservee'] == False: uneDate['verrouillee'] = True if uneDateISO in joursF: uneDate['verrouillee'] = True if uneDateISO[5:10] in joursF: uneDate['verrouillee'] = True dates.append(uneDate) if soldeCarte < tarifRepas: soldeInsuffisant = True else: soldeInsuffisant = False return render_template('vueListeReservations.html', joursF=joursF, laSession=session, leSolde=solde, lesDates=dates, soldeInsuffisant=soldeInsuffisant)
def ajouterJoursFeries(): jour = request.form['jour'] mois = request.form['mois'] libelle = request.form['libelle'] rep = modeleResanet.setJoursFeries(jour, mois, libelle) jours = modeleResanet.getJoursFeries() return render_template('joursFeries.html', ferie=jours, card=True, jour=jour, mois=mois)
def supJoursFeries(): jour = request.form['jour'] mois = request.form['mois'] print jour print mois rep = modeleResanet.suppJoursFeries(jour, mois) jours = modeleResanet.getJoursFeries() return render_template('joursFeries.html', ferie=jours, cardS=True, jour=jour, mois=mois)
def goAjouterJoursFeries(): jours = modeleResanet.getJoursFeries() return render_template('joursFeries.html', ferie=jours, cardAjout=True)
def listerJoursFeries(): ferie = modeleResanet.getJoursFeries() print "Jours feries : ", ferie return render_template('joursFeries.html', ferie=ferie)
def goJF() : jours = modeleResanet.getJoursFeries() return render_template( 'reservationFerie.html' , jours = jours )