<?php
require('includes/global.php');

if(isset($_POST['spawnrep'])) {
   $error = array();
   if(empty($_POST['slots'])) $error['slots'] = ERROR;
   
   if(empty($error)) {
      $ettvd->init();
      if($ettvd->spawn_replayer($_POST['slots'], $_POST['port'], $_POST['privslots'], $_POST['demo'], $_POST['config'])) {
         send('index.php');
      }
   } else {
      $tpl->assign('error', $error);
   }
}

$tpl->assign('area', 'Spawn Replayer');
$tpl->assign('body', $tpl->fetch('spawn_replayer.tpl'));
require('finish.php');
?>