<?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");

$id			= isset($_REQUEST['id'])	?	trim($_REQUEST['id'])	:	"0";
$message	= "";
if (!$objDB)
 {
	$message	= "Unable to Locate Database Server.";
 }
else
 {
	$objMisc = new miscellaneous($objDB);
	if (isset($_POST['BackNow']))
	{
		if ($message == "")
		 {
			header("Location: cms.php");
			exit;
		 }
	}
	else
	{
		$array	= $objMisc->get_cms($id);
		$objMisc->set_cms($array);
	}
}

include_once('title.inc.php');
?>
<?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 Page (Contents)</td>
              </tr>
            </table>
			<div class="bordernew padding2">
				<form name="frmUser" method="post" action="">
          <table width="100%"  border="0" cellspacing="0" cellpadding="5">
            <tr>
              <td><?php
//				  	echo "title=".$objMisc->vTitle;
//					echo "content=".$objMisc->tContent;
				  ?>
				  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
			  		<?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">
                  <td width="3%" class="maintext2">&nbsp;</td>
                  <td width="27%" class="maintext2">Page Title</td>
                  <td width="70%" class="maintext2">
				  
				  <?php echo htmlspecialchars($objMisc->vTitle)?></td>
  				</tr>
                 <tr align="left">
                  <td class="maintext2">&nbsp;</td>
                  <td valign="top" class="maintext2">Page Content</td>
                  <td valign="top" class="maintext2"><?php echo ($objMisc->tContent)?></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="5%"  border="0" cellspacing="0" cellpadding="0">
                            <tr>
							<input type="hidden" name="id" value="<?php echo $id?>">
									  <?php if ($id > 0) { ?>
									  <input name="vTitle" type="hidden" value="<?php echo htmlspecialchars($objMisc->vTitle)?>">
                              <td><input name="BackNow" type="submit" class="back-btn" value="Back"></td>
							  <?php } ?>
                              </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');?>