@app.route("/dashboard")
def bookingOwners():
cursor = mysql.connection.cursor()
sorgu = "SELECT * FROM masters WHERE username IN(SELECT username FROM booking WHERE owner_id IN(SELECT id FROM masters WHERE username = %s))"
sorgu2 = "SELECT * FROM masters WHERE username IN(SELECT username FROM booking WHERE username=%s)"
result2 = cursor.execute(sorgu2,(session["username"],))
result = cursor.execute(sorgu,(session["username"],))
if result > 0:
bookingOwners = cursor.fetchall()
return render_template("dashboard.html",bookingOwners = bookingOwners)
if result2 > 0:
bookingOwners = cursor.fetchall()
return render_template("dashboard.html",bookingOwners = bookingOwners)
else:
return render_template("dashboard.html")