/
dquble
/
pythonMS
Обзор
Документация
Войти
/
dquble
/
pythonMS
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
cgi-bin/form.py
34 строки
1 KB
dqublebubble
коммит проекта
12 апр 2025, 15:05
12 апр 2025, 15:05
6261313
Код
Авторство
О чём код?
import cgi from CreditPaymentsModule import CreditPayments from xmlrpc import client form = cgi.FieldStorage() deal_id = form.getfirst("numOfCredit", "none") pay_date = form.getfirst("dateCredit", "none") credit = CreditPayments() calc_res = credit.getRestOfCredit(deal_id, pay_date) calc_summ = credit.getSummOfCredit(deal_id) client_clientInfo = client.ServerProxy('http://localhost:9001') inn_res = client_clientInfo.inn(deal_id) fio_res = client_clientInfo.fio(inn_res) client_clientHistory = client.ServerProxy('http://localhost:9000') history_res = client_clientHistory.history(inn_res) print("Content-type: text/html\n") print("""<!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>Обработка данных форм</title> </head> </body>""") print("<h1>Остаток кредита по договору №{} на дату {} составляет:</h1>".format(deal_id, pay_date)) print("<h2>{} тыс. руб.</h2>".format(calc_res)) print("<h2>Сумма кредита: {}</h2>".format(calc_summ)) print("<h2>Клиент:</h2>") print("<p>ИНН: <b>{}</b><br>".format(inn_res)) print("ФИО: <b>{}</b><br>".format(fio_res)) print("Кредитная история: <b>{}</b></p>".format(history_res)) print("""</body> </html>""")