Exemplo n.º 1
0
def build_resume_list():
    if request.method == 'POST':
        vacancyId = request.form['vacancy_id']
        vMatcher.VacancyMatching().matchingByVacencyId(vacancyId)

        print("Vacancy Id: " + vacancyId)
        matchingDetails = vm.sq_vacancy_matching().selectByVacancyID(int(vacancyId))
        print("Matching Details: " + str(matchingDetails))


        # Build Suggestion Result
        candidates = list()
        anonimityList = list()

        for row in matchingDetails:
            user = userClass.user().selectUser(row[1])
            print(row[1])
            anonimityValues = anonimity.anonimity().selectByUserID(row[1])
            candidates.append(user)
            print(anonimityValues)
            anonimityList.append(anonimityValues)

        print(candidates)
        print(anonimityList)

    else:
        return render_template('suggetion_resume.html')
    return render_template('suggetion_resume.html', candidates=anonimityList)
Exemplo n.º 2
0
def upload_vacancy():
    if request.method == 'POST':

        # Vacancy Details
        name = request.form['name']
        email = request.form['email']
        address = request.form['address']
        phone = request.form['phone']
        job_type = request.form['job_type']
        job_title = request.form['job_title']
        edu_qualification = request.form['edu_qualification']
        exp_technologies = request.form['exp_technologies']
        exp_yrs = request.form['exp_yrs']
        required_skills = request.form['required_skills']
        other_skills = request.form['other_skills']

        # Display Resume Details
        print("Company Details")
        print('Company Name: ' + name)
        print('Company Email: ' + email)
        print('Company Phone: ' + phone)
        print('Company Address: ' + address)
        print('Company Job Type: ' + job_type)
        print('Company Job Title: ' + job_title)
        print('Required Education Qualification: ' + edu_qualification)
        print('Experienced Technologies: ' + exp_technologies)
        print('Required Skills: ' + required_skills)
        print('Required Experience Years: ' + exp_yrs)
        print('Other Skills: ' + other_skills)
        print("======================================")

        companyId = company.company().insertCompany(name, address, phone, email, job_type)
        vacancyId = vacancies.sq_vacancies().insertVacancy(companyId, job_title, edu_qualification, exp_technologies, exp_yrs, required_skills, other_skills)
        vMatcher.VacancyMatching().matchingByVacencyId(vacancyId)

        print("Vac ID:" + str(vacancyId))
        matchingDetails = vm.sq_vacancy_matching().selectByVacancyID(vacancyId)


        # Build Suggestion Result
        candidates = list()
        anonimityList = list()

        for row in matchingDetails:
            user = userClass.user().selectUser(row[1])
            anonimityValues = anonimity.anonimity().selectByUserID(row[1])
            candidates.append(user)
            anonimityList.append(anonimityValues)

        print(candidates)
        print(anonimityList)
    #
    else:
        return render_template('suggetion_resume.html')
    return render_template('suggetion_resume.html', candidates=anonimityList)
Exemplo n.º 3
0
def clogin():
    if request.method == 'POST':
        username11 = (request.form['uemail'])
        password11 = (request.form['upassword'])
        # company login
        mycursor.execute("SELECT * from company where email=%s AND password=%s", [username11, password11])
        account = mycursor.fetchone()

        print("Return values: " + str(account))

        if account:
            pid = str(account[0])
            print("id: " + pid)

            return redirect(url_for('profileload1', id2=pid))
        # CV login
        else:
            mycursor.execute("SELECT * from cv_reg where email=%s AND password=%s;", [username11, password11])
            account = mycursor.fetchone()
            if account:
                # Create session data, we can access this data in other routes
                userid = (account[0])

                Predictor.Prediction().makePredictionNb()
                vacancy_matching = vm.sq_vacancy_matching().selectByResumeID(int(userid))

                # Build Suggestion Result
                matching_vacancyList = list()

                for row in vacancy_matching:
                    vacancyList = vacancies.sq_vacancies().selectVacancies(row[2])
                    matching_vacancyList.append(vacancyList)

                print("Matching Vacancy List: " + str(matching_vacancyList))

                print("======================================")

                return render_template('suggestion_vacancy.html', vacancyListParam=matching_vacancyList)

            else:
                # Account doesnt exist or username/password incorrect
                msg = 'Incorrect username/password!'

    return render_template('joinivm.html')
Exemplo n.º 4
0
def upload_resume():
    if request.method == 'POST':

        # Resume Details
        name = request.form['name']
        email = request.form['email']
        address = request.form['address']
        age = request.form['age']
        university = request.form['university']
        nic = request.form['nic']
        degree = request.form['degree']
        specialization = request.form['specialization']
        exp_yrs = request.form['exp_yrs']
        skills = request.form['skills']
        phone = request.form['phone']

        # Anonimity Details
        a_name = request.form['a_name']
        a_email = request.form['a_email']
        a_address = request.form['a_address']
        a_nic = request.form['a_nic']
        a_phone = request.form['a_phone']

        # Save the comment here.
        print("Personal Details")
        print('Name: ' + name)
        print('Email: ' + email)
        print('Phone: ' + phone)
        print('Address: ' + address)
        print('Age: ' + age)
        print('University: ' + university)
        print('NIC: ' + nic)
        print('Degree: ' + degree)
        print('Specialization: ' + specialization)
        print('Experience Years: ' + exp_yrs)
        print('skills: ' + skills)
        print("======================================")

        print("Anonimity Level")
        print('Anonimity Value for Name: ' + a_name)
        print('Anonimity Value for Email: ' + a_email)
        print('Anonimity Value for Phone: ' + a_phone)
        print('Anonimity Value for Address: ' + a_address)
        print('Anonimity Value for NIC: ' + a_nic)
        print("======================================")

        projects = ''
        obj = ''

        # Anonymize Values
        if(int(a_name) != 0):
            anonimized_name = name.replace(name[0:math.ceil((int(len(name)-1) * int(a_name)) / 10):], "XXX")
        else:
            anonimized_name = name

        if(int(a_address) != 0):
            anonimized_address = address.replace(address[0:math.ceil((int(len(address)-1) * int(a_address)) / 10):], "XXX")
        else:
            anonimized_address = address

        if(int(a_nic)!= 0):
            anonimized_nic = nic.replace(nic[0:math.ceil((int(len(nic)-1) * int(a_nic)) / 10):], "XXX")
        else:
            anonimized_nic = nic

        if(int(a_email) != 0):
            anonimized_email = email.replace(email[0:math.ceil((int(len(email)-1) * int(a_email)) / 10):], "XXX")
        else:
            anonimized_email = email

        if(int(a_phone) != 0):
            anonimized_phone = phone.replace(phone[0:math.ceil((int(len(phone)-1) * int(a_phone)) / 10):], "XXX")
        else:
            anonimized_phone = phone

        userid = userClass.user().insertUser(age, name, address, nic, email, phone)
        cvPredict.cv_q_predict().insertPredictionData(userid, age, skills, projects, exp_yrs, university, degree, specialization, obj)
        anonimity.anonimity().insertAnonimity(userid, anonimized_name, anonimized_address, anonimized_nic, anonimized_email, anonimized_phone)

        Predictor.Prediction().makePredictionNb()
        vacancy_matching = vm.sq_vacancy_matching().selectByResumeID(userid)

        print("Vacancy_matching" + str(vacancy_matching))

        # Build Suggestion Result
        matching_vacancyList = list()

        for row in vacancy_matching:
            vacancyList = vacancies.sq_vacancies().selectVacancies(row[2])
            matching_vacancyList.append(vacancyList)

        print(matching_vacancyList)

        print("======================================")

        return render_template('suggestion_vacancy.html', vacancyListParam = matching_vacancyList)

    else:
        return render_template('resume_details.html')
    return render_template('resume_details.html')
Exemplo n.º 5
0
 def __init__(self):
     self.vac = vacClass.sq_vacancies()
     self.vm = vmClass.sq_vacancy_matching()
     self.nbp = nbpClass.sq_nb_prediction()
     self.dtp = dtpClass.sq_dt_prediction()