def evalution(): form = EvaluationForm() if form.validate_on_submit(): fuck_dlnu = urp(form.username.data, form.password_urp.data) if fuck_dlnu.login(): lists = fuck_dlnu.evaluation() pool = Pool(12) pool.map(fuck_dlnu.post_evaluation, lists) pool.close() pool.join() return redirect('/') flash("密码输入有误") return render_template('evaluation.html', title='F****n School', form=form)
def evalution(): form = EvaluationForm() if form.validate_on_submit(): fuck_dlnu = urp(form.username.data, form.password_urp.data) if fuck_dlnu.login(): lists = fuck_dlnu.evaluation() pool = Pool(12) pool.map(fuck_dlnu.post_evaluation, lists) pool.close() pool.join() return redirect('/') flash("密码输入有误") return render_template('evaluation.html', title = 'F****n School', form = form)
def EvaluateDeactivateCardRequest(id, rid, Acctype): reqs = CardDeActLogs.query.filter_by(id=rid).first() cust = B_Customer.query.filter_by(C_id=reqs.C_id).first() form = EvaluationForm() if form.validate_on_submit(): if form.Approve.data: card = B_Customer_Card_Details.query.filter_by( Card_No=reqs.CardNo).first() card.Card_Activate = False db.session.add(card) db.session.delete(reqs) now = datetime.now() dt_string = now.strftime("%B %d %Y-- %H:%M:%S") log = logs( Actor_id=id, Actor_Type=Acctype, ActionDone="Accepted Customer Request for card Deactivation ", OtherId=rid, ActionTime=dt_string) db.session.add(log) db.session.commit() sub = "Card Deactivation Request Approved" htmlbody = f"Hello <b>{cust.C_firstname}</b>,<br><br>Your Request for Card Deactivation is Approved <br><b>Reference Id</b> :{rid}<br>please login to portal to find more<br>if not done on your request, please report us<br><b>Best Wishes,</b><br><br>Team Bank Application" msg = Message(sub, sender='*****@*****.**', recipients=[cust.C_email]) msg.html = htmlbody mail.send(msg) msg = "Accepted Customer Request for card Deactivation" return render_template('CreateAlert.html', id=id, msg=msg, Atype=Acctype) else: db.session.delete(reqs) now = datetime.now() dt_string = now.strftime("%B %d %Y-- %H:%M:%S") log = logs( Actor_id=id, Actor_Type=Acctype, ActionDone="Declined Customer Request for card Deactivation ", OtherId=rid, ActionTime=dt_string) db.session.add(log) db.session.commit() sub = "Card Deactivation Request Declined" htmlbody = f"Hello <b>{cust.C_firstname}</b>,<br><br>Your Request for Card Deactivation is Declined <br><b>Reference Id</b> :{rid}<br>please login to portal to find more<br>if not done on your request, please report us<br><b>Best Wishes,</b><br><br>Team Bank Application" msg = Message(sub, sender='*****@*****.**', recipients=[cust.C_email]) msg.html = htmlbody mail.send(msg) msg = "Declined Customer Request for card Deactivation" return render_template('CreateAlert.html', id=id, msg=msg, Atype=Acctype) else: flash(form.errors) return render_template('EvaluateDeactivateCardRequest.html', id=id, reqs=reqs, cust=cust, form=form, Acctype=Acctype)
def EvaluateIssueCardRequest(id, rid): reqs = CardRequests.query.filter_by(id=rid).first() cust = B_Customer.query.filter_by(C_id=reqs.C_id).first() form = EvaluationForm() if form.validate_on_submit(): if form.Approve.data: cardno = B_Customer_Card_Details.query.all()[-1] cardid = cardno.Card_No + 1 card1 = B_Customer_Card_Details( C_id=reqs.C_id, Card_Type=reqs.Card_Type, Card_No=cardid, Card_Activate=True, Usagetype=reqs.Usagetype, Card_Status_Type=reqs.Card_Status_Type, ExpiryDate="02/28") db.session.add(card1) db.session.delete(reqs) now = datetime.now() dt_string = now.strftime("%B %d %Y-- %H:%M:%S") log = logs(Actor_id=id, Actor_Type="Admin", ActionDone="Issue a new card for an customer ", OtherId=rid, ActionTime=dt_string) db.session.add(log) db.session.commit() sub = "Card Approved" htmlbody = f"Hello <b>{cust.C_firstname}</b>,<br><br>Your Request for new Card is Approved <br><b>Reference Id</b> :{rid}<br>please login to portal to find more<br>if not done on your request, please report us<br><b>Best Wishes,</b><br><br>Team Bank Application" msg = Message(sub, sender='*****@*****.**', recipients=[cust.C_email]) msg.html = htmlbody mail.send(msg) msg1 = "Issued a new card succesfully" return render_template('CreateAlert.html', id=id, msg=msg1, Atype="Admin") else: db.session.delete(reqs) now = datetime.now() dt_string = now.strftime("%B %d %Y-- %H:%M:%S") log = logs(Actor_id=id, Actor_Type="Admin", ActionDone="Declined a Customer Request for new card ", OtherId=rid, ActionTime=dt_string) db.session.add(log) db.session.commit() sub = "Card Declined" htmlbody = f"Hello <b>{cust.C_firstname}</b>,<br><br>Your Request for new Card is Declined <br><b>Reference Id</b> :{rid}<br>please login to portal to find more<br>if not done on your request, please report us<br><b>Best Wishes,</b><br><br>Team Bank Application" msg = Message(sub, sender='*****@*****.**', recipients=[cust.C_email]) msg.html = htmlbody mail.send(msg) msg = "Declined a Customer Request for new card" return render_template('CreateAlert.html', id=id, msg=msg, Atype="Admin") else: flash(form.errors) return render_template('EvaluateIssueCardRequest.html', id=id, reqs=reqs, cust=cust, form=form)