Skip to content

Commit

Permalink
Fixed bugs in cart enhancement
Browse files Browse the repository at this point in the history
  • Loading branch information
tharanithar-r committed Oct 27, 2023
2 parents fe341a8 + 4650199 commit 52750ff
Show file tree
Hide file tree
Showing 12 changed files with 327 additions and 34 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Cafe Management

An online portal for a cafe for ordering coffee or snacks or whatever else it offers.
<img width="944" alt="image" src="https://github.com/Kavyam172/Cafe-Management/assets/124245507/75e2ecaa-3c77-45c9-ae88-53a328453343">
<img width="927" alt="image" src="https://github.com/Open-Source-Chandigarh/Cafe-Management/assets/124245507/b5937489-da33-4858-bba2-d81323861292">




Expand All @@ -22,7 +23,7 @@ Steps to contribute:
```
4. Make changes to the code.
5. Once you are satisfied, commit the changes and and push your code to the forked repository.
6. Create a pull request from the forked repository to this repository.Make sure to provide a concise title and description.Your pull request will only be accepted if the issue is assigned to you.
6. Create a pull request from the forked repository to this repository.Make sure to provide a concise title and description and link the related issue to the pull request.Your pull request will only be accepted if the issue is assigned to you.

We will review your code and merge it into the project.
Please adhere to the code of conduct mentioned in [code_of_conduct.md](https://github.com/Open-Source-Chandigarh/Cafe-Management/blob/main/conduct_of_code.md).
Expand Down
6 changes: 6 additions & 0 deletions about.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@
<li class="nav-item">
<a href="faq.html" class="nav-link active" style="color:rgba(255, 255, 255);">FAQ</a>
</li>
<li class="nav-item">
<a href="signup.html" class="nav-link active" style="color:rgba(255, 255, 255);">Sign Up</a>
</li>
<li class="nav-item">
<a href="login.html" class="nav-link active" style="color:rgba(255, 255, 255);">Login</a>
</li>
</ul>
</div>
</div>
Expand Down
6 changes: 6 additions & 0 deletions contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@
<li class="nav-item">
<a href="faq.html" class="nav-link active" style="color:rgba(255, 255, 255);">FAQ</a>
</li>
<li class="nav-item">
<a href="signup.html" class="nav-link active" style="color:rgba(255, 255, 255);">Sign Up</a>
</li>
<li class="nav-item">
<a href="login.html" class="nav-link active" style="color:rgba(255, 255, 255);">Login</a>
</li>
</ul>
</div>
</div>
Expand Down
6 changes: 6 additions & 0 deletions faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@
<li class="nav-item">
<a href="faq.html" class="nav-link active" style="color:rgba(255, 255, 255);">FAQ</a>
</li>
<li class="nav-item">
<a href="signup.html" class="nav-link active" style="color:rgba(255, 255, 255);">Sign Up</a>
</li>
<li class="nav-item">
<a href="login.html" class="nav-link active" style="color:rgba(255, 255, 255);">Login</a>
</li>

</ul>
</div>
Expand Down
6 changes: 6 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@
<li class="nav-item">
<a href="faq.html" class="nav-link active" style="color:rgba(255, 255, 255);">FAQ</a>
</li>
<li class="nav-item">
<a href="signup.html" class="nav-link active" style="color:rgba(255, 255, 255);">Sign Up</a>
</li>
<li class="nav-item">
<a href="login.html" class="nav-link active" style="color:rgba(255, 255, 255);">Login</a>
</li>
</ul>
</div>
</div>
Expand Down
123 changes: 123 additions & 0 deletions login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
<link rel="stylesheet" href="about.css">
<link rel="stylesheet" href="mynav.css">
<script src="jquery-3.6.4.min.js"></script>
<script src="mynav.js"></script>
<style>
/* Add your custom styles here */
body {
font-family: Arial, sans-serif;
background-color: rgb(111, 85, 85);
}
.containerr {
max-width: 600px;
margin: 0 auto;
padding: 40px;
background-color: white;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
margin-top: 100px;
max-height: 380px;
}
.sign{
text-align: center; /* Center align content */
}
.form-group {
margin-bottom: 20px;
}
label {
font-weight: bold;
display: block;
margin-bottom: 5px;
}
input[type="text"],
input[type="email"],
input[type="password"] {
width: 100%;
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
}
button[type="submit"] {
padding: 10px 20px;
background-color: #007bff;
border: none;
color: #fff;
border-radius: 4px;
cursor: pointer;
}
button[type="submit"]:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<nav class="navbar navbar-light navbar-expand-md navbar-fixed-top navigation-clean-button">
<div class="container">
<button class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#mynav"><span
class="visually-hidden">.</span><span class="navbar-toggler-icon"></span></button>
<div>
<a href="index.html" class="navbar-brand
"><span><strong>The Cafe</strong></span></a>
</div>
<div class="collapse navbar-collapse" id="mynav">
<ul class="navbar-nav navbar-right">
<li class="nav-item">
<a href="index.html" class="nav-link active" style="color:rgb(255, 255, 255);">Home</a>
</li>
<li class="nav-item dropdown">
<a class="dropdown-toggle nav-link" data-bs-toggle="dropdown" href="#"
style="color:rgba(255, 255, 255);">Services</a>
<div class="dropdown-menu">
<a href="menu.html" class="dropdown-item bg-dark" data-bss-hover-animate="pulse"
style="color:rgba(255, 255, 255);">Menu</a>
<a href="order.html" class="dropdown-item bg-dark d-fle" data-bss-hover-animate="pulse"
style="color:rgba(255, 255, 255);">Your Order</a>
</div>
</li>
<li class="nav-item">
<a href="about.html" class="nav-link active" style="color:rgba(255, 255, 255);">About Us</a>
</li>
<li class="nav-item">
<a href="contact.html" class="nav-link active" style="color:rgba(255, 255, 255);">Contact Us</a>
</li>
<li class="nav-item">
<a href="faq.html" class="nav-link active" style="color:rgba(255, 255, 255);">FAQ</a>
</li>
<li class="nav-item">
<a href="signup.html" class="nav-link active" style="color:rgba(255, 255, 255);">Sign Up</a>
</li>
<li class="nav-item">
<a href="login.html" class="nav-link active" style="color:rgba(255, 255, 255);">Login</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Your login form starts here -->
<div class="containerr">
<h2 class="sign">Login</h2>
<form action="login_form.php" method="post">
<div class="form-group">
<label for="username">Username</label>
<input type="text" id="username" name="username" required>
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" id="password" name="password" required>
</div>
<div class="form-group" >
<button type="submit">Login</button>
</div>
</form>
<p>Don't have an account? <a href="signup.html">Sign Up here</a>.</p>
</div>
<!-- Your login form ends here -->
</body>
</html>
6 changes: 6 additions & 0 deletions menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,10 @@ div.col h3{

.fb:hover{
background: #385568;
}

.flex-menu {
display: flex;
justify-content: space-between;
gap: 1px;
}
2 changes: 1 addition & 1 deletion menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ <h3 style="color: #2F4858;padding-left: 50px;font-weight: bold;">Cart</h3>
<div class="row" style="height: 15px;"></div>
<div class="row">
<div class="col" style="text-align: center;">
<button class="fb" style="">Checkout<a href="order.html"></a></button>
<button class="fb">Checkout<a href="order.html"></a></button>
</div>
</div>
<div class="row" style="height: 15px;"></div>
Expand Down
8 changes: 8 additions & 0 deletions order.css
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,12 @@ body{
padding: 8px;
border-radius: 20px;
text-align: center;
}

.hide_as_link {
text-decoration: none;
color: #000000;
}
.hide_as_link :active {
color: #000000;
}
25 changes: 15 additions & 10 deletions order.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,25 @@
<li class="nav-item">
<a href="faq.html" class="nav-link active" style="color:rgba(255, 255, 255);">FAQ</a>
</li>
<li class="nav-item">
<a href="signup.html" class="nav-link active" style="color:rgba(255, 255, 255);">Sign Up</a>
</li>
<li class="nav-item">
<a href="login.html" class="nav-link active" style="color:rgba(255, 255, 255);">Login</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="container step1">
<div class="row">
<h2> Step 1 - My Awesome Cart Express Checkout - Review Your Cart items </h2>
<div class="row">
<div id="items">
<!-- items will be added here -->
</div>

</div>
</div>
<div class="container step1">
<a class="hide_as_link" href="./menu.html">
<h2> Step 1 - My Awesome Cart Express Checkout - Review Your Cart items </h2>
<div class="row">
<div id="items">
<!-- items will be added here -->
</div>
</div>
</a>
</div>
<div class="col my-4">
<h2> Step 2 - Enter Address & Other Details</h2>
Expand Down
37 changes: 16 additions & 21 deletions order.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,21 @@ $(document).ready(function () {
listcart(cart);
});
function listcart(cart) {
let str=``;
if (cart == {}) {
str += `<div id="default">
<span><h5>Your Cart is Empty........</h5></span>
let str_order=``;
for (let item in cart) {
str_order+=`<div class="row">
<div class="col">
`+cart[item].name+`
</div>
<div class="col">
x`+ cart[item].quantity +`
</div>
<div class="col">
= Rs.`+ (cart[item].price)*(cart[item].quantity) +`
</div>
</div>`
}
else{
for (let item in cart) {
str+=`<div class="row">
<div class="col">
`+cart[item].name+`
</div>
<div class="col">
x`+ cart[item].quantity +`
</div>
<div class="col">
= Rs.`+ (cart[item].price)*(cart[item].quantity) +`
</div>
</div>`
}
}
document.getElementById("items").innerHTML=str;
}

if(str_order == ``) str_order = `<h5 class='default'> Your Cart is Empty. Click here to Go to Menu </h5>`;
document.getElementById("items").innerHTML= str_order;
}
Loading

0 comments on commit 52750ff

Please sign in to comment.