Esempio n. 1
0
def home():
    if verify_role(0) == 0:
        return redirect(url_for(get_home_route()))

    from service.utility import get_student_internship_service

    return render_template("student/homeStudent.html")
def home():
    if verify_role(5) == 0:
        return redirect(url_for(get_home_route()))
    return render_template(
        "cadruDidacticSupervizor/homeCadruDidacticSupervizor.html")


#todo: implement general data for cadruDidacticSuperizor
def acord():
    if verify_role(1) == 0:
        return render_template("home.html")
    repoUser = UserRepository()
    serviceUser = UserService(repoUser)
    idOfCurrentUser = serviceUser.getOneByUsername(
        session["username"]).get_id()
    repoComp = CompanyInfoRepository()
    serviceComp = CompanyInfoService(repoComp)

    if request.method == "POST":
        company = serviceComp.getOne(idOfCurrentUser)
        accordYear = request.form["AccordYear"]
        noHours = request.form["InternshipLenghtDays"]
        accordSignDate = request.form["AccordSignDate"]

        companyName = company.get_name()
        companyCity = company.get_city()
        companyStreet = company.get_street()
        companyStreetNo = company.get_streetNo()
        companyPhone = company.get_phone()
        fax = company.get_fax()
        companyFiscalCode = company.get_fiscalCode()
        companyBank = company.get_bank()
        companyIBAN = company.get_iban()
        companyLegalRepresentative = company.get_legalRepresentative()

        nrOfStudents = request.form["TotalNoStudents"]
        noStudents1 = request.form["NoStudents1"]
        noStudents2 = request.form["NoStudents2"]
        specialization1 = request.form["Specialization1"]
        specialization2 = request.form["Specialization2"]
        faculty2 = request.form["Faculty2"]
        faculty1 = request.form["Faculty1"]

        signature = request.form["signature"]
        create_acord(accordYear, noHours, accordSignDate, companyName,
                     companyCity, companyStreet, companyStreetNo, companyPhone,
                     fax, companyFiscalCode, companyBank, companyIBAN,
                     companyLegalRepresentative, nrOfStudents, noStudents1,
                     noStudents2, specialization1, specialization2, faculty1,
                     faculty2, signature)

        flash("Ati completat cu succes acordul!")
        return render_template("firmaResponsabil/homeResponsabilFirma.html")
    else:
        try:
            company = serviceComp.getOne(idOfCurrentUser)
        except:
            flash("Trebuie sa introduceti mai intai datele firmei.")
            return redirect(url_for("responsabil_firma.home"))

        return render_template("firmaResponsabil/acordResponsabilFirma.html")
def date_firma():
    if verify_role(1) == 0:
        return render_template("home.html")
    if request.method == "POST":
        repoUser = UserRepository()
        serviceUser = UserService(repoUser)
        idOfCurrentUser = serviceUser.getOneByUsername(
            session["username"]).get_id()

        companyName = request.form["CompanyName"]
        companyCity = request.form["CompanyCity"]
        companyStreet = request.form["CompanyStreet"]
        companyStreetNo = request.form["CompanyStreetNo"]
        companyPhone = request.form["CompanyPhone"]
        companyFax = request.form["CompanyFax"]
        companyFiscalCode = request.form["CompanyFiscalCode"]
        companyBank = request.form["CompanyBank"]
        companyIBAN = request.form["CompanyIBAN"]
        companyLegalRepresentative = request.form["CompanyLegalRepresentative"]

        companyLRFunction = request.form["CompanyLegalRepresentativeFunction"]
        companyEmail = request.form["CompanyEmail"]
        adresaPractica = request.form["AdresaPractica"]
        from domain.company_info import CompanyInfo
        companyInfo = CompanyInfo(idOfCurrentUser, companyLegalRepresentative,
                                  companyName, companyCity, companyStreet,
                                  companyStreetNo, companyPhone, companyFax,
                                  companyFiscalCode, companyBank, companyIBAN,
                                  companyLRFunction, companyEmail,
                                  adresaPractica)
        repoComp = CompanyInfoRepository()
        serviceComp = CompanyInfoService(repoComp)
        try:
            serviceComp.add(companyInfo)
        except:  # nu s-a putut adauga, deci deja exista, caz in care il updatam.
            serviceComp.update(companyInfo)

        flash("Ati completat cu succes datele firmei!")
        return redirect(url_for("responsabil_firma.home"))
    else:
        return render_template("firmaResponsabil/dateGeneraleFirma.html")
def home():
    import datetime
    from repository.internship_repository import InternshipRepository
    from service.internship_service import InternshipService

    repo = InternshipRepository()
    service = InternshipService(repo)

    active = False

    try:
        internship = service.get_by_representative_id(session["id"])
        active = True
    except ValueError:
        pass

    if verify_role(1) == 0:
        return render_template("home.html")
    year = datetime.datetime.now().year
    return render_template("firmaResponsabil/homeResponsabilFirma.html",
                           year=year,
                           active=active)
Esempio n. 6
0
def home():
    if verify_role(7) == 0:
        return  redirect(url_for(get_home_route()))
    return render_template("decan/homeDecan.html")
def home():
    if verify_role(2) == 0:
        return redirect(url_for(get_home_route()))
    return render_template("firmaTutore/homeTutoreFirma.html")
Esempio n. 8
0
def home():
    if verify_role(6) == 0:
        return redirect(url_for(get_home_route()))
    return render_template(
        "responsabilFacultate/homeResponsabilFacultate.html")
Esempio n. 9
0
def home():
    if verify_role(3) == 0:
        return redirect(url_for(get_home_route()))
    return render_template("secretara/homeSecretara.html")
def home():
    if verify_role(4) == 0:
        return redirect(url_for(get_home_route()))
    return render_template("protectiaMuncii/homeProtectiaMuncii.html")