<?

  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 '

';
  if ($_GET['id'])
  {
    if (!($result = mysql_query ('' . 'select * from categories WHERE id=' . $_GET['id'])))
    {
      exit ('Query failed');
      ;
    }

    $row = mysql_fetch_array ($result);
  }

  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_Edit_category;
  echo '</B></FONT> <FONT COLOR="red">';
  echo $row['name'];
  echo '</FONT></TD></TR><TR><TD VALIGN=top>

<FORM ACTION="categories.php" METHOD="post" enctype="multipart/form-data">


';
  echo $admin_Name;
  echo '<BR>
<textarea cols="40" rows="2" name="modified">';
  echo $row['name'];
  echo '</textarea>
<BR><br>

';
  echo $admin_Lock;
  echo ' <INPUT TYPE=radio NAME="protect" VALUE="on" ';
  if ($row['protect'] == 'on')
  {
    echo 'CHECKED';
  }

  echo '>';
  echo $admin_On;
  echo '<INPUT TYPE=radio NAME="protect" VALUE="off" ';
  if ($row['protect'] == 'off')
  {
    echo 'CHECKED';
  }

  echo '>';
  echo $admin_Off;
  echo '<BR><BR>
';
  echo $admin_Old_Image;
  echo '<br>
';
  if ($dir = @opendir ($documentroot . '/upload/cat_images'))
  {
    while ($file = readdir ($dir) !== false)
    {
      if (strstr ($file, $row['name']))
      {
        echo '	<IMG SRC="../../upload/cat_images/';
        echo $file;
        echo '" BORDER="0"><BR>
	<INPUT TYPE="hidden" NAME="Old_Image_Name" VALUE="';
        echo $file;
        echo '">
	';
        continue;
      }
    }

    closedir ($dir);
  }

  echo '<br>

';
  echo $admin_Replace_with_new;
  echo '<br>
<input type="file" name="image" size="50" accept="image/jpeg,image/gif"><br><br>


<INPUT TYPE=submit NAME="edit" VALUE="';
  echo $admin_Modify;
  echo '">
<INPUT TYPE=submit NAME="no" VALUE="';
  echo $admin_Go_back;
  echo '"><BR>
<INPUT TYPE=hidden NAME="id" VALUE="';
  echo $row['id'];
  echo '">
</FORM>

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