<?

  include_once '../../config.inc.php';
  if (!include '../autorization.php')
  {
    echo 'Access denied!';
    exit ();
  }

  if (!($result_proper = mysql_query ('select * from properties')))
  {
    exit ('<b>Error:</b>' . mysql_error ());
    ;
  }

  $proper = mysql_fetch_array ($result_proper);
  include '../lang/' . $proper['admin_language'];
  echo '<HTML><BODY STYLE="color: Navy;"><LINK HREF="../style.css" REL="stylesheet" TYPE="text/css"><TABLE WIDTH="600" BORDER=0 CELLSPACING=0 CELLPADDING=1><TR><TD style="background-color:#505090;"><TABLE WIDTH="100%" BORDER=0 CELLSPACING=0 CELLPADDING=5 BGCOLOR="#EFEFF8">
<TR><TD VALIGN=top BGCOLOR="#BFBFDF" STYLE="border-bottom: 1px solid #505090;"><FONT COLOR="navy"><B>';
  echo $admin_Add_Remove_Group;
  echo '</B></FONT></TD></TR><TR><TD VALIGN=top>

';
  echo '<S';
  echo 'CRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
function confirmSubmit(record) 
{
if (confirm("Are you sure you wish to delete group \\"" + record + "\\"?"))
	return true ;
else
	return false ;
}
//-->
</SCRIPT>




<FORM ACTION="';
  echo $php_self;
  echo '" METHOD="post">
';
  echo $admin_Width;
  echo '<INPUT TYPE=text NAME="Width">';
  echo $admin_Pixel;
  echo '<BR>
';
  echo $admin_Height;
  echo '<INPUT TYPE=text NAME="Height">';
  echo $admin_Pixel;
  echo '<BR><BR>
<INPUT TYPE=submit NAME="add" VALUE="';
  echo $admin_Add_Group;
  echo '">
</FORM>



';
  if ($_GET['delete'])
  {
    if (!(mysql_query ('' . 'DELETE FROM ban_group WHERE id=\'' . $_GET['delete'] . '\'')))
    {
      exit ('Query failed');
      ;
    }
  }

  echo '




';
  if ($_POST['add'])
  {
    if (($_POST['Width'] != '' AND $_POST['Height'] != ''))
    {
      $SQL = '' . 'select * from ban_group WHERE width=' . $_POST['Width'] . ' AND height=' . $_POST['Height'];
      if (!($result = mysql_query ($SQL)))
      {
        exit ('Query failed1');
        ;
      }

      $row = mysql_fetch_array ($result);
      if (!$row)
      {
        $SQL = '' . 'INSERT INTO ban_group VALUES(\'\',' . $_POST['Width'] . ',' . $_POST['Height'] . ')';
        if (!(mysql_query ($SQL)))
        {
          exit ('Query failed');
          ;
        }
      }
      else
      {
        echo '<S';
        echo 'CRIPT LANGUAGE="JavaScript" TYPE="text/javascript">alert("Group \\"';
        echo $_POST['Width'] . 'x' . $_POST['Height'];
        echo '\\" already exist!")</SCRIPT>';
      }
    }
  }

  echo '

<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=3>
<TR BGCOLOR="#505090">
<TD><FONT COLOR="#FFFFFF">';
  echo $admin_table4[0];
  echo '</FONT></TD>
<td><FONT COLOR="#FFFFFF">';
  echo $admin_table4[1];
  echo '</FONT></td>
</tr>

';
  if (!($result = mysql_query ('SELECT * FROM ban_group')))
  {
    exit ('Query failed4');
    ;
  }

  while ($row = mysql_fetch_array ($result))
  {
    echo '					<TR bgcolor="';
    if ($i % 2)
    {
      echo '#BFBFDF';
    }
    else
    {
      echo '#DCDCED';
    }

    echo '">
					<TD width=140>';
    echo $row['width'] . 'x' . $row['height'];
    echo '</TD>
					<TD ALIGN=center><A onclick="return confirmSubmit(\'';
    echo $row['width'] . 'x' . $row['height'];
    echo '\')" HREF="group.php?delete=';
    echo $row['id'];
    echo '"><IMG SRC="../images/delete.gif" ALT="Delete" BORDER=0></A></TD>
					</TR>
			';
  }

  echo '</TABLE>






</TD></TR></TABLE></TD></TR></TABLE></BODY></HTML>';
?>
