<?php
  /**
   * Copyright 2011 Zazavi - http://www.zazavi.com
   * Zazavi is free software released under the terms of the GNU General Public License.
   * You should have received a copy of the license.  If not, see <http://www.gnu.org/licenses/>.
   */
  if (!defined("_VALID_PHP"))
      die('Direct access to this location is not allowed.');
	  
  require_once(ZAZAVILITE . "lib/class_forms.php");
  $form = new Forms();  
?>
<?php
  $frow = $form->getSingleForm($this->cform);
  if (isset($_POST['submit']))
      $form->sendForm($frow['id']);
?>
<?php if(!$frow):?>
<div class="msgAlert"><?php echo _FORM_ALERT2;?></div>
<?php else:?>
<div id="fullform" style="margin-top:10px" class="box">
  <h2><?php echo $frow['name'];?></h2>
<?php if (isset($_GET['sent']) && $_GET['sent'] == 1) print  "<div class=\"msgOk\"><?php echo _FORM_SENT;?></div>";?>
  <form action="" method="post" id="admin_form" name="admin_form">
    <table width="100%" border="0" cellpadding="3" cellspacing="1" id="master_form">
      <?php $form->drawForm($frow['id']);?>
	  <?php if($frow['captcha']):?>
        <tr>
          <td><strong><?php echo _CF_TOTAL;?>: <?php echo required();?></strong></td>
          <td><span class="inputwrap">
            <input name="code" type="text" class="inputbox required" id="code" title="<?php echo _CF_TOTAL_R;?>" size="5" maxlength="1" />
            </span></td>
        </tr>
    <?php endif;?>  
      <tr>
        <td colspan="2"><input id="submit" name="submit" value="<?php echo $frow['submit'];?>" type="submit" class="button" /></td>
      </tr>
    </table>
  </form>
</div>
<?php endif;?> 