1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
|
import locale
import sqlite3
from datetime import *
from tkinter import *
from tkinter import ttk
def FenPlann2():
locale.setlocale (locale.LC_TIME, '')
fPlann = Tk ()
fPlann.title ('Planning ')
fPlann.geometry ('1450x900+%d+%d' % (55, 55))
# onglets planning semaine
n2 = ttk.Notebook (fPlann)
n2.place (x=5, y=50, width=1850, height=1000)
fPlann1 = ttk.Frame (n2)
fPlann1.pack ()
fPlann2 = ttk.Frame (n2)
fPlann2.pack ()
fPlann3 = ttk.Frame (n2)
fPlann3.pack ()
n2.add (fPlann1, text=" Lu / Ma ")
n2.add (fPlann2, text=" Me / Je ")
n2.add (fPlann3, text=" Ve / Sa ")
ListeDebut = [0, 0] # contient les dates (L et S) de la semaine actuels
ListeDebutStr = [0, 0]
datePlannDebut = StringVar ()
datePlannFin = StringVar ()
locale.setlocale (locale.LC_TIME, '')
Jourtoday = str (datetime.now ().strftime ("%A"))
# print(Jourtoday)
if Jourtoday == "dimanche":
Prem = (date.today () + timedelta (days=1))
Der = (date.today () + timedelta (days=6))
if Jourtoday == "samedi":
Prem = (date.today () - timedelta (days=5))
Der = (date.today ())
if Jourtoday == "vendredi":
Prem = (date.today () - timedelta (days=4))
Der = (date.today () + timedelta (days=1))
if Jourtoday == "jeudi":
Prem = (date.today () - timedelta (days=3))
Der = (date.today () + timedelta (days=2))
if Jourtoday == "mercredi":
Prem = (date.today () - timedelta (days=2))
Der = (date.today () + timedelta (days=3))
if Jourtoday == "mardi":
Prem = (date.today () - timedelta (days=1))
Der = (date.today () + timedelta (days=4))
if Jourtoday == "lundi":
Prem = (date.today ())
Der = (date.today () + timedelta (days=5))
PremStr = Prem.strftime ("%a %d %B %y")
DerStr = Der.strftime ("%a %d %B %y")
ListeDebut[0] = Prem
ListeDebut[1] = Der
ListeDebutStr[0] = PremStr
ListeDebutStr[1] = DerStr
print (ListeDebutStr[0], ListeDebutStr[1])
datePlannDebut.set (ListeDebutStr[0])
datePlannFin.set (ListeDebutStr[1])
BoutPlus = Button (fPlann, text="+", bg="darkblue", fg="yellow", font=("Arial", 12))
BoutPlus.place (x=250, y=15, width=50)
Attente = Button (fPlann, text="Liste d'attente :", bg="darkblue", fg="yellow", font=("Arial", 12))
Attente.place (x=450, y=570, width=465)
LbldateDebut = Label (fPlann, textvariable=datePlannDebut, font=("Arial", 12))
LbldateDebut.place (x=430, y=20)
LbldateFin = Label (fPlann, textvariable=datePlannFin, font=("Arial", 12))
LbldateFin.place (x=620, y=20)
BoutPrev = Button (fPlann, text="◄", bg="darkblue", fg="yellow", font=("Arial", 12))
BoutPrev.place (x=380, y=15, width=50)
BoutNext = Button (fPlann, text="►", bg="darkblue", fg="yellow", font=("Arial", 12))
BoutNext.place (x=780, y=15, width=50)
Boutton_Export_Planning = Button (fPlann, text="Exporter :", bg="darkblue", fg="yellow", font=("Arial", 10))
Boutton_Export_Planning.place (x=1110, y=15, width=150)
Lbl_Lundi1 = Label (fPlann1, text="Lundi 13h00")
Lbl_Lundi1.place (x=50, y=10)
Lbl_Lundi2 = Label (fPlann1, text="Lundi 15h15")
Lbl_Lundi2.place (x=215, y=10)
Lbl_Lundi3 = Label (fPlann1, text="Lundi 17h30")
Lbl_Lundi3.place (x=380, y=10)
tree_Lundi1 = ttk.Treeview (fPlann1, columns=(1, 2, 3), height=5, show="headings", style="mystyle.Treeview")
tree_Lundi1.place (x=20, y=30, width=160, height=400)
tree_Lundi2 = ttk.Treeview (fPlann1, columns=(1, 2, 3), height=5, show="headings", style="mystyle.Treeview")
tree_Lundi2.place (x=185, y=30, width=160, height=400)
tree_Lundi3 = ttk.Treeview (fPlann1, columns=(1, 2, 3), height=5, show="headings", style="mystyle.Treeview")
tree_Lundi3.place (x=350, y=30, width=160, height=400)
# dimensions des colonnes
tree_Lundi1.column (1, width=80)
tree_Lundi1.column (2, width=40)
tree_Lundi1.column (3, width=5)
tree_Lundi2.column (1, width=80)
tree_Lundi2.column (2, width=40)
tree_Lundi2.column (3, width=5)
tree_Lundi3.column (1, width=80)
tree_Lundi3.column (2, width=40)
tree_Lundi3.column (3, width=5)
# en tete des TreeView
tree_Lundi1.heading (1, text="Nom")
tree_Lundi1.heading (2, text="")
tree_Lundi1.heading (3, text="")
tree_Lundi2.heading (1, text="Nom")
tree_Lundi2.heading (2, text="")
tree_Lundi2.heading (3, text="")
tree_Lundi3.heading (1, text="Nom")
tree_Lundi3.heading (2, text="")
tree_Lundi3.heading (3, text="")
# séparateur
separateur31 = ttk.Separator (fPlann1, orient="horizontal")
separateur31.place (relx=0, rely=0.5, relwidth=1, relheight=0.2)
separateur32 = ttk.Separator (fPlann2, orient="horizontal")
separateur32.place (relx=0, rely=0.5, relwidth=1, relheight=0.2)
separateur33 = ttk.Separator (fPlann3, orient="horizontal")
separateur33.place (relx=0, rely=0.5, relwidth=1, relheight=0.2)
# Eleves en attente
Lbl_LundiA1 = Label (fPlann1, text="Lundi 13h00")
Lbl_LundiA1.place (x=50, y=540)
Lbl_LundiA2 = Label (fPlann1, text="Lundi 15h15")
Lbl_LundiA2.place (x=215, y=540)
Lbl_LundiA3 = Label (fPlann1, text="Lundi 17h30")
Lbl_LundiA3.place (x=380, y=540)
# TreeView d'attente
tree_LundiA1 = ttk.Treeview (fPlann1, columns=(1, 2, 3), height=5, show="headings", style="mystyle.Treeview")
tree_LundiA1.place (x=20, y=560, width=160, height=155)
tree_LundiA1.column (1, width=80)
tree_LundiA1.column (2, width=40)
tree_LundiA1.column (3, width=5)
tree_LundiA1.heading (1, text="Nom")
tree_LundiA1.heading (2, text="")
tree_LundiA1.heading (3, text="")
tree_LundiA2 = ttk.Treeview (fPlann1, columns=(1, 2, 3), height=5, show="headings", style="mystyle.Treeview")
tree_LundiA2.place (x=185, y=560, width=160, height=155)
tree_LundiA2.column (1, width=80)
tree_LundiA2.column (2, width=40)
tree_LundiA2.column (3, width=5)
tree_LundiA2.heading (1, text="Nom")
tree_LundiA2.heading (2, text="")
tree_LundiA2.heading (3, text="")
tree_LundiA3 = ttk.Treeview (fPlann1, columns=(1, 2, 3), height=5, show="headings", style="mystyle.Treeview")
tree_LundiA3.place (x=350, y=560, width=160, height=155)
tree_LundiA3.column (1, width=80)
tree_LundiA3.column (2, width=40)
tree_LundiA3.column (3, width=5)
tree_LundiA3.heading (1, text="Nom")
tree_LundiA3.heading (2, text="")
tree_LundiA3.heading (3, text="")
fPlann.mainloop ()
#FenPlann2() |
Partager