diff --git a/filter.html b/filter.html new file mode 100644 index 0000000..c86e997 --- /dev/null +++ b/filter.html @@ -0,0 +1,27 @@ + + + + + + + + Document + + +
+
+
+
+{% if usr%} + + {% for u in usr %} + + + + {% endfor %} +
{{ u[1] }}
+{% else %} +
No search results.
+{% endif %} + + \ No newline at end of file diff --git a/first.css b/first.css new file mode 100644 index 0000000..b0620e8 --- /dev/null +++ b/first.css @@ -0,0 +1,357 @@ +@import url(https://use.fontawesome.com/releases/v5.8.2/css/all.css) +/* Global Styles */ + +* { +box-sizing: border-box; +margin: 0; +padding: 0; +} +body { +font-family: 'Arial', sans-serif; +-webkit-font-smoothing: antialiased; +background: #000; +color: #999; +} +ul { +list-style: none; +} +h1, +h2, +h3, +h4 { +color: #fff; +} +a { +color: #fff; +text-decoration: none; +} +p { +margin: 0.5rem 0; +} +img { +width: 100%; +margin-top: 80px; +} +.showcase { +width: 100%; +height: 93vh; +position: relative; +background: url('https://i.ibb.co/vXqDmnh/background.jpg') no-repeat center center/cover; +} +.showcase::after { +content: ''; +position: absolute; +top: 0; +left: 0; +width: 100%; +height: 100%; +z-index: 1; +background: rgba(0, 0, 0, 0.6); +box-shadow: inset 120px 100px 250px #000000, inset -120px -100px 250px #000000; +} +.showcase-top { +position: relative; +z-index: 2; +height: 90px; +} +.showcase-top img { +width: 170px; +position: absolute; +top: 50%; +left: 50%; +transform: translate(-50%, -50%); +margin-left: 0; +} +.showcase-top a { +position: absolute; +top: 50%; +right: 0; +transform: translate(-50%, -50%); +} +.showcase-content { +position: relative; +z-index: 2; +width: 65%; +margin: auto; +display: flex; +flex-direction: column; +justify-content: center; +align-items: center; +text-align: center; +margin-top: 9rem; +} +.showcase-content h1 { +font-weight: 700; +font-size: 5.2rem; +line-height: 1.1; +margin: 0 0 2rem; +} +.showcase-content p { +text-transform: uppercase; +color: #fff; +font-weight: 400; +font-size: 1.9rem; +line-height: 1.25; +margin: 0 0 2rem; +} +/* Tabs */ +.tabs { +background: var(--dark-color); +padding-top: 1rem; +border-bottom: 3px solid #3d3d3d; +border-right: none; +} +.tabs .container { +display: grid; +grid-template-columns: repeat(3, 1fr); +grid-gap: 1rem; +align-items: center; +justify-content: center; +text-align: center; +} +.tabs p { +font-size: 1.2rem; +padding-top: 0.5rem; +} +.tabs .container > div { +padding: 1.5rem 0; +} +.tabs .container > div:hover { +color: #fff; +cursor: pointer; +} +.tab-border { +border-bottom: #e50914 4px solid; +} +/* Tab Content */ +.tab-content { +padding: 3rem 0; +background: #000; +color: #fff; +} +/* Hide initial content */ +#tab-1-content, +#tab-2-content, +#tab-3-content { +display: none; +opacity: 0; +} +.show { +display: block !important; +opacity: 1 !important; +transition: all 1000 ease-in; +} +#tab-1-content .tab-1-content-inner { +display: grid; +grid-template-columns: repeat(2, 1fr); +grid-gap: 2rem; +align-items: center; +justify-content: center; +} +#tab-2-content .tab-2-content-top { +display: grid; +grid-template-columns: 2fr 1fr; +grid-gap: 1rem; +justify-content: center; +align-items: center; +} +#tab-2-content .tab-2-content-bottom { +margin-top: 2rem; +display: grid; +grid-template-columns: repeat(3, 1fr); +grid-gap: 2rem; +text-align: center; +} +.table { +width: 100%; +margin-top: 2rem; +border-collapse: collapse; +border-spacing: 0; +} +.table thead th { +text-transform: uppercase; +padding: 0.8rem; +} +.table tbody { +display: table-row-group; +vertical-align: middle; +border-color: inherit; +} +.table tbody tr td { +color: #999; +padding: 0.8rem 1.2rem; +text-align: center; +} +.table tbody tr td:first-child { +text-align: left; +} +.table tbody tr:nth-child(odd) { +background: #222; +} +.footer { +max-width: 70%; +margin: 1rem auto; +overflow: auto; +} +.footer, +.footer a { +color: #999; +font-size: 0.9rem; +} +.footer p { +margin-bottom: 1.5rem; +} +.footer .footer-cols { +display: grid; +grid-template-columns: repeat(4, 1fr); +grid-gap: 2rem; +} +.footer li { +line-height: 1.9; +} +.footer .lang-select { +margin-top: 2rem; +color: #999; +background-color: #000; +background-image: none; +border: 1px solid #333; +padding: 1rem 1.2rem; +border-radius: 5px; +} +/* Container */ +.container { +max-width: 70%; +margin: auto; +overflow: hidden; +padding: 0 2rem; +} +/* Text Styles */ +.text-xl { +font-size: 2rem; +} +.text-lg { +font-size: 1.8rem; +margin-bottom: 1rem; +} +.text-md { +margin-bottom: 1.5rem; +font-size: 1.2rem; +} +.text-center { +text-align: center; +} +.text-dark { +color: #999; +} +/* Buttons */ +.btn { +display: inline-block; +background: #e50914; +color: #fff; +padding: 0.4rem 1.3rem; +font-size: 1rem; +text-align: center; +border: none; +cursor: pointer; +margin-right: 0.5rem; +transition: opacity 0.2s ease-in; +outline: none; +box-shadow: 0 1px 0 rgba(0, 0, 0, 0.45); +border-radius: 2px; +} +.btn:hover { +opacity: 0.9; +} +.btn-rounded { +border-radius: 5px; +} +.btn-xl { +font-size: 2rem; +padding: 1.5rem 2.1rem; +text-transform: uppercase; +} +.btn-lg { +font-size: 1rem; +padding: 0.8rem 1.3rem; +text-transform: uppercase; +} +.btn-icon { +margin-left: 1rem; +} +@media (max-width: 960px) { +.showcase { +height: 70vh; +} +.hide-sm { +display: none; +} +.showcase-top img { +top: 30%; +left: 5%; +transform: translate(0); +} +.showcase-content h1 { +font-size: 3.7rem; +line-height: 1; +} +.showcase-content p { +font-size: 1.5rem; +} +.footer .footer-cols { +grid-template-columns: repeat(2, 1fr); +} +.btn-xl { +font-size: 1.5rem; +padding: 1.4rem 2rem; +text-transform: uppercase; +} +.text-xl { +font-size: 1.5rem; +} +.text-lg { +font-size: 1.3rem; +margin-bottom: 1rem; +} +.text-md { +margin-bottom: 1rem; +font-size: 1.2rem; +} +} +@media (max-width: 700px) { +.showcase::after { +background: rgba(0, 0, 0, 0.6); +box-shadow: inset 80px 80px 150px #000000, inset -80px -80px 150px #000000; +} +.showcase-content h1 { +font-size: 2.5rem; +line-height: 1; +} +.showcase-content p { +font-size: 1rem; +} +#tab-1-content .tab-1-content-inner { +grid-template-columns: 1fr; +text-align: center; +} +#tab-2-content .tab-2-content-top { +display: block; +text-align: center; +} +#tab-2-content .tab-2-content-bottom { +margin-top: 2rem; +display: grid; +grid-template-columns: 1fr; +grid-gap: 2rem; +text-align: center; +} +.btn-xl { +font-size: 1rem; +padding: 1.2rem 1.6rem; +text-transform: uppercase; +} +} +@media(max-height: 600px) { +.showcase-content { +margin-top: 3rem; +} +} \ No newline at end of file diff --git a/first.html b/first.html new file mode 100644 index 0000000..2a230e6 --- /dev/null +++ b/first.html @@ -0,0 +1,29 @@ + + + + + + + + + + + +
+
+ + Sign In +
+
+

See what's next

+

Book Your Tickets Now

+ Register Here +
+
+ + + + + \ No newline at end of file diff --git a/hello.py b/hello.py new file mode 100644 index 0000000..ad79085 --- /dev/null +++ b/hello.py @@ -0,0 +1,130 @@ +from flask import Flask, render_template, request, redirect, url_for, session +import re +import cx_Oracle +con = cx_Oracle.connect('c##preet/oracle@DESKTOP-PEKHAL8:1521/orcl21c') +app = Flask(__name__,template_folder="template") +app.secret_key = ' key' +app.static_folder='static' +@app.route("/") +def first(): + return render_template('first.html') +@app.route("/login/", methods=['GET', 'POST']) +def login(): + # Output message if something goes wrong... + session={} + msg = '' + if request.method == 'POST' and 'username' in request.form and 'password' in request.form: + # Create variables for easy access + username = request.form['username'] + password = request.form['password'] + cursor = con.cursor() + cursor.execute('SELECT * FROM form WHERE username = :username AND password = :password',{"username": username, "password": password}) + account = cursor.fetchone() + + if account: + session['loggedin'] = True + session['id'] = account[0] + session['username'] = account[1] + # Redirect to home page + if 'loggedin' in session: + # User is loggedin show them the home page + return redirect(url_for('home')) + # User is not loggedin redirect to login page + return redirect(url_for('login')) + else: + # Account doesnt exist or username/password incorrect + msg = 'Incorrect username/password!' + + return render_template("login.html",msg=msg) +@app.route('/login/logout') +def logout(): + # Remove session data, this will log the user out + session.pop('loggedin', None) + session.pop('id', None) + session.pop('username', None) + # Redirect to login page + return redirect(url_for('login')) +@app.route('/register/', methods=['GET', 'POST']) +def register(): + # Output message if something goes wrong... + msg = '' + # Check if "username", "password" and "email" POST requests exist (user submitted form) + if request.method == 'POST' and 'username' in request.form and 'password' in request.form and 'email' in request.form and 'age' in request.form: + # Create variables for easy access + username = request.form['username'] + password = request.form['password'] + email = request.form['email'] + dob = request.form['dob'] + # Check if account exists using MySQL + cursor = con.cursor() + cursor.execute('SELECT * FROM form WHERE username = :username OR email = :email',{"username": username,"email":email}) + account = cursor.fetchone() + # If account exists show error and validation checks + if account: + msg = 'Account already exists!' + elif not re.match(r'[^@]+@[^@]+\.[^@]+', email): + msg = 'Invalid email address!' + elif not re.match(r'[A-Za-z0-9]+', username): + msg = 'Username must contain only characters and numbers!' + elif not username or not password or not email or not dob: + msg = 'Please fill out the form!' + else: + # Account doesnt exists and the form data is valid, now insert new account into accounts table + cursor.execute('INSERT INTO form VALUES (:username, :password, :email,:dob)', {"username":username,"password": password,"email": email,"dob":dob}) + con.commit() + con.close() + msg = 'You have successfully registered!' + elif request.method == 'POST': + # Form is empty... (no POST data) + msg = 'Please fill out the form!' + # Show registration form with message (if any) + return render_template('register.html', msg=msg) +@app.route('/home/') +def home(): + return render_template("home.html") +def getMovies(search): + con = cx_Oracle.connect('c##preet/oracle@DESKTOP-PEKHAL8:1521/orcl21c') + cursor = con.cursor() + search = search.lower() + cursor.execute("Select * from movies where lower(title) like :search or genre like :search",('%'+search+'%','%'+search+'%')) + results = cursor.fetchall() + print(results) + con.close() + return results + +@app.route("/search/", methods=['GET', 'POST']) +def search_result(): + col = ["Movie id: ","Title: ","Movie Description: ","Duration: ","Language: ","Release Date: ","Genre: "] + if request.method=="POST": + data = request.form['search'] + print(data) + users = getMovies(data) + print(users) + + + else: + users = [] + return render_template("search.html",usr=users) +def filter(data): + con = cx_Oracle.connect('c##preet/oracle@DESKTOP-PEKHAL8:1521/orcl21c') + cursor = con.cursor() + data1="" + for i in data: + data1=data1+i + print(data1) + cursor.execute("Select * from movies where lower(genre) like :data1",("%"+data1+"%")) + results = cursor.fetchall() + con.close() + return results + +@app.route("/filter/",methods=['GET','POST']) +def filter_result(): + if request.method=="POST": + data = request.form.getlist('mycheckbox') + print(data) + users = filter(data) + else: + users = [] + return render_template("filter.html",usr=users) +app.debug = True +app.run() \ No newline at end of file diff --git a/home.css b/home.css new file mode 100644 index 0000000..34b9095 --- /dev/null +++ b/home.css @@ -0,0 +1,305 @@ +@import url('https://fonts.googleapis.com/css2?family=Joan&display=swap'); +* { + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: 'Joan', serif; +} + +a { + text-decoration: none; + color: #adadad; +} + +.btn { + display: inline-block; + padding: .5rem 1rem; + background-color: #cd8c38; + border-radius: 2rem; + color: #1e1f26; + transition: .3s; +} + +.btn:hover { + background-color: #92601f; +} + +.btn-l { + width: 100%; + text-align: center; +} + +body { + background-color: #1e1f26; + display: grid; + grid-template-columns: 1000px; + justify-content: space-evenly; + color: white +} + + +/* top bar */ + +.top-bar { + display: flex; + align-items: center; + justify-content: space-between; + padding: 1.5rem 1rem; +} + +.left-content, +.right-content { + display: flex; + align-items: center; +} + +.title { + margin-right: 3rem; + color: #cd8c38; +} + +.navigation { + display: flex; + list-style: none; +} + +.navigation li { + margin-right: 1rem; +} + +.navigation li a:hover { + color: #cd8c38; +} + +.active { + color: #cd8c38; +} + +.filter, +.cart, +.help, +.menu { + position: relative; + width: 20px; + height: 20px; +} + +.filter, +.cart, +.help { + margin-right: 1rem; +} + +.menu { + margin-left: .8rem; +} + +.filter, +.menu { + display: none; +} + +.profile-img-box { + position: relative; + height: 30px; + width: 30px; + border-radius: 50%; + overflow: hidden; +} + +img { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + object-fit: cover; +} + + +/* main container */ + +.main-container { + color: #adadad; + display: grid; + grid-template-columns: 1fr 3fr; + gap: 2rem; +} + + +/* sidebar */ + +.sidebar { + background: linear-gradient(45deg, rgba(255, 255, 255, .05), rgba(205, 140, 56, .15)); + backdrop-filter: blur(5px); + height: fit-content; + border-radius: 1rem; + padding: 2rem 2.5rem; +} + +.sidebar-groups { + margin-bottom: 1rem; +} + +.sg-title { + margin-bottom: .5rem; + color: #fff; +} + +input { + margin-bottom: .6rem; +} + +input[type=checkbox]:checked { + accent-color: #cd8c38; +} + +input[type=radio]:checked { + accent-color: #cd8c38; +} + +label { + margin-left: .5rem; +} + + +/* movies container */ + +.upcoming-img-box { + position: relative; + height: 300px; + width: 100%; + border-radius: 1rem; + overflow: hidden; + margin-bottom: 1.5rem; +} + +.upcoming-title { + position: absolute; + top: 2rem; + left: 2rem; + color: #cd8c38; + background-color: #1e1f26; + padding: .5rem 1rem; + border-radius: 2rem; + border: 1px solid #cd8c38; + font-weight: 500; +} + +.buttons { + position: absolute; + bottom: 2rem; + left: 2rem; +} + +.btn-alt { + background-color: #1e1f26; + color: #cd8c38; + border: 1px solid #cd8c38; + margin-left: 1rem; +} + +.btn-alt:hover { + color: #1e1f26; + background-color: #cd8c38; +} + + +/* current movies */ + +.movies-container { + padding-bottom: 2rem; +} + +.current-movies { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 1.5rem; +} + +.current-movie { + background: linear-gradient(45deg, rgba(255, 255, 255, .05), rgba(205, 140, 56, .15)); + padding: 1rem; + border-radius: .5rem; +} + +.cm-img-box { + position: relative; + height: 150px; + width: auto; + margin-bottom: 1rem; + border-radius: .5rem; + overflow: hidden; +} + +.movie-title { + color: #fff; + margin-bottom: .2rem; +} + +.booking { + display: flex; + align-items: center; + justify-content: space-between; + margin-top: 1rem; +} + +.price { + color: #cd8c38; +} + +.btn-alt1 { + background-color: #1e1f26; + color: #cd8c38; + padding: .5rem 1rem; + border: 1px solid #cd8c38; + border-radius: 2rem; + margin-left: 1rem; +} +.btnbook{ + width: 50%; + padding: .5rem 1rem; + background-color: #cd8c38; + border-radius: 2rem; + color: #1e1f26; + transition: .3s; +} +.btnbook:hover { + background-color: #92601f; +} +.search{ + font-size: large; +} +.filterrr{ + font-size: large; +} +.btnbuy{ + width: 100%; + padding: .5rem 3rem; + background-color: #cd8c38; + border-radius: 2rem; + color: #1e1f26; + transition: .3s; +} +.btnbuy:hover { + background-color: #92601f; +} +.current-movies1 { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 1rem; +} + +.current-movie1 { + + background: linear-gradient(45deg, rgba(255, 255, 255, .05), rgba(205, 140, 56, .15)); + padding: 1rem; + border-radius: 1rem; +} +u{ + color: #cd8c38; +} +.underline{ + color:aliceblue; + text-decoration: underline #cd8c38 4px; +} \ No newline at end of file diff --git a/home.html b/home.html new file mode 100644 index 0000000..930c854 --- /dev/null +++ b/home.html @@ -0,0 +1,132 @@ + + + + + + + + + Movie booking + + + +
+
+

You

+ +
+
+ + + +
+ +
+ +
+
+
+ +
+
+ +

Upcoming Movie

+ +
+
+
+
+ +
+

J urassic World

+

Screen : Platinum

+
+

15$

+ Buy Tickets +
+
+
+
+ +
+

Vikram

+

Screen : Gold

+
+

10$

+ Buy Tickets +
+
+
+
+ +
+

Firestarter

+

Screen : Silver

+
+

5$

+ Buy Tickets +
+
+
+
+
+ + \ No newline at end of file diff --git a/login.html b/login.html new file mode 100644 index 0000000..2a94909 --- /dev/null +++ b/login.html @@ -0,0 +1,30 @@ + + + + + Login Form + + + + +
+

LOGIN

+ +
+ + + + +
{{ msg }}
+ +
+
+ + \ No newline at end of file diff --git a/movie.html b/movie.html new file mode 100644 index 0000000..7888266 --- /dev/null +++ b/movie.html @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/register.html b/register.html new file mode 100644 index 0000000..b8c1e8d --- /dev/null +++ b/register.html @@ -0,0 +1,41 @@ + + + + + Register + + + + +
+

Register

+ +
+ + + + + + + + + + + +
{{ msg }}
+ +
+
+ + \ No newline at end of file diff --git a/search.html b/search.html new file mode 100644 index 0000000..5bee6d3 --- /dev/null +++ b/search.html @@ -0,0 +1,49 @@ + + + + + + + + Document + + + + {% if usr%} + {%for movie in usr %} +
+ + + + + {% endfor %} +
+
+
+ +

{{movie[1]}}



+

Desc :
{{movie[2]}}

Duration :
{{movie[3]}}

Language :
{{movie[4]}}

Release Date :
{{movie[5]}}

Genre :
{{movie[6]}}

+
+ Buy +
+
+
+{% else %} +
No search results.
+{% endif %} + + + diff --git a/styles.css b/styles.css new file mode 100644 index 0000000..1d75fcf --- /dev/null +++ b/styles.css @@ -0,0 +1,122 @@ +* { + box-sizing: border-box; + font-family: -apple-system, BlinkMacSystemFont, "segoe ui", roboto, oxygen, ubuntu, cantarell, "fira sans", "droid sans", "helvetica neue", Arial, sans-serif; + font-size: 16px; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +body { + + background-image: url(https://ik.imagekit.io/ikmedia/backlit.jpg); + background-repeat: no-repeat; + background-size: 1700px 900px; + +} +.login, .register { + width: 400px; + background-color: #ffffff; + box-shadow: 0 0 9px 0 rgba(0, 0, 0, 0.3); + margin: 100px auto; +} +.login h1, .register h1 { + text-align: center; + color: brown; + font-size: 24px; + padding: 20px 0 20px 0; + border-bottom: 1px solid #dee0e4; +} +.login .links, .register .links { + display: flex; + padding: 0 15px; +} +.login .links a, .register .links a { + color: #adb2ba; + text-decoration: none; + display: inline-flex; + padding: 0 10px 10px 10px; + font-weight: bold; +} +.login .links a:hover, .register .links a:hover { + color: brown; +} +.login .links a.active, .register .links a.active { + border-bottom: 3px solid brown; + color:brown; +} +.login form, .register form { + display: flex; + flex-wrap: wrap; + justify-content: center; + padding-top: 20px; +} +.login form label, .register form label { + display: flex; + justify-content: center; + align-items: center; + width: 50px; + height: 50px; + background-color:brown; + color: #ffffff; +} +.login form input[type="password"], .login form input[type="text"], .login form input[type="email"], .register form input[type="password"], .register form input[type="text"], .register form input[type="email"] { + width: 310px; + height: 50px; + border: 1px solid #dee0e4; + margin-bottom: 20px; + padding: 0 15px; +} +.login form input[type="submit"], .register form input[type="submit"] { + width: 100%; + padding: 15px; + margin-top: 20px; + background-color: brown; + border: 0; + cursor: pointer; + font-weight: bold; + color: #ffffff; + transition: background-color 0.2s; +} +.login form input[type="submit"]:hover, .register form input[type="submit"]:hover { + background-color:brown; + transition: background-color 0.2s; +} +.navtop { + background-color: #2f3947; + height: 60px; + width: 100%; + border: 0; +} +.navtop div { + display: flex; + margin: 0 auto; + width: 1000px; + height: 100%; +} +.navtop div h1, .navtop div a { + display: inline-flex; + align-items: center; +} +.navtop div h1 { + flex: 1; + font-size: 24px; + padding: 0; + margin: 0; + color: #eaebed; + font-weight: normal; +} +.navtop div a { + padding: 0 20px; + text-decoration: none; + color: #c1c4c8; + font-weight: bold; +} +.navtop div a i { + padding: 2px 8px 0 0; +} +.navtop div a:hover { + color: #eaebed; +} +body.loggedin { + background-color: #f3f4f7; +}