def See(id): if 'Username' in session: seach = mainClass.AllSeach(request.form) if request.method=='POST' and seach.validate: showData = request.form['SeachSelect'] userid = dbColl.find_one({'_id':ObjectId(id)}) if userid: if userid['Category']=='Patient' and showData == 'Patient': Category = userid['Category'] flash(" ", Category ) return render_template("/SeeAll.html", seach=seach, AlluserCat=[], id=id) elif userid['Category']=='Patient': data= dbColl.find({'Category':showData}) Category = userid['Category'] flash(" ", Category ) return render_template("/SeeAll.html", seach=seach, AlluserCat=data, id=id) else: data= dbColl.find({'Category':showData}) Category = userid['Category'] flash(" ", Category ) return render_template("/SeeAll.html", seach=seach, AlluserCat=data, id=id) else: flash(u'Plase call support', 'error') return redirect(url_for('/index')) else: flash(u'Please select a options', 'error') return render_template("/SeeAll.html", seach=seach, AlluserCat=[], id=id)
def See(id): if 'Username' in session: seach = mainClass.AllSeach(request.form) if request.method=='POST' and seach.validate: showData = request.form['SeachSelect'] userid = dbColl.find_one({'_id':ObjectId(id)}) if userid: if userid['Category']=='Patient' and showData == 'Patient': Category = userid['Category'] flash(" ", Category ) print("usted no tiene permiso para ver a todos los"+showData) return render_template("/SeeAll.html", seach=seach, AlluserCat=[], id=id) elif userid['Category']=='Patient': data= dbColl.find({'Category':showData}) Category = userid['Category'] flash(" ", Category ) return render_template("/SeeAll.html", seach=seach, AlluserCat=data, id=id) else: data= dbColl.find({'Category':showData}) Category = userid['Category'] flash(" ", Category ) return render_template("/SeeAll.html", seach=seach, AlluserCat=data, id=id) else: print("Hubo un error comuniquese con soporte tecnico") return redirect(url_for('/index')) else: print("Seleccione una opcion") return render_template("/SeeAll.html", seach=seach, AlluserCat=[], id=id)
def edit(id): if 'Username' in session: AllSeach = mainClass.AllSeach(request.form) Register = mainClass.Register(request.form) UserName = session['Username'] userLog = dbColl.find_one({'userAccount.UserName': UserName}) if userLog: session['Username'] = UserName Category = userLog['Category'] flash(" ", Category) return render_template("edit.html", seach = AllSeach, form=Register, id = id,)
def register(id): Seach = mainClass.AllSeach(request.form) Register = mainClass.Register(request.form) user = dbColl.find_one({'_id':ObjectId(id)}) if user: if user['Category']== 'DirectorDoctor': return render_template("register.html", form=Register, seach=Seach, id = id, User=user) elif user['Category']== 'Patient': flash(u'you did singup success', 'info') return render_template("register.html", form=Register, id = id) else: return render_template("register.html", form=Register, id = id) return render_template("index.html")
def register(id): Seach = mainClass.AllSeach(request.form) Register = mainClass.Register(request.form) user = dbColl.find_one({'_id':ObjectId(id)}) if user: if user['Category']== 'DirectorDoctor': Category = user['Category'] flash(" ",Category) return render_template("register.html", form=Register, seach=Seach, id = id) elif user['Category']== 'Patient': return render_template("register.html", form=Register, id = id) else: return render_template("register.html", form=Register, id = id) return render_template("index.html")
def Discharge(id): UserLog = mainClass.UserLog(request.form) if 'Username' in session: AllSeach = mainClass.AllSeach(request.form) Register = mainClass.Register(request.form) UserName = session['Username'] userLog = dbColl.find_one({'userAccount.UserName': UserName}) if userLog: session['Username'] = UserName Category = userLog['Category'] DrId = userLog['_id'] flash(" ", Category) emerdelete= dbColl.update({"_id":ObjectId(id)}, {'$unset':{"Emergincy":{'$exists':'true'}}}) print(emerdelete) return redirect(url_for("EmergencyStaff", id = DrId))
def SeeAll(id): if 'Username' in session: seach = mainClass.AllSeach(request.form) return render_template("/SeeAll.html", seach=seach, id=id)