Пример #1
0
    def getNoticeData(self):
        basicDB = BasicDB()
        conn = basicDB.conn
        curs = conn.cursor()

        sql = "SELECT * FROM eiom_db.company;"
        curs.execute(sql)

        rows = curs.fetchall()

        for i in range((self.currentpage - 1) * 9, self.currentpage * 9):
            if i < len(rows):
                self.companies[i % 9].companyname = rows[i][0]
                self.companies[i % 9].id = rows[i][1]
                self.companies[i % 9].address = rows[i][3]
                self.companies[i % 9].annualsales = rows[i][4]
                self.companies[i % 9].web = rows[i][5]
                self.companies[i % 9].introduce = rows[i][9]
                self.companies[i % 9].major = rows[i][10]
                self.companies[i % 9].employees_num = rows[i][14]
            else:
                self.companies[i % 9].companyname = ''
                self.companies[i % 9].id = ''
                self.companies[i % 9].address = ''
                self.companies[i % 9].annualsales = ''
                self.companies[i % 9].web = ''
                self.companies[i % 9].introduce = ''
                self.companies[i % 9].major = ''
                self.companies[i % 9].employees_num = ''

        self.pageCount = len(rows) // 9 + 1

        conn.close()
Пример #2
0
def saveLanguages():
    basicDB = BasicDB()
    conn = basicDB.conn
    curs = conn.cursor()

    sql = "select * from languages where id = '" + Student.ID + "';"
    curs.execute(sql)
    row=curs.fetchall()
    Languages.java = row[0][1]
    Languages.c = row[0][2]
    Languages.cpp = row[0][3]
    Languages.cs = row[0][4]
    Languages.html = row[0][5]
    Languages.css = row[0][6]
    Languages.js = row[0][7]
    Languages.jq = row[0][8]
    Languages.node = row[0][9]
    Languages.react = row[0][10]
    Languages.py = row[0][11]
    Languages.php = row[0][12]
    Languages.jsp = row[0][13]
    Languages.mysql = row[0][14]
    Languages.servlet = row[0][15]
    Languages.android = row[0][16]
    Languages.linux = row[0][17]
    Languages.oracle = row[0][18]
    Languages.spring = row[0][19]
    Languages.kotlin = row[0][20]
    Languages.etc = row[0][21]
Пример #3
0
    def idOverlapCheck(self):

        try:
            if len(self.idInput.text()) > 0:
                basicDB = BasicDB()
                conn = basicDB.conn
                curs = conn.cursor()

                sql = "select EXISTS (select * from student where id='" + self.idInput.text(
                ) + "') as success;"
                curs.execute(sql)

                result = curs.fetchall()
                if result[0][0] == 1:
                    print("중복되는 아이디입니다.")
                    self.idOverlapChecked = False
                elif result[0][0] == 0:
                    print("사용 가능한 아이디입니다.")
                    self.idOverlapChecked = True

                conn.close()
            else:
                print("아이디를 입력하십시오.")
                self.idOverlapChecked = False
        except Exception as e:
            print(e)
Пример #4
0
def saveCompanyInfo():
    basicDB = BasicDB()
    conn = basicDB.conn
    curs = conn.cursor()

    sql = "select * from company where id = '" + Company.ID + "';"
    curs.execute(sql)

    row = curs.fetchall()
    Company.companyname = row[0][0]
    Company.ID = row[0][1]
    Company.password = row[0][2]
    Company.address = row[0][3]
    Company.annualsales = row[0][4]
    Company.web = row[0][5]
    Company.email = row[0][6]
    Company.manager_name = row[0][7]
    Company.manager_ph = row[0][8]
    Company.introduce = row[0][9]
    Company.major = row[0][10]
    Company.pfauthority = row[0][11]
    Company.pfperiod = row[0][12]
    Company.request_authority = row[0][13]
    Company.employees_num = row[0][14]
    company.EmployeeRequestDB.callRequest()
Пример #5
0
def callRequest():
    basicDB = BasicDB()
    conn = basicDB.conn
    curs = conn.cursor()

    sql = "select *  from employment_request where company_id='"+Company.ID+"';"
    curs.execute(sql)
    row=curs.fetchall()
    if len(row)>0:
        Request.id = row[0][0]
        Request.company_id = row[0][1]
        Request.recruit = row[0][2]
        Request.hopeperson = row[0][3]
        Request.apply = row[0][4]
        Request.royalty = row[0][5]
        Request.document = row[0][6]
        Request.uselang = row[0][7]
        Request.employment = row[0][8]
        Request.work = row[0][9]
        Request.money = row[0][10]
        Request.worktime = row[0][11]
        Request.benefit = row[0][12]
        Request.period = row[0][13]
        Request.pmoney = row[0][14]
        Request.manager_email = row[0][15]
        Request.manager_ph = row[0][16]
Пример #6
0
    def getNoticeData(self):
        basicDB = BasicDB()
        conn = basicDB.conn
        curs = conn.cursor()

        sql = "select * from notice order by date desc;"
        curs.execute(sql)

        rows = curs.fetchall()

        for i in range((self.currentpage - 1) * 9, self.currentpage * 9):
            if i < len(rows):
                self.notices[i % 9].id = rows[i][0]
                self.notices[i % 9].writer = rows[i][1]
                self.notices[i % 9].date = rows[i][2]
                self.notices[i % 9].title = rows[i][3]
                self.notices[i % 9].content = rows[i][4]
            else:
                self.notices[i % 9].id = ''
                self.notices[i % 9].writer = ''
                self.notices[i % 9].date = ''
                self.notices[i % 9].title = ''
                self.notices[i % 9].content = ''

        self.pageCount = len(rows) // 9 + 1

        conn.close()
Пример #7
0
def orderByBestLang():
    basicDB = BasicDB()
    conn = basicDB.conn
    curs = conn.cursor()

    sql = "select  * from best_lang"

    curs.execute(sql)

    row = curs.fetchall()
    lang = {}
    lang['java'] = row[0][0]
    lang['c'] = row[0][1]
    lang['cpp'] = row[0][2]
    lang['cs'] = row[0][3]
    lang['javascript'] = row[0][4]
    lang['jquery'] = row[0][5]
    lang['nodejs'] = row[0][6]
    lang['react'] = row[0][7]
    lang['python'] = row[0][8]
    lang['php'] = row[0][9]
    lang['jsp'] = row[0][10]
    lang['mysql'] = row[0][11]
    lang['servlet'] = row[0][12]
    lang['android'] = row[0][13]
    lang['linux'] = row[0][14]
    lang['oracle'] = row[0][15]
    lang['spring'] = row[0][16]
    lang['kotlin'] = row[0][17]

    sorted(lang.items(), key=lambda x: x[1], reverse=True)
    return lang
Пример #8
0
    def uploadPost(self):
        # 포스트 업로드
        try:
            basicDB = BasicDB()
            conn = basicDB.conn
            curs = conn.cursor()

            # 자소서 추가
            ifile_name = self.fileInput.split('/')[-1]
            ioriginal_path = self.fileInput.replace('/' + ifile_name, '')
            idestination_path = os.path.dirname(
                os.path.realpath(__file__)) + "\\notice"
            shutil.copyfile(os.path.join(ioriginal_path, ifile_name),
                            os.path.join(idestination_path, ifile_name))

            sql = "INSERT INTO `eiom_db`.`notice` (`writer`, `date`, `title`, `content`, `file`) VALUES ('" + Teacher.name + "', '" + time.strftime(
                '%Y-%m-%d', time.localtime(
                    time.time())) + "', '" + self.titleInput.text(
                    ) + "', '" + self.contentInput.text() + "', 'ㅁㅇㄴㄹ');"

            curs.execute(sql)
            conn.commit()

            conn.close()

            r = teacher.NoticeContent.noticeList()
            r.show()
            self.hide()
        except Exception as e:
            print(e)
Пример #9
0
def pofolRequestInsert(pfrequest,pfperiod):
    basicDB = BasicDB()
    conn = basicDB.conn
    curs = conn.cursor()

    sql = "insert into portfolio_request (com_id,company_name,pfrequest ,pfperiod ) values('"+\
          Company.ID+"','"+Company.companyname+"','"+pfrequest+"','"+pfperiod+"');"

    curs.execute(sql)
    conn.commit()
Пример #10
0
def updateCompanyInfo(companyname,employees_num,major,annualsale,introduce,web,address):
    basicDB = BasicDB()
    conn = basicDB.conn
    curs = conn.cursor()

    sql="update company set companyname='"+companyname+"', employees_num="+employees_num+", major='"+major+\
        "', annualsales='"+annualsale+"', introduce='"+introduce+"', web='"+web+"',address='"+address+\
        "' where id='"+Company.ID+"';"
    curs.execute(sql)
    conn.commit()

    Login.saveCompanyInfo();
Пример #11
0
def getLanguages():
    basicDB = BasicDB()
    conn = basicDB.conn
    curs = conn.cursor()

    sql = "DESCRIBE languages;"
    curs.execute(sql)
    rows1 = curs.fetchall()

    languages = []
    for i in range(1, len(rows1)):
        languages.append(rows1[i][0])

    return languages
Пример #12
0
Файл: Join.py Проект: yj310/EIOM
def TeacherJoin():
    try:

        basicDB = BasicDB()
        conn = basicDB.conn
        curs = conn.cursor()

        sql = "INSERT INTO `eiom_db`.`teacher` (`id`, `name`, `password`, `email`) VALUES ('" + Teacher.ID + "', '" + Teacher.name + "', '" + Teacher.password + "', '" + Teacher.email + "');"

        curs.execute(sql)
        conn.commit()

        conn.close()
        return True
    except Exception as e:
        print(e)
        return False
Пример #13
0
    def getNoticeData(self):
        basicDB = BasicDB()
        conn = basicDB.conn
        curs = conn.cursor()

        sql = "SELECT * FROM eiom_db.student where portfolio like '%';"
        curs.execute(sql)

        rows = curs.fetchall()

        for i in range((self.currentpage-1)*9, self.currentpage*9):
            if i < len(rows) :
                self.pofols[i%9].name = rows[i][2]
                self.pofols[i%9].pofol = rows[i][6]
                self.pofols[i%9].hakbun = str(rows[i][4]) + "학년" + str(rows[i][5]) + "반"
            else:
                self.pofols[i%9].name = ''
                self.pofols[i%9].pofol = ''
                self.pofols[i%9].hakbun = ''

        self.pageCount = len(rows) // 9 + 1


        sql = "SELECT * FROM eiom_db.portfolio_request;"
        curs.execute(sql)

        rows = curs.fetchall()

        for i in range((self.c_currentpage-1)*9, self.c_currentpage*9):
            if i < len(rows) :
                self.reque[i%9].id = rows[i][0]
                self.reque[i%9].companyname = rows[i][1]
                self.reque[i%9].pfrequest = rows[i][2]
                self.reque[i%9].pfperiod = rows[i][3]
                self.reque[i%9].com_id = rows[i][4]
            else:
                self.reque[i%9].id = ''
                self.reque[i%9].companyname = ''
                self.reque[i%9].pfrequest = ''
                self.reque[i%9].pfperiod = ''
                self.reque[i%9].com_id = ''

        self.c_pageCount = len(rows) // 9 + 1

        conn.close()
Пример #14
0
def insertRequest(cid, recruit, hopeperson, apply, royalty, document, uselang, employemnt, work, money, worktime,
                  benefit, period, pmoney, manager_email, manager_ph):
    basicDB = BasicDB()
    conn = basicDB.conn
    curs = conn.cursor()

    sql = "insert into employment_request (company_id,recruit, hopeperson, apply, royalty, "+ \
          "document,uselang, employment,work,money,worktime,"+ \
          "benefit,period,pmoney,manager_email,manager_ph) values ('" + cid + "','" + \
          recruit + "','" + hopeperson + "','" + apply + "','" + royalty + "','" + document + "','" + uselang + "','" + employemnt + "','" + work + "','" + money \
          + "','" + worktime + "','" + benefit + "','" + period + "','" + pmoney + "','" + manager_email + "','" + manager_ph + "');"

    curs.execute(sql)
    conn.commit()
    BestLang(uselang)

    Company.request_authority=1

    callRequest()
Пример #15
0
Файл: Join.py Проект: yj310/EIOM
def CompanyJoin():
    try:
        basicDB = BasicDB()
        conn = basicDB.conn
        curs = conn.cursor()

        sql = "INSERT INTO `eiom_db`.`company` (`companyname`, `id`, `password`, `address`, `annualsales`," \
              " `web`, `email`, `manager_name`, `manager_ph`,request_authority, pfauthority,employees_num) " \
              "VALUES ('"+Company.companyname+"', '"+Company.ID+"', '"+Company.password +"', '"+Company.address+"', '"+\
              Company.annualsale+"', '"+Company.web+"', '"+Company.email+"', '"+Company.manager_name+"', '"+Company.manager_ph+"',"+0+","+0+","+0+");"

        curs.execute(sql)
        conn.commit()

        conn.close()
        return True
    except Exception as e:
        print(e)
        return False
Пример #16
0
def companyLogin(id,pw):
    basicDB = BasicDB()
    conn = basicDB.conn
    curs = conn.cursor()

    sql = "select * from company where id = '" + id + "';"
    curs.execute(sql)

    row = curs.fetchall()
    if len(row) > 0:
        if row[0][2] == pw:
            Company.ID = row[0][1]
            saveCompanyInfo()
            return True
        else:
            return False
    else:
        return False

    conn.close()
Пример #17
0
def updateRate(y1, y2, y3):
    basicDB = BasicDB()
    conn = basicDB.conn
    curs = conn.cursor()

    sql = "update employee_rate set grade3_people_num = "+str(y1['grade3'])+", eiom="+str(y1['eiom'])+\
          ", self="+str(y1['self'])+", scene="+str(y1['scene'])+", request_cnt="+str(y1['request_cnt'])+" where year='"+y1['year']+"';"
    curs.execute(sql)
    conn.commit()

    sql = "update employee_rate set grade3_people_num = " + str(y2['grade3']) + ", eiom=" + str(y2['eiom']) + \
          ", self=" + str(y2['self']) + ", scene=" + str(y2['scene']) + ", request_cnt=" + str(y2['request_cnt']) + " where year='"+y2['year']+"';"
    curs.execute(sql)
    conn.commit()

    sql = "update employee_rate set grade3_people_num = " + str(y3['grade3']) + ", eiom=" + str(y3['eiom']) + \
          ", self=" + str(y3['self']) + ", scene=" + str(y3['scene']) + ", request_cnt=" + str(y3['request_cnt']) + " where year='"+y3['year']+"';"
    curs.execute(sql)
    conn.commit()

    print("업데이트")
Пример #18
0
def saveStudentInfo():
    basicDB = BasicDB()
    conn = basicDB.conn
    curs = conn.cursor()

    sql = "select * from student where id = '" + Student.ID + "';"
    curs.execute(sql)

    rows = curs.fetchall()
    if len(rows)>0:
        Student.ID = rows[0][0]
        Student.password = rows[0][1]
        Student.name = rows[0][2]
        Student.major = rows[0][3]
        Student.grade = rows[0][4]
        Student.class_ = rows[0][5]
        Student.portfolio = rows[0][6]
        Student.introduce = rows[0][7]
        Student.likeCompany = rows[0][8]
        Student.email = rows[0][9]
        saveLanguages()
Пример #19
0
def uselang():
    basicDB = BasicDB()
    conn = basicDB.conn
    curs = conn.cursor()

    sql = "select * from languages where id='" + Student.ID + "';"

    curs.execute(sql)
    row = curs.fetchall()

    lang = {}
    if len(row) > 0:
        lang['java'] = row[0][0]
        lang['c'] = row[0][1]
        lang['c++'] = row[0][2]
        lang['c#'] = row[0][3]
        lang['html'] = row[0][4]
        lang['css'] = row[0][5]
        lang['javascript'] = row[0][6]
        lang['jquery '] = row[0][7]
        lang['node.js'] = row[0][8]
        lang['react'] = row[0][9]
        lang['python'] = row[0][10]
        lang['php'] = row[0][11]
        lang['jsp'] = row[0][12]
        lang['mysql'] = row[0][13]
        lang['servlet'] = row[0][14]
        lang['android'] = row[0][15]
        lang['linux'] = row[0][16]
        lang['oracle'] = row[0][17]
        lang['spring'] = row[0][18]
        lang['kotlin'] = row[0][19]
    li = []
    for key, value in lang.items():
        if value == True:
            li.append(key)

    u = ', '.join(li)
    return u
Пример #20
0
def studentLogin(id,pw):

    basicDB = BasicDB()
    conn = basicDB.conn
    curs = conn.cursor()

    sql = "select * from student where id = '"+id+"';"
    curs.execute(sql)

    rows = curs.fetchall()

    if len(rows) > 0:
        if rows[0][1] == pw:
            Student.ID = rows[0][0]
            saveStudentInfo()
            return True
        else:
            return False
    else:
        return False

    conn.close()
Пример #21
0
def eRateDB(i):
    basicDB = BasicDB()
    conn = basicDB.conn
    curs = conn.cursor()

    sql = "select * from employee_rate ORDER BY year DESC LIMIT 3;"
    curs.execute(sql)

    rows = curs.fetchall()

    y1 = {
        'year': rows[0][0],
        'grade3': rows[0][1],
        'eiom': rows[0][2],
        'self': rows[0][3],
        'scene': rows[0][4],
        'request_cnt': rows[0][5]
    }
    y2 = {
        'year': rows[1][0],
        'grade3': rows[1][1],
        'eiom': rows[1][2],
        'self': rows[1][3],
        'scene': rows[1][4],
        'request_cnt': rows[1][5]
    }
    y3 = {
        'year': rows[2][0],
        'grade3': rows[2][1],
        'eiom': rows[2][2],
        'self': rows[2][3],
        'scene': rows[2][4],
        'request_cnt': rows[2][5]
    }

    if i == 1: return y1
    if i == 2: return y2
    if i == 3: return y3
Пример #22
0
    def nameOverlapCheck(self):

        if len(self.nameInput.text()) > 0:
            basicDB = BasicDB()
            conn = basicDB.conn
            curs = conn.cursor()

            sql = "select EXISTS (select * from company where companyname='" + self.nameInput.text(
            ) + "') as success;"
            curs.execute(sql)

            result = curs.fetchall()
            conn.close()
            if result[0][0] == 1:
                print("이미 가입된 회사명입니다.")
                self.CompanyNameOverlapChecked = False
            elif result[0][0] == 0:
                print("가입 가능한 회사명입니다.")
                self.CompanyNameOverlapChecked = True

        else:
            print("회사명을 입력하십시오.")
            self.CompanyNameOverlapChecked = False
Пример #23
0
def teacherLogin(id,pw):
    basicDB = BasicDB()
    conn = basicDB.conn
    curs = conn.cursor()


    sql = "select * from teacher where id = '" + id + "';"
    curs.execute(sql)

    rows = curs.fetchall()
    if len(rows) > 0:
        print(rows)
        if rows[0][2] == pw:
            Teacher.ID=rows[0][0]
            Teacher.name=rows[0][1]
            Teacher.password=rows[0][2]
            Teacher.email=rows[0][3]
            return True
        else:
            return False
    else:
        return False

    conn.close()
Пример #24
0
Файл: Join.py Проект: yj310/EIOM
def StudentJoin(languages=Languages()):
    try:
        basicDB = BasicDB()
        conn = basicDB.conn
        curs = conn.cursor()

        if len(Student.portfolio) > 0 and len(Student.introduce) > 0:
            # 포폴, 자소서 추가

            pfile_name = Student.portfolio.split('/')[-1]
            poriginal_path = Student.portfolio.replace('/' + pfile_name, '')
            pdestination_path = os.path.dirname(
                os.path.realpath(__file__)) + "\\\portfolio"
            Student.portfolio = str(Student.grade) + "학년" + str(
                Student.class_
            ) + "반" + Student.name + "_포트폴리오." + Student.portfolio.split(
                '.')[-1]
            shutil.copyfile(os.path.join(poriginal_path, pfile_name),
                            os.path.join(pdestination_path, Student.portfolio))

            ifile_name = Student.introduce.split('/')[-1]
            ioriginal_path = Student.introduce.replace('/' + ifile_name, '')
            idestination_path = os.path.dirname(
                os.path.realpath(__file__)) + "\\introduce"
            Student.introduce = str(Student.grade) + "학년" + str(
                Student.class_
            ) + "반" + Student.name + "_자기소개서." + Student.portfolio.split(
                '.')[-1]
            shutil.copyfile(os.path.join(ioriginal_path, ifile_name),
                            os.path.join(idestination_path, Student.introduce))

            sql = "INSERT INTO `eiom_db`.`student` (`id`, `password`, `name`, `major`, `grade`, `class`, `portfolio`, `introduce`, `email`) VALUES ('" + Student.ID + "', '" + Student.password + "', '" + Student.name + "', '" + Student.major + "', " + str(
                Student.grade
            ) + ", " + str(
                Student.class_
            ) + ", '" + Student.portfolio + "', '" + Student.introduce + "', '" + Student.email + "');"

        elif len(Student.portfolio) > 0:
            # 포폴 추가
            pfile_name = Student.portfolio.split('/')[-1]
            poriginal_path = Student.portfolio.replace('/' + pfile_name, '')
            pdestination_path = os.path.dirname(
                os.path.realpath(__file__)) + "\\portfolio"
            Student.portfolio = str(Student.grade) + "학년" + str(Student.class_) + "반" + Student.name + "_포트폴리오." + \
                                Student.portfolio.split('.')[-1]
            shutil.copyfile(os.path.join(poriginal_path, pfile_name),
                            os.path.join(pdestination_path, Student.portfolio))

            sql = "INSERT INTO `eiom_db`.`student` (`id`, `password`, `name`, `major`, `grade`, `class`, `portfolio`, `email`) VALUES ('" + Student.ID + "', '" + Student.password + "', '" + Student.name + "', '" + Student.major + "', " + str(
                Student.grade) + ", " + str(
                    Student.class_
                ) + ", '" + Student.portfolio + "', '" + Student.email + "');"

        elif len(Student.introduce) > 0:
            # 자소서 추가
            ifile_name = Student.introduce.split('/')[-1]
            ioriginal_path = Student.introduce.replace('/' + ifile_name, '')
            idestination_path = os.path.dirname(
                os.path.realpath(__file__)) + "\\introduce"
            Student.introduce = str(Student.grade) + "학년" + str(Student.class_) + "반" + Student.name + "_자기소개서." + \
                                Student.portfolio.split('.')[-1]
            shutil.copyfile(os.path.join(ioriginal_path, ifile_name),
                            os.path.join(idestination_path, Student.introduce))

            sql = "INSERT INTO `eiom_db`.`student` (`id`, `password`, `name`, `major`, `grade`, `class`, `introduce`, `email`) VALUES ('" + Student.ID + "', '" + Student.password + "', '" + Student.name + "', '" + Student.major + "', " + str(
                Student.grade) + ", " + str(
                    Student.class_
                ) + ", '" + Student.introduce + "', '" + Student.email + "');"

        else:
            sql = "INSERT INTO `eiom_db`.`student` (`id`, `password`, `name`, `major`, `grade`, `class`, `email`) VALUES ('" + Student.ID + "', '" + Student.password + "', '" + Student.name + "', '" + Student.major + "', " + str(
                Student.grade) + ", " + str(
                    Student.class_) + ", '" + Student.email + "');"

        curs.execute(sql)
        conn.commit()

        sql = "INSERT INTO `eiom_db`.`languages` (`id`, `java`, `c`, `cpp`, `cs`, `html`, `css`, `javascript`, `jquery`, `nodejs`, `react`, `python`, `php`, `jsp`, `msql`, `servlet`, `android`, `linux`, `oracle`, `spring`, `kotlin`, `etc`) VALUES ('" + Student.ID + "', " + getBool(
            Languages.java) + ", " + getBool(Languages.c) + ", " + getBool(
                Languages.cpp) + ", " + getBool(Languages.cs) + ", " + getBool(
                    Languages.html
                ) + ", " + getBool(Languages.css) + ", " + getBool(
                    Languages.js) + ", " + getBool(
                        Languages.jq) + ", " + getBool(
                            Languages.node) + ", " + getBool(
                                Languages.react
                            ) + ", " + getBool(Languages.py) + ", " + getBool(
                                Languages.php
                            ) + ", " + getBool(Languages.jsp) + ", " + getBool(
                                Languages.mysql) + ", " + getBool(
                                    Languages.servlet) + ", " + getBool(
                                        Languages.android) + ", " + getBool(
                                            Languages.linux) + ", " + getBool(
                                                Languages.oracle
                                            ) + ", " + getBool(
                                                Languages.spring
                                            ) + ", " + getBool(
                                                Languages.kotlin
                                            ) + ", '" + Languages.etc + "');"

        curs.execute(sql)
        conn.commit()

        conn.close()
        return True
    except Exception as e:
        print(e)
        return False
Пример #25
0
def BestLang(k):
    basicDB = BasicDB()
    conn = basicDB.conn
    curs = conn.cursor()

    k = k.replace(' ', '')
    list = k.split(',')

    for i in range(0, len(list)):
        list[i] = list[i].upper()

    sql = "select  * from best_lang"

    curs.execute(sql)

    row = curs.fetchall()

    java = row[0][0]
    c = row[0][1]
    cpp = row[0][2]
    cs = row[0][3]
    javascript = row[0][4]
    jquery = row[0][5]
    nodejs = row[0][6]
    react = row[0][7]
    python = row[0][8]
    php = row[0][9]
    jsp = row[0][10]
    mysql = row[0][11]
    servlet = row[0][12]
    android = row[0][13]
    linux = row[0][14]
    oracle = row[0][15]
    spring = row[0][16]
    kotlin = row[0][17]

    for i in range(0, len(list)):
        if list[i] == 'JAVA' or list[i] == '자바':
            java += 1
        elif list[i] == 'C':
            c += 1
        elif list[i] == 'C++':
            cpp += 1
        elif list[i] == 'C#':
            cs += 1
        elif list[i] == 'JAVASCRIPT' or list[i] == 'JS':
            javascript += 1
        elif list[i] == 'JQUERY':
            jquery += 1
        elif list[i] == 'NODEJS' or list[i] == 'NODE.JS':
            nodejs += 1
        elif list[i] == 'REACT' or list[i] == '리액트':
            react += 1
        elif list[i] == 'PYTHON' or list[i] == '파이썬':
            python += 1
        elif list[i] == 'php':
            php += 1
        elif list[i] == 'jsp':
            jsp += 1
        elif list[i] == 'MYSQL':
            mysql += 1
        elif list[i] == 'SERVLET' or list[i] == '서블릿':
            servlet += 1
        elif list[i] == 'ANDROID' or list[i] == '안드로이드':
            android += 1
        elif list[i] == 'LINUX' or list[i] == '리눅스':
            linux += 1
        elif list[i] == 'ORACLE' or list[i] == '오라클':
            oracle += 1
        elif list[i] == 'SPRING' or list[i] == '스프링':
            spring += 1
        elif list[i] == 'KOTLIN' or list[i] == '코틀린':
            kotlin += 1

    sql = 'update best_lang set java=' + str(java) + ', c=' + str(c) + ', cpp=' + str(cpp) + \
          ',cs=' + str(cs) + ', javascript=' + str(javascript) + ', jquery=' + str(jquery) + \
          ', nodejs=' + str(nodejs) + ', react=' + str(react) + ', python=' + str(python) + \
          ', php=' + str(php) + ', jsp=' + str(jsp) + ', msql=' + str(mysql) + ', servlet=' + str(servlet) + \
          ', android=' + str(android) + ', linux=' + str(linux) + ', oracle= ' + str(oracle) +\
          ', spring=' + str(spring) + ', kotlin=' + str(kotlin);
    curs.execute(sql)
    conn.commit()
Пример #26
0
    def getNoticeData(self):
        basicDB = BasicDB()
        conn = basicDB.conn
        curs = conn.cursor()

        sql = "select * from employment_request;"
        curs.execute(sql)

        rows = curs.fetchall()

        for i in range((self.currentpage - 1) * 9, self.currentpage * 9):
            if i < len(rows):
                self.reque[i % 9].id = rows[i][0]
                self.reque[i % 9].company_id = rows[i][1]
                self.reque[i % 9].recruit = rows[i][2]
                self.reque[i % 9].hopeperson = rows[i][3]
                self.reque[i % 9].apply = rows[i][4]
                self.reque[i % 9].royalty = rows[i][5]
                self.reque[i % 9].document = rows[i][6]
                self.reque[i % 9].uselang = rows[i][7]
                self.reque[i % 9].employment = rows[i][8]
                self.reque[i % 9].work = rows[i][9]
                self.reque[i % 9].money = rows[i][10]
                self.reque[i % 9].worktime = rows[i][11]
                self.reque[i % 9].benefit = rows[i][12]
                self.reque[i % 9].period = rows[i][13]
                self.reque[i % 9].pmoney = rows[i][14]
                self.reque[i % 9].manager_email = rows[i][15]
                self.reque[i % 9].manager_ph = rows[i][16]
                curs2 = conn.cursor()
                sql2 = "select * from company Where id='" + self.reque[
                    i % 9].company_id + "';"
                curs2.execute(sql2)
                rows2 = curs2.fetchall()
                self.reque[i % 9].company_name = rows2[0][0]
                self.reque[i % 9].company_address = rows2[0][3]
                self.reque[i % 9].company_annualsale = rows2[0][4]
                self.reque[i % 9].company_web = rows2[0][5]
                self.reque[i % 9].company_intro = rows2[0][9]
                self.reque[i % 9].company_major = rows2[0][10]
                self.reque[i % 9].company_employees_num = rows2[0][14]
                self.reque[i % 9].request_authority = rows2[0][13]

            else:
                self.reque[i % 9].id = ''
                self.reque[i % 9].company_id = ''
                self.reque[i % 9].recruit = ''
                self.reque[i % 9].hopeperson = ''
                self.reque[i % 9].apply = ''
                self.reque[i % 9].royalty = ''
                self.reque[i % 9].document = ''
                self.reque[i % 9].uselang = ''
                self.reque[i % 9].employment = ''
                self.reque[i % 9].work = ''
                self.reque[i % 9].money = ''
                self.reque[i % 9].worktime = ''
                self.reque[i % 9].benefit = ''
                self.reque[i % 9].period = ''
                self.reque[i % 9].pmoney = ''
                self.reque[i % 9].manager_email = ''
                self.reque[i % 9].manager_ph = ''
                self.reque[i % 9].company_name = ''
                self.reque[i % 9].company_address = ''
                self.reque[i % 9].company_annualsale = ''
                self.reque[i % 9].company_web = ''
                self.reque[i % 9].company_intro = ''
                self.reque[i % 9].company_major = ''
                self.reque[i % 9].company_employees_num = ''
                self.reque[i % 9].request_authority = ''

        self.pageCount = len(rows) // 9 + 1

        conn.close()
Пример #27
0
def updateStudentInfo(name, major, grade, class_, likecompany, pf, intro):
    basicDB = BasicDB()
    conn = basicDB.conn
    curs = conn.cursor()

    sql = "update student set name='" + name + "';"