Ejemplo n.º 1
0
def otp_check():
    otp = random.randint(0, 100)
    text = "OTP is: " + str(otp)
    messagebot.send_msg("8130878090", text)
    if (int(raw_input('Enter OTP: ')) != otp):
        return 0
    return 1
Ejemplo n.º 2
0
def sign_up():

    create_table()
    name = raw_input("Enter your name")
    username = raw_input("ENter username")
    curs.execute("SELECT * FROM USER WHERE username =?", (username, ))
    data = curs.fetchall()
    if (data):
        print "Username already exists"
        return
    conn.commit()

    password = raw_input("Enter your password")
    batch = raw_input("ENter batch")
    branch = raw_input("ENter branch")
    year = raw_input("ENter year")
    mobileno = raw_input("Enter mobile no")
    if mobileno == raw_input("Re-enter mobile no"):
        otp = random.randint(0, 100)
        text = "OTP is: " + str(otp)
        messagebot.send_msg(mobileno, text)
        if (int(raw_input('Enter OTP:')) != otp):
            mobileno = 0
    gender = raw_input("Enter your gender")
    email = raw_input("ENter email")
    sec1 = raw_input("Ur first mobile phone?")
    sec2 = raw_input("ur first sem cgpa")
    insert_data_user(name, username, password, batch, branch, year, mobileno,
                     email, gender, sec1, sec2)
Ejemplo n.º 3
0
def sign_up():

    create_table()
    name = raw_input("Enter your name")
    username = raw_input("ENter username")
    curs.execute("SELECT USERNAME FROM USER")
    user_exist = curs.fetchall()
    for row in user_exist:
        if username in row:
            print "You have already signed in."
            return

    password = raw_input("Enter your password")
    batch = raw_input("ENter batch")
    branch = raw_input("ENter branch")
    year = raw_input("ENter year")
    mobileno = raw_input("Enter mobile no")
    if mobileno == raw_input("Re-enter mobile no"):
        otp = random.randint(0, 100)
        text = "OTP is: " + str(otp)
        messagebot.send_msg(mobileno, text)
        if (int(raw_input('Enter OTP:')) != otp):
            mobileno = 0
    gender = raw_input("Enter your gender")
    email = raw_input("ENter email")
    sec1 = raw_input("Ur first mobile phone?")
    sec2 = raw_input("ur first sem cgpa")
    insert_data_user(name, username, password, batch, branch, year, mobileno,
                     email, gender, sec1, sec2)
Ejemplo n.º 4
0
def send_students_msg():
    year = raw_input("Enter year")
    batch = raw_input("ENter batch")
    curs.execute("SELECT mobileno FROM USER WHERE year =? and batch =?",
                 (year, batch))
    data = curs.fetchall()
    #msg=raw_input("ENter your message")
    for row in data:
        messagebot.send_msg(row, msg)