<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */
  require_once "C:/Users/Dani/Documents/xampp-win32-1.6.6a/xampp/htdocs/janizm/cmsAdmin/lib/viewer_functions.php";
  include_once "C:/Users/Dani/Documents/xampp-win32-1.6.6a/xampp/htdocs/dBug/dBug.php"; 
 
  list($contactRecords, $contactMetaData) = getRecords(array(
    'tableName'   => 'contact',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $contactRecord = @$contactRecords[0]; // get first record  
  // show error message if no matching record is found
  if (!$contactRecord) {
    print "Record not found!";
    exit;
  }

?>
<!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="keywords" content="<?php echo $contactRecord['metakeywords'] ?>" />
<meta name="description" content="<?php echo $contactRecord['metadescription'] ?>" />
<link href="css/janizm.css" rel="stylesheet" type="text/css" />
<title><?php echo $contactRecord['title'] ?></title>
</head>

<body>
	<div class="container">
       	<?php
		include("navigation/navigation.php");
		?>
        <div class="mainText">
            <?php echo $contactRecord['content'] ?>
		</div>
		<?php if(strlen(@$_REQUEST['frmEmailUs'])) { ?>
		<?php echo $contactRecord['sent_email'] ?>
    	<?php }else{ ?>
        <form class="frmEmailUs" name="frmEmailUs" method="post" action="sendemail.php">
            <input type="hidden" name="ArticleAction" value="doEmailUs" />
            <fieldset>
            <legend>Email Us</legend>
            <div class="left">
                <div class="formfield">
                    <label for="name"> Full name* :</label>
                    <div class="control">
                        <input class="width480px" name="name" type="text" id="name" value="" />
                    </div>
                </div>
                <div class="formfield">
                    <label for="email">Email address* : </label>
                    <div class="control">
                        <input class="width480px" name="email" id="email" type="text" value="" />
                    </div>
                </div>
            </div>
            <div class="right">
                <div class="formfield">
                    <label for="message">Your Message* :</label>
                    <div class="control">
                        <textarea class="width480px" id="message" name="message" rows="4" cols="2"></textarea>
                    </div>
                </div>
               	<div class="formfield submit">
                    <label for="submitbutton">&nbsp;</label>
                    <div class="control">
                        <input type="submit" id="submitbutton" class="submitbutton" name="btnSubmit" value="Submit" />
                    </div>
                </div>
            </div>
            </fieldset>
        </form>
		<?php } ?>
        <br class="clearBoth" />
    </div>
</body>
</html>
