From 95566819c7dbb740121e97351cfcb73d1494f8a2 Mon Sep 17 00:00:00 2001 From: gn64_jp Date: Sun, 28 Jun 2009 13:38:56 +0000 Subject: [PATCH] correct rectask over check. git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@62 4e526526-5e11-4fc0-8910-f8fd03428081 --- Rec10WEB/trunk/src/rec10web.py | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/Rec10WEB/trunk/src/rec10web.py b/Rec10WEB/trunk/src/rec10web.py index a05ba1d..1867bcf 100644 --- a/Rec10WEB/trunk/src/rec10web.py +++ b/Rec10WEB/trunk/src/rec10web.py @@ -76,27 +76,29 @@ def reserv(type,keyword,chtxt,btime,etime,deltatime,opt,deltaday): db=sqlite3.connect(dbpath) bt="\'"+btime+"\'" et="\'"+etime+"\'" - dbexe="SELECT chdata.bctype,rectime.chtxt,rectime.title FROM rectime INNER JOIN chdata ON rectime.chtxt=chdata.chtxt" + dbexe="SELECT type,chdata.bctype,rectime.chtxt,rectime.title FROM rectime INNER JOIN chdata ON rectime.chtxt=chdata.chtxt" #dbexe="SELECT bctype,chtxt,title FROM rectime INNER JOIN chdata ON rectime.chtxt=chdata.chtxt" dbexe=dbexe+" WHERE NOT( ( rectime.etime <= "+bt+" ) OR ( rectime.btime >= "+et+" ) )" - for bctypet, chtxtt, titlet in db.execute(dbexe): - if bctypet.find("cs")>-1: - MaxS=MaxS-1 - elif bctypet.find("bs")>-1: - MaxS=MaxS-1 - elif bctypet.find("te")>-1: - MaxT=MaxT-1 + for typet,bctypet, chtxtt, titlet in db.execute(dbexe): + if (typet=="rec") or (typet=="res") or (typet=="key") or (typet=="keyevery"): + if bctypet.find("cs")>-1: + MaxS=MaxS-1 + elif bctypet.find("bs")>-1: + MaxS=MaxS-1 + elif bctypet.find("te")>-1: + MaxT=MaxT-1 bctype="" rett="" for bctypet, chtxtt in db.execute("SELECT bctype,chtxt FROM chdata WHERE chtxt=\'"+chtxt+"\'"): bctype=bctypet - if bctype.find("cs")>-1: - MaxS=MaxS-1 - elif bctype.find("bs")>-1: - MaxS=MaxS-1 - elif bctype.find("te")>-1: - MaxT=MaxT-1 + if (type=="rec") or (type=="res") or (type=="key") or (type=="keyevery"): + if bctype.find("cs")>-1: + MaxS=MaxS-1 + elif bctype.find("bs")>-1: + MaxS=MaxS-1 + elif bctype.find("te")>-1: + MaxT=MaxT-1 if MaxS>-1 and MaxT>-1: recline="\""+type+"\",\""+chtxt+"\",\""+keyword+"\",datetime(\""+btime+"\"),datetime(\""+etime+"\"),\""+deltatime+"\",\""+opt+"\",\""+deltaday+"\"" #print recline -- 2.11.0