<?php 
/*
##################################################################
#                       PHP 4&5 MySQL 4&5                        #
##################################################################
#           Copyright (c) 2004-2008 Armia Systems Inc            #
##################################################################
#               This file is part of Cybermatch site             #
##################################################################
#    Developed By: simi (simi@armia.com)                         #

##################################################################
#               Developed On:   03-04-2008                       #
##################################################################
#               Modified By:                                     #
##################################################################
#               Modified On:                                     #
##################################################################
# This script may not be distributed, sold, given away for free  #
# to third party, or used as a part of any internet services 	 #
# such as webdesign etc.                                         #
##################################################################
*/

require_once ("config.inc.php");
require_once ("includes/userlogincheck.inc.php");
require_once ("includes/mysql.inc.php");
require_once ("classes/misc.class.php");
require_once ("classes/userside.class.php");
require_once ("includes/Pager/Pager.php");
require_once ("includes/arrays.inc.php");
require_once ("classes/timespamp.php");
$ds = new FuzzyTime();

$message	= "";
$data		= array();
$array		= array();
$script		= "";
$pages		= "";
$page		= isset($_REQUEST['page'])	?	trim($_REQUEST['page'])	:	"1";
$type		= isset($_REQUEST['type'])	?	trim($_REQUEST['type'])	:	"__";

$stamsg		= "";
if ($type == "AN")	$stamsg	= "approved";
else if ($type == "DN")	$stamsg	= "declined";
else if ($type == "NN")	$stamsg	= "pending";

if (!$objDB) {
	$message	= "Unable to Locate Database Server.";
} else {
	$objU	= new userside($objDB);
	$objM	= new misc($objDB);
	if (isset($_POST['DM'])) {
		$message	= $objU->delete_interests($_POST);
	}
	if (isset($_POST['A'])) {
		$message	= $objM->change_interest_status($_POST, "AN");
	}
	if (isset($_POST['D'])) {
		$message	= $objM->change_interest_status($_POST, "DN");
	}
	
	$array		= $objM->get_intrests($type, $_SESSION['user_id'], true);
	$params 	= array(
		'mode'      => 'Sliding',
		'perPage'   => PAGESIZE,
		'urlVar'    => 'page',
		'extraVars' => array('type'=>$type),
		'itemData'  => $array
	);
	$objP 		= & Pager::factory($params);
	$data  		= $objP->getPageData();
	$pages		= $objP->links;
	if (empty($data))
		$message	.= "No $stamsg interest(s) in your inbox folder.<br>";
	$script		= $objU->get_script($message);
	$message	= $objU->remove_script($message);
}

include_once ("title.inc.php");
include_once ("tophtml.inc.php");
?>

<div class="row">
	<div class="eight columns">
		<div class="search-rslts">
			<div class="row"><div class="inenr-hd"><h2>Express Interests Received</h2></div></div>
			
			<div class="row">
			
				<div class="newdesignforinput maintext1">
				
				<?php if(isset($message) && trim($message)!='')
				  {?>
					<div class="full_row">
						<div class="maintext1 warning"><?php echo $message;?></div>
					</div>			
					<?php }//end if?>
					</div>
					<form name="frmTell" method="post" action="<?php echo $_SERVER['PHP_SELF']?>">
						<?php if (!empty($data)) 
						{ 
						foreach ($data as $key => $value) 
						{ 
						?>			
						<div class="full_row search-rslts-row profile_list_outer">
							<div class="three columns">
								<a href="profile.php?id=<?php echo $value['nUser_Id']?>">
									<img src="<?php echo $objU->get_pimage_url(PROFILE_IMAGE_URL, $value['nPhoto_Id'], $value['vGender']);?>" width="165" height="125" title="<?php echo $value['vLogin']?>" alt="<?php echo $value['vLogin']?>" border="0">
								</a>
							</div>
							<!-- <tr>
							<td align="right" class="profilenumber"><table width="100%"  border="0" cellspacing="0" cellpadding="3">
							<tr>
							<td align="right"><?php echo $value['nUser_Id']?></td>
							</tr>
							</table></td>
							</tr>-->
							<div class="nine columns">
				  			<div class="profile_L eight columns">
								<div class="full_row">
									<div class="nine columns">
										<div class="profile-name"><?php echo $value['vLogin']?></div>
										<div class="clear"></div>
										<div class="twelve">
											<div class="one columns" style="padding:5px 0 0 0; "><input type="checkbox" name="ids[]" value="<?php echo $value['nInterest_Id']?>"></div>
											<div class="eleven columns gray_normal_txt">Request Status:&nbsp;<?php echo $arrIntrestStatus[$value['vStatus']]?></div>
										</div>
										<!--<div class="full_row maintext1"><strong><?php// echo $value['dDay']?></strong></div>-->
										<div class="full_row gray_normal_txt">
											<b><?php echo $value['vAge']?>-year-old <?php echo $value['vGender']?></b>
											&nbsp; &nbsp;Height : <?php echo $value['nHeight'] <> "" ? $objU->get_height($value['nHeight']) : "--"?><br>
											<?php echo ($value['vCounty']!='')?$value['vCounty'].",":"";?>
											<?php echo ($value['vState']!='')?$value['vState'].",":"";?>
											<?php echo $value['vCountry']?>
										</div>								
										<div class="clear"></div>
										<div class="full_row gray_normal_txt"><?php echo $value['vTitle']?></div>
										<div class="clear"></div>
										<div class="view-pro-row"><a href="profile.php?id=<?php echo $value['nUser_Id']?>" class="view-pro-btn" title="View Full Profile">View Profile</a></div>
									</div>
									
									<div class="three columns right">
										<div class="twelve">
											<div class="twelve columns"><?php echo $objU->get_bgcheck_image($value['nUser_Id'])?></div>
										</div>
									</div>
								<div class="clear"></div>
								</div>
							</div>
							
				  			<div class="profile_R four columns">
								<div class="twelve columns featured_icon"><?php echo $objU->get_featured_image($value['nUser_Id'])?></div>
								<div class="twelve">
										<?php if(isset($_SESSION['user_id']) && $_SESSION['user_id']!='')
										{ ?>
										<!-- <div class="full_row icon_txt"><a href="profile.php?id=<?php echo $value['nUser_Id']?>&EI=yes" class="signupbuttonlink" title="Express Interest">Express Interest</a></div>-->
										<div class="full_row icon_txt"><a href="profile.php?id=<?php echo $value['nUser_Id']?>&SM=yes" class="send-mail-btn" title="Send An Email">Send An Email</a></div>
										<!--<div class="full_row icon_txt"><a title="Add as favourite" href="profile.php?id=<?php echo $value['nUser_Id']?>&AF=yes"><img src="images/addasfav.gif" alt="Add to favourite list" width="23" height="22" border="0" title="Add to favourite list"></a></div>-->
										<div class="full_row icon_txt"><a href="profile.php?id=<?php echo $value['nUser_Id']?>&AH=yes" class="hotlist-btn" title="Add To Hot List">Add To Hot List</a></div>
										<div class="full_row icon_txt"><a href="profile.php?id=<?php echo $value['nUser_Id']?>&ATF=yes" class="im-btn" title="Add To IM List">Add To IM List</a></div>
										<?php }//end if?>
								</div>
							</div>
							
							</div>
							<div class="clear"></div>
						</div>
						<?php }//end foreach
							}//end if
							if (!empty($data)) 
							{ 
						?>
						
						<div class="full_row">
							<div class="twelve">
								<input name="DM" type="submit" class="loginbutton" id="DM" onClick="return confirm_check();" value="Delete Interest(s)">
								<?php if ($type <> "AN") { ?><input name="A" type="submit" class="loginbutton" id="A" value="Accept">
                                <?php }//end if?> 
								<?php if ($type <> "DN") { ?>
								 <?php }//end if?><input name="D" type="submit" class="loginbutton" id="D" value="Decline"><input type="hidden" name="page" value="<?php echo $page?>"> <input type="hidden" name="type" value="<?php echo $type?>">
							</div>
							
						</div>
							<?php }//end if
							   if ($pages <> "") 
							   {
						   ?>
						<div class="full_row pagenation"><?php echo $pages?></div>
						<?php } ?>
					</form>
				</div>
			</div>
		</div>
	<div class="four columns right search_result_R"><?php include_once ("left.inc.php");?></div>
</div>


	
<?php include_once('bottomhtml.inc.php');?>
