Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@


## Team Name
Name
Renegades

# Team Member
Member 1 Github Link
Abhinav KP https://github.com/rxzjerry

MEmber 2 Github Link
Janbaas Jamal K k https://github.com/Penquinz01

## Idea
Breif Idea in two three sentences
Hostel Fee Payment portal

## Features
1.
1. Hostel fee portal for all hostels around Cet including MH and LH

## Link to product walkthrough
[link to video](Link Here)
Expand All @@ -29,7 +29,9 @@ Library Name - Version
Instructions for setting up project

## How to Run
Instructions for running
Login function isnt working properly
click on registration adn fill in the details and click on registration again and fill in the rest of the details,
now an option to pay or request the fee of hostel will be shown depending on wheather you are owner of an hostel or student

## How to contribute ?
Features to implement
88 changes: 88 additions & 0 deletions Registration_s.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>User Registration</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
form {
text-align: center;
}
input {
border-radius:5px;
margin-bottom: 20px;
}
</style>
<!-- Add Firebase SDK -->
<script src="https://www.gstatic.com/firebasejs/8.3.0/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.3.0/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.3.0/firebase-firestore.js"></script>
<script>
// Your Firebase configuration
const firebaseConfig = {

apiKey: "AIzaSyBrjqkKK70PHNRrEFLz6aYRtFwFSpqOe1M",

authDomain: "hostelpayment-d4051.firebaseapp.com",

projectId: "hostelpayment-d4051",

storageBucket: "hostelpayment-d4051.appspot.com",

messagingSenderId: "1023501459060",

appId: "1:1023501459060:web:69257a360e921210587b21",

measurementId: "G-SYTDE0FHC3"

};


// Initialize Firebase
firebase.initializeApp(firebaseConfig);

// Function to handle user registration
function registerUser() {
var name = document.getElementById('name').value;
var email = document.getElementById('email').value;
var phoneNumber = document.getElementById('phoneNumber').value;
var password = document.getElementById('password').value;

// Create user with email and password
firebase.auth().createUserWithEmailAndPassword(email, password)
.then((userCredential) => {
// Update user profile with name
userCredential.user.updateProfile({
displayName: name
});
// You can redirect or do anything after successful registration
window.location.href="registration2.html";
console.log("User registered successfully:", userCredential.user);
})
.catch((error) => {
var errorCode = error.code;
var errorMessage = error.message;
console.error(errorMessage);
// Handle errors, display messages to users, etc.
});
}
</script>
</head>
<body>
<form>
<h1>User Registration</h1>
<input type="text" id="name" placeholder="Full Name"><br>
<input type="email" id="email" placeholder="Email"><br>
<input type="tel" id="phoneNumber" placeholder="Phone Number"><br>
<input type="password" id="password" placeholder="Password"><br>
<button type="button" onclick="registerUser()">Register</button>
</form>
</body>
</html>
1 change: 1 addition & 0 deletions Renegades
Submodule Renegades added at 4e6b2b
Binary file added Sep152017132952(1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions common.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
header{
background-color: rgba(68, 142, 228,2);
height:100px;
text-align: center;
padding: 1% 0 0 0;
position:relative;
}
body{
padding : 0;
margin :0;
}
.logo{
align-items: right;
position:absolute;
right:0;
height:118px;
width:118px;
top:0;

}

a{
border-width: 2px;
border-style:solid;
background-color: rgb(255, 255, 255);
border-color: black;
margin: 10px;
size: 20px;
height: 20px;
width: 50px;
text-decoration: none;
border-radius: 5px;
padding: 7px;
text-align:center;
color: black;
}
a:hover{
background-color: rgb(207, 207, 207);
text-decoration: none;
}
#nav{
background-color: white;
}
.ass{
align: center;
width: 50%;
align-content: center;
margin: auto;
text-align: center;
}
footer{
text-align: center;
background-color: rgba(rgba(0, 0, 0, 0.772), green, blue);
}
102 changes: 102 additions & 0 deletions login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Email Login</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
form {
text-align: center;
}
input {
margin-bottom: 20px;
}
</style>

<!-- Add Firebase SDK -->
<script src="https://www.gstatic.com/firebasejs/8.3.0/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.3.0/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.3.0/firebase-firestore.js"></script>

<script>
// Your Firebase configuration
const firebaseConfig = {

apiKey: "AIzaSyBrjqkKK70PHNRrEFLz6aYRtFwFSpqOe1M",

authDomain: "hostelpayment-d4051.firebaseapp.com",

projectId: "hostelpayment-d4051",

storageBucket: "hostelpayment-d4051.appspot.com",

messagingSenderId: "1023501459060",

appId: "1:1023501459060:web:4da228dcda075f8e587b21",

measurementId: "G-BRF7GHCYQL"

};



// Initialize Firebase
firebase.initializeApp(firebaseConfig);

// Function to handle user login
function loginUser() {
var email = document.getElementById('email').value;
var password = document.getElementById('password').value;

// Sign in with email and password
firebase.auth().signInWithEmailAndPassword(email, password)
.then((userCredential) => {
// Signed in
var user = userCredential.user;

// Check if the user exists in the Firestore database
var db = firebase.firestore();
db.collection("user_registrations").where("email", "==", email)
.get()
.then((querySnapshot) => {
if (!querySnapshot.empty) {
querySnapshot.forEach((doc) => {
console.log("Document ID:", doc.id);
// Redirect to profile page with the document name
window.location.href = `profile.html?docName=${doc.id}`;
});
} else {
console.log("User not found in the database");
// Handle user not found in the database
}
})
.catch((error) => {
console.error("Error getting document:", error);
// Handle error
});
})
.catch((error) => {
var errorCode = error.code;
var errorMessage = error.message;
console.error(errorMessage);
// Handle errors, display messages to users, etc.
});
}
</script>
</head>
<body>
<form>
<h1>Login with Email and Password</h1>
<input type="email" id="email" placeholder="Email"><br>
<input type="password" id="password" placeholder="Password"><br>
<button type="button" onclick="loginUser()">Login</button>
</form>
</body>
</html>
Binary file added logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
112 changes: 112 additions & 0 deletions profile.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>User Profile</title>
<style>
body {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
font-family: Arial, sans-serif;
}

#userDetails {
background-color: #f2f2f2;
padding: 20px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
text-align: left;
}

#userDetails p {
margin: 10px 0;
}

button {
margin-top: 20px;
}
</style>

<script src="https://www.gstatic.com/firebasejs/8.3.0/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.3.0/firebase-firestore.js"></script>

<script>
// Your Firebase configuration
const firebaseConfig = {
apiKey: "AIzaSyBrjqkKK70PHNRrEFLz6aYRtFwFSpqOe1M",
authDomain: "hostelpayment-d4051.firebaseapp.com",
projectId: "hostelpayment-d4051",
storageBucket: "hostelpayment-d4051.appspot.com",
messagingSenderId: "1023501459060",
appId: "1:1023501459060:web:69257a360e921210587b21",
measurementId: "G-SYTDE0FHC3"
};

// Initialize Firebase
firebase.initializeApp(firebaseConfig);

// Get the document name from the URL parameters
const urlParams = new URLSearchParams(window.location.search);
const docName = urlParams.get('docName');

// Fetch the user data from Firestore
var db = firebase.firestore();
db.collection("user_registrations").doc(docName).get()
.then(function(doc) {
if (doc.exists) {
var userData = doc.data();
document.getElementById('email').textContent = userData.email;
document.getElementById('name').textContent = userData.name;
document.getElementById('hostelName').textContent = userData.hostelName;
document.getElementById('userType').textContent = userData.userType;
if (userData.yearOfStudy) {
document.getElementById('yearOfStudy').textContent = userData.yearOfStudy;
} else {
document.getElementById('yearOfStudy').parentElement.style.display = 'none';
}

// Display different options based on user type
var buttonContainer = document.getElementById('buttonContainer');
if (userData.userType === 'owner') {
var requestPaymentButton = document.createElement('button');
requestPaymentButton.textContent = 'Request Payment';
requestPaymentButton.addEventListener('click', function() {
// Redirect to success page
window.location.href = 'success.html';
});
buttonContainer.appendChild(requestPaymentButton);
} else if (userData.userType === 'student') {
var makePaymentButton = document.createElement('button');
makePaymentButton.textContent = 'Make Payment';
makePaymentButton.addEventListener('click', function() {
// Redirect to success page
window.location.href = 'success.html';
});
buttonContainer.appendChild(makePaymentButton);
}
} else {
console.log("No such document!");
}
})
.catch(function(error) {
console.log("Error getting document:", error);
});
</script>
</head>
<body>
<div id="userDetails">
<h1>User Profile</h1>
<p>Email: <span id="email"></span></p>
<p>Name: <span id="name"></span></p>
<p>Hostel Name: <span id="hostelName"></span></p>
<p>User Type: <span id="userType"></span></p>
<p>Year of Study: <span id="yearOfStudy"></span></p>
<div id="buttonContainer"></div>
</div>
</body>
</html>
Loading