Beispiel #1
0
def  ins(movname1, descr1, cast1, poster1, RatingSpinbox1, ageratingcombo, genrecombo ):
    movname=movname1.get()
    descr=descr1.get()
    rating=RatingSpinbox1.get()
    cast=cast1.get()
    age_rating=ageratingcombo.get()
    poster=poster1.get()
    genre=genrecombo.get()
    print(movname,descr,rating,cast,age_rating,poster,genre)
    if(len(movname)!=0 and len(descr)!=0 and len(rating)!=0 and len(cast)!=0 and len(age_rating)!=0 and len(genre)!=0 and len(poster)!=0):						
        try:
            t=querys(movname, descr, rating, cast, age_rating, genre, poster)
            if(t==1):
                messagebox.showinfo("Sucess", "Registration successfull")
                root.withdraw()
                adhome.create_AdHome(root)
            else:
                messagebox.showerror("UnSucess", "Registration Unsuccessfull")

        except Exception as e: print(e)

    else:
        messagebox.showerror("Error", "Fields cannot be empty")
    root.destroy()
    adhome.vp_start_guih()
Beispiel #2
0
def sub(slotid, top):
    global fin
    flag = 0
    chkM = 1
    if (len(fin) == 0):
        messagebox.showerror("Error", "No Seats selected")
    else:

        for i in fin:
            if (i[1] == 'i'):
                i[1] = 'v'
                if (quer(slotid, i[0], i[1])):
                    flag = 1
                else:
                    flag = 0

    if flag == 1:
        sts = ''
        for i in range(len(fin)):
            if i == 0:
                sts += str(fin[i][2])
            else:
                sts += "," + str(fin[i][2])
        st = "Seats Modified successfully\n Seat number : " + sts
        messagebox.showinfo("Sucess", st)
        top.destroy()
        adhome.vp_start_guih()
Beispiel #3
0
def dele(top,movieid):
	q=queryd("Delete from moviedet where movie_id={0}".format(movieid))
	if q==1:
		messagebox.showinfo("Success","movie deleted successfully")
		top.destroy()
		adhome.vp_start_guih()
	else:
		messagebox.showerror("Failure","Movie ALready running in theatres please delete it slots instance")
		top.destroy()
		adhome.vp_start_guih()
Beispiel #4
0
def delete_user(user):
	tname=user.get()
	try:
		print("Delete FROM user where email='{0}'".format(tname))
		q=query("Delete FROM User where email='{0}'".format(tname))
		
		print(q)
	except Exception as e:
		print(e)
		messagebox.showerror("Failed", "Could not Delete the user")
	root.destroy()
	adhome.vp_start_guih()
Beispiel #5
0
def ins(theater_name1, time1, showdate1, cost1, movieid):
    print(theater_name1, time1, showdate1, cost1)
    theater_name = theater_name1.get()
    time = time1.get()
    showdate = showdate1.get_date()
    cost = cost1.get()

    if (len(theater_name) != 0 and len(time) != 0 and len(str(showdate)) != 0
            and len(cost) != 0):
        regex = "^([01]?[0-9]|2[0-3]):[0-5][0-9]$"
        pattern = re.compile(regex)
        print(time)
        print(re.search(pattern, str(time)))
        if pattern.search(time):
            try:
                cost = int(cost)
                try:
                    result = querys2(theater_name)
                    if result:
                        theater_id, capacity = result
                        movie_id = movieid
                        t, slot_id = querys(theater_id, time, showdate,
                                            str(cost), movie_id)
                        if t == 1:
                            z = seats(slot_id, capacity)
                        else:
                            messagebox.showerror("Error",
                                                 "Could not add a slot")
                        if (t == 1):
                            messagebox.showinfo("Success",
                                                "Show Creation successfull")
                            root.destroy()
                            adhome.vp_start_guih()
                        else:
                            messagebox.showerror(
                                "UnSucess", "Show Creation Unsuccessfull")
                    else:
                        messagebox.showerror("Error",
                                             "Could not find that Theater")
                except Exception as e:
                    print(e)
            except Exception as e:
                print(e)
                messagebox.showerror("UnSucess", "Enter a number in cost")
        else:
            messagebox.showerror("Error", "time has to be in hh:mm format")
    else:
        messagebox.showerror("Error", "Fields cannot be empty")
Beispiel #6
0
def back(top):
    top.destroy()
    adhome.vp_start_guih()