<?php session_start();  //Developed by ITechScripts
require 'include/announcements.php'; // ITECHBIDS Configuration File
require 'include/itechbids.php'; // Server compatibility Patch
$default_currency="select * from genaralsettings where set_id=55";
$default_res=mysql_query($default_currency);
$default_row=mysql_fetch_array($default_res);
$default_cur=$default_row[set_value];

$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];
$pay_delete=$_REQUEST[pay_delete];



// -------------- Delete Selling items--------------------------

if($pay_delete=="yes")
{

    $items=$_POST[chkbox];
	$count=count($items);
	$productid=$_REQUEST[productid];
    if($count!=0)
    {
	foreach($items as $item)
     {
	  echo $pay_up="delete auction_details  where productid=$item";
	  exit();
      mysql_query($pay_up);
     }   
	}
	else
	{
	$productid=$_REQUEST[productid];
	$pay_up="delete from auction_details  where productid=$productid";
	$pay_res=mysql_query($pay_up);
	} 
}

// -------------- end of Delete Selling items--------------------------

 $pay_sqlh="select * from auction_details where user_id=$user_id and status='new'";
 $pay_resh=mysql_query($pay_sqlh);
 $pay_total_records=mysql_num_rows($pay_resh);

?>

<? require'themes/pay.tpl';?>
</table>
</body>
</html>

<script language="javascript">
function pay_selectall()
 {
    len=document.pay_frm.len.value;
	if(len==1)
	 {
     
	if(document.pay_frm.chkMain.checked==true) 
				document.pay_frm.chkbox.checked=true;
		if(document.pay_frm.chkMain.checked==false)
			document.pay_frm.chkbox.checked=false;
	}
		else
	 {
	 		for(i=0;i<len;i++)
		 {
	    if(document.pay_frm.chkMain.checked==true)
			document.pay_frm.chkbox[i].checked=true;
		if(document.pay_frm.chkMain.checked==false)
			document.pay_frm.chkbox[i].checked=false;     
		}
	}
	
}

function go_page_link(action_id,id,seller_id)
{
if(action_id==5)
{
var where_to= confirm("Are U Sure U Want to delete the items?");
if (where_to== true)
 {
document.pay_frm.pay_delete.value="yes";
document.pay_frm.productid.value=id;
document.pay_frm.action="pay.php";
document.pay_frm.submit();
 }
}
if(action_id==4)
{
document.pay_frm.productid.value=id;
document.pay_frm.action="addcoupon.php";
document.pay_frm.submit();
}
}

function del()
{
 var where_to= confirm("Are U Sure U Want to delete the items?");
 if (where_to== true)
 {
 document.pay_frm.pay_delete.value="yes";
 document.pay_frm.submit();
 }
}
</script>
