Esempio n. 1
0
def labor_other_do_process(request):
    if 'logged' not in request.session:
        return {'ok': 0, 'msg': 'Please login.'}
    else:
        csrf_token = request.params['csrf_token']
        is_token = (csrf_token == unicode(request.session.get_csrf_token()))

        if is_token:

            labor_other = LaborOtherModel(request)

            start_date = h.jsdate_to_string(request.params['start_date'])
            end_date = h.jsdate_to_string(request.params['end_date'])

            hospcode = request.params['hospcode']

            labor_other.do_process_list(hospcode, start_date, end_date)
            return {'ok': 1}
        else:
            return {'ok': 0, 'msg': 'Not ajax request'}
Esempio n. 2
0
def labor_other_do_process(request):
    if 'logged' not in request.session:
        return {'ok': 0, 'msg': 'Please login.'}
    else:
        csrf_token = request.params['csrf_token']
        is_token = (csrf_token == unicode(request.session.get_csrf_token()))

        if is_token:

            labor_other = LaborOtherModel(request)

            start_date = h.jsdate_to_string(request.params['start_date'])
            end_date = h.jsdate_to_string(request.params['end_date'])

            hospcode = request.params['hospcode']

            labor_other.do_process_list(hospcode, start_date, end_date)
            return {'ok': 1}
        else:
            return {'ok': 0, 'msg': 'Not ajax request'}