def submitInterviewCandidate(Firstname, Lastname, Consultant_Name, Date, Vendor_Name, Technology, Client_Name, Marketed_by, Interviewer_Names, Feedback, State): sql = "INSERT INTO INTERVIEWS (candidate_id, Firstname, Lastname, Consultant_Name, Date, Vendor_Name, Technology, Client_Name, Marketed_By, Interviewer_Names, Feedback, State) VALUES ('" + get_candidate_id( ) + "','" + Firstname + "','" + Lastname + "','" + Consultant_Name + "','" + Date + "','" + Vendor_Name + "','" + Technology + "','" + Client_Name + "','" + Marketed_by + "','" + Interviewer_Names + "','" + Feedback + "','" + State + "');" try: mycursor.execute(sql) except mysql.connector.Error as err: print('error') finally: mydb.commit()
def submitEntry(name, task, details, technology, source, link, time, notes): sql = "INSERT INTO TASKS (task_id, name, task, details, technology, source, link, time, notes)" \ "VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)" args = (get_task_id(), name, task, details, technology, source, link, time, notes) try: mycursor.execute(sql, args) except mysql.connector.Error as err: print('error') finally: mydb.commit()
def submitHiringCandidate(Firstname, Lastname, EmailID, India_Number, US_Number, Visa_Status, College_Name1, College_Name2, India_Address, US_Address, reference): sql = "INSERT INTO CANDIDATES (candidate_id, Firstname, Lastname, EmailID, Contact_Number, Visa_Status, College_Name1, College_Name2, reference, state) VALUES ('" + get_candidate_id( ) + "','" + Firstname + "','" + Lastname + "','" + EmailID + "','" + India_Number + "','" + US_Number + "','" + Visa_Status + "','" + College_Name1 + "','" + College_Name2 + "','" + India_Address + "','" + US_Address + "','" + reference + "','0');" try: mycursor.execute(sql) except mysql.connector.Error as err: print('error') finally: mydb.commit()
def submitPlacedCandidate(Firstname, Lastname, EmailID, India_Number, US_Number, Visa_Status, College_Name1, College_Name2, Technology, StartDate, EndDate, Vendor_Name, Client_Name, Job_Location, dollarRate_per_hour, India_Address, US_Address, reference): sql = "INSERT INTO CANDIDATES (candidate_id, Firstname, Lastname, EmailID, India_Number, US_Number, Visa_Status, College_Name1, College_Name2, Technology, StartDate, EndDate, Vendor_Name, Client_Name, Job_Location, dollarRate_per_hour, India_Address, US_Address, reference, state) VALUES ('" + get_candidate_id( ) + "','" + Firstname + "','" + Lastname + "','" + EmailID + "','" + India_Number + "','" + US_Number + "','" + Visa_Status + "','" + College_Name1 + "','" + College_Name2 + "','" + Technology + "','" + StartDate + "','" + EndDate + "','" + Vendor_Name + "','" + Client_Name + "','" + Job_Location + "','" + dollarRate_per_hour + "','" + India_Address + "','" + US_Address + "','" + reference + ",'4');" print("before insert", sql) try: mycursor.execute(sql) except mysql.connector.Error as err: print(err) finally: mydb.commit()
def getRandomId(str, id): print("SELECT " + str + "_id from " + str + "s where " + str + "_id='" + id + "';") mycursor.execute("SELECT " + str + "_id from " + str + "s where " + str + "_id='" + id + "';") return mycursor.fetchall()
def getUsers(): mycursor.execute("SELECT * FROM USERS") return mycursor.fetchall()
def getTasks(user_id): mycursor.execute("SELECT * FROM TASKS where user_id='" + user_id + "';") return mycursor.fetchall()
def deleteTask(tid): mycursor.execute("DELETE FROM TASKS WHERE task_id='" + tid + "';") mydb.commit()
def getMarketingCandidates(): mycursor.execute("SELECT candidate_id from CANDIDATES where state='1'") return mycursor.fetchcall()
def getCandidates(): mycursor.execute("SELECT * FROM CANDIDATES") return mycursor.fetchall()
def deletePlacedCandidate(cid): mycursor.execute("DELETE FROM CANDIDATES WHERE candidate_id='"+cid+"';") mydb.commit()
def saveHiringCandidate(cid,Firstname,Lastname,EmailID,India_Number,US_Number,Visa_Status,College_Name1,College_Name2,India_Address,US_Address,reference): mycursor.execute("UPDATE CANDIDATES SET Firstname='"+ Firstname +"', Lastname='"+ Lastname +"', EmailID='"+ EmailID +"', India_Number='"+ India_Number +"', US_Number='"+ US_Number +"', Visa_Status='"+ Visa_Status +"', College_Name1='"+ College_Name1 +"', College_Name2='"+ College_Name2 +"', India_Address='"+ India_Address +"', US_Address='"+ US_Address +"', reference='"+ reference +"' WHERE candidate_id='" +cid +"';") mydb.commit()
def getPlacedCandidates(): mycursor.execute("SELECT * FROM CANDIDATES where state='4'") return mycursor.fetchall()
def getHiringCandidates(): mycursor.execute("SELECT * FROM CANDIDATES where state='0'") return mycursor.fetchall()
def getInterviews(): mycursor.execute("SELECT * FROM INTERVIEWS") return mycursor.fetchall()
def deleteInterviewCandidate(cid): mycursor.execute("DELETE FROM INTERVIEWS WHERE candidate_id='" + cid + "';") mydb.commit()