<?

require 'include/configurations.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];

$mode=$_REQUEST[mode];

if($mode=="in")

{

 $mail_sql="select * from askseller where to_id=$user_id and status!='delete'  order by qst_id desc";

}

else

{

 $mail_sql="select * from askseller where from_id=$user_id and status='reply' order by qst_id desc";

}



$mail_res=mysql_query($mail_sql);

$mail_total_records=mysql_num_rows($mail_res);

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

	  

     }   

     $conf=$err_32;

   } 

}



// --------------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>