class LodScreen(Screen): def set(self): self.name = "LodgingScreen" self.T = Title() self.T.set() self.add_widget(self.T, index = 0) self.L = LodBg() self.L.set() self.add_widget(self.L,index = 1) self.bl = StackLayout(orientation = 'rl-tb',size_hint = (1,None),height = 30) self.bl.add_widget(Button(text = 'Back',size_hint= (.1,1),on_press = self.back)) self.add_widget(self.bl) self.bk = False def update(self,a): for i in range(10): if self.L.rooms[i].rcin == True and self.L.rooms[i].cin == True: self.d = '{}/{}/{}'.format(now.day, now.month, now.year) self.t = '{}:{}:{}'.format(now.hour, now.minute, now.second) self.queryin = 'insert into lodgedetails values ("{}","{}","{}","{}","in")'.format(self.d, self.t,random.randint(10,10000),self.L.rooms[i].room) cursor.execute(self.queryin) self.L.rooms[i].cin = False hmdb.commit() elif self.L.rooms[i].rcout == True and self.L.rooms[i].cout == True: self.d = '{}/{}/{}'.format(now.day, now.month, now.year) self.t = '{}:{}:{}'.format(now.hour, now.minute, now.second) self.queryout = 'insert into lodgedetails values ("{}","{}","{}","{}","out")'.format(self.d, self.t,random.randint(10,10000),self.L.rooms[i].room) self.L.rooms[i].cout = False cursor.execute(self.queryout) hmdb.commit() def back(self,a): self.bk = True
class SignUpScreen(Screen, BoxLayout): # main screen for sign up def set(self): self.name = 'signup' self.orientation = 'vertical' self.T = Title() self.T.set() self.add_widget(self.T, index=0) self.add_widget(STitle(), index=0) self.X = SignUpBg() self.X.set() self.X.SL.su.b.on_press = self.getdata self.add_widget(self.X, index=1) def getdata(self): self.X.FL.getdata() self.fl = self.X.FL.FirstListItem self.X.SL.getdata() self.sl = self.X.SL.SecondListItem self.total = self.fl + self.sl self.X.SL.su.backtl = True self.query = 'INSERT INTO userdetails VALUES (' for i in range(len(self.total)): self.query += "'" + self.total[i] + "'" if i == len(self.total) - 1: self.query = self.query else: self.query += ',' self.query += ')' cursor.execute(self.query) self.q = "insert into logindetails values ('{}','{}','Customer')".format( self.total[4], self.total[5]) cursor.execute(self.q) hmdb.commit()
def set(self,rmno): self.rmno = rmno self.T = Title() self.T.set() self.add_widget(self.T) self.gr = GuestBg() self.gr.set() self.add_widget(self.gr)
def set(self): self.username = '' self.name = 'pref' self.T = Title() self.T.set() self.add_widget(self.T) self.p = PrefBg() self.p.set() self.add_widget(self.p)
def set(self): self.orientation = 'vertical' self.name = 'admin' self.T = Title() self.T.set() self.add_widget(self.T) self.b = AdminBg() self.b.set() self.add_widget(self.b)
class GuestDataScreen(Screen): def set(self,rmno): self.rmno = rmno self.T = Title() self.T.set() self.add_widget(self.T) self.gr = GuestBg() self.gr.set() self.add_widget(self.gr)
class AdminScreen(Screen, BoxLayout): def set(self): self.orientation = 'vertical' self.name = 'admin' self.T = Title() self.T.set() self.add_widget(self.T) self.b = AdminBg() self.b.set() self.add_widget(self.b)
def set(self): # Section Screen set the values to approprate postion self.name = 'section' self.orientation = 'vertical' self.T = Title() self.T.set() self.add_widget(self.T, index=0) self.m = Main(size_hint=(1, .9)) self.m.set() self.add_widget(self.m, index=0)
def set(self): self.name = 'signup' self.orientation = 'vertical' self.T = Title() self.T.set() self.add_widget(self.T, index=0) self.add_widget(STitle(), index=0) self.X = SignUpBg() self.X.set() self.X.SL.su.b.on_press = self.getdata self.add_widget(self.X, index=1)
def set(self): self.name = "LodgingScreen" self.T = Title() self.T.set() self.add_widget(self.T, index = 0) self.L = LodBg() self.L.set() self.add_widget(self.L,index = 1) self.bl = StackLayout(orientation = 'rl-tb',size_hint = (1,None),height = 30) self.bl.add_widget(Button(text = 'Back',size_hint= (.1,1),on_press = self.back)) self.add_widget(self.bl) self.bk = False
class SignUpScreen(Screen, BoxLayout): # main screen for sign up def set(self): self.name = 'signup' self.orientation = 'vertical' self.T = Title() self.T.set() self.add_widget(self.T, index=0) self.add_widget(STitle(), index=0) self.X = SignUpBg() self.X.set() self.X.SL.su.b.on_press = self.getdata self.add_widget(self.X, index=1) self.signT = False def getdata(self): self.signT = True self.X.FL.getdata() self.fl = self.X.FL.FirstListItem print(self.fl) self.X.SL.getdata() self.sl = self.X.SL.SecondListItem print(self.sl) self.total = self.fl + self.sl # for i in self.sl: # self.total.append(i) print(tuple(self.total)) self.X.SL.su.backtl = True self.query = 'INSERT INTO studentdetails VALUES (' for i in range(len(self.total)): self.query += "'" + self.total[i] + "'" if i == len(self.total) - 1: self.query = self.query else: self.query += ',' self.query += ')' print(self.query) cursor.execute(self.query) self.q = "insert into logindetails values ('{}','{}','{}')".format( self.total[4], self.total[5], 'Student') print(self.q) cursor.execute(self.q) elect.commit()