Exemple #1
0
def verification():
    """
    登录验证
    :return:
    """
    user = request.form.get('u')
    pasd = request.form.get('p')
    print(user, pasd)
    flag = sqllitDBHelper().check_login(user,pasd)
    print('-*-*-', flag)
    return jsonify(flag)
Exemple #2
0
def deloneclass():
    """
    登录成功后,根据itemid删除这条课程数据
    :return:
    """
    itemid = request.form.get('itemid')
    uid = request.form.get('uid')
    print("del收到itemid:",itemid)
    db = sqllitDBHelper()
    db.del_one_class(itemid)
    class_list = db.select_user_news(uid)
    return jsonify(class_list)
Exemple #3
0
def getclass():
    """
    登录成功后,根据uid查询出这个uid的所有课程数据
    :return:
    """
    uid = request.form.get('uid')
    if uid:
        print("收到uid:",uid)
        class_list = sqllitDBHelper().select_user_news(uid)
        return render_template('timeSheet.html', class_data_list=class_list,name=request.form.get('name'),uid=request.form.get('uid'))
    else:
        return render_template('index.html')
Exemple #4
0
def get_mounth_class_minutes():
    """
    获取月度总共分钟数
    :return:
    """
    uid = request.form.get('uid')
    curYear = request.form.get('curYear')
    curMonth = request.form.get('curMonth')
    if len(curMonth) < 2:
        curMonth = f'0{curMonth}'
    class_list = sqllitDBHelper().select_user_news(uid, curYear+'-'+curMonth)
    min = sum_month_class_min(class_list)
    return jsonify({'min':min})
Exemple #5
0
def insert():
    """
    登录成功后,插入一条新数据
    :return:
    """
    start_end = request.form.get('start_end')
    start_time_list  = start_end.split(' - ')
    note = request.form.get('note')
    now_click_date = request.form.get('date')
    uid = request.form.get('uid')
    db = sqllitDBHelper()
    db.insert_data(uid, f'{now_click_date} {start_time_list[0]}', f'{now_click_date} {start_time_list[1]}', now_click_date, note)
    class_list = db.select_user_news(uid)
    return jsonify(class_list)