rentingproduct.php
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 |
<?php session_start(); require 'init.php'; if(!isset($_SESSION['name'])){ echo " You are loggedOut"; header('location:login.php'); } ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width , initial-scale=1.0"> <title>Online rental system </title> <link rel="stylesheet" type="text/css" href="adupload.css"> <link rel="stylesheet" type="text/css" href="index.css"> <link rel="preconnect" href="https://fonts.gstatic.com"> <!---font link starts----> <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet"><!--fontlinkend--> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> </head> <body> <div class="navbar" style="height: 70px;"> <!--navbar class div starts--> <div class="logo"> <a href="index.php"> <img src="images/weblogoooo.png" style="width: 150px;"> </a> </div> <nav> <ul id="menuitems" style="font-size: 20px;" > <li> <a href="index.php" > Home </a> </li> <li> <a href="products.php"> Products</a> </li> <li> <a href="aboutus.php"> About US </a> </li> <li> <a href="contactus.php"> Contact US </a> </li> <?php if(isset($_SESSION['name'])){?> <li><a href="welcome.php" style="color: #80ccff;"> <?php echo $_SESSION['name'];?>'s Profile</a></li> <?php } else {?> <li><a href="login.php">Login </a></li> <?php } ?> </ul> </nav> </div> <div class="wrapper1" style="height: 480px;width: 800px; margin-top: 35px; "> <div class="title"> <h1>Upload Product (For Rent)</h1> </div> <form action="rentingproduct.php" method="post" enctype="multipart/form-data"> <div class="contact-form"> <div class="input-fields"> <input type="" name="name" placeholder="Enter Product name"required> <input type="" class="input" name="price" placeholder="Enter Per day rent price"required> <input type="text" id="email" name="email_id" value= <?php if(isset($_SESSION['email_id'])){ echo $_SESSION['email_id']; }?> readonly> <input type="" name="phone" placeholder="phone no"> <input type="file" name="img" required style="background: transparent; color:#05ade6;"required> </div> <div class="msg"> <input type="" class="input" name="pick_loc" placeholder="Possible Pickup Points" required> <input type="" class="input" name="rentdays" placeholder="Max days for renting"required> <textarea name="pdescription" placeholder="Write Product Description (Conditon/query)" style="height: 100px;"required></textarea> </div> </div> <button type="submit" name="upload" class="btn" style="margin-bottom: 5px;margin-top: 10px; width: 80%;margin-left: 70px;">Upload Product</button><br> </form> </div> </body> </html> <?php if (isset($_POST['upload'])) { $name=$_POST['name']; $email=$_SESSION['email_id']; $phone=$_POST['phone']; $price=$_POST['price']; $pickloc=$_POST['pick_loc']; $pdescription=$_POST['pdescription']; $rentdays=$_POST['rentdays']; $date=date("d,M y H:i:s"); $img =rand(10,100000)."-".$_FILES['img']['name']; $loc= $_FILES['img']['tmp_name']; $folder =("rentingimg/"); $f_img = strtolower(str_replace(" ", "-", $img)); if(move_uploaded_file($loc, $folder.$f_img)){ $sql= "INSERT INTO renting(name,email_id,phone,price,img,pick_loc,pdescription,rentdays,registered_at)VALUES('$name','$email','$phone','$price','$f_img','$pickloc','$pdescription','$rentdays','$date')"; $res=mysqli_query($con,$sql); if($res){ $success="<div class='success'><h3>Producted Uploaded</h3></div>"; header('location:allrentingproducts.php'); }else{ echo "image didnt move"; } } } ?> |
rentingproductdetails.php
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 |
<?php session_start(); include("database.php"); extract($_POST); ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width , initial-scale=1.0"> <title>Online rental system</title> <link rel="stylesheet" type="text/css" href="css/style.css"> <link rel="stylesheet" type="text/css" href="productdetail.css"> <link rel="preconnect" href="https://fonts.gstatic.com"> <!---font link starts----> <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet"><!--fontlinkend--> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> </head> <body> <div class="header" > <!-- header class div starts----> <div class="container"> <div class="navbar"> <!--navbar class div starts--> <div class="logo"> <a href="index.php"> <img src="images/weblogoooo.png" width="150px"> </a> </div> <nav> <ul id="menuitems" > <li> <a href="index.php" > Home </a> </li> <li> <a href="products.php"> Products</a> </li> <li> <button onclick="window.location.href='adupload.php';" style="background: black;color: white;height:25px; width: 100px;"> Post Your Add</button> </li> <li> <a href=""> About </a> </li> <li> <a href='contactus.php'> Contact </a> </li> <?php if(isset($_SESSION['user_id'])) {?> <li><a href="login.php"> <?php echo $_SESSION['name'];?> </a></li> <?php } else { ?> <li><a href="login.php">Login </a></li> <?php } ?> </ul> </nav> <a href="cart.html"> <img src="images/cart.png" width="30px" height="30px"> </a> <img src="images/menu-icon.png" height="30px" class="menu-icon" onclick="menutoggle()"> </div> </div> </div> <div class="small-container"> <div class="row"> <?php require 'init.php'; $ID=$_GET["userid"]; $sql= "SELECT * FROM renting WHERE id ='$ID'"; $res=mysqli_query($con,$sql); while ($row=mysqli_fetch_assoc($res)) { $f_img=("rentingimg/").$row['img']; ?> <div class="col2" style="margin-bottom: 20px;" > <img src="<?php echo $f_img; ?>"> <p style="border: solid red; width: 390px;margin-top: 10px;padding: 10px;"> If you want to report this User - Copy this Email and send us Or If you want to report this specific product: Copy this page linke and paste in message.<br> <button type="submit" name="add" class="btn" style="margin-top: 2px;margin-left: 40%;"><a href="report.php" style="color:#ffffff"> Report User </a></button> </p> </div> <div class="col2" > <h1> <?php echo $row['name']; ?></h1> <h3> Price: </h3> <h4><?php echo $row['price']; ?> </h4><br> <h3> Pickup Point: </h3><h4> <?php echo $row['pick_loc']; ?></h4> <br> <h3> Maximum renitng Days: </h3><h4> <?php echo $row['rentdays']; ?></h4> <br> <h3> Product Description <i class="fa fa-indent" ></i></h3><br><p><?php echo $row['pdescription']; ?></p><br> <h3> Chat with the owner (Copy the link below) </h3> <h4> <i class="fa fa-whatsapp"></i> <?php echo $row['phone']; ?> <span style="margin-left: 40%;"><br> <i class="fa fa-envelope" style="margin-right:10px;margin-left: 30%;"></i><?php echo $row['email_id']; ?> </span></h4> </div> <?php } ?> </div> </div> </div> <!--------------Footer--------------------> <div class="row" style="background-color: #000000;"> <div class="footer-col2"> <img src="images/weblogoooo.png"> <p> Our Main purpose is to sustainably Make your life easier and comfortable. </p> <hr> <!------horizontal line------> <p class="copyright">Copyright 2021 - RentingInn</p> </div> </div> <!-------row cls div ends---------> </body> </html> |
search.php
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 |
<?php if (isset($_GET['search'])) { $search=$_GET['search']; }else{ header('location:products.php'); } ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width , initial-scale=1.0"> <title><?php echo $search; ?> Search Products </title> <link rel="stylesheet" type="text/css" href="css/style.css"> <link rel="preconnect" href="https://fonts.gstatic.com"> <!---font link starts----> <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet"><!--fontlinkend--> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> </head> <body> <div class="header" > <!-- header class div starts----> <div class="container"> <!--contanier class div starts--> <div class="navbar"> <!--navbar class div starts--> <div class="logo"> <a href="index.php"> <img src="images/weblogoooo.png" width="150px"> </a> </div> <nav> <ul id="menuitems" > <li> <a href="index.php" > Home </a> </li> <li> <a href="products.php"> Products</a> </li> <li> <button onclick="window.location.href='adupload.php';" style="background: black;color: white;height:25px; width: 100px;"> Post Your Add</button> </li> <li> <a href=""> About </a> </li> <li> <a href='contactus.php'> Contact </a> </li> <?php if(isset($_SESSION['user_id'])) {?> <li><a href="login.php"> <?php echo $_SESSION['name'];?> </a></li> <?php } else { ?> <li><a href="login.php">Login </a></li> <?php } ?> </ul> </nav> <a href="cart.html"> <img src="images/cart.png" width="30px" height="30px"> </a> <img src="images/menu-icon.png" height="30px" class="menu-icon" onclick="menutoggle()"> </div> <div class="row"> <div class="col22"> <form action="search.php" method="GET"> <input type="text" name="search" placeholder=" Search Product by Name" autocomplete="off" required style="width: 500px;height: 40px;text-align: center;font-size: 20px; border-radius: 30px;border-color: #ff1a1a; background: transparent;" > <button type="submit" style="width: 50px;height: 40px;text-align: center;border-radius:30px; background: transparent; font-size: 30px;border: none; color: #ff1a1a;"></button> </form> </div> <div class="col22"> <form action="searchloc.php" method="GET"> <input type="text" name="locsearch" placeholder=" Search Product by City" autocomplete="off" required style="width: 500px;height: 40px;text-align: center;font-size: 20px; border-radius: 30px;border-color: #ff1a1a; background: transparent;" > <button type="submit" style="width: 50px;height: 40px;text-align: center;border-radius: 30px; background: transparent; font-size: 30px;border: none; color: #ff1a1a;"><i class="fa fa-search" ></i></button> </form> </div> </div> <div class="row"> <!---products row start--> <?php require 'init.php'; $sql= "SELECT * FROM products WHERE p_name LIkE '%$search%' "; $res=mysqli_query($con,$sql); while ($row=mysqli_fetch_assoc($res)) { $f_img=("pimages/").$row['p_img']; ?> <div class="col4" > <a href="productdetail.php?userID= <?php echo $row['p_id']; ?>" > <img style="width: 250px;height: 250px;" src="<?php echo $f_img; ?>" > <h2 style="color: #000000;"> <?php echo $row['p_name']; ?></h2> <h3 style="color: #000000;"> Price: </h3> <h4><?php echo $row['p_price']; ?> </h4><br> <button type="submit" name="add" class="btn" style="margin-top: 0px;"><a style="color: #ffff;" href="productdetail.php?userID= <?php echo $row['p_id']; ?>"> Product Details <i class="fa fa-info-circle" ></i> </a> </a> </div> <?php } ?> </div><!--products row ends here------> <div class="row" style="background-color: #000000;"> <div class="footer-col2"> <img src="images/weblogoooo.png"> <p> Our Main purpose is to sustainably Make your life easier and comfortable. </p> <hr> <!------horizontal line------> <p class="copyright">Copyright 2021 - RentingInn</p> </div> </div> <!-------row cls div ends---------> </body> </html> |
adminpanal.php
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 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
<?php include('action.php'); if (isset($_SESSION['admin'])) { $admin=$_SESSION['admin']; }else{ header('location:adminlogin.php'); } if (isset($_GET['unset'])) { unset($_SESSION['admin']); header('location:adminlogin.php'); }else{ // } ?> <!DOCTYPE html> <html> <head> <title> Admin Panal</title> <link rel="stylesheet" type="text/css" href="adminpanal.css"> <link rel="stylesheet" type="text/css" href="index.css"> </head> <body style="text-align: center; margin-left: 25px;"> <div class="navbar" style="height: 70px;"> <!--navbar class div starts--> <div class="logo"> <a href="index.php"> <img src="images/weblogoooo.png" style="width: 150px;"> </a> </div> <nav> <ul id="menuitems" > <li> <a href="adminpanalhome.php" > Home </a> </li> <li> <a href="adminreguser.php"> Registered Users </a> </li> <li> <a href="adminregproducts.php"> Registered Products</a> </li> <li> <a href="adminrentingproducts.php"> Registered Products for Rent </a> </li> <li><a href="adminpanal.php?unset=1" class="btn" style="width: 150px; text-align: center;text-decoration: none;position: relative; margin-bottom: 0px;margin-left: 10%;margin-top: 0px;">LogOut</a></li> </ul> </nav> </div> <div class="table"> <div class="table-con"> <h1>Verified Users</h1> <?php if(isset($_GET['delete'])){ echo $success; } ?> <table> <tr> <th>ID</th> <th>Images</th> <th>Name</th> <th>Email</th> <th>RegisteredAT</th> <th>UpdatedAT</th> <th>Delete</th> <th>Update</th> </tr> <?PhP require'init.php'; $sql= "SELECT * FROM user ORDER BY id DESC"; $res=mysqli_query($con,$sql); if(mysqli_num_rows($res)>0){ while ($row=mysqli_fetch_assoc($res)) { $id=$row['id']; $img=("uploads/").$row['img']; $name=$row['name']; $email=$row['email']; $reg=$row['registered_at']; $up=$row['updated_at']; echo" <tr> <td>$id</td> <td><img src='$img' ></td> <td>$name</td> <td>$email</td> <td>$reg</td> <td>$up</td> <td> <form action='adminpanal.php' method='post'> <button type='submit' class='atag' name= 'delete' value=$id>Delete</button> </form> </td> <td> <form action='adminpanal.php' method='post'> <button type='submit' class='update' name= 'update' value=$id>Update</button> </form> </td> </tr> "; }} else{ echo" <tr> <td>NO DATA</td> <td>NO DATA</td> <td>NO DATA</td> <td>NO DATA</td> <td>NO DATA</td> </tr> "; } ?> </table> </div> <?php if(isset($_GET['update-data'])){ echo $success; } ?> <?PhP if(isset($_POST['update'])){ require'init.php'; $id=$_POST['update']; $sql= "SELECT * FROM user Where id = '$id'"; $res=mysqli_query($con,$sql); if(mysqli_num_rows($res)>0){ while ($row=mysqli_fetch_assoc($res)) { $id=$row['id']; $img=("uploads/").$row['img']; $name=$row['name']; $email=$row['email']; $pass=$row['password']; echo" <div class=wrapper style='margin-top:2px'> <div class='title'> <h1>Update</h1> <div class='contact-form'> <form action='adminpanal.php' method='post' enctype='multipart/form-data'> <input class='hidden' type='text' name='id' value=$id placeholder='Enter Product Name' required><br> <input type='text' name='name' value=$name placeholder='Enter Product Name' required><br> <input type='email' name='email' value=$email placeholder='Enter Product Discription' required><br> <input type='password' name='pass' value=$pass placeholder='Enter Product Price' required><br> <input type='file' name='img' required> <button type='submit' name='update-data' class='btn'><h2>Update Data</h2></button> </form> </div> </div> </div> "; }} else{ echo" <h1> No DATA </h1> "; } } ?> </div> </body> </html> |
Download full PHP Code of Online rental system with database
More helping material for the Online rental system (Final Year Project – FYP)
- Online rental system project documentation
- Functional and Non Functional Requirements of Online rental system
- Use Case Diagram of Online rental system
- Use case Description of Online rental system
- Class Diagram of Online rental system
- Context Diagram of Online rental system
- ERD of Online rental system Entity Relationship Diagram
- Sequence Diagram of Online rental system
- Software testing of Online rental system
- Code of Online rental system in PHP
Hopefully, this final year project (FYP, Capstone project, Software project, semester project, degree project) will well helpful for the students of BSCS, BSSE, BSIT, BCS (Software engineering, information technology, computer engineering and computer science) studying in a college, institute, and university.