def main():
    params = cgi.FieldStorage()
    equipmentID = params['equipID'].value
    
    html.open_html(sess.cookie, loggedIn)
    
    print_body(equipmentID, params)
    html.close_html()
    sess.close()
    return
Пример #2
0
def main():
    html.open_html(sess.cookie, loggedIn)
    error = False
    if params.has_key('error'):
        error = True
    print_body(error)

    html.close_html()
    sess.close()
    return
def main():
    if not html.check_player(loggedIn):
        return
    html.open_html(sess.cookie, loggedIn)
    #Get data through params and SQL
    gameID = params['gameID'].value
    game_data = sql.run_sql("""SELECT GameID, Name, Genre, Review, StarRating, ClassificationRating, PlatformNotes, PromotionLink, Cost FROM Game WHERE GameID = %s"""%(gameID))[0]
    body.print_game(game_data)
    html.close_html()
    return
Пример #4
0
def main():
    html.open_html(sess.cookie, loggedIn)
    error = False
    #Print error if any
    if params.has_key('error'):
        error = True
    form.print_details(error)
    html.close_html()
    sess.close()
    return
def main():
    params = cgi.FieldStorage()
    playerID = params['playerID'].value
    
    html.open_html(sess.cookie, loggedIn)
    
    print_body(playerID, params)
    html.close_html()
    sess.close()
    return
def main():
    if not html.check_player(loggedIn):
        return
    html.open_html(sess.cookie, loggedIn)
    #Get data through SQL
    achievements = sql.run_sql("""SELECT Achievement.AchievementID, Achievement.Name, Achievement.InstanceRunID, Achievement.WhenAchieved, Achievement.RewardBody
                                   FROM Achievement""")
    body.print_achievements("Achievements", ("Name", "Instance Run ID", "When Achieved", "Reward Body"), achievements, loggedIn)
    html.close_html()
    return
Пример #7
0
def main():
    if not html.check_logged_in(loggedIn):
        return
    video_id = get_vid_id(params)
    
    html.open_html(sess.cookie, loggedIn)
    print_body(video_id, params)
    html.close_html()
    
    sess.close()
    return
def main():
    if not html.check_player(loggedIn):
        return
    html.open_html(sess.cookie, loggedIn)
    #Get data through params and SQL
    instance_runs = sql.run_sql("""SELECT IR.InstanceRunID, IR.Name, IR.RecordedTime, IR.CategoryName, P.GameHandle
                                   FROM InstanceRun as IR, Player as P
                                       WHERE P.PlayerID = IR.SupervisorID""")
    body.print_instances("Instance Runs", ("Name", "Time", "Category Name", "Supervisor Handle"), instance_runs, loggedIn)
    html.close_html()
    return
def main():
    if not html.check_logged_in(loggedIn):
        return
    html.open_html(sess.cookie, loggedIn)
    
    print_body()
    html.close_html()
    sess.data['loggedIn'] = 0 # log them out
    sess.data['userName'] = "******"
    sess.set_expires('')
    sess.close()
    return
Пример #10
0
def main():
    if loggedIn in (1, 2):
        redirect.refresh("home.py", sess.cookie)
        return
    
    params = cgi.FieldStorage()
    cookie = sess.cookie
    html.open_html(cookie, 0)
    form.print_form(params.has_key('error'))
    html.close_html()
    sess.close()
    return
def main():
    if not html.check_player(loggedIn):
        return
    html.open_html(sess.cookie, loggedIn)
    # Get data through params and SQL
    achievementID = params["achievementID"].value
    achievement_data = sql.run_sql(
        """SELECT AchievementID, Name, InstanceRunID, WhenAchieved, RewardBody FROM Achievement WHERE AchievementID = %s"""
        % (achievementID)
    )[0]
    body.print_achievement(achievement_data)
    html.close_html()
    return
def main():
    if not html.check_player(loggedIn):
        return
    html.open_html(sess.cookie, loggedIn)
    if params.has_key('notFound'):
        print """
             <div style="text-align:center" class="col-lg-4 col-lg-offset-4">
                 <label class="col-lg-3 control-label">User Not Found</label>
             </div>
        """
    search_form()
    html.close_html()
    return
Пример #13
0
def load_page():
    #Get Session from cookie and fieldstorage that has been passed on from previous page
    sess = session.Session(expires=20*60, cookie_path='/')
    username = sess.data.get('userName')
    loggedIn = sess.data.get('loggedIn')
    #Oepn html using session
    html.open_html(sess.cookie, loggedIn)
    #Is logged in as Viewer
    if loggedIn == 1:
        #get viewer type of the current user
        viewer_type = sql.run_sql(
        """SELECT ViewerType FROM Viewer
           WHERE Viewer.ViewerID = (SELECT ViewerLogin.ViewerID FROM ViewerLogin
                                    WHERE ViewerLogin.UserName = "******")"""%(username))[0][0]
        if viewer_type == 'C':
            name = sql.run_sql("""SELECT FirstName, LastName FROM CrowdFundingViewer
                                  WHERE CrowdFundingViewer.ViewerID = (SELECT ViewerLogin.ViewerID FROM ViewerLogin
                                                              WHERE ViewerLogin.UserName = "******")"""%(sess.data.get('userName')))[0]
            
            html.print_welcome(name[0], name[1])
    
    
    if loggedIn in (1, 2):
        videos = sql.run_sql("""SELECT VideoID, Video.Name, Game.Name, VideoType, InstanceRun.Name, Player.GameHandle, Player.PlayerID, Equipment.ModelAndMake, Equipment.EquipmentID FROM Video, Game, InstanceRun, Player, Equipment
                                 WHERE Video.InstanceRunID = InstanceRun.InstanceRunID
                                 AND Video.GameID = Game.GameID
                                 AND InstanceRun.SupervisorID = Player.PlayerID
                                 AND Player.PlayerID = (SELECT Venue.SupervisorID FROM Venue
                                                         WHERE Venue.VenueID = (SELECT VenueEquipment.VenueID FROM VenueEquipment
                                                                                 WHERE VenueEquipment.EquipmentID = Equipment.EquipmentID))
                                 ORDER BY VideoID""")
    else:
        videos = sql.run_sql("""SELECT VideoID, Video.Name, Game.Name, VideoType, InstanceRun.Name, Player.GameHandle, Player.PlayerID, Equipment.ModelAndMake, Equipment.EquipmentID FROM Video, Game, InstanceRun, Player, Equipment
                                 WHERE Video.InstanceRunID = InstanceRun.InstanceRunID
                                 AND Video.GameID = Game.GameID
                                 AND InstanceRun.SupervisorID = Player.PlayerID
                                 AND Player.PlayerID = (SELECT Venue.SupervisorID FROM Venue
                                                         WHERE Venue.VenueID = (SELECT VenueEquipment.VenueID FROM VenueEquipment
                                                                                 WHERE VenueEquipment.EquipmentID = Equipment.EquipmentID))
                                 AND Video.VideoType = 'Free'
                                 ORDER BY VideoID""")
    
    html.print_videos("Videos", ("Name", "Game", "Type", "Instance", "Supervisor", "Equipment"), videos, loggedIn)
    
    html.close_html()

    sess.close()
    return
def main():
    if not html.check_logged_in(loggedIn):
        return
    html.open_html(sess.cookie, loggedIn)
    error = False
    username = params['userName'].value
    if (loggedIn != 2) and (sess.data['userName'] != username):
        redirect.refresh("home.py", sess.cookie)
        return
    if params.has_key('error'):
        error = True
    print_body(username, error)

    html.close_html()
    sess.close()
    return
def main():
    if not html.check_logged_in(loggedIn):
        return
    html.open_html(sess.cookie, loggedIn)
    error = False
    # Get data through params and SQL

    username = sess.data["userName"]
    if loggedIn != 2:
        redirect.refresh("home.py", sess.cookie)
        return
    if params.has_key("error"):
        error = True
    print_body(username, error)

    html.close_html()
    sess.close()
    return
def main():
    
    #Get Session from cookie and fieldstorage that has been passed on from previous page
    sess = session.Session(expires=20*60, cookie_path='/')
    username = sess.data.get('userName')
    loggedIn = sess.data.get('loggedIn')
    params= cgi.FieldStorage()
    
    if not html.check_player(loggedIn):
        return
    #Get data through params and SQL
    instanceRunID = params['instancerunID'].value
    
    IR = sql.run_sql("""SELECT InstanceRun.InstanceRunID, InstanceRun.Name, InstanceRun.SupervisorId, InstanceRun.CategoryName FROM InstanceRun
                        WHERE InstanceRun.InstanceRunID = %s"""%instanceRunID)[0]
    
    html.open_html(sess.cookie, loggedIn)
    if IR:
        body.edit_instancerun(IR)
    html.close_html()
    return