def register_doctor(): if (request.method=="GET"): return render_template("Register/register_doctor.html",title="Doctor") elif (request.method == "POST"): inpDict = { "doctorID" : str(request.form["doctorID"]), "doctorName" : str(request.form["doctorName"]), "email" : str(request.form["email"]), "dob" : str(request.form["dob"]), "address" : str(request.form["address"]), "sex" : str(request.form["sex"]), "phoneNO" : str(request.form["phoneNo"]), "designation" : str(request.form["designation"]), "password" : str(request.form["password"]), } if not models.isExistingUser(inpDict["doctorID"],"Doctor"): # Insert if not existing res = models.insertNewUser(inpDict,"Doctor") if(res==True): return redirect(url_for("home")) else: flash("Error") else: flash("Error")
def register_pharmacy(): if (request.method=="GET"): return render_template("Register/register_pharmacy.html",title="Pharmacy") elif (request.method == "POST"): inpDict = { "pharmacyID" : str(request.form["pharmacyID"]), "pharmacyName" : str(request.form["pharmacyName"]), "address" : str(request.form["address"]), "email" : str(request.form["email"]), "phoneNO" : str(request.form["phoneNo"]), "password" : str(request.form["password"]), } if not models.isExistingUser(inpDict["pharmacyID"],"Pharmacy"): # Insert if not existing res = models.insertNewUser(inpDict,"Pharmacy") if(res==True): return redirect(url_for("home")) else: flash("Error") else: flash("Error")