                                                    
<?php
//-->-->-->-->-->-->-->-->-->-->-->-->
  $sLibraryPath = 'c:\\apache2\\htdocs\\ideas\\product-data\\lib\\';
  include "$sLibraryPath"."RETROVOX-CONSTANT-VARIABLES.php";
  include "$sLibraryPath"."fnRetrovoxStartHtml.php";
  include "$sLibraryPath"."fnDirectoryTreeHtmlSelect.php";

  $sSourceFileName = stripslashes($_GET['file']);  
  $sSourceFileNameEncoded = htmlspecialchars($sSourceFileName);

  if ($sSourceFileName != '')
  {
    $sDirectoryPath = dirname($sSourceFileName);
    $sDirectoryPathEncoded = htmlspecialchars($sDirectoryPath);
  }
  
  $sDirectoryTreeHtmlSelect = 
    fnDirectoryTreeHtmlSelect('c:\\apache2\\htdocs');

  $sTargetDirectoryTreeHtmlSelect =
    preg_replace("#name\s*=\s*'directory'#im", "name = 'target'", 
                  $sDirectoryTreeHtmlSelect); 
//--<--<--<--<--<--<--<--<--<--<--<--<  
?>

<?=fnRetrovoxStartHtml("File and Directory functions")?>
<big>Hints and instructions</big><br>
<ul>
  <li>You can type in a directory name and click copy or press enter
      and a list of files in the directory will be displayed. </li>
  <li>Begin directory paths with "/public_html/" for any file that 
      is viewable from a web-browser</li>
</ul>
  <form  action = "copy-file.php"  method = "get">
  <strong>Copy a file </strong><br>
  <input type = "text"  name = "old-name"  size = "70" 
        value = "<?=$sSourceFileNameEncoded?>"><br>
  <strong>To the new file name </strong><br>
  <input type = "text"  name = "new-name"  size = "70" 
        value = "<?=$sDirectoryPathEncoded?>"><br>
  <input type = "submit"  value = "copy">
  </form>

  <form  action = "rename-file.php"  method = "get">
  <strong>Rename a file </strong><br>
  <input type = "text"  name = "old-name"  size = "70" 
        value = "<?=$sSourceFileNameEncoded?>"><br>
  <strong>To the new file name </strong><br>
  <input type = "text"  name = "new-name"  size = "70" 
        value = "<?=$sDirectoryPathEncoded?>"><br>
  <input type = "submit"  value = "rename"> 
  </form>

  <form  action = "copy-directory.php"  method = "get">
  <strong><u>Copy all file in a directory</u></strong><br><br>
  <strong>Select the directory to copy</strong><br>
  <?= $sDirectoryTreeHtmlSelect ?><br>
  <strong>Select a directory to copy the files to</strong><br>
  <?= $sTargetDirectoryTreeHtmlSelect ?><br>
  <input type = "submit"  value = "copy files">
  </form>

  <form  action = "create-directory.php"  method = "get">
  <strong><u>Create a new directory</u></strong><br><br>
  <strong>Select a parent directory</strong><br>
  <?= $sDirectoryTreeHtmlSelect ?><br>
  <strong>Type a directory name</strong><br>
  <input type = "text"  name = "name"  size = "70" 
        value = "<?=?>"><br>
  <input type = "submit"  value = "create">
  </form>

  <!--
  <form  action = "chmod-file.php"  method = "get">
  chmod<br>
  <input type = "text"  name = "file-name"  value = "<?=$sSourceFileName?>"> to
  <input type = "text"  name = "chmod-mode"  value = "0755">
  <input type = "submit"  value = "change permissions">
  </form>
  <small>
  NOTE: the chmoding of files doesn't work very often because of
  various permissions problems</small>
  <br>
  -->
<? //phpinfo() ?>
</body>
</html>
                                                    