iro/acounting.py
changeset 67 d1912509f375
parent 60 5ca3aa8d75e1
child 70 a9ee0fe847a8
equal deleted inserted replaced
66:eabb8ead183d 67:d1912509f375
     7 class Acounting(Database):
     7 class Acounting(Database):
     8     def __init__(self,id, connection):
     8     def __init__(self,id, connection):
     9         Database.__init__(self,connection)
     9         Database.__init__(self,connection)
    10         self.id=id
    10         self.id=id
    11 
    11 
    12     def setId(self,id):
    12     def setId(self,id, user):
    13         self.id=id
    13         self.id=id
       
    14         if user:
       
    15             self.connect()
       
    16             self.cursor.execute ("INSERT INTO %s (id,user) VALUES ('%s','%s')" % (self.connection['overview'], self.id,user.name))
       
    17             self.disconnect()
       
    18 
    14 
    19 
    15     def getStatus(self):
    20     def getStatus(self):
    16         self.connect()
    21         self.connect()
    17         self.cursor.execute ("SELECT status,tel FROM %s WHERE id='%s'" % (self.connection['table'], self.id))
    22         self.cursor.execute ("SELECT status,tel FROM %s WHERE id='%s'" % (self.connection['table'], self.id))
    18         ret= self.cursor.fetchall()
    23         ret= self.cursor.fetchall()