def createResPage(): form = forms.registration() rn = request.form['myRoomNumber'] inS= request.form['myInS'] outS = request.form['myOutS'] numG = request.form['myGuestsS'] # send hidden form data to contact.html. # Contact then sends it along to /register and that part does all the work return render_template('contact.html',form=form,rn=rn,inS=inS,outS=outS,numG=numG)
def ex6(): name = None form = registration() if form.validate_on_submit(): session['Name'] = form.name.data name = form.name.data session['Surname'] = form.surname.data return redirect('dashboard') else: return render_template('form.html', form=form, name=name)
def register(): reg_form = registration() if reg_form.validate_on_submit(): #detail=details(name=reg_form.name, userID=reg_form.userID, emailID= reg_form.emailID, mobileNo=reg_form.mobileNo) #creds=cred(userID= reg_form.userID, passwd=reg_form.passwd) dbengine.execute( "insert into details(name, userID, emailID, mobileNo) values ('{}', '{}', '{}', {});" .format(reg_form.name.data, reg_form.userID.data, reg_form.emailID.data, reg_form.mobileNo.data)) dbengine.execute( "insert into cred(userID, passwd) values ('{}', '{}');".format( reg_form.userID.data, reg_form.passwd.data)) return redirect(url_for('login')) return render_template('register.html', form=reg_form)
def reg(): name = None reg = registration() if reg.validate_on_submit(): session['Name'] = reg.name.data session['Mail'] = reg.email.data password_2 = Bcrypt.generate_password_hash( reg.password.data).encode('utf-8') with app.push.context(): new = User(name=session.get('Name'), username=reg.email.data, email=reg.email.data, password=password_2) db.session.add(new) db.session.commit() return redirect('dashboard') return render_template('register.html', reg=reg, name=name)
def contact(): form = forms.registration() if request.method == 'POST': gID=getnewID() addGuest(gID, request.form['Name'], request.form['Address'], request.form['Phone'], request.form['Email'] ) inD = datetime.datetime.strptime(request.form['inDateS'],'%m/%d/%Y').date() outD = datetime.datetime.strptime(request.form['outDateS'],'%m/%d/%Y').date() id = addRes(gID, inD,outD, request.form['roomNum'], request.form['numGuestsS'] ) return redirect('/res/'+str(id)) elif request.method == 'GET': return error404(404)