<?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 ("includes/arrays.inc.php");
require_once ("classes/userside.class.php");
require_once ("includes/Pager/Pager.php");
require_once ("classes/misc.class.php");

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

if (!$objDB) {
	$message	= "Unable to Locate Database Server.";
} else {
	$objC		= new check();
	$objU		= new userside($objDB);
	$objM		= new misc($objDB);
	
	if (isset($_POST['DEN'])) {
            $message	= $objM->delete_shortlist($_POST);
	}
	
	$array		= $objM->my_shortlists($_SESSION['user_id']);
	$params 	= array(
		'mode'      => 'Sliding',
		'perPage'   => PAGESIZE,
		'urlVar'    => 'page',
		'extraVars' => array(),
		'itemData'  => $array
	);
	$objP 		= & Pager::factory($params);
	$data  		= $objP->getPageData();	
	if (empty($data))
		$message	.= "No profiles exist....<br>";
	else
		$pages	= $objP->links;;		
		
	$script		= $objU->get_script($message);
	$message	= $objU->remove_script($message);
}
include_once ("title.inc.php");
include_once ("tophtml.inc.php");
?>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="72%" valign="top"><div class="search-rslts"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td> <table width="100%"  border="0" cellspacing="0" cellpadding="5">
                    <tr align="left">
                   <td width="100%" class="inenr-hd"><h2>My Shortlists</h2></td>
                      </tr>
					 <tr align="left">
                      	<td colspan="2">&nbsp;</td>
                      </tr>
					</table>
					<?php if(isset($message) && trim($message)!='')
					      {
					?>
				<table width="100%"  border="0" cellspacing="0" cellpadding="5">
					<tr align="center">
                      <td colspan="2">&nbsp;</td>
                      </tr>
                    <tr align="center">
                      <td colspan="2" class="maintext1 warning"><?php echo $message;?></td>
                      </tr></table>
					<?php }//end if?>
<form name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']?>">
				 <?php if (!empty($data)) 
					   { 
					  		foreach ($data as $key => $value) 
							{ 
				?>
				<table width="98%"  border="0" cellspacing="0" cellpadding="3" align="center"  class="bordernew">
                <tr>
                  <td height="193" valign="top"><table width="93%"  border="0" cellspacing="0" cellpadding="3">
                      <tr>
                        <td><table width="57%"  border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td class="box3"><table width="54%"  border="0" cellspacing="0" cellpadding="0">
                                  <tr>
                                    <td><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="100" height="100" title="<?php echo $value['vLogin']?>" alt="<?php echo $value['vLogin']?>" border="0"></a></td>
                                  </tr>
                              </table></td>
                            </tr>
                        </table></td>
                      </tr>
                      <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>
                  </table></td>
                  <td width="86%" valign="top" class="box2"><table width="100%"  border="0" cellspacing="0" cellpadding="3">
                      <tr>
                        <td><table width="100%"  border="0" cellspacing="0" cellpadding="5">
                              <tr>
                                <td align="right"><table width="10%"  border="0" cellspacing="0" cellpadding="0">
                                                          <tr align="center">
                                                            <td><?php echo $objU->get_bgcheck_image($value['nUser_Id'])?></td>
                                                            <td><?php echo $objU->get_featured_image($value['nUser_Id'])?></td>
														 </tr>
                                  </table></td>
                              </tr>
                          </table>
						 <table width="100%"  border="0" cellspacing="0" cellpadding="3">
                            <tr>
                              <td width="56%" ><?php echo $value['vLogin']?></td>
                              <td width="40%" align="right" class="maintext"></td>
                              <td width="4%" align="center" class="maintext"><input type="checkbox" name="ids[]" value="<?php echo $value['nShortlist_Id']?>"></td>
                            </tr>
                          </table>
                            <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                              <tr>
                                <td><table width="100%"  border="0" cellspacing="0" cellpadding="2">
                                  <tr>
                                    <td width="15%" class="maintext"><strong><?php echo $value['vAge']?>-year-old <?php echo $value['vGender']?> </strong>&nbsp;&nbsp;Height : <?php echo $value['nHeight'] <> "" ? $objU->get_height($value['nHeight']) : "--"?><br>
                                      <strong>
                                          <?php echo ($value['vCounty']!='')?$value['vCounty'].",":"";?>
                                            <?php echo ($value['vState']!='')?$value['vState'].",":"";?>
                                            <?php echo $value['vCountry']?>
                                      </strong></td>
                                  </tr>
                                </table>
                                <table width="100%"  border="0" cellspacing="0" cellpadding="2">
                                    <tr>
                                      <td class="maintext"><?php echo $value['vTitle']?></td>
                                    </tr>
                                </table>
								</td>
                              </tr>
                            </table>
                            <table width="100%"  border="0" cellspacing="0" cellpadding="5">
                              <tr>
                                <td><table width="80%"  border="0" cellspacing="0" cellpadding="0">
                                    <tr>
									<?php if(isset($_SESSION['user_id']) && $_SESSION['user_id']!='')
										  {
									?>
                                      <td align="center"><a href="profile.php?id=<?php echo $value['nUser_Id']?>&EI=yes" class="button_stylenew marginr" title="Express Interest">Express Interest</a></td>
                                      <td align="center"><a href="profile.php?id=<?php echo $value['nUser_Id']?>&SM=yes" class="button_stylenew marginr" title="Send An Email">Send An Email</a></td>
                                  <!--<td><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></td>-->
                                      <td><a href="profile.php?id=<?php echo $value['nUser_Id']?>&ATF=yes" class="button_stylenew marginr" title="Add To IM List">Add To IM List</a></td>
									 <?php }//end if?>
                                      <td><a href="profile.php?id=<?php echo $value['nUser_Id']?>" class="button_stylenew2 r_float" title="View Full Profile">View Full Profile</a></td>
                                    </tr>
                                </table></td>
                              </tr>
                          </table>
						</td>
                      </tr>
                  </table></td>
                </tr>
            </table>
              <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td class="">&nbsp;</td>
                </tr>
              </table>
			<?php }//end foreach
				}//end if
 				if (!empty($data)) 
				{ 
			?>
							<table width="100%"  border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="78%">&nbsp;</td>
                        <td width="22%" align="right"><table width="8%"  border="0" cellspacing="2" cellpadding="0">
                          <tr align="center">
                            <td><input name="DEN" type="submit" class="loginbutton" value="Delete"><input type="hidden" name="page" value="<?php echo $page?>"></td>
                          </tr>
                        </table></td>
                      </tr>
                    </table>
			<?php }//end if
		       if ($pages <> "") 
			   {
		   ?>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="78%">&nbsp;</td>
                        <td width="22%"><table width="100%"  border="0" cellspacing="2" cellpadding="0">
                          <tr align="center" class="textbox">
                            <td class="pagenation"><?php echo $pages?></td>
                          </tr>
                        </table></td>
                      </tr>
                    </table>
 				<?php } ?></form>
		</td>
          </tr>
        </table></div></td><td width="1%">&nbsp; </td>
        <td width="28%" valign="top"><?php include_once ("left.inc.php");?></td>
      </tr>
    </table>      
      </td>
  </tr>
</table>
<?php include_once('bottomhtml.inc.php');?>
