<?php session_start(); 
$previous = $_SESSION['previous'];
$_SESSION['previous'] = "buy_validate";
echo $previous.'<br>';

if( !isset($_SESSION['userid']))
{  echo "username is not set <br>";
}
else
{  echo "username is set : ".$_SESSION['userid']."<br>";	
}
$isbn = $_POST['isbn'];
$bid = $_SESSION['userid'];
$sid = $_POST['sid'];
$stype = $_POST['stype'];
$price = $_POST['price'];
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Search Results </title>

<script type="text/javascript">
function validate(form)
{
form.submit()
}

function re(form1)
{ 
  if(confirm("Do you want to reset the form"))
  {
  }   
}
</script>


<?php
   
  echo ' 
  <h1> Transaction Details </h1>
   
  <form id="form1" name="form1" method="post" action="transaction.php">

  <label>BUYER ID 
  <input type="text" readonly="readonly" name="bid" id="bid" value="'.$bid.'" />
  </label>
  <br>
  <label>SELLER ID 
  <input type="text" readonly="readonly" name="sid" id="sid" value="'.$sid.'" />
  </label>
  <br>
  <label>ISBN
  <input type="text" readonly="readonly" name="isbn" id="isbn" value="'.$isbn.'" />
  </label>
  <br>
  <label>BOOK TYPE
  <input type="text" readonly="readonly" name="stype" id="stype" value="'.$stype.'" />
  </label>
  <br>
  <label>PRICE
  <input type="text" readonly="readonly" name="price" id="price" value="'.$price.'" />
  </label>
  <br><br><br>
  <label>DATE
  <input type="text" name="date" id="date" />
  </label>
  <br>
  <label>CREDIT CARD NUMBER 
  <input type="text" name="ccnum" id="ccnum" />
  </label>
  <br>
  <label>CREDIT CARD TYPE
  <input type="text" name="cctype" id="cctype" />
  </label>
  <br>
  <label>CREDIT CARD EXPIRY
  <input type="text" name="ccexpiry" id="ccexpiry"/>
  </label>
  <br>
  <p>
    <input type="submit" onClick="validate(this.form)" name="button" id="button" value="Submit" />
    <input name="b" type="button" onClick="re(this.form)" id="b" value="Clear" />
  </p>
  </form>';
  
?>

</body> 
</html>
