<?

require 'include/announcements.php'; // ITECHBIDS Configuration File

require 'include/itechbids.php'; // ITECHBIDS Configuration File







$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];

$mail_sql="select * from askseller where qst_id=$qst_id";

$mail_res=mysql_query($mail_sql);

$mail_row=mysql_fetch_array($mail_res);

$mail_total_records=mysql_num_rows($mail_res);



if($mail_row[from_id])

 {

 $user_sql="select * from member_details where user_id=".$mail_row[from_id];

 $user_res=mysql_query($user_sql);

 $user_row=mysql_fetch_array($user_res);

 }



 $to_user_sql="select * from member_details where user_id=".$mail_row[to_id];

 $to_user_res=mysql_query($to_user_sql);

 $to_user_row=mysql_fetch_array($to_user_res);



  $item_sql="select * from auction_details where productid=".$mail_row[productid];

  $item_res=mysql_query($item_sql);

  $item_row=mysql_fetch_array($item_res);

$mailitem = $item_row[productid];

$itemtittle=$item_row[producttitle];

  if($mail_row[status]=="unread" or $mail_row[status]=="read" )

  $message=$mail_row[question];

  else if($mail_row[status]=="reply")

  $message=$mail_row[answer];



// $mail_conf=$_REQUEST[mail_conf];





// -------------- Delete Inbox--------------------------





if($mail_conf=="yes")

{

    $items=$_POST[chkbox];

	$count=count($items);

    if($count!=0)

    {

	foreach($items as $item)

     {

	  $up_sql="update askseller set status='delete' where qst_id=$item";

      mysql_query($up_sql);

	  exit();

     }   



   } 

}



// --------------End of Inbox Deletion --------------------------







?>

<script language="javascript">

function mail_del()

{

var where_to= confirm("Are U Sure U Want to delete the items?");

if (where_to== true)

 {

document.mail_form.mail_conf.value="yes";

document.mail_form.submit();

 }

}

function selectall()

 {



	len=document.mail_form.len.value;

	  if(len==1)

	 {

	 if(document.mail_form.chkMain.checked==true) 

				document.mail_form.chkbox.checked=true;

		if(document.mail_form.chkMain.checked==false)

			document.mail_form.chkbox.checked=false;

	}

		else

	 {

		for(i=0;i<len;i++)

		 {

	if(document.mail_form.chkMain.checked==true)

			document.mail_form.chkbox[i].checked=true;

		if(document.mail_form.chkMain.checked==false)

			document.mail_form.chkbox[i].checked=false;     

			  				}

	}

	

}

</script>