<?php session_start();  //Developed by ITechScripts
require 'include/configurations.php'; // ITECHBIDS Configuration File
$frm=$_POST["cate"];
$country=$_POST["cat"];
$mode=$_REQUEST[mode];
$countryid=$_REQUEST['id'];
require 'include/header.php';
if($mode=='edit')
{
$cat_sql="select * from site_countries where country_id=$countryid";
$cat_res=mysql_query($cat_sql);
$cat_row=mysql_fetch_array($cat_res);
}
if($frm==1)
{
      if($mode=="edit")
       {
         $sql1="update site_countries set country='$country' where country_id=$countryid";
         $res1=mysql_query($sql1);
	   }
      else
      {
         $sql="insert into site_countries(country) values('$country')";
         $res=mysql_query($sql);
		 	 
      }
	 
    echo '<meta http-equiv="refresh" content="0;url=country.php">';
}
 
?>
<html>
<body>
<form action="addcountry.php" method="post">

  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <table align="center" class="ft" width="500" height="200">
<td height="49" colspan="2" class="ct" height="25" align="center"><b>
<? 
if($mode=='edit')
{
echo ("Edit Country");
}
else
{
echo ("Add Country");
}
?></b>
</td>
<tr class="ct" height="25" >
<td align="center"  > <span height="25">
<B>Country Name</B></span>
<input type="text" class="bluetext"name="cat" value="<?=$cat_row[country];?>"  >
<br>
<input type="hidden" name="cate" value=1>
<input type="hidden" name="mode" value=<?= $mode;?> >
<input type="hidden" name="id" value=<?= $countryid;?> >
<br><br><input  type="submit" class="button" name="add" value="Submit" >
</td></tr>

</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
</form></body></html>
<?
	require 'include/footer.php';
?>