<?php
  require ("vote.php");
?>
<html>
<meta http-equiv="content-type" content="text/html; charset=windows-1251">
  <title>New vote setting</title>
  <body bgcolor=#000000>
    <font color=#ffffff size=2 face=verdana>
    <?php
      if (($qn>9)||($qn<2))
        {
          echo("Error! Incorrect number. Must be >1 and <10.");
          die();
        }
      if ($qq=='')
        {
          echo("Error! No question specifed.");
          die();
        }
      $zz=array();
      array_push($zz,$qn);
      array_push($zz,$qq);
      array_push($zz,$ql1);
      array_push($zz,$ql2);
      if ($qn>2) array_push($zz,$ql3);
      if ($qn>3) array_push($zz,$ql4);
      if ($qn>4) array_push($zz,$ql5);
      if ($qn>5) array_push($zz,$ql6);
      if ($qn>6) array_push($zz,$ql7);
      if ($qn>7) array_push($zz,$ql8);
      if ($qn>8) array_push($zz,$ql9);
      for ($i=0;$i<$qn;$i++) array_push($zz,'0');
      for ($i=0;$i<count($zz);$i++) $zz[$i].=chr(13).chr(10);
      myflock();
      $f=fopen("votion.dat","w");
      for ($i=0;$i<count($zz);$i++) fputs($f,$zz[$i]);
      fclose($f);
      myfunlock();
      echo("New question have been added...");
    ?>
    </font>
  </body>
</html>
