
<h2>Gästebuch</h2>
<h3>Neue Einträge</h3>
<?php

# prints out the guestbook entries in descending order
# for this page
for($c = $this->data['start_at']; $c >= $this->data['stop_at']; $c--)
{
?>
    <h4 class='gb_header'><?php echo $this->data['guestbook'][$c]->name.' || '.$this->data['guestbook'][$c]->date ?></h4>
    <p class='gb_text'><?php echo nl2br($this->data['guestbook'][$c]->message) ?></p>
<?php
}

?>
<div class='gb_pager'>
<?php

# the newer and older links
if($this->data['newer']) {
?>
    <div class='gb_newer'>
        &lt; <a href='guestbook.php?page=<?php echo $this->data['newer'] ?>'>newer entries</a>
    </div>
<?php
}

if($this->data['older']) {
?>
    <div class='gb_older'>
        <a href='guestbook.php?page=<?php echo $this->data['older'] ?>'>older entries</a> &gt;
    </div>
<?php
}
?>
</div>

<h3>Ihren Eintrag Hinzufügen</h3>
<form action="guestbook.php" method="post" onsubmit="return CheckGuestbookFields();" id='guestbook_form'>
    <input type='hidden' name='cmd' value='add' />
    <label for='name'>
        Name
        <input type="text" size='30' name="name" id="name" value='<?php #echo $_POST['name'] ?>' />
    </label>
    <label for='message'>
        Nachricht
        <input type="hidden" name="captcha_random" value="<?php echo $this->data['captcha']->random() ?>" />
        <textarea rows="6" cols="41" name="message" id="message"><?php #echo $_POST['message']?></textarea>
    </label>
    <div id='captcha_div'>
        <?php echo $this->data['captcha']->image() ?>
    </div>
    <label for='captcha_password' class='wide'>
         Bitte gib den Text vom Bild ein
        <input type='text' name='captcha_password' id='captcha_password' />
    </label>
    <div>
        <input name="submit" type="submit" id="submit" value="Eintrag Hinzufügen" />
    </div>
</form>