-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8111368
commit 52da5bc
Showing
12 changed files
with
132 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*__pycache__ | ||
.vscode | ||
.idea |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
from flask import Flask, redirect, url_for, request, render_template | ||
from main import * | ||
|
||
app = Flask(__name__, template_folder='template') | ||
app = Flask(__name__, template_folder='template', static_folder='static', static_url_path='') | ||
|
||
@app.route('/success/<user_id>/<user_product>/<user_qty>',methods = ['GET']) | ||
def success(user_id, user_product, user_qty): | ||
ret=main_recommend(int(user_id), int(user_product), float(user_qty)) | ||
return render_template('results.html', res=ret) | ||
|
||
@app.route('/login',methods = ['POST', 'GET']) | ||
@app.route('/',methods = ['POST', 'GET']) | ||
def login(): | ||
if request.method == 'POST': | ||
user_id = request.form['nm'] | ||
user_product= request.form['pr'] | ||
user_qty = request.form['qty'] | ||
return redirect(url_for('success',user_id = user_id, user_product=user_product, user_qty=user_qty)) | ||
else: | ||
return render_template('login.html') | ||
return render_template('index.html') | ||
|
||
if __name__ == '__main__': | ||
app.run(debug = True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
.product{ | ||
position: relative; | ||
top: 30vh; | ||
left: 10vw; | ||
width: 20vw; | ||
padding-left: 3vw; | ||
} | ||
|
||
|
||
body { | ||
background: linear-gradient(-45deg, #23a6d5, #23d5ab); | ||
background-size: 400% 400%; | ||
animation: gradient 15s ease infinite; | ||
} | ||
|
||
@keyframes gradient { | ||
0% { | ||
background-position: 0% 50%; | ||
} | ||
50% { | ||
background-position: 100% 50%; | ||
} | ||
100% { | ||
background-position: 0% 50%; | ||
} | ||
} | ||
|
||
input[type=text]{ | ||
width: 300px; | ||
/* padding: 10px 20px; */ | ||
padding-top: 5px; | ||
padding-bottom: 10px; | ||
border-color: transparent; | ||
border-bottom: 1px solid whitesmoke; | ||
font-size: 15px; | ||
background: transparent; | ||
} | ||
|
||
input:focus{ | ||
outline: none; | ||
} | ||
|
||
input::-webkit-input-placeholder { | ||
padding-left: 5px; | ||
font-size: 15px; | ||
color: whitesmoke; | ||
} | ||
|
||
input:-moz-placeholder { /* Firefox 18- */ | ||
padding-left: 5px; | ||
font-size: 15px; | ||
color: whitesmoke; | ||
} | ||
|
||
input::-moz-placeholder { /* Firefox 19+ */ | ||
padding-left: 5px; | ||
font-size: 15px; | ||
color: whitesmoke; | ||
} | ||
|
||
input:-ms-input-placeholder { | ||
padding-left: 5px; | ||
font-size: 15px; | ||
color: whitesmoke; | ||
} | ||
|
||
label{ | ||
font-size: 20px; | ||
/* color: rgb(82, 71, 71); */ | ||
color: rgb(99, 93, 93); | ||
padding-top: 5px; | ||
} | ||
input[type=submit] { | ||
cursor: pointer; | ||
border: 1px solid white; | ||
background-color: transparent; | ||
height: 50px; | ||
width: 200px; | ||
color: white; | ||
font-size: 17px; | ||
/* box-shadow: 0 6px 6px rgba(0, 0, 0, 0.6); */ | ||
} | ||
|
||
.form-label{ | ||
font-size: 25px; | ||
color: rgb(99, 93, 93); | ||
font-weight: bold; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<html> | ||
|
||
<head> | ||
<link rel="stylesheet" href="index.css"> | ||
</head> | ||
|
||
<body> | ||
<div class="product"> | ||
<p class="form-label">Select a product:</p> | ||
<form action="http://localhost:5000/" method="post" > | ||
<label for="nm">User ID:</label> | ||
<input type="text" name="nm" id="nm" /><br><br> | ||
<label for="pr">Product:</label> | ||
<input type="text" name="pr" id="pr" /><br><br> | ||
<label for="qty">Quantity:</label> | ||
<input type="text" name="qty" id="qty" /><br><br> | ||
<input type="submit" value="Provide reccomendation" class="btn" /> | ||
</form> | ||
</div> | ||
<div id="result"> | ||
|
||
</div> | ||
</body> | ||
|
||
</html> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
<html> | ||
<body> | ||
<p>New recommendations based on users using similar product: {{res[0]}}<br> | ||
New recommendations based on users in similar location and groupements: {{res[1]}}<br> | ||
New recommendations based on similar products: {{res[2]}}<br> | ||
Previously ordered products recommendations based on users using similar product: {{res[3]}}<br> | ||
Previously ordered products recommendations based on users in similar location and groupements: {{res[4]}}<br> | ||
Previously ordered products recommendations based on similar products: {{res[5]}}<br> | ||
</p> | ||
</body> | ||
|
||
<body> | ||
<p> | ||
New recommendations based on users using similar product: {{res[0]}}<br> | ||
New recommendations based on users in similar location and groupements: {{res[1]}}<br> | ||
New recommendations based on similar products: {{res[2]}}<br> | ||
Previously ordered products recommendations based on users using similar product: {{res[3]}}<br> | ||
Previously ordered products recommendations based on users in similar location and groupements: {{res[4]}}<br> | ||
Previously ordered products recommendations based on similar products: {{res[5]}}<br> | ||
</p> | ||
</body> | ||
|
||
</html> |