Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Francois Mares
NF18 - Projet SCF - Groupe 5
Commits
b8ef34b3
Commit
b8ef34b3
authored
May 18, 2021
by
Francois Mares
Browse files
Replace Client.py
parent
596e87cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Python/Client.py
View file @
b8ef34b3
...
...
@@ -3,18 +3,29 @@ from SQL import SQL
class
Client
(
SQL
):
def
__init__
(
self
):
super
(
self
)
print
(
"Nouveau client
\n
"
)
def
consulter_horaire_train
(
self
):
print
(
"rien"
)
def
rechercher_trajet
(
self
,
depart
,
arrivee
):
self
.
requete_sql
(
"INSERT INTO exemple VALUES('exemple')"
)
print
(
"rien"
)
def
__init__
(
self
,
HOST
=
None
,
DATABASE
=
None
,
PASSWORD
=
None
,
USER
=
None
):
super
().
__init__
(
HOST
,
DATABASE
,
PASSWORD
,
USER
)
def
consulter_horaire_train
(
self
,
numero
):
sql
=
'''
SELECT depart, arrivee
FROM train INNER JOIN horaires
ON train.numero = horaires.id_train
WHERE train.numero=%d;
'''
%
numero
return
self
.
requete_sql
(
sql
)
# TO DO
def
rechercher_trajet
(
self
,
ville_depart
,
ville_arrivee
):
sql
=
'''
SELECT numero
FROM (train INNER JOIN horaires
ON train.numero = horaires.id_train)
INNER JOIN arret
ON arret.gare = gare.id_gare
WHERE (gare.nom_ville='%s' OR gare.nom_ville='%s');
'''
%
(
ville_depart
,
ville_arrivee
)
return
self
.
requete_sql
(
sql
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment