<?php

	$getPage = $_GET['p'];
	$getName = file_get_contents("rr/productname.txt", true);
	$getHTML = file_get_contents("pages/$getPage/html.txt", true);
	$getLogo = file_get_contents("script/design.txt", true);
	
	$filename= "pages/$getPage/views.txt" ;
	$fd = fopen ($filename , "r") or die ("Can't open $filename") ;
	$fstring = fread ($fd , filesize ($filename)) ;
	fclose($fd) ;
	
	$fd = fopen ($filename , "w") or die ("Can't open $filename") ;
	$fcounted = $fstring + 1 ;
	$fout= fwrite ($fd , $fcounted ) ;
	fclose($fd) ;

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
<title><?php echo $getName; ?></title>
<style type="text/css">
<!--
-->
</style>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>

<body>

<div id="mainWrapper">

	<div id="headerLogoArea">
    	<img src="<?php echo "$getLogo"; ?>" />
    </div>
    
    <div id="contentWrapper">
    
    	<div id="shadowArea">
    			<img src="imgs/shadow.png" />    
        </div>
        
        <div id="contentHere">
        
        	<?php
			
				echo "$getHTML";
			
			?>
        
        </div>
        
    </div>
    
    <div id="footerArea">
    	<img src="imgs/footer.png" width="320" height="15" />
    </div>

</div>

</body>
</html>
