예제 #1
0
def listerReservations():
    tarifRepas = modeleResanet.getTarifRepas(session['numeroCarte'])

    soldeCarte = modeleResanet.getSolde(session['numeroCarte'])

    solde = '%.2f' % (soldeCarte, )

    aujourdhuifr = datesResanet.getDateAujourdhuiFR()

    aujourdhui = datesResanet.getDateAujourdhuiISO()

    days = ['Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'vendredi']

    datesPeriodeISO = datesResanet.getDatesPeriodeCouranteISO()

    datef = modeleResanet.getjourferie(datesPeriodeISO[0], datesPeriodeISO[-1])

    datesResas = modeleResanet.getReservationsCarte(session['numeroCarte'],
                                                    datesPeriodeISO[0],
                                                    datesPeriodeISO[-1])

    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 uneDateISO in datef:
            uneDate['ferie'] = True
        else:
            uneDate['ferie'] = False

        if soldeCarte < tarifRepas and uneDate['reservee'] == False:
            uneDate['verrouillee'] = True

        dates.append(uneDate)

    if soldeCarte < tarifRepas:
        soldeInsuffisant = True
    else:
        soldeInsuffisant = False

    return render_template('vueListeReservations.html',
                           laSession=session,
                           leSolde=solde,
                           lesDates=dates,
                           soldeInsuffisant=soldeInsuffisant,
                           aujourdhuifr=aujourdhuifr,
                           days=days)
예제 #2
0
def resereDate():
    date = request.form['date']
    perso = modeleResanet.getReservationsDate(date)
    aujourdhuifr = datesResanet.getDateAujourdhuiFR()
    return render_template('vuePersonneReserveDate.html',
                           aujourdhuifr=aujourdhuifr,
                           perso=perso,
                           date=date)
예제 #3
0
def crediter(m, n, p, s):
    aujourdhuifr = datesResanet.getDateAujourdhuiFR()
    return render_template('vueOperationCreditCarte.html',
                           aujourdhuifr=aujourdhuifr,
                           m=m,
                           n=n,
                           p=p,
                           s=s)
예제 #4
0
def creercompte(m, n, p, s):
    aujourdhuifr = datesResanet.getDateAujourdhuiFR()
    return render_template('vueCreationCompteRestauration.html',
                           aujourdhuifr=aujourdhuifr,
                           m=m,
                           n=n,
                           p=p,
                           s=s)
예제 #5
0
def initmdp(numero, nom, prenom):
    modeleResanet.reinitialiserMdp(numero)
    personnel = modeleResanet.getPersonnelsAvecCarte()
    aujourdhuifr = datesResanet.getDateAujourdhuiFR()
    return render_template('vuePersonnelAvecCarte.html',
                           personnel=personnel,
                           aujourdhuifr=aujourdhuifr,
                           mdpinit=True,
                           nom=nom,
                           prenom=prenom)
예제 #6
0
def history(m, n, p, s):

    history = modeleResanet.getHistoriqueReservationsCarte(m)
    aujourdhuifr = datesResanet.getDateAujourdhuiFR()
    return render_template('vueHistoriqueCarte.html',
                           aujourdhuifr=aujourdhuifr,
                           history=history,
                           m=m,
                           n=n,
                           p=p,
                           s=s)
예제 #7
0
def listerReservations():
    tarifRepas = modeleResanet.getTarifRepas(session['numeroCarte'])

    soldeCarte = modeleResanet.getSolde(session['numeroCarte'])

    solde = '%.2f' % (soldeCarte, )

    aujourdhui = datesResanet.getDateAujourdhuiISO()
    aujourdhuis = datesResanet.getDateAujourdhuiFR()
    jours = ["Lundi", "Mardi", "Mecredi", "Jeudi", "Vendredi"]
    datesPeriodeISO = datesResanet.getDatesPeriodeCouranteISO()

    datesResas = modeleResanet.getReservationsCarte(session['numeroCarte'],
                                                    datesPeriodeISO[0],
                                                    datesPeriodeISO[-1])

    dates = []
    for uneDateISO in datesPeriodeISO:
        uneDate = {}
        uneDate['iso'] = uneDateISO
        uneDate['fr'] = datesResanet.convertirDateISOversFR(uneDateISO)
        estFerie = modeleResanet.estJoursFeries(uneDateISO)

        if uneDateISO <= aujourdhui or estFerie == True:
            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

        dates.append(uneDate)

    if soldeCarte < tarifRepas:
        soldeInsuffisant = True
    else:
        soldeInsuffisant = False

    return render_template('vueListeReservations.html',
                           laSession=session,
                           leSolde=solde,
                           lesDates=dates,
                           soldeInsuffisant=soldeInsuffisant,
                           aujourdhui=aujourdhuis,
                           jours=jours)
예제 #8
0
def creer(numero):
    etat = request.form['etat']
    if etat == '1':
        i = True
    else:
        i = False
    ex = modeleResanet.ext(numero)
    if ex == True:
        return redirect('/gestionnaire/liste/avecCarte')
    else:
        modeleResanet.creerCarte(numero, i)
        personnel = modeleResanet.getPersonnelsAvecCarte()
        aujourdhuifr = datesResanet.getDateAujourdhuiFR()
        return render_template('vuePersonnelAvecCarte.html',
                               personnel=personnel,
                               aujourdhuifr=aujourdhuifr)
예제 #9
0
def inserteUneDate():
    aujourdhuifr = datesResanet.getDateAujourdhuiFR()
    return render_template('vueDateInsert.html', aujourdhuifr=aujourdhuifr)
예제 #10
0
def dateFerie():
    date = modeleResanet.getdateferie()
    aujourdhuifr = datesResanet.getDateAujourdhuiFR()
    return render_template('vueJourferie.html',
                           aujourdhuifr=aujourdhuifr,
                           date=date)
예제 #11
0
def reservationParDate():
    aujourdhuifr = datesResanet.getDateAujourdhuiFR()
    return render_template('vueReservationParDate.html',
                           aujourdhuifr=aujourdhuifr)
예제 #12
0
def listePersonnelSansCarte():
    personnelsans = modeleResanet.getPersonnelsSansCarte()
    aujourdhuifr = datesResanet.getDateAujourdhuiFR()
    return render_template('vuePersonnelSansCarte.html',
                           personnelsans=personnelsans,
                           aujourdhuifr=aujourdhuifr)