示例#1
0
#! C:\Python36\python
import cgi
import template
from accountDb import Account

print(template.printHead())
acc = Account("", "", "", 0)
form = cgi.FieldStorage()
if form.getvalue("accNo"):
    accountId = form.getvalue("accNo")
    acc = acc.getAccDetails(accountId)
    print(template.printMenuBar().format(accId=accountId))
    print("""<br>
    <p> Feel free to deposit your money in our bank. We assure you that your money is safe with us ;)</p>
    <br>
    <form method="post" action="service.py">
    <div class="form-group">
    <label for="amount">Amount in Rs</label>
    <input type="number" class="form-control" name="amount" placeholder="1000 Rs" min=0 max=999999 step=0.1 required>
    <br>
    <div class="text-center">
    <input type="hidden" value="deposit" name="operation">
    <input type="hidden" value="{accID}" name="accountID">
    <input class="btn btn-success btn-lg" type="submit" value="Deposit">
    </div>
    </div>
    </form>
    """.format(accID=accountId))

print(template.printFoot())
示例#2
0
#! C:\Python36\python
import cgi
import template
from accountDb import Account

acc = Account("", "", "", 0)
form = cgi.FieldStorage()
if form.getvalue("accountId") and form.getvalue("password"):
    accountId = form.getvalue("accountId")
    password = form.getvalue("password")
    if (acc.validateAcc(accountId, password)):
        print("Location:dashboard.py?accNo=" + accountId)
    else:
        print("Location:index.html?validated=False")
print(template.printFoot())
示例#3
0
#! C:\Python36\python

import cgi
import sys
from accountDb import Account
import template

acc = Account(0, "", "", "")

print(template.printHead())
form = cgi.FieldStorage()
if form.getvalue("accountId") and form.getvalue("password") and form.getvalue(
        "accName") and form.getvalue("deposit"):
    accountId = str(form.getvalue("accountId"))
    password = str(form.getvalue("password"))
    name = str(form.getvalue("accName"))
    deposit = str(form.getvalue("deposit"))
    print(acc.registerAcc(accountId, name, password, deposit))
    print("""
    """)

print(template.printFoot())
示例#4
0
#! C:\Python36\python
import cgi
import template
from transferDB import Transfer
from accountDb import Account

transaction = Transfer(0, 0, 0, "", 0)
acc = Account(0, "", "", "")
form = cgi.FieldStorage()
print(template.printHead())


def doDeposit():
    if form.getvalue("accountID"):
        print(template.printMenuBar().format(accId=form.getvalue("accountID")))
        accId = form.getvalue("accountID")
        amount = form.getvalue("amount")
        print(acc.depositMoney(accId, amount))


def doTransaction():
    if form.getvalue("accountID"):
        print(template.printMenuBar().format(accId=form.getvalue("accountID")))
        accId = form.getvalue("accountID")
        amount = form.getvalue("payeeAmount")
        payeeBank = form.getvalue("payeeBank")
        payeeAccNO = form.getvalue("payeeNumber")
        print(transaction.addTransaction(accId, payeeAccNO, payeeBank, amount))
        print(acc.debitAmt(accId, amount))

示例#5
0
#! C:\Python36\python
import cgi
import template
from accountDb import Account

print(template.printHead())
acc = Account("", "", "", 0)
form = cgi.FieldStorage()
if form.getvalue("accNo"):
    accountId = form.getvalue("accNo")
    password = form.getvalue("pass")
    conPass = form.getvalue("conPass")
    if password == conPass:
        print(acc.updatePass(accountId, password))
    else:
        print("""<br>
        <p> Passwords do not match or the Account is not registered with the Bank. Please <a href="register.py" class="alert-link">Register</a> a new account or visit the Bank for more clarifications :)
        """)

print(template.printFoot())