예제 #1
0
def courseSearch(request):

    try:

        termList = coursesDAL.termList()
        campusList = coursesDAL.campusOfInstructionList()

        coursenumber = request.GET.get('coursenumber', None)
        coursename = request.GET.get('coursename', None)
        campusinstructions = request.GET.get('campusinstructions', None)

        term = request.GET.get('term', None)
        if term:
            termCd = enrollmentsDAL.GetAcadTermCode(term)
        else:
            termCd = None

        coursesList = coursesDAL.coursesList(coursenumber, coursename,
                                             campusinstructions, termCd)

        context = {
            'terms': termList,
            'campuses': campusList,
            'courses': coursesList,
            'values': request.GET
        }

    except:
        error = "Date: " + str(datetime.now()) + " Error: " + str(
            sys.exc_info())
        logging.write_log(error)

    finally:
        return JsonResponse(context)
예제 #2
0
def studentSearch(request):

    try:

        username = request.GET.get('username', None)
        uid = request.GET.get('uid', None)
        firstname = request.GET.get('firstname', None)
        lastname = request.GET.get('lastname', None)
        campusOfenrollment = request.GET.get('campusOfenrollment', None)
        studentType = request.GET.get('studentType', None)
        dcPartner = request.GET.get('dcPartner', None)
        currentlyEnrolled = request.GET.get('currentlyEnrolled', None)
        # pendingEnrollmentReq = request.GET.get('pendingEnrollmentReq', None)

        campusList = coursesDAL.campusOfEnrollmentList()
        dcPartnerList = studentsDAL.dcPartnerList()

        studentsList = studentsDAL.studentsList(username, uid, firstname,
                                                lastname, campusOfenrollment,
                                                dcPartner, currentlyEnrolled)

        context = {
            'campuses': campusList,
            'dcPartners': dcPartnerList,
            'studentDetails': studentsList
        }

    except:
        error = "Date: " + str(datetime.now()) + " Error: " + str(
            sys.exc_info())
        logging.write_log(error)

    finally:
        return JsonResponse(context)
예제 #3
0
def courseDetailView(request, courseinfo):

    try:

        courseInformation = courseinfo.split("|")
        courseID = courseInformation[0]
        term = courseInformation[1]
        CampusOfInstruction = courseInformation[2]

        if term:
            termCd = enrollmentsDAL.GetAcadTermCode(term)
        else:
            termCd = None

        courseDetailsHeader1List, courseDetailsHeader2List, campusSeatsList, StudentDetailsList = coursesDAL.courseDetailView(
            courseID, termCd, CampusOfInstruction)

        # print(courseDetailsHeader1List)
        # print(courseDetailsHeader2List)
        # print(campusSeatsList)
        # print(StudentDetailsList)

        courseDetailsDict = {}

        #Course Details
        if courseDetailsHeader1List:
            courseDetailsDict['Course Description'] = courseDetailsHeader1List[
                1]
            courseDetailsDict['Term Offered'] = courseDetailsHeader1List[2]
            courseDetailsDict[
                'Campus of Instruction'] = courseDetailsHeader1List[4]
        else:
            courseDetailsDict['Course Description'] = 'None'
            courseDetailsDict['Term Offered'] = 'None'
            courseDetailsDict['Campus of Instruction'] = 'None'

        if courseDetailsHeader2List:
            courseDetailsDict['Number of Drops'] = courseDetailsHeader2List[3]
            courseDetailsDict[
                'Number of Withdrawals'] = courseDetailsHeader2List[4]
        else:
            courseDetailsDict['Number of Drops'] = 'None'
            courseDetailsDict['Number of Withdrawals'] = 'None'

        context = {
            'courseDetailsDict': courseDetailsDict,
            'campusSeatsList': campusSeatsList,
            'StudentDetailsList': StudentDetailsList,
            'courseId': courseID
        }

    except:
        error = "Date: " + str(datetime.now()) + " Error: " + str(
            sys.exc_info())
        logging.write_log(error)

    finally:
        return render(request, 'courses/courseDetailedView.html', context)
예제 #4
0
def studentDetailView(request, student_uid):

    try:

        StudentDetailList, StudentFormerNamesList, studentQualitricsTabHeaderList, studentEnrollmentHistoryList, StudentCourseRequest = studentsDAL.studentDetailView(
            str(student_uid))

        studentDetailsDict = {}
        if StudentDetailList:
            studentDetailsDict['Student Name'] = StudentDetailList[0]
            studentDetailsDict['User Name'] = StudentDetailList[1]
            studentDetailsDict['UID'] = StudentDetailList[2]
            studentDetailsDict['Date of Birth'] = StudentDetailList[3]
            # studentDetailsDict['Citizenship'] = 'None'
            # studentDetailsDict['Student Type'] = 'None'

            studentDetailsDict['Legal Sex'] = StudentDetailList[4]
            studentDetailsDict['Gender Identity'] = StudentDetailList[5]
            studentDetailsDict['Phone Number'] = StudentDetailList[6]
            studentDetailsDict['Contact Method'] = StudentDetailList[7]
            studentDetailsDict['Email'] = StudentDetailList[8]

            studentDetailsDict['Current Mailing Address'] = StudentDetailList[
                9]
            studentDetailsDict[
                'Permanent Mailing Address'] = StudentDetailList[10]
            studentDetailsDict['Residency'] = StudentDetailList[11]
            studentDetailsDict[
                'Documents Send under another name'] = StudentDetailList[12]

        qualitricsTabHeaderList = []

        for qualitricsTabHeader in studentQualitricsTabHeaderList:
            qualitricsTabHeaderList.append(qualitricsTabHeader[0] + '|' +
                                           qualitricsTabHeader[1])

        context = {
            'studentUid': student_uid,
            'studentDetailsDict': studentDetailsDict,
            'studentFormerNamesList': StudentFormerNamesList,
            'tabsLists': qualitricsTabHeaderList,
            # 'tabQualitricsData' : studentQualitricsdata,
            'enrollmentHistoryDetailsList': studentEnrollmentHistoryList,
            'courseDetailsList': StudentCourseRequest
            #'commentsList' : commentsList
        }

    except:
        error = "Date: " + str(datetime.now()) + " Error: " + str(
            sys.exc_info())
        logging.write_log(error)

    finally:
        return render(request, 'students/studentDetailedView.html', context)
예제 #5
0
def index(request):

    try:
        termList = coursesDAL.termList()
        campusList = coursesDAL.campusOfInstructionList()

        context = {'terms': termList, 'campuses': campusList}
    except:
        error = "Date: " + str(datetime.now()) + " Error: " + str(
            sys.exc_info())
        logging.write_log(error)

    finally:
        return render(request, 'courses/search.html', context)
예제 #6
0
def index(request):

    try:

        campusList = coursesDAL.campusOfEnrollmentList()
        dcPartnerList = studentsDAL.dcPartnerList()

        context = {'campuses': campusList, 'dcPartners': dcPartnerList}

    except:
        error = "Date: " + str(datetime.now()) + " Error: " + str(
            sys.exc_info())
        logging.write_log(error)

    finally:
        return render(request, 'students/search.html', context)
예제 #7
0
def exportcsv(request):

    try:

        if request.method == 'POST':
            username = request.POST['username']
            uid = request.POST['uid']
            firstname = request.POST['firstname']
            lastname = request.POST['lastname']
            campusOfenrollment = request.POST['campusOfenrollment']
            #studentType = request.POST['studentType']
            dcPartner = request.POST['dcPartner']
            currentlyEnrolled = request.POST['currentlyEnrolled']
            #pendingEnrollmentReq = request.POST['pendingEnrollmentReq']

            studentsList = studentsDAL.studentsList(username, uid, firstname,
                                                    lastname,
                                                    campusOfenrollment,
                                                    dcPartner,
                                                    currentlyEnrolled)

            response = HttpResponse(content_type='text/csv')
            response[
                'Content-Disposition'] = 'attachment; filename=students.csv'
            writer = csv.writer(response, delimiter=',')

            response.write(u'\ufeff'.encode('utf8'))

            writer.writerow([
                'PRSN_UNIV_ID', 'Student Name', 'DC Partner', 'Course Choice',
                'Second Course Choice', 'CREDITS_COMPLETED',
                'PRSN_GDS_CMP_EMAIL_ADDR', 'INST_CD'
            ])

            for obj in studentsList:
                writer.writerow([
                    obj[0], obj[1], obj[2], obj[3], obj[4], obj[5], obj[6],
                    obj[7]
                ])

    except:
        error = "Date: " + str(datetime.now()) + " Error: " + str(
            sys.exc_info())
        logging.write_log(error)

    finally:
        return response
예제 #8
0
def exportcsv(request):

    try:

        if request.method == 'POST':
            coursenumber = request.POST['coursenumber']
            coursename = request.POST['coursename']
            campusinstructions = request.POST['campusinstructions']
            term = request.POST['term']

            if term:
                termCd = enrollmentsDAL.GetAcadTermCode(term)
            else:
                termCd = None

            coursesList = coursesDAL.coursesList(coursenumber, coursename,
                                                 campusinstructions, termCd)

            response = HttpResponse(content_type='text/csv')
            response[
                'Content-Disposition'] = 'attachment; filename= courses.csv'
            writer = csv.writer(response, delimiter=',')
            response.write(u'\ufeff'.encode('utf8'))

            writer.writerow([
                'CRS_ID', 'CRS_DESC', 'ACAD_TERM_CD', 'COI_INST_CD',
                'CLS_INSTR_NM', 'ENROLLMENT_CAP', 'ENROLLMENT_TOTAL',
                'Calculated_Remaining'
            ])

            for obj in coursesList:
                writer.writerow([
                    obj[1], obj[2], obj[3], obj[4], obj[5], obj[6], obj[7],
                    obj[8]
                ])

            #print(response)

    except:

        error = "Date: " + str(datetime.now()) + " Error: " + str(
            sys.exc_info())
        logging.write_log(error)

    finally:
        return response
예제 #9
0
def exportcsv(request):

    try:

        if request.method == 'POST':
            term = request.POST['term']
            course = request.POST['course']
            funding = request.POST['funding']

            if term:
                termCd = enrollmentsDAL.GetAcadTermCode(term)
            else:
                termCd = None

            if funding:
                fundingId = enrollmentsDAL.GetFundingId(funding)
            else:
                fundingId = None

            enrollmentDetailsExportList = enrollmentsDAL.enrollmentList(
                termCd, course, fundingId)

            response = HttpResponse(content_type='text/csv')
            response[
                'Content-Disposition'] = 'attachment; filename=enrollment.csv'
            writer = csv.writer(response, delimiter=',')

            response.write(u'\ufeff'.encode('utf8'))

            writer.writerow([
                'ACAD_TERM_CD', 'CRS_SUBJ_CD', 'Funding',
                'STUDENT_ENRL_ADD_DT', 'UserName'
            ])

            for obj in enrollmentDetailsExportList:
                writer.writerow([obj[0], obj[1], obj[5], obj[2], obj[3]])

    except:
        error = "Date: " + str(datetime.now()) + " Error: " + str(
            sys.exc_info())
        logging.write_log(error)

    finally:
        return response
예제 #10
0
def index(request):

    try:

        termList = enrollmentsDAL.termList()
        courseList = enrollmentsDAL.courseList()
        fundingList = enrollmentsDAL.fundingList()

        context = {
            'terms': termList,
            'courses': courseList,
            'fundings': fundingList
        }

    except:
        error = "Date: " + str(datetime.now()) + " Error: " + str(
            sys.exc_info())
        logging.write_log(error)

    finally:
        return render(request, 'enrollments/search.html', context)
예제 #11
0
def studentQualitricsYearWiseDetails(request):

    try:

        if request.method == 'POST':
            studentUid = request.POST['studentUid']
            academicYear = request.POST['academicYear']

            StudentQualitricsDataList = studentsDAL.studentYearWiseQualitricsData(
                studentUid, academicYear)

            #print(StudentQualitricsDataList)

            context = {'StudentQualitricsDataList': StudentQualitricsDataList}

    except:
        error = "Date: " + str(datetime.now()) + " Error: " + str(
            sys.exc_info())
        logging.write_log(error)

    finally:
        return JsonResponse(context)
예제 #12
0
def search(request):

    try:

        term = request.GET.get('term', None)
        if term:
            termCd = enrollmentsDAL.GetAcadTermCode(term)
        else:
            termCd = None

        course = request.GET.get('course', None)
        funding = request.GET.get('funding', None)

        if funding:
            fundingId = enrollmentsDAL.GetFundingId(funding)
        else:
            fundingId = None

        termList = enrollmentsDAL.termList()
        courseList = enrollmentsDAL.courseList()
        enrollmentDetailsList = enrollmentsDAL.enrollmentList(
            termCd, course, fundingId)

        context = {
            'terms': termList,
            'courses': courseList,
            'enrollments': enrollmentDetailsList,
            'values': request.GET
        }

    except:
        error = "Date: " + str(datetime.now()) + " Error: " + str(
            sys.exc_info())
        logging.write_log(error)

    finally:
        return JsonResponse(context)