<?php
require 'include/configurations.php'; // ITECHBIDS Configuration File
require 'include/header.php';
?>
<?
if(isset($_REQUEST['update1']))
{

  $query = "update terms set term_body='$_REQUEST[htmlcontent]' where term_id='1' ";
 if(mysql_query($query))
 echo "<br><font color='#ff0000'><strong>Registration Detail Updated On Successfully ! </strong></font><br><br>";
}

if(isset($_REQUEST['update2']))
{
echo $query = "update terms set term_body='$_REQUEST[selling]' where term_id='2' ";
 if(mysql_query($query))
 echo "<br><font color='#ff0000'><strong>Selling Detail Updated On Successfully ! </strong></font><br><br>";
}

if(isset($_REQUEST['update3']))
{
echo  $query = "update terms set term_body='$_REQUEST[buying]' where term_id='3' ";
 if(mysql_query($query))
 echo "<br><font color='#ff0000'><strong>  Buying Detail Updated On Successfully ! </strong></font><br><br>";
}
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<br>
<table align="center" width="100%" height="35" class="ft" heught=25">
<tr><td align="center">
<a href="terms.php?page=1" id="link3"><strong>Registration Terms</strong></a></td>
<td align="center">
<a href="terms.php?page=2" id="link3"><strong>Selling Terms</strong></a></td>
<td align="center">
<a href="terms.php?page=3" id="link3"><strong>Buying Terms</strong></a></td></tr>
</table>
<br><br>
<? 
/* if($_REQUEST['page']==1)
{ */
?>   
<?


$query="select * from terms where term_id=1";
$tab=mysql_query($query);
if($row=mysql_fetch_array($tab))
{
$registration=$row['term_body'];
}
?>

<form method="post" action="<?= $_SERVER['PHP_SELF']; ?>" name=form1>
<table width="80%"  border="0" cellpadding="5" cellspacing="1" class="ft" align="center">
<tr class="ct" height="25">
<td colspan="4">Registration Terms</td>
<tr >
<td><Strong>Registration Terms </strong></td>
<td>
<?
echo '<textarea name="registration" cols="60" rows="15">' . $registration . '</textarea>';
?>

<!-- <textarea name="registration" cols=50 rows=10><?= $registration; ?></textarea> --> </td></tr>
<input type="hidden" name="term_id" value="1">
<tr ><td></td><td> 
<input type="submit" class="button"   name="update1" value="Update"  > </td></tr>
</table>
</form>

<?

/* }
if($_REQUEST['page']==2)
{
?>
<?
$query="select * from terms where term_id=2";
$tab=mysql_query($query);
if($row=mysql_fetch_array($tab))
{
$selling=$row['term_body'];
}
?>
<form method=post action="<?=$_SERVER['PHP_SELF'];?>" name=form1>
<table width="80%"  border="0" cellpadding="5" cellspacing="1" class="ft" align="center">
<tr class="ct" height="25">
<td colspan="4">Selling Terms</td>
<tr ><td><Strong>Selling Terms </strong></td><td>
<?
echo '<textarea name="selling" cols="60" rows="15"> $selling;  </textarea>';
?>
<!-- <textarea name="selling" cols=50 rows=10>
<?= $selling; ?></textarea> --> </td></tr>
<input type="hidden" name="term_id" value="2">
<tr><td>&nbsp;</td><td> 
<input type="submit" class="button"   name="update2" value="Update"  > </td></tr>
</table>
</form>
<?
}
if($_REQUEST['page']==3)
{
?>
<?
$query="select * from terms where term_id=3";
$tab=mysql_query($query);
if($row=mysql_fetch_array($tab))
{
$buying=$row['term_body'];
}
?>
<form method=post action="<?=$_SERVER['PHP_SELF'];?>" name=form1>
<table width="80%"  border="0" cellpadding="5" cellspacing="1" class="ft" align="center">
<tr class="ct" height="25">
<td colspan="4">Buying Terms</td>
<tr ><td><Strong>Buying Terms </strong></td>
<td>
<!-- <textarea name="buying" cols=50 rows=10><?= $buying; ?></textarea> -->
<?
echo '<textarea name="buying" cols="60" rows="15">'.$buying.'</textarea>';
?>
</td></tr>
<input type="hidden" name="term_id" value="3">
</form>
<tr ><td></td><td>
 <input type="submit" class="button"   name="update3" value="Update"  value="<?= $submit; ?>"> </td></tr>
</table>
<?
} */
?>

<br><br>
<? require 'include/footer.php'; ?>
</body>
</html>
