OSDN Git Service

correct rectask over check.
[rec10/rec10-git.git] / Rec10WEB / trunk / src / rec10web.py
index a05ba1d..1867bcf 100644 (file)
@@ -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