commit 1e583b0fcf2089569f81cfdf00e8b96a87326bbc
Author: xiaofeng <1164368694@qq.com>
Date: Wed May 6 00:20:24 2020 +0800
first commit
diff --git a/alter.html b/alter.html
new file mode 100644
index 0000000..a1962ef
--- /dev/null
+++ b/alter.html
@@ -0,0 +1,58 @@
+
+
+
+
+ 修改
+
+
+
+
+
+
+
+
diff --git a/app.py b/app.py
new file mode 100644
index 0000000..45151c7
--- /dev/null
+++ b/app.py
@@ -0,0 +1,110 @@
+from flask import Flask,render_template,request,redirect
+from flask_sqlalchemy import SQLAlchemy
+
+app = Flask(__name__)
+db = SQLAlchemy(app)
+
+
+app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://root:@127.0.0.1:3306/epidemic2'
+
+
+class Donor(db.Model):
+ donor_code = db.Column(db.String(255),primary_key=True)
+ donor_name = db.Column(db.String(255))
+ type1 = db.Column(db.String(255))
+ ded_name = db.Column(db.String(255))
+ ded_code = db.Column(db.String(255))
+ amount = db.Column(db.Integer)
+ date = db.Column(db.String(255))
+ trans = db.Column(db.String(255))
+
+db.create_all()
+
+
+
+
+@app.route("/select")
+
+def selectAll():
+ donorList = Donor.query.all()
+ return render_template("index.html", donor_list=donorList)
+
+@app.route('/')
+def index():
+ return selectAll()
+
+ # 添加数据
+
+@app.route('/insert', methods=['GET', 'POST'])
+def insert():
+ # 进行添加操作
+ donor_code = request.form['donor_code']
+ donor_name = request.form['donor_name']
+ type1 = request.form['type1']
+ ded_name = request.form['ded_name']
+ ded_code = request.form['ded_code']
+ amount = request.form['amount']
+ date = request.form['date']
+ trans = request.form['trans']
+ donor = Donor(donor_code=donor_code, donor_name=donor_name, type1=type1, ded_name=ded_name, ded_code=ded_code, amount= amount, date=date, trans=trans)
+ db.session.add(donor)
+ db.session.commit()
+
+ # 添加完成重定向至主页
+ return redirect('/')
+
+@app.route("/insert_page")
+def insert_page():
+ # 跳转至添加信息页面
+ return render_template("insert.html")
+
+ # 删除数据
+
+@app.route("/delete", methods=['GET'])
+def delete():
+ # 操作数据库得到目标数据,before_number表示删除之前的数量,after_name表示删除之后的数量
+ donor_code = request.args.get("donor_code")
+ donor = Donor.query.filter_by(donor_code=donor_code).first()
+ db.session.delete(donor)
+ db.session.commit()
+ return redirect('/')
+
+ # 修改操作
+@app.route("/alter", methods=['GET', 'POST'])
+def alter():
+ # 可以通过请求方式来改变处理该请求的具体操作
+ # 比如用户访问/alter页面 如果通过GET请求则返回修改页面 如果通过POST请求则使用修改操作
+ if request.method == 'GET':
+ donor_code = request.args.get("donor_code")
+ donor_name = request.args.get("donor_name")
+ type1 = request.args.get("type1")
+ ded_name = request.args.get("ded_name")
+ ded_code = request.args.get("ded_code")
+ amount = request.args.get("amount")
+ date = request.args.get("date")
+ trans = request.args.get("trans")
+ donor = Donor(donor_code=donor_code, donor_name=donor_name, type1=type1, ded_name=ded_name,ded_code=ded_code,
+ amount=amount, date=date, trans=trans)
+ return render_template("alter.html", donor=donor)
+ else:
+ donor_code = request.form["donor_code"]
+ donor_name = request.form['donor_name']
+ type1 = request.form['type1']
+ ded_name = request.form['ded_name']
+ ded_code = request.form['ded_code']
+ amount = request.form['amount ']
+ date = request.form['date']
+ trans = request.form['trans']
+ donor = Donor.query.filter_by(donor_code=donor_code).first()
+ donor.donor_name = donor_name
+ donor.type1 = type1
+ donor.ded_name = ded_name
+ donor.ded_code = ded_code
+ donor.amount = amount
+ donor.date = date
+ donor.trans = trans
+ db.session.commit()
+ return redirect('/')
+
+if __name__ == "__main__":
+ app.run(debug=True)
diff --git a/demo.html b/demo.html
new file mode 100644
index 0000000..99dae9e
--- /dev/null
+++ b/demo.html
@@ -0,0 +1,140 @@
+
+
+
+
+
+
+ Animated Login Form
+
+
+
+
+
+
\ No newline at end of file
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..775a9e8
--- /dev/null
+++ b/index.html
@@ -0,0 +1,77 @@
+
+
+
+
+ 首页
+
+
+
+
+
添加情况
+
+
+
+
+
+
+
+
+ 捐赠方代码 |
+ 捐赠方名字 |
+ 捐赠方类型 |
+ 被赠方代码 |
+ 被赠方名字 |
+ 金额 |
+ 日期 |
+ 物流 |
+ |
+
+
+
+ {% for item in donor_list %}
+
+ {{ item.donor_code }} |
+ {{ item.donor_name }} |
+ {{ item.type1 }} |
+ {{ item.ded_code }} |
+ {{ item.ded_name }} |
+ {{ item.amount }} |
+ {{ item.date }} |
+ {{ item.trans }} |
+
+ {% endfor %}
+
+
+
+
+
+
+
+
diff --git a/insert.html b/insert.html
new file mode 100644
index 0000000..0402e4c
--- /dev/null
+++ b/insert.html
@@ -0,0 +1,80 @@
+
+
+
+
+ 增加
+
+
+
+
+
+
+
+
+
diff --git a/login.css b/login.css
new file mode 100644
index 0000000..4606dc1
--- /dev/null
+++ b/login.css
@@ -0,0 +1,66 @@
+@charset "utf-8";
+body
+{
+ background:url("壁纸01.jpg");
+ background-repeat:no-repeat;
+ background-size: 100% auto;
+}
+#login_box
+{
+ width:200;
+ height:400px;
+ background:#00000060;
+ margin:auto;
+ margin-top:10%;
+ text-align:center;
+ border-radius: 10px;
+ padding:50px 50px;
+}
+#login_box h2
+{
+ color:#FFFFFF90;
+ margin-top:5%;
+}
+#login_box #form #input_box
+{
+ margin-top: 5%;
+}
+
+#login_box #form #input_box i
+{
+ color:#FFFFFF;
+}
+
+#login_box #form #input_box input
+{
+ border:0;
+ width:60%;
+ font-size:15px;
+ color:#FFFFFF;
+ background:#FFFFFF00;
+ border-bottom: 2px solid #FFFFFF;
+ padding:5px 10px;
+ margin-top: 10px;
+}
+#login_box button
+{
+ margin-top:50px;
+ width:40%;
+ height:20px;
+ border-radius: 10px;
+ border:0;
+ color:#FFFFFF;
+ font-size:15px;
+ background-image: linear-gradient(to right,#b8cbb8 0%,#b8cbb8 0%,#b465da 0%,#cf6cc9 33%,#ee689c 66%,#ee689c 100%);
+}
+
+#login_box #Sign
+{
+ margin-top: 45%;
+ margin-right:50%;
+}
+
+#login_box #Sign a
+{
+ color:#894648;
+}
\ No newline at end of file
diff --git a/login.html b/login.html
new file mode 100644
index 0000000..7cdd1c9
--- /dev/null
+++ b/login.html
@@ -0,0 +1,29 @@
+
+
+
+
+ LOGIN
+
+
+
+
LOGIN
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/style.css b/style.css
new file mode 100644
index 0000000..dd868b0
--- /dev/null
+++ b/style.css
@@ -0,0 +1,106 @@
+body{
+ margin:0;
+ padding:0;
+ font-family:montserrat;
+ background:linear-gradient(120deg,#2980b9,#8e44ad);
+ height: 100vh;
+ overflow:hidden;
+}
+.center{
+ position:absolute;
+ top:50%;
+ left:50%;
+ transform:translate(-50%,-50%);
+ width:400px;
+ background:white;
+ border-radius:10px;
+}
+.center h1{
+ text-align:center;
+ padding:0 0 20px 0;
+ boder-bottom:1px solid silver;
+}
+.center form{
+ padding:0 40px;
+ box-sizing:border-box;
+}
+form.txt_field{
+ position:relative;
+ boder-bottom:2px solid #adadad;
+ margin:30px 0;
+}
+.txt_field input{
+ width.100%;
+ padding:0 5px;
+ height:40px;
+ font-size:16px;
+ border:none;
+ background:none;
+ outline:none;
+}
+.txt_field label{
+ position:absolute;
+ top:50%;
+ left:5px;
+ color:#adadad;
+ transform:translateY(-50%);
+ font-size:16px;
+ pointer-events:none;
+ transition:.5s;
+}
+.txt_field span::before{
+ content:'';
+ position:absolute;
+ top:40px;
+ left:0;
+ width:0%;
+ height:2px;
+ background: #2691d9;
+ transition: .5s;
+}
+.txt_field input:focus ~ label,
+.txt_field input:valid ~ label{
+ top: -5px;
+ color: #2691d9;
+}
+.txt_field input:focus ~ span::before,
+.txt_field input:valid ~ span::before{
+ width:100%;
+}
+.pass{
+ margin: -5px 0 20pc 5px;
+ color:#a6a6a6;
+ cursor:pointer;
+}
+.pass:hover{
+ text-decoration:underline;
+}
+input[type="submit"]{
+ width: 100%;
+ height:50px;
+ border:1px solid;
+ background: #2691d9;
+ border-radius: 25px;
+ font-size:18px;
+ color:#e9f4fb;
+ font-weight: 700;
+ cursor:pointer;
+ outline:none;
+}
+input[type="submit"]:hover{
+ border-color:#2691d9;
+ transition: ,5s;
+}
+.signup_link{
+ margin:30px 0;
+ text-align:center;
+ font-size:16px;
+ color:#666666;
+}
+.signup_link a{
+ color:#2691d9;
+ text-decoration:none;
+}
+.signup_link a:hover{
+ text-decoration: underline;
+}
\ No newline at end of file