def get_resetpassword_page(appname, burl, step, data, data2, terminal):
    """ xxx """
    return_data = ''
    page_content = ''
    if step == str(2):
        page_content = validate_email_input(burl, data)
    elif step == str(3):
        page_content = change_password_form(burl, data)
    elif step == str(4):
        page_content = set_new_password(burl, data, data2)
    else:
        page_content = get_resetpassword_email_input(burl)

    return_data = get_head(get_loading_head() +\
                           get_googleanalytics() +\
                           get_title(appname) +\
                           get_metatags(burl) +\
                           set_ogp(burl, 1, '', '') +\
                           get_bootstrap(get_sa_theme(), burl) +\
                           get_font_awesome() +\
                           get_stylesheet(burl))
    return_data = return_data + get_body(get_loading_body(),
                                         navbar(burl, 0, terminal) +\
                                         page_content +\
                                         get_page_footer(burl, False),'')
    return_data = set_page(return_data)
    return return_data
Example #2
0
def gen_portf_page(uid, appname, burl, pop, terminal):
    """ xxx """
    return_data = ''
    if uid is None:
        uid = 0
    if uid == '':
        uid = 0
    connection = pymysql.connect(host=DB_SRV,
                                 user=DB_USR,
                                 password=DB_PWD,
                                 db=DB_NAME,
                                 charset='utf8mb4',
                                 cursorclass=pymysql.cursors.DictCursor)
    cursor = connection.cursor(pymysql.cursors.SSCursor)
    sql = "SELECT instruments.fullname FROM `symbol_list` "+\
    "JOIN instruments ON symbol_list.symbol = instruments.symbol "+\
        "WHERE symbol_list.uid = " + str(uid)

    cursor.execute(sql)
    res = cursor.fetchall()
    instfullname = ''
    for row in res:
        instfullname = row[0]
    cursor.close()
    connection.close()

    if instfullname != '':
        return_data = get_head(get_loading_head() +\
                               get_googleanalytics() +\
                               get_title(appname +' - ' + instfullname) +\
                               get_metatags(burl) +\
                               redirect_if_not_logged_in(burl, '') +\
                               set_ogp(burl, 1, '', '') +\
                               get_bootstrap(get_sa_theme(), burl) +\
                               get_font_awesome() +\
                               get_google_chart_script() +\
                               get_stylesheet(burl))
        return_data = return_data +\
        get_body(get_loading_body(), gen_portf_popup(pop) +\
                 navbar(burl, 0, terminal) +\
                 '<div class="box-top"><div class="row">' +\
                 get_details_header(uid, burl) +\
                 get_portf_alloc(uid, burl) +\
                 get_portf_perf_desc(uid) +\
                 get_portf_risk_trail_returns(uid) +\
                 get_trades_box(uid, burl, None) +\
                 '</div></div>' +\
                 get_page_footer(burl, False),'')
        return_data = set_page(return_data)
    else:
        get_error_page(appname, burl, terminal)
    return return_data
def get_signin_page(appname, burl, err, redirect, terminal):
    """ xxx """
    return_data = ''
    return_data = get_head(get_loading_head() +\
                           get_googleanalytics() +\
                           get_title(appname) +\
                           get_metatags(burl) +\
                           set_ogp(burl, 1, '', '') +\
                           get_bootstrap(get_sa_theme(), burl) +\
                           get_font_awesome() +\
                           get_stylesheet(burl))
    return_data = return_data + get_body(get_loading_body(), navbar(burl, 0, terminal) +\
                                         get_signin_content(burl, 'light', err, redirect) +\
                                         get_page_footer(burl, False) +\
                                         get_purechat(1),'')
    return_data = set_page(return_data)
    return return_data
Example #4
0
def gen_main_page(selection,
                  appname,
                  burl,
                  is_dashboard,
                  tour,
                  nonavbar,
                  terminal):
    """ xxx """
    metarefresh = ''
    refresh_in_second = 900
    navbarcontent = ''
    if nonavbar is None:
        navbarcontent = navbar(burl, 0, terminal)
    page_content = ''
    
    if is_dashboard == str(1):
        if user_is_login() == 1:
            page_content = get_dashboard(burl, is_dashboard)
        else:
            page_content = ''
    else:
        page_content = get_page_content(burl, terminal, selection)
        if user_is_login() == 1:
            metarefresh = '<meta http-equiv="refresh" content="'+ str(refresh_in_second) +'">'

        
    return_data = get_head(get_loading_head() +\
                           get_googleanalytics() +\
                           get_googleadsense() +\
                           get_title(appname) +\
                           metarefresh+get_metatags(burl) +\
                           set_ogp(burl, 1, '', '') +\
                           get_bootstrap(get_sa_theme(), burl) +\
                           get_font_awesome() +\
                           get_google_chart_script() +\
                           get_stylesheet(burl))
    return_data = return_data + get_body(get_loading_body(),
                                         navbarcontent +\
                                         gen_tour_popup(tour, burl) +\
                                         get_signin_box(burl) +\
                                         get_box_user_profile_header() +\
                                         page_content + get_page_footer(burl, False) +\
                                         get_purechat(0),'')
    return_data = set_page(return_data)
    return return_data
Example #5
0
def get_xxx_page(appname, burl, terminal):
    """ Return the content of the entire page """
    return_data = ''
    return_data = get_head(get_loading_head() +\
                           get_googleanalytics() +\
                           get_title(appname) +\
                           get_metatags(burl) +\
                           redirect_if_not_logged_in(burl, '') +\
                           set_ogp(burl, 1, '', '') +\
                           get_bootstrap(get_sa_theme(), burl) +\
                           get_font_awesome() +\
                           get_stylesheet(burl))
    return_data = return_data +\
    get_body(get_loading_body(), navbar(burl, 0, terminal) +\
             get_xxx_content(burl) +\
             get_page_footer(burl, False),'')
    return_data = set_page(return_data)
    return return_data
def get_plan_selection_page(appname, burl, terminal):
    """ xxx """
    return_data = ''
    theme = 'light'
    return_data = get_head(get_loading_head() +\
                           get_googleanalytics() +\
                           get_title(appname) +\
                           get_metatags(burl) +\
                           set_ogp(burl, 1, '', '') +\
                           get_bootstrap(theme, burl) +\
                           get_font_awesome() +\
                           get_stylesheet(burl))
    return_data = return_data +\
    get_body(get_loading_body(), navbar(burl, 0, terminal) +\
             get_box_plan_selection(burl) +\
             get_page_footer(burl, False) +\
             get_purechat(1),'')
    return_data = set_page(return_data)
    return return_data
Example #7
0
def get_search_page(appname, burl, nonavbar, terminal):
    """ xxx """
    return_data = ''
    navbarcontent = ''
    if nonavbar is None:
        navbarcontent = navbar(burl, 1, terminal)

    return_data = get_head(get_loading_head() +\
                           get_googleanalytics() +\
                           get_title(appname) +\
                           get_metatags(burl) +\
                           set_ogp(burl, 1, '', '') +\
                           get_bootstrap(get_sa_theme(), burl) +\
                           get_font_awesome() +\
                           get_stylesheet(burl))
    return_data = return_data +\
    get_body(get_loading_body(), navbarcontent +\
             get_search_page_content(burl, nonavbar, terminal) +\
             get_page_footer(burl, False),'')
    return_data = set_page(return_data)
    return return_data
def gen_view_list_instr_n_portf(appname, burl, what, sel, terminal):
    """ xxx """
    #what = 'instr', what = 'portf'
    #sel = market or asset class
    return_data = ''
    if what == 'instr':
        numrow = 10000
    else:
        numrow = 200
    page_title = 'Top Performing Trades of the Week'

    page_desc = 'Access to thousands of financial instruments, '+\
    'stocks, forex, commodities & cryptos. '+\
    'Create your trading signals portfolio powered by Artificial intelligence.'

    return_data = get_head(get_loading_head() +\
                           get_googleanalytics() +\
                           get_googleadsense() +\
                           get_title(appname) +\
                           get_metatags(burl) +\
                           set_ogp(burl, 2, page_title, page_desc) +\
                           get_bootstrap(get_sa_theme(), burl) +\
                           get_font_awesome() + get_stylesheet(burl))
    return_data = return_data + get_body(get_loading_body(),
                                         navbar(burl, 0, terminal) +\
                                         get_top_instr_n_portf_list() +\
                                         get_box_list_instr_n_portf(burl,
                                                                    'view',
                                                                    what,
                                                                    1,
                                                                    numrow,
                                                                    sel) +\
                                         get_page_footer(burl, False) +\
                                         get_purechat(0),
                                         '')
    return_data = set_page(return_data)
    return return_data
Example #9
0
def get_doc_page(appname, burl, uid, terminal):
    """ Return the content of the entire page """
    return_data = ''

    document = doc_data(uid)
    title = document.get_title()
    content = document.get_content()
    category = document.get_category()
    page_url = burl + 'doc/?uid=' + str(uid)

    return_data = get_head(get_loading_head() +\
                           get_googleanalytics() +\
                           get_title(appname) +\
                           get_metatags(burl) +\
                           set_ogp(burl, 2, title, page_url) +\
                           get_bootstrap(get_sa_theme(), burl) +\
                           get_font_awesome() +\
                           get_stylesheet(burl))
    return_data = return_data +\
    get_body(get_loading_body(), navbar(burl, 0, terminal) +\
             get_doc_content(burl, title, content, category, terminal) +\
             get_page_footer(burl, False),'overflow: hidden;')
    return_data = set_page(return_data)
    return return_data
Example #10
0
def gen_createuser_page(uid, appname, burl, name, username, password, from_ip,
                        broker, username_broker, terminal):
    """ xxx """
    return_data = ''
    if uid == '0':
        return_data = get_head(get_loading_head() +\
                               get_googleanalytics() +\
                               get_title(appname) +\
                               get_metatags(burl) +\
                               set_ogp(burl, 1, '', '') +\
                               get_bootstrap(get_sa_theme(), burl) +\
                               get_font_awesome() +\
                               get_stylesheet(burl))
        return_data = return_data +\
        get_body(get_loading_body(), navbar(burl, 0, terminal) +\
                 get_user_creation_form(burl, broker) +\
                 get_page_footer(burl, False),'')
        return_data = set_page(return_data)
    else:
        connection = pymysql.connect(host=DB_SRV,
                                     user=DB_USR,
                                     password=DB_PWD,
                                     db=DB_NAME,
                                     charset='utf8mb4',
                                     cursorclass=pymysql.cursors.DictCursor)
        cursor = connection.cursor(pymysql.cursors.SSCursor)
        sql = "SELECT username FROM users WHERE uid = '"+\
        str(uid) +"' OR username LIKE '"+\
        str(username) +"' "
        cursor.execute(sql)
        res = cursor.fetchall()
        check_exists = ''
        for row in res:
            check_exists = row[0]
        if check_exists == '':
            name = name.lower()
            nickname = set_nickname()
            date_today = datetime.datetime.now()
            date_today = date_today.strftime('%Y%m%d')
            referred_by_code = get_refer_by_code()
            avatar_id = get_random_num(19)
            email_subscription = 'ALL'
            password = get_hash_string(password)
            broker = str(broker)
            username_broker = str(username_broker)
            sql = "INSERT INTO users(uid, name, nickname, username, "+\
            "password, created_on, referred_by_code, avatar_id, "+\
            "from_ip,lang,email_subscription,broker,username_broker) "+\
            "VALUES ('"+\
            str(uid) +"','"+\
            str(name) +"','"+\
            str(nickname) +"','"+\
            str(username) +"','"+\
            str(password) +"',"+\
            str(date_today) +", '"+\
            str(referred_by_code) +"', "+\
            str(avatar_id) +", '"+\
            str(from_ip) + "', '"+\
            str(get_lang())  +"', '"+\
            str(email_subscription) +"','"+\
            str(broker)+"', '"+\
            str(username_broker) +"' )"
            cursor.execute(sql)
            connection.commit()
            return_data = set_sa_cookie(uid,
                                        set_page(
                                            get_head('<meta http-equiv="refresh" content="0;URL=' +\
                                                         burl + 'n/?step=c" />') +\
                                                         get_body('', '','')))
            send_email_notification(broker, name, username)
        else:
            return_data = 'user already exists :P !'
        cursor.close()
        connection.close()
    return return_data
Example #11
0
def get_contact_tab(burl):
    """ xxx """
    ret = ''
    ret = ret + get_page_footer(burl, True)
    return ret