correction creation d'un rdv

This commit is contained in:
2017-04-25 21:30:00 +02:00
parent ca0f4cf234
commit a42987c2b5
3 changed files with 7 additions and 6 deletions

View File

@@ -113,9 +113,10 @@ def update_rdv(request, nodossier, nolig, comment, commentvi, date_rdv):
ddate = datetime.strptime(date_rdv, '%d-%m-%Y %H:%M')
datevi = ddate.strftime("%Y-%m-%d")
heurevi = date_rdv[-5:]
auj = date.today().strftime("%Y-%m-%d")
if nolig == '0':
query = "INSERT INTO %s SET societe='%s', datevi='%s', heurevi='%s', comment='%s', commentvi='%s'" % (table, societe, datevi, heurevi, comment, commentvi)
query = "INSERT INTO %s SET societe='%s',no_id=%s,date='%s',datevi='%s',heurevi='%s',comment='%s',commentvi='%s'" % (table, societe, no_id,auj,datevi, heurevi, comment, commentvi)
else:
query = "UPDATE %s SET datevi='%s', heurevi='%s', comment='%s', commentvi='%s' where societe = '%s' and no_id=%s and nolig=%s;" % (table, datevi, heurevi, comment, commentvi, societe, no_id, nolig)