Ejemplo n.º 1
0
def lifetime_report():
    """Lifetime report, all statistics"""
    if "user" in session:
        user = session["user"]
        date = Date()
        current_date = date.todays_date()
        total = random_data([x for x in range(9, 9999)], 1)
        total_players = random_data([x for x in range(59999, 99999)], 1)
        revenue = sum(random_data([x for x in range(9, 9999)], 12))
        sale = sum(random_data([x for x in range(9, 9999)], 12))
        event_data = [generate_buzz() for _ in range(5)]
        country = random_data(countries, 12)
        labels = [x.upper() for x in country]
        values = random_data([x for x in range(499, 14999)], 12)
        colors = [
            "#F7464A", "#46BFBD", "#FDB45C", "#FEDCBA",
            "#ABCDEF", "#DDDDDD", "#ABCABC", "#4169E1",
            "#C71585", "#FF4500", "#FEDCBA", "#46BFBD"
        ]

        return render_template('reports/lifetime_report.html', title="Lifetime Report | BestApp",
                               todays_date=current_date, username=user,
                               total=total, revenue=revenue, sale=sale,
                               max=17000, chart_=zip(values, labels, colors),
                               event_data=event_data, total_players=total_players)
    else:
        return redirect(url_for('login'))
Ejemplo n.º 2
0
def get_top_100():
    """Generate random Data"""
    if "user" in session:
        user = session["user"]
        event_data = [generate_buzz() for _ in range(100)]
        return render_template('reports/get_top_100.html', title="Top 100 | BestApp",
                               event_data=event_data, username=user)
    else:
        return redirect(url_for('login'))
Ejemplo n.º 3
0
def profile():
    """Access the user's profile and stats"""
    if "user" in session:
        user = session["user"]
        geo_data = get_data()
        event_data = generate_buzz()

        return render_template('profile.html', title="My Profile | BestApp", username=user,
                               geo_data=geo_data, event_data=event_data)
    else:
        return redirect(url_for('login'))
Ejemplo n.º 4
0
def _get_data():
    get_data = [generate_buzz() for _ in range(1)]
    return jsonify({
        "data": render_template("reports/gen_players.html", get_data=get_data)
    })