<?php
  $Type = $_GET['type'];
  if($Type == 'pieplot3d')
    $File = '../graphconf/pieplot3d.inc';
  if($Type == 'pie')
    $File = '../graphconf/pie.inc';
  if(!empty($_POST['Change']))
  {
    $Height = $_POST['height'];
    $Width  = $_POST['width'];
    $Str = "<?php\n";
    $Str .= "\$Height = {$Height};\n";
    $Str .= "\$Width = {$Width};\n";
    $Str .= "?>";
    SaveStringInFile($File, $Str, 'w');
    Refresh("graphic_jpgraph_pies&type={$Type}");
  }
  include_once($File);
  $OptStr = "<option value=50>50<option value=100>100<option value=150>150<option value=200>200<option value=250>250<option value=300>300<option value=350>350<option value=400>400<option value=450>450<option value=500>500<option value=550>550<option value=600>600<option value=650>650<option value=700>700<option value=750>750<option value=800>800<option value=850>850<option value=900>900<option value=950>950<option value=1000>1000";
  if($Type == 'pie')
    print "<h5>{$Heading_Pie}</h5>";
  if($Type == 'pieplot3d')
    print "<h5>{$Heading_PiePlot3d}</h5>";
  print "<form method=post action=''>";
  print "<fieldset class=VeryMiniField align=center>";
    print "<table class=General align=center border=0 cellspacing=0 cellpadding=0 width=75%>";
      print "<tr>";
        print "<td>{$Cpt_jpgraph_width}</td>";
        print "<td>";
          print "<select name=width>";
            $Tmp = str_replace("<option value={$Width}>{$Width}", "<option value={$Width} selected>{$Width}", $OptStr);
            print $Tmp;
          print "</select>";
        print "</td>";
        print "<td rowspan=2 align=center valign=middle><input class = ButtonSettings type=Submit name=Change value='{$Button_Change}'></td>";
      print "</tr>";
      print "<tr>";
        print "<td>{$Cpt_jpgraph_height}</td>";
        print "<td>";
          print "<select name=height>";
            $Tmp = str_replace("<option value={$Height}>{$Height}", "<option value={$Height} selected>{$Height}", $OptStr);
            print $Tmp;
          print "</select>";
        print "</td>";
      print "</tr>";
    print "</table>";
  print "</fieldset>";
  print "</form>";
?>