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

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

if (!$objDB) {
	$message	= "Unable to Locate Database Server.";
} else {
	$objC		= new check();
	$objU		= new userside($objDB);
	$objM		= new misc($objDB);
	$count		= $objM->get_story_count();
	$params 	= array(
		'mode'      => 'Sliding',
		'perPage'   => PAGESIZE, 
		'urlVar'    => 'page',
		'extraVars' => array(),
		'totalItems' => $count,
		'delta'		=> 7
	);
	$objP 		= & Pager::factory($params);
	if ($count > 0) {
		$data  		= $objM->get_story_page(($page-1)*PAGESIZE, PAGESIZE);
		$pages		= $objP->links;
	} else
		$message	= "No success stories found.<br>";		
	$script		= $objU->get_script($message);
	$message	= $objU->remove_script($message);
}
include_once ("title.inc.php");
include_once ("tophtml.inc.php");
?>
<link href="js/facebox.css" media="screen" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="js/jquery.js"></script>
<script src="js/facebox.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
    var $ = jQuery.noConflict();
    $(document).ready(function() {
      $('a[rel*=facebox]').facebox();
    });
  </script>
  
<div class="row">
	<div class="eight columns">
		<div class="search-rslts">
			<div class="row"><div class="inenr-hd"><h2>Success Stories</h2></div></div>
			<div class="row">
				<h2 class="headings2">Profile Images</h2>
			</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
 					      if (!empty($data)) 
						  { 
					  			foreach ($data as $key => $value) 
								{ 
					?>
					<div class="stories_outer">
						<div class="full_row">
							<div class="twelve columns" align="right">
								Posted by <b><?php echo stripslashes($value['vLogin'])?></b> on <?php echo date('m/d/Y',strtotime($value['dDay']))?>
							</div>
						</div>
						
						<div class="full_row">
							<div class="two columns">
								<a href="<?php echo $value['vPicURL']<>""?$siteSettings['site_normal_url'].STORY_IMAGE_URL.'/'.$value['vPicURL']:($value['vGender'] == "Male" ? $siteSettings['site_normal_url'].STORY_IMAGE_URL.'/'."nophotosuccess.gif" : $siteSettings['site_normal_url'].STORY_IMAGE_URL.'/'."nophotosuccess1.gif")?>" rel="facebox"><img src="<?php echo $value['vPicURL']<>""?$siteSettings['site_normal_url'].STORY_IMAGE_URL.'/'."sthumb_".$value['vPicURL']:($value['vGender'] == "Male" ? $siteSettings['site_normal_url'].STORY_IMAGE_URL.'/'."nophotosuccess.gif" : $siteSettings['site_normal_url'].STORY_IMAGE_URL.'/'."nophotosuccess1.gif")?>" width="100" height="100" border="0"></a>
							</div>
							<div class="ten columns">
								<div class="twelve columns">
									<h2 class="headings3"><?php echo htmlspecialchars(stripslashes($value['vStory_Title']))?></h2>
								</div>
								
								<div class="twelve columns">
								<?php echo nl2br(htmlspecialchars(stripslashes(strip_tags($value['tStory']))))?>
								</div>
							</div>							
						</div>
						
					</div>
					<?php 	}//end foreach
						}//end if
					?>
					
					
				</div>
				<?php if ($pages <> "") 
				{
				?>
				
				<div class="full_row pagenation"><?php echo $pages?></div>
				 <?php } ?>
			</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');?>
