Name now on to lines.
This commit is contained in:
parent
831097aa75
commit
d5c4ee5997
34
IFPass.py
34
IFPass.py
@ -112,11 +112,11 @@ def get_fullname():
|
|||||||
docteur = yes_or_no('Est-ce un Docteur ?')
|
docteur = yes_or_no('Est-ce un Docteur ?')
|
||||||
if docteur:
|
if docteur:
|
||||||
titre = 'Dr.'
|
titre = 'Dr.'
|
||||||
fullname = titre + ' ' + surname + ' ' + firstname
|
titrename = titre + ' ' + surname
|
||||||
else:
|
else:
|
||||||
titre = ''
|
titre = ''
|
||||||
fullname = surname + ' ' + firstname
|
titrename = surname
|
||||||
return titre, firstname, surname, fullname
|
return titre, firstname, surname, titrename
|
||||||
|
|
||||||
|
|
||||||
def yes_or_no(question):
|
def yes_or_no(question):
|
||||||
@ -137,7 +137,6 @@ def getclientID():
|
|||||||
else:
|
else:
|
||||||
clientID = str(int(lastID) + 1).zfill(10)
|
clientID = str(int(lastID) + 1).zfill(10)
|
||||||
|
|
||||||
writeindb(clientID)
|
|
||||||
return clientID
|
return clientID
|
||||||
|
|
||||||
|
|
||||||
@ -228,12 +227,13 @@ def fillcard(barcode):
|
|||||||
draw = ImageDraw.Draw(im)
|
draw = ImageDraw.Draw(im)
|
||||||
|
|
||||||
# Name embedding :
|
# Name embedding :
|
||||||
font = ImageFont.truetype(fonttemplate, 45)
|
font = ImageFont.truetype(fonttemplate, 40)
|
||||||
draw.text((401, 310), fullname, fill=(0, 0, 0), font=font)
|
draw.text((401, 296), titrename, fill=(0, 0, 0), font=font)
|
||||||
|
draw.text((401, 334), firstname, fill=(0, 0, 0), font=font)
|
||||||
|
|
||||||
# Date embedding :
|
# Date embedding :
|
||||||
font = ImageFont.truetype(fonttemplate, 30)
|
font = ImageFont.truetype(fonttemplate, 30)
|
||||||
draw.text((401, 390), dateexp, fill=(0, 0, 0), font=font)
|
draw.text((401, 400), dateexp, fill=(0, 0, 0), font=font)
|
||||||
|
|
||||||
# ID embedding :
|
# ID embedding :
|
||||||
font = ImageFont.truetype('arial.ttf', 30)
|
font = ImageFont.truetype('arial.ttf', 30)
|
||||||
@ -248,6 +248,7 @@ def fillcard(barcode):
|
|||||||
# Create PDF :
|
# Create PDF :
|
||||||
im = im.convert("RGB")
|
im = im.convert("RGB")
|
||||||
im.save(imgdir + clientID + '_Front.pdf', 'PDF', resolution=299.0, quality=98)
|
im.save(imgdir + clientID + '_Front.pdf', 'PDF', resolution=299.0, quality=98)
|
||||||
|
writeindb(clientID)
|
||||||
|
|
||||||
print(colored('[OK]', 'green'))
|
print(colored('[OK]', 'green'))
|
||||||
|
|
||||||
@ -312,6 +313,7 @@ def membersearch():
|
|||||||
print(colored('Choix invalide ! Veillez bien à sélectionner le numéro de la colonne "Choix"', 'red', attrs=['bold']))
|
print(colored('Choix invalide ! Veillez bien à sélectionner le numéro de la colonne "Choix"', 'red', attrs=['bold']))
|
||||||
os.system('cls')
|
os.system('cls')
|
||||||
|
|
||||||
|
while 'Choix incorect':
|
||||||
print("Titre : ", colored(member[0], 'green'))
|
print("Titre : ", colored(member[0], 'green'))
|
||||||
print("Prénom : ", colored(member[1], 'green'))
|
print("Prénom : ", colored(member[1], 'green'))
|
||||||
print("Nom : ", colored(member[2], 'green'))
|
print("Nom : ", colored(member[2], 'green'))
|
||||||
@ -327,12 +329,25 @@ def membersearch():
|
|||||||
elif diff == 0:
|
elif diff == 0:
|
||||||
print(colored("Il s'agit du dernier jour de l'abonnement, il expirera demain.", 'yellow', attrs=['bold']))
|
print(colored("Il s'agit du dernier jour de l'abonnement, il expirera demain.", 'yellow', attrs=['bold']))
|
||||||
|
|
||||||
|
print('\n1 - Modifier', "2 - Renouveller l'abonnement", '3 - Menu principal', sep='\n')
|
||||||
|
choix = input('Choix : ')
|
||||||
|
if choix == '1':
|
||||||
|
print(1)
|
||||||
|
elif choix == '2':
|
||||||
|
print(2)
|
||||||
|
elif choix == '3':
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
os.system('cls')
|
||||||
|
print(colored('Choix incorrect !\n', 'red', attrs=['bold']))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print(colored("Aucun membre n'a été trouvé.", 'red', attrs=['bold']))
|
print(colored("Aucun membre n'a été trouvé.", 'red', attrs=['bold']))
|
||||||
|
os.system("pause")
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
global titre, firstname, surname, fullname, dateinsc, dateexp, clientID, clientsfile, IFPassDBdir, clientsfile, imgdir, clientsbkpfile, templatesdir, pngtemplate, fonttemplate, picture, pdftemplate, printername, AcrobatReader
|
global titre, firstname, surname, titrename, dateinsc, dateexp, clientID, clientsfile, IFPassDBdir, clientsfile, imgdir, clientsbkpfile, templatesdir, pngtemplate, fonttemplate, picture, pdftemplate, printername, AcrobatReader
|
||||||
while "The program is running":
|
while "The program is running":
|
||||||
init() # Initialisation of colorama
|
init() # Initialisation of colorama
|
||||||
IFPassDBdir, printername, AcrobatReader, clientsfile, clientsbkpfile, imgdir, templatesdir, pdftemplate, pngtemplate, fonttemplate = initialisation()
|
IFPassDBdir, printername, AcrobatReader, clientsfile, clientsbkpfile, imgdir, templatesdir, pdftemplate, pngtemplate, fonttemplate = initialisation()
|
||||||
@ -350,7 +365,7 @@ def main():
|
|||||||
if choix == '1':
|
if choix == '1':
|
||||||
while "the informations are incorrect": # Loop Filling informations
|
while "the informations are incorrect": # Loop Filling informations
|
||||||
os.system('cls')
|
os.system('cls')
|
||||||
titre, firstname, surname, fullname = get_fullname()
|
titre, firstname, surname, titrename = get_fullname()
|
||||||
dateinsc = date.today()
|
dateinsc = date.today()
|
||||||
dateexp = dateinsc + timedelta(days=365)
|
dateexp = dateinsc + timedelta(days=365)
|
||||||
|
|
||||||
@ -391,7 +406,6 @@ def main():
|
|||||||
elif choix == '2':
|
elif choix == '2':
|
||||||
os.system('cls')
|
os.system('cls')
|
||||||
membersearch()
|
membersearch()
|
||||||
os.system("pause")
|
|
||||||
|
|
||||||
elif choix == '3':
|
elif choix == '3':
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
Loading…
Reference in New Issue
Block a user