Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <title>ECA Consultant Log In</title>
- <meta charset="utf-8">
- <link rel="stylesheet"href="css/common.css" type="text/css">
- <script src="script/myscript.js"></script>
- </head>
- <body onload="pload()">
- <img src="img/logo.png" alt="logo">
- <p id ="date1">Date</p>
- <p id ="time1">Time</p>
- <h3>Navigation</h3>
- <nav>
- <ul>
- <li><a href="home.html">Home</a></li>
- <li><a href="login.html">Login</a></li>
- <li><a href="addedit.php">New User</a></li>
- <li><a href="aboutus.html">About Us</a></li>
- <li><a href="contactus.html">Contact Us</a></li>
- <li><a href="instruction/Instruction.pdf">Instruction</a></li>
- </ul>
- </nav>
- <h1>Welcome to the RYAN park!</h1>
- <h2>RYAN is the best lion!:)</h2>
- <?php
- //declare all variables for db connection
- $dbserver="localhost:3307";
- $dbuser="root";
- $dbpassword="";
- $dbname="kydb2019";
- //create connection
- $conn= new mysqli($dbserver,$dbuser,$dbpassword,$dbname);
- //check connect error
- if($conn->connect_error==true){
- die("connection failed error description: $conn->Connection_error");
- }else{
- echo "<p class=dbs>Connection Success</p>";
- }
- $custid=$_POST['id'];
- $name=$_POST['name'];
- //create sql statement
- $sql="SELECT * FROM ORDERS WHERE CustID=".$custid."";
- //execte sql and assign to result
- $result=$conn->query($sql);
- echo "<form method=post action=shopping.php>";
- if($result->num_rows<=0){
- echo"<p class='fail'>Welcome ".$name." You have not order yet</p>";
- }else{
- echo "<h1 id='welcome'>welcome ".$name." your details are below </h1>";
- echo "<h2 id='welcome'>See Your Past Orders</h2>";
- //create form for submission
- echo "<table border=1>";
- echo "<th>OrderID<th>Date<th>Pen QTY<th>Doll QTY<th>Note QTY<th>Order Total<th>Card name";
- while($row=$result->fetch_assoc()){
- echo"<tr><td> ".$row['OrderID']."</td>";
- echo"<td> ".$row['Date']."</td>";
- echo"<td> ".$row['PenQTY']."</td>";
- echo"<td> ".$row['DollQTY']."</td>";
- echo"<td> ".$row['NoteQTY']."</td>";
- echo"<td> ".$row['Total']."</td>";
- echo"<td> ".$row['CardName']."</td>";
- }
- }
- echo"</table>";
- //close db connection
- $conn->close();
- echo "<h2>Would you like to order ?</h2>";
- echo "<input type=hidden name=id value=".$custid.">";
- echo "<input type=hidden name=name value=".$name.">";
- echo"<h2><input type=submit formaction=shopping.php class=goshopping value='Go Shopping'></h2>";
- echo"</form>";
- ?>
- <footer>
- <p>Copyright © 2019 - All rights Reserved</p>
- <p>Keunyoung Kwak</p>
- </footer>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement