-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcollect.py
168 lines (139 loc) · 3.88 KB
/
collect.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 25 02:20:48 2021
@author: Sristi
"""
from django.http import HttpResponse
from django.template import loader
from django.template.loader import render_to_string
from django.template import engines
from django.template import RequestContext
from django.views.decorators.csrf import csrf_exempt
from DaddyLongLegs import upgcinfo
from DaddyLongLegs import Money
from DaddyLongLegs import webparsing
#from gcinfo import *
#from webparsing import *
# from suject_match import *
#from upgcinfo import *
from DaddyLongLegs import surplus_funds
from DaddyLongLegs import upgpinfo
from DaddyLongLegs import unique
@csrf_exempt
def success(request):
if request.method=='POST':
global name
global budget
global preference
name=request.POST.get('name')
budget=request.POST.get('budget')
preference=request.POST.get('preference')
email=request.POST.get('email')
f=open('buffer.txt','w')
f.writelines([name+'\n',budget+'\n',preference+'\n'])
f.close()
print(budget,preference)
from DaddyLongLegs import MASTER
status='You have been alloted Godparent to '
STATUS,F= MASTER.IamGod([preference,float(budget)])
print(F)
if F==0:
status=''
funds=budget
else:
print(STATUS)
rgid=unique.uniqid()
print(rgid)
status=status+str(STATUS)+'<br> Your unique id is : '+rgid+'<br>Please remember this for login.'
mn=Money.money(preference,float(budget))
funds=str(surplus_funds.surplus(float(budget),mn, preference))
upgpinfo.upgodp([rgid,name,email])
upgcinfo.update_godchild_table(preference,mn)
MASTER.rgid_col(mn,rgid)
print(funds)
about='''
<html>
{% load static %}
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
font-family:'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
}
* {
box-sizing: border-box;
}
.container {
padding: 16px;
background-image: url("{% static 'Images/yay.png'%}");
background-size: cover;
height: 600px;
text-align: center;
align-items: center;
}
.container3 {
height: 200px;
position: relative;
border: 3px solid green;
}
.center {
margin: 0;
position: absolute;
top: 50%;
left: 50%;
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
input[type=text] {
width: 50%;
padding: 15px;
margin: 5px 0 20px 0;
display: inline-block;
border: 5;
background: #faf9f9;
}
input[type=text]:focus {
background-color: rgb(97, 125, 138);
outline-style: double;
}
hr {
border: 1px solid #141111;
margin-bottom: 30px;
}
a {
color: rgb(88, 100, 112);
}
#button4{
width: 200px;
height: 30px;
color: rgb(12, 12, 17);
background-color: rgb(11, 241, 42);
}
.signupbtn {
float: left;
width: 50%;
}
</style>
</head>
<body>
<br>
<form method = 'POST'>
<div class="container">
<div class ="center">
<h1><b>THANK YOU!</b></h1><br>
<p> '''+status+''' <br><br>
Your surplus funds are '''+funds+'''<br>
Would you like to store your funds in the Bank?</p>
<button type="submit" class="btn" id="button4" formaction="/GP/info/collection/finaldonationpage"><b>YES</b></button>
</form>
<button id="button4"><b><a href='http://127.0.0.1:8000'>NO</b></button></a>
</div>
</div>
<br><br>
</body>
</html>
'''
django_engine=engines['django']
template=django_engine.from_string(about)
html=template.render()
return HttpResponse(html)