<?php session_start();  //Developed by ITechScripts
require 'include/announcements.php'; // ITECHBIDS Configuration File
require 'include/itechbids.php'; // Server compatibility Patch

$locheckuser=$_SESSION[username];
$locheckpass=$_SESSION[checkpass];
if((strlen($locheckuser)==0) || (strlen($locheckpass)==0))
{
echo '<meta http-equiv="refresh" content="0; url=index.php">';
exit();
} 
$lochecksql="select * from member_details where user_name='$locheckuser' and password='$locheckpass' and verified='yes' and approved='yes' and payment_status='yes'";
$locheckre=mysql_query($lochecksql);
if(mysql_num_rows($locheckre)==0)
{
echo '<meta http-equiv="refresh" content="0; url=index.php">';
exit();
} 


$user_id=$_SESSION[userid];
$mode=$_GET[mode];
$flag=$_POST[flag];
if($flag==1)
{
$mode=$_POST[mode];
$productid=$_POST[item_no];
if($productid=="select")
$err_flag=1;
if($err_flag!=1)
{
 if($mode=="repost")
{
$repost_sql="select * from auction_details where productid=$productid";
$repost_res=mysql_query($repost_sql);
$repost_row=mysql_fetch_array($repost_res);
$admin_sql="select * from genaralsettings where set_id=37";
$admin_res=mysql_query($admin_sql);
$admin_row=mysql_fetch_array($admin_res);
if($respost_res[no_of_repost] > $admin_row[no_of_repost])
{
$msg="Sorry!You Have Already Reposted $repost_res[no_of_repost] items.So You Can not Repost Your Item.";
} 
} 

/* if($mode=="edit")
{ */
$user_sql="select * from auction_details where user_id=$user_id and productid=$productid";
$user_res=mysql_query($user_sql);
$user_row=mysql_num_rows($user_res);
if($user_row==0)
{
$msg=$err_84;

// $msg="Sorry! You Can not Edit or Repost this Item .Because Your Item Id was not Match Your Posted Items.!";
}
else
{
echo '<meta http-equiv="refresh" content="0;url=modifyitem_cate.php?productid='.$productid.'&mode='.$mode.'">';
echo "<font size=+1 color=#003366>$lang_676....</font>";
exit();
}
// }
}
}
?>
<?
require 'themes/require_item_no.tpl'; // ITECHBIDS Configuration File
?>
   <script language="JavaScript">
  function get_item() 
  {
  document.require_no.flag.value=1;
  
  }
  </script>