<?php
require_once ("../config.inc.php");
require_once ("../includes/adminlogincheck.inc.php");
require_once ("../includes/mysql.inc.php");
require_once ("../includes/arrays.inc.php");
require_once ("../classes/miscellaneous.class.php");

$page		= isset($_REQUEST['page'])	?	trim($_REQUEST['page'])	:	"1";
$id			= isset($_REQUEST['id'])	?	trim($_REQUEST['id'])	:	"0";
$message	= "";

if (!$objDB) {
	$message	= "Unable to Locate Database Server.";
} else {
	$objM		= new miscellaneous($objDB);
	if (isset($_POST['SaveNow'])) {
		if ($message == "") {
			header("Location: stories.php?page=$page");
			exit;
		}
	}
	$array	= $objM->get_success_story($id);
	$objM->set_success_story($array);
}

include_once('title.inc.php');
?>
<script language="javascript" type="text/javascript">
function validate()
{
	var frm	= document.frmUser;
}
</script>
<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">
    jQuery(document).ready(function($) {
      $('a[rel*=facebox]').facebox()
    })
  </script>
  <?php include_once('tophtml.php');?>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top" class="white"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="72%" valign="top">
			<table width="100%"  border="0" cellspacing="0" cellpadding="5">
          <tr>
            <td><table width="100%"  border="0" cellspacing="0" cellpadding="5">
              <tr>
                <td width="41%" class="headings1" colspan="2">View Success Story</td>
              </tr>
            </table>
			<div class="bordernew padding2">
				<form action="" method="post" enctype="multipart/form-data" name="frmUser" onSubmit="return validate();">
          <table width="100%"  border="0" cellspacing="0" cellpadding="5">
            <tr>
              <td><table width="100%"  border="0" cellspacing="1" cellpadding="0" class="listing_tbl_admin">
				<?php if ($objDB) 
					  { 
				?>
					<?php 	if(isset($message) && $message!='')
							{
					?>
                <tr align="left">
                  <td align="center" class="maintext2">&nbsp;</td>
                  <td colspan="2" class="maintext2 warning"><?php echo $message;?></td>
                  </tr>
					<?php  	}//end if?>
  				<tr align="left">
                  <th width="27%" class="maintext2">User (Login name)</th>
                  <th width="70%" class="maintext2"><?php echo htmlspecialchars($objM->vLogin)?></th>
  				</tr>
                 <tr align="left">
                  <td class="maintext2">Story Title</td>
                  <td class="maintext2"><?php echo htmlspecialchars($objM->vStory_Title)?></td>
                 </tr>
                <tr align="left">
                  <td class="maintext2">Story Content</td>
                  <td class="maintext2"><?php echo nl2br($objM->tStory)?></td>
                </tr>
                <tr align="left">
                  <td valign="top" class="maintext2">Story Image</td>
                  <td valign="top" class="maintext2"><a href="<?php echo $objM->vPicURL <> "" ? $siteTitle['site_normal_url'].STORY_IMAGE_URL."/".$objM->vPicURL : $siteTitle['site_normal_url'].STORY_IMAGE_URL."/nophoto_big.gif"?>" rel="facebox"><img src="<?php echo $objM->vPicURL <> "" ? $siteTitle['site_normal_url'].STORY_IMAGE_URL."/sthumb_".$objM->vPicURL : $siteTitle['site_normal_url'].STORY_IMAGE_URL."/nophoto_big.gif"?>" border="0"></a></td>
                </tr>
				<?php 			
						}//end first if
				?>
              </table>
                <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td align="right"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td>&nbsp;</td>
                      </tr>
                    </table>
                      <?php if ($objDB) 
					  { 
					?>
                      <table width="100%"  border="0" cellspacing="0" cellpadding="5">
                      <tr>
                        <td align="center"><table width="6%"  border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td><input name="SaveNow" type="submit" class="back-btn" value="Back"><input type="hidden" name="page" value="<?php echo $page?>">
                                      <input type="hidden" name="id" value="<?php echo $id?>"></td>
                              </tr>
                        </table></td>
                      </tr>
                    </table>
					<?php 		
						}//end first if
				?></td>
                  </tr>
                </table></td>
            </tr>
          </table></form>
			</div>
			</td>
          </tr>
        </table>
		</td>
        </tr>
    </table>      
    </td>
  </tr>
</table>
<?php include_once('bottomhtml.php');?>