SHARE
TWEET

young

a guest Mar 3rd, 2019 604 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.     <head>
  4.         <title>ECA Consultant Log In</title>
  5.         <meta charset="utf-8">
  6.         <link rel="stylesheet"href="css/common.css" type="text/css">
  7.         <script src="script/myscript.js"></script>
  8.     </head>
  9.     <body onload="pload()">
  10.         <img src="img/logo.png" alt="logo">
  11.          <p id ="date1">Date</p>
  12.         <p id ="time1">Time</p>
  13.         <h3>Navigation</h3>
  14.         <nav>
  15.             <ul>
  16.                 <li><a href="home.html">Home</a></li>
  17.                 <li><a href="login.html">Login</a></li>
  18.                 <li><a href="addedit.php">New User</a></li>
  19.                 <li><a href="aboutus.html">About Us</a></li>
  20.                 <li><a href="contactus.html">Contact Us</a></li>
  21.                 <li><a href="instruction/Instruction.pdf">Instruction</a></li>
  22.                
  23.             </ul>    
  24.         </nav>
  25.         <h1>Welcome to the RYAN park!</h1>
  26.         <h2>RYAN is the best lion!:)</h2>
  27.         <?php
  28.         //declare all variables for db connection
  29.         $dbserver="localhost:3307";
  30.         $dbuser="root";
  31.         $dbpassword="";
  32.         $dbname="kydb2019";
  33.         //create connection
  34.         $conn= new mysqli($dbserver,$dbuser,$dbpassword,$dbname);
  35.         //check connect error
  36.         if($conn->connect_error==true){
  37.             die("connection failed error description: $conn->Connection_error");
  38.         }else{
  39.             echo "<p class=dbs>Connection Success</p>";
  40.         }
  41.         $custid=$_POST['id'];
  42.         $name=$_POST['name'];
  43.        
  44.        
  45.        
  46.         //create sql statement
  47.         $sql="SELECT * FROM ORDERS WHERE CustID=".$custid."";
  48.         //execte sql and assign  to result
  49.         $result=$conn->query($sql);
  50.         echo "<form method=post action=shopping.php>";
  51.         if($result->num_rows<=0){
  52.         echo"<p class='fail'>Welcome ".$name." You have not order yet</p>";
  53.            
  54.         }else{
  55.         echo "<h1 id='welcome'>welcome ".$name." your details are below </h1>";
  56.             echo "<h2 id='welcome'>See Your Past Orders</h2>";
  57.         //create form for submission
  58.        
  59.        
  60.         echo "<table border=1>";
  61.         echo "<th>OrderID<th>Date<th>Pen QTY<th>Doll QTY<th>Note QTY<th>Order Total<th>Card name";
  62.         while($row=$result->fetch_assoc()){
  63.             echo"<tr><td> ".$row['OrderID']."</td>";
  64.             echo"<td> ".$row['Date']."</td>";
  65.             echo"<td> ".$row['PenQTY']."</td>";
  66.             echo"<td> ".$row['DollQTY']."</td>";
  67.             echo"<td> ".$row['NoteQTY']."</td>";
  68.             echo"<td> ".$row['Total']."</td>";
  69.             echo"<td> ".$row['CardName']."</td>";
  70.            
  71.         }
  72.         }
  73.        
  74.            
  75.             echo"</table>";
  76.             //close db connection
  77.             $conn->close();
  78.        
  79.         echo "<h2>Would you like to order ?</h2>";
  80.         echo "<input type=hidden name=id value=".$custid.">";
  81.         echo "<input type=hidden name=name value=".$name.">";
  82.         echo"<h2><input type=submit formaction=shopping.php class=goshopping value='Go Shopping'></h2>";
  83.         echo"</form>";
  84.       ?>
  85.    
  86.     <footer>
  87.             <p>Copyright &copy; 2019 - All rights Reserved</p>
  88.             <p>Keunyoung Kwak</p>
  89.         </footer>
  90.         </body>
  91. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top