<?php
// one_line_find.php
// Find files webpage wise all in one inline arranged horizontal line
// RJM Programming
// February, 2026
// One line ls -clt https://www.rjmprogramming.com.au/*.txt via find $_SERVER['DOCUMENT_ROOT'] -type d -name '*' 

  $offdr='';
  $resis='';
  $offdrverbose='';
  $fifteen="15";
  $forty="50"; // 70
  $selbit='';
  $more='';
  if (isset($_GET['fsub'])) { $fifteen=str_replace('+',' ',urldecode($_GET['fsub'])); }
  if (isset($_POST['fsub'])) { $fifteen=str_replace('+',' ',urldecode($_POST['fsub'])); }


  if (isset($_GET['anyway']) || (!isset($_GET['offdr']) && !isset($_POST['offdr']))) {
    $extbit='*.txt';
    if (isset($_GET['extbit'])) { $extbit=str_replace('+',' ',urldecode($_GET['extbit'])); }
    if (isset($_POST['extbit'])) { $extbit=str_replace('+',' ',urldecode($_POST['extbit'])); }
     $extbit='*.[tjpmwag][xpnopaid][etgvf34]*';
    if (isset($_GET['offdr'])) {
     $offdr=str_replace('+',' ',urldecode($_GET['offdr']));
     $extbit='*.txt';
     if (isset($_GET['extbit'])) { $extbit=str_replace('+',' ',urldecode($_GET['extbit'])); }
     $extbit='*.[tjpmwag][xpnopaid][etgvf34]*';
     $more=" document.getElementById('offdr').value='" . $offdr . "';  document.getElementById('offdr').style.width='" . $fifteen . "px'; document.getElementById('fsub').name='fsub'; document.getElementById('fsub').click(); ";
    }
    $resis=str_replace($_SERVER['DOCUMENT_ROOT'],'',shell_exec('ls -lhgo ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $offdr . $extbit));
    if ($resis == '') {  $forty="15"; }
    if (file_exists('save_time.xxx')) {
        $offdrverbose=file_get_contents('save_time.xxx');
    } else {
        $offdrverbose=shell_exec("find " . $_SERVER['DOCUMENT_ROOT'] . " -type d -name '*'");
        file_put_contents('save_time.xxx', $offdrverbose);
    }
    $offds=explode("\n", $offdrverbose);
    $selbit="<select style=display:inline-block;background-color:#f0f0f0; onchange=document.getElementById(getfsub()).click(); id=offdr name=offdr></select>";
    for ($i=0; $i<sizeof($offds); $i++) {
      if (substr($offds[$i] . ' ',0,2) == '. ' || $i == 0) {
      if (strpos($offds[$i], $_SERVER['DOCUMENT_ROOT']) === false) {
        $offds[$i].=DIRECTORY_SEPARATOR;
      }
      $selbit=str_replace("</select>","<option value='" . str_replace($_SERVER['DOCUMENT_ROOT'],'',substr($offds[$i],0)) . "'>" . str_replace($_SERVER['DOCUMENT_ROOT'],'',substr($offds[$i],0)) . "</option></select>", $selbit);
      if ($i == 0) { sort($offds);  }
     } else if ($offds[$i] == $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR || $offds[$i] == $_SERVER['DOCUMENT_ROOT']) {
      $i=$i;
     } else if (substr($offds[$i] . ' ',0,2) == './') {
      $selbit=str_replace("</select>","<option value='" . str_replace($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR,'',substr($offds[$i],2)) . "'>" . str_replace($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR,'',substr($offds[$i],1)) . "</option></select>", $selbit);
     } else {
      $selbit=str_replace("</select>","<option value='" . str_replace($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR,'',substr($offds[$i],0)) . DIRECTORY_SEPARATOR . "'>" . str_replace($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR,'',substr($offds[$i],0)) . DIRECTORY_SEPARATOR . "</option></select>", $selbit);
     }
    }
  
  echo "<html>
<head>
<title>Folder listing relative to Document Root (brought to you by RJM Programming ... February, 2026)</title>
<style>
  #midtd { border-right: 2px dotted blue; border-top: 2px dotted blue;  border-bottom: 2px dotted blue; text-shadow:-1px 1px 1px #ff2d95;  }
  #lefttd { border-top: 2px dotted blue;  border-bottom: 2px dotted blue; text-shadow:-1px 1px 1px #ff2d95; }
  #extbit {  text-shadow:-1px 1px 1px #ff2d95; }
  #djc { overflow: hidden; }
</style>
<scr" . "ipt type=text/javascript>
  var fsub='fsub', wo=null, divelem=null, gtao=null, mytrih='', anyway='&anyway=y';
  var xtypes = ['audio/x-m4r','audio/wav','audio/x-wav','audio/x-pn-realaudio','audio/x-mpegurl','audio/x-aiff','audio/mpeg','audio/mid',
      'audio/basic','audio/ogg','video/x-sgi-movie','video/x-msvideo','video/quicktime','audio/mp3','video/mp4','video/mpeg',
      'video/x-la-asf','video/ogg','video/webm','audio/mp4', 'image/jpeg', 'image/jpeg', 'image/png', 'image/gif', 'image/bmp', 'image/tif',
      'text/html', 'text/html', 'text/html', 'text/javascript', 'text/css', 'text/plain', 'text/xml', 'text/csv',
      'application/vnd.ms-word', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/x-php', 'application/pdf', 'IMAGE/pdf',
      'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/vnd.ms-powerpoint',
      'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'];
  var xexts = ['.m4r','.wav','.wav','.ram','.m3u','.aiff','.mp3','.rmi',
      '.snd','.ogg','.movie','.avi','.mov','.mp3','.m4v','.mpeg',
      '.lsx','.ogv','.webm','.m4a', '.jpg', '.jpeg', '.png', '.gif', '.bmp', '.tif',
      '.htm', '.html', '.htmls', '.js', '.css', '.txt', '.xml', '.csv',
      '.doc', '.docx', '.php', '.pdf', '.pdf',
      '.pptx', '.ppt',
      '.xls', '.xlsx'];
  var myt='mytable';
  var theblank='_blank';
  var pos='bottom right';
  if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i) && 1 == 1) { anyway-='&anyway=y'; myt='mymediatr'; theblank='theblank'; pos='top left'; }


  function showit(ioi) {
     document.getElementById('mymediatr').innerHTML=mytrih;
     if (ioi.outerHTML.indexOf('<span') != -1) {
     outwo(ioi.getAttribute('data-href'));
     } else {
     outwo(ioi.href);
     }
  }

  function hideit(ioi) {
     document.getElementById('mymediatr').innerHTML=mytrih;
  }
  
  function hideitlater(ioi) {
     if (2 == 5) {
     setTimeout(function(){
     document.getElementById('mymediatr').innerHTML=mytrih;
     }, 15000);
     }
  }
   
  function outwo(inchk) {
    for (var iut=0; iut<xexts.length; iut++) {
      if ((inchk).toLowerCase().indexOf(xexts[iut]) != -1) {
        if (xtypes[iut].indexOf('pdf') != -1) {
          document.getElementById('mediatable').style.display='block';
    if (document.getElementById('mymediatr').innerHTML.indexOf((inchk)) == -1) {
          document.getElementById('mymediatr').innerHTML=mytrih;
          document.getElementById('mypdf').innerHTML='<object data=\"' + (inchk) + '\" type=\"application/pdf\"></object>';
    }
          return 'application/';
        } else if (xtypes[iut].indexOf('image/') != -1) {
          document.getElementById(myt).style.background='url(' + inchk + ')';
          document.getElementById(myt).style.backgroundSize='contain';
          document.getElementById(myt).style.backgroundRepeat='no-repeat';
          document.getElementById(myt).style.backgroundPosition=pos;
          if (document.getElementById('theblank')) { document.getElementById('mediatable').style.display='block'; document.getElementById('theblank').style.display='block'; document.getElementById('theblank').src=inchk; return 'IMAGE/';  }
          return '';
        } else if (xtypes[iut].indexOf('video/') != -1) {
          document.getElementById('mediatable').style.display='block';
    if (document.getElementById('mymediatr').innerHTML.indexOf((inchk)) == -1) {
          document.getElementById('mymediatr').innerHTML=mytrih;
          document.getElementById('myvideo').innerHTML='<video controls><source type=\"' + xtypes[iut] + '\" src=\"' + (inchk) + '\"></source></video>';
    }
          return 'video/';
        } else if (xtypes[iut].indexOf('audio/') != -1) {
          document.getElementById('mediatable').style.display='block';
    if (document.getElementById('mymediatr').innerHTML.indexOf((inchk)) == -1) {
          document.getElementById('mymediatr').innerHTML=mytrih;
          document.getElementById('myaudio').innerHTML='<audio controls><source type=\"' + xtypes[iut] + '\" src=\"' + (inchk) + '\"></source></audio>';
    }
          return 'audio/';
        }
      }
    } 
          document.getElementById('mediatable').style.display='block';
    document.getElementById('mymediatr').innerHTML=mytrih;
    document.getElementById('mytext').innerHTML='<iframe frameborder=0 style=width:100%;height:1600px; src=\"' + (inchk) + '\"></iframe>';
    return '';
  }
  
  function getfsub() {
    document.getElementById('offdr').style.width='' + document.getElementById('fsub').value + 'px';
    return 'fsub';
  }
  
function resizeSelect(sel) { // thanks to https://www.google.com/search?q=make+select+element+width+in+sympathy+with+length+of+its+value&rlz=1C5OZZY_en&oq=make+select+element+width+in+sympathy+with+length+of+its+value&gs_lcrp=EgZjaHJvbWUyBggAEEUYOdIBCTI3MzEzajBqNKgCALACAQ&sourceid=chrome&ie=UTF-8
  // 1. Create a temporary span to measure text width
  var tempSpan = document.createElement('span');
  tempSpan.style.visibility = 'hidden';
  tempSpan.style.position = 'absolute';
  tempSpan.style.whiteSpace = 'pre';
  // 2. Set font styles to match the select box
  tempSpan.style.font = window.getComputedStyle(sel).font;
  // 3. Set content to selected text
  tempSpan.innerText = sel.options[sel.selectedIndex].text;
  document.body.appendChild(tempSpan);
  
  // 4. Update width (with extra space for the dropdown arrow)
  sel.style.width = (tempSpan.offsetWidth + 30) + 'px';
  document.body.removeChild(tempSpan);
}

  function getid(ofw) {
    return document.getElementById(ofw).innerHTML;
  }
  
  function wbt(tao) {
    //alert(tao.value);
    if (tao) {
     if (!divelem) {
     gtao=tao;
     //document.getElementById('helpout').style.backgroundColor='yellow';
     //document.getElementById('dcont').style.backgroundColor='yellow';
     if (tao.value.trim() != '') {
     divelem = document.getElementById('djc');
     gtao=tao;
     var recto = tao.getBoundingClientRect();
     if (divelem) { // thanks to ideas off http://stackoverflow.com/questions/12266320/copy-div-content-to-textarea-or-text-with-the-same-font-family-style
      divelem.style.display='block'; //'flex';
    //divelem.style.alignItems='flex-end';
      divelem.style.overflowY='scroll';
      //divelem.style.flexFlow='column nowrap';
      divelem.style.flexDirection='column-reverse';
      divelem.style.fontFamily = 'Courier-New'; //window.getComputedStyle(tao,null).fontFamily || tao.style.fontFamily || tao.currentStyle.getCurrentProperty('font-family');
      divelem.style.fontSize = window.getComputedStyle(tao,null).fontSize || tao.style.fontSize || tao.currentStyle.getCurrentProperty('font-size');
      divelem.style.border = window.getComputedStyle(tao,null).border || tao.style.border || tao.currentStyle.getCurrentProperty('border');
      divelem.style.padding = window.getComputedStyle(tao,null).padding || tao.style.padding || tao.currentStyle.getCurrentProperty('padding');
      divelem.style.margin = window.getComputedStyle(tao,null).margin || tao.style.margin || tao.currentStyle.getCurrentProperty('margin');
      divelem.style.overflowX = 'hidden'; //window.getComputedStyle(tao,null).overflow || tao.style.overflow || tao.currentStyle.getCurrentProperty('overflow');
      divelem.style.position='absolute';
      divelem.style.left='' + recto.left + 'px';
      divelem.style.width='' + eval(-20 + recto.width) + 'px';
      divelem.style.height='' + recto.height + 'px';
      divelem.style.top='' + eval(-4 + recto.top) + 'px';
      //alert('' + recto.top + ' ' + recto.height + ' ' + ' ... ' + 'eval(-4 + recto.top + recto.height)=' + eval(-4 + recto.top + recto.height));
      //divelem.style.bottom='' + eval(-4 + recto.top + recto.height) + 'px';
      divelem.style.zIndex='999';
      //divelem.scrollTop=divelem.scrollHeight;
      //setTimeout(function(){ divelem.scrollTop=divelem.scrollHeight; }, 4000);
      tao.style.color='transparent';
      //var contis=massage(tao.value);
      //alert(contis);
      //while (contis.indexOf(String.fromCharCode(10)) != -1) {
      //  contis=contis.replace(String.fromCharCode(10), '<br>');
      //}
      //alert(contis);
      //divelem.innerHTML=contis;
     }
     }
     var taovalue=tao.value.replace(/\</g,'&lt;').replace(/\>/g,'&gt;');
     while (taovalue.indexOf(String.fromCharCode(10)) != -1) {
      taovalue=taovalue.replace(String.fromCharCode(10),'<br>');
     }
     document.getElementById('djc').innerHTML='<div id=indiv title=\"Report\" style=\"white-space:pre;text-shadow:-0.5px 0.5px 0.5px #ff0000;background: linear-gradient(to right, #e0eafc, #ffffff);\">' + massage(taovalue) + '</div>';
     var sps=document.getElementsByTagName('span');
     for (var isps=0; isps<sps.length; isps++) {
       if (('' + sps[isps].className) == 'sed') {
         //sps[isps].setAttribute('data-oit', encodeURIComponent(sps[isps].innerText.toHtmlEntities()).replace(/\%0A$/g,''));
         if (sps[isps].innerHTML.indexOf('   ') == 0) { 
           sps[isps].innerHTML=sps[isps].innerHTML.replace('   ','&nbsp;&nbsp;&nbsp;'); 
           //sps[isps].setAttribute('data-oit', encodeURIComponent(sps[isps].innerText.replace('   ','&nbsp;&nbsp;&nbsp;')).replace(/\%0A$/g,''));
           sps[isps].setAttribute('data-oit', encodeURIComponent(sps[isps].innerHTML).replace(/\%0A$/g,''));
         } else {
           sps[isps].setAttribute('data-oit', encodeURIComponent(sps[isps].innerText.toHtmlEntities()).replace(/\%0A$/g,''));
         }
       }
     }
     }
    }
    return '';
  }
  
  function onl() {
     if (window.opener) {
     document.getElementById('lefttd').innerHTML=window.opener.getid('lefttd');
     document.getElementById('midtd').innerHTML=window.opener.getid('midtd');
     } else {
    document.getElementById('lefttd').innerHTML=\"<span title='&lt;-- Folder listing relative to Document Root (brought to you by RJM Programming ... February, 2026) of ...' id=prefix>\" + document.URL.substring(0,8) + document.URL.substring(8).split('/')[0] + \"/</span>" . $selbit . "\";
    document.getElementById('midtd').innerHTML=\"<input style=width:210px; type=text id=extbit name=extbit value='" . $extbit . "' readonly disabled></input>\";
     }
    document.getElementById('fsub').value='' + document.getElementById('offdr').getBoundingClientRect().width;
    document.getElementById('fsub').name='fsub';
    document.getElementById('offdr').style.width='15px';
    document.getElementById('jc').title=\"" . str_replace("\n","\" + String.fromCharCode(10) + \"",str_replace($_SERVER['DOCUMENT_ROOT'],'',$resis)) . "\"; 
    resizeSelect(document.getElementById('offdr'));
    if (('' + top.document.URL).indexOf('/ITblog') != -1) {
      document.getElementById('myform').target='_top';
      document.getElementById('myform').method='GET';
    }
    " . $more . "
    wbt(document.getElementById('jc'));  
  }
  
  function rez(ota) {
     if (divelem && ota == gtao) { // thanks to ideas off http://stackoverflow.com/questions/12266320/copy-div-content-to-textarea-or-text-with-the-same-font-family-style
//alert(1);
      var recto = gtao.getBoundingClientRect();
      var jrecto = document.getElementById('jcont').getBoundingClientRect();
      var drecto = document.getElementById('dcont').getBoundingClientRect();
//alert(12);
//alert(31);
      if (eval('' + recto.width) > eval('' + drecto.width)) {
//alert(31);
        document.getElementById('dcont').style.width='' + eval(30 + eval('' + recto.width)) + 'px';
      }
       if (eval('' + recto.height) > eval('' + drecto.height)) {
//alert(31);
        document.getElementById('dcont').style.height='' + eval(30 + eval('' + recto.height)) + 'px';
      }
      if (eval('' + recto.width) > eval('' + jrecto.width)) {
//alert(41);
        document.getElementById('jcont').style.width='' + eval(20 + eval('' + recto.width)) + 'px';
      }
      if (eval('' + recto.height) > eval('' + jrecto.height)) {
//alert(41);
        document.getElementById('jcont').style.height='' + eval(20 + eval('' + recto.height)) + 'px';
      }
      divelem.style.left='' + recto.left + 'px';
//alert(41);
      divelem.style.width='' + eval(-20 + recto.width) + 'px';
//alert(51);
      divelem.style.height='' + recto.height + 'px';
//alert(61);
      //divelem.style.top='' + eval(-4 + recto.top) + 'px';
      //divelem.style.bottom='' + eval(-4 + recto.top + recto.height) + 'px';
      divelem.style.zIndex='999';
      divelem.sty.e.whitespace='pre';
//alert(71);
      gtao.style.color='transparent';
//alert(81);
     }
  }
  
  
  function massage(tv) {
    var tscnt=0, itv=0, ihis='', uids=[];
    var tlls=tv.split('<br>');
    for (itv=eval(-1 + tlls.length); itv>=0; itv--) {
      if (tlls[itv].indexOf(' /') != -1) {
       uids=tlls[itv].split(' /');
       ihis=tlls[itv].replace(tlls[itv].split(' /')[0] + ' ','');
       if (eval('' + uids.length) == 3) {
       if (outwo('/' + uids[2]) == 'IMAGE/' && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i) && 1 == 1) {  
              tv=tv.replace(tlls[itv].split(' /')[0] + ' ' + ihis, tlls[itv].split(' /')[0] + '&#9;<span title=\"\" style=text-decoration:underline; onmouseover=showit(this); onmouseout=hideit(this); ontouchmove=showit(this); ontouchend=hideitlater(this); href=# data-href=\"/' + uids[2] + '\">' + ihis.split('%20-')[0].split(' -')[0] + '</span>');
       } else {
              tv=tv.replace(tlls[itv].split(' /')[0] + ' ' + ihis, tlls[itv].split(' /')[0] + '&#9;<a title=\"\" target=_blank onmouseover=showit(this); onmouseout=hideit(this); ontouchmove=showit(this); ontouchend=hideitlater(this) href=\"/' + uids[2] + '\">' + ihis.split('%20-')[0].split(' -')[0] + '</a>');
       }
       } else {
       if (outwo(ihis.split('%20-')[0].split(' -')[0]) == 'IMAGE/' && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i) && 1 == 1) {  
              tv=tv.replace(tlls[itv].split(' /')[0] + ' ' + ihis, tlls[itv].split(' /')[0] + '&#9;<span title=\"\" style=text-decoration:underline; onmouseover=showit(this); onmouseout=hideit(this); ontouchmove=showit(this); ontouchend=hideitlater(this); href=# data-href=\"' + ihis.split('%20-')[0].split(' -')[0] + '\">' + ihis.split('%20-')[0].split(' -')[0] + '</span>');
       } else {
              tv=tv.replace(tlls[itv].split(' /')[0] + ' ' + ihis, tlls[itv].split(' /')[0] + '&#9;<a title=\"\" target=_blank onmouseover=showit(this); onmouseout=hideit(this); ontouchmove=showit(this); ontouchend=hideitlater(this); href=\"' + ihis.split('%20-')[0].split(' -')[0] + '\">' + ihis.split('%20-')[0].split(' -')[0] + '</a>');
       }
       }
      }
    }
    setInterval(function(){ var onerect=document.getElementById('djc').getBoundingClientRect(), tworect=document.getElementById('jc').getBoundingClientRect();   if (Math.abs(eval(eval(('' + onerect.height) - eval('' + tworect.height)))) > 20) {  document.getElementById('djc').style.height='' + tworect.height + 'px';  document.getElementById('djc').style.width='' + eval(-20 + tworect.width) + 'px'; } }, 6000);
    return tv;
  }
  
  function mobit(inid) {
    if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i) && 1 == 1) {  
      document.getElementById('myimg').innerHTML='<iframe frameborder=0 name=theblank id=theblank style=display:none;height:1600px; src=/About_Us.html></iframe>';
      myt='mymediatr'; 
      theblank='theblank'; 
    }
    return inid;
  }

</scr" . "ipt>
</head>
<body id=xbody onload=\"mytrih=document.getElementById(mobit('mymediatr')).innerHTML; onl();\" title='Folder listing (brought to you by RJM Programming ... February, 2026)'>
<form id=myform onsubmit=\"if (('' + this.method).toUpperCase() == 'GET') {   wo=window.open(this.action + '?offdr=' + encodeURIComponent(document.getElementById('offdr').value) + '&fsub=' + encodeURIComponent(document.getElementById('fsub').value) + '&extbit=' + encodeURIComponent(document.getElementById('extbit').value) + anyway, '_blank', 'top=200,left=0,width=' + screen.width + ',height=150');  document.getElementById('offdr').value='';  document.getElementById('offdr').style.width='15px'; return false;  } else {  document.getElementById('myform').style.display='none'; document.getElementById('myif').style.display='block'; return true; } \" method=POST target=myif action='./one_line_find.php'>
<table id=mytable style=width:100%;>
<tr id=mytr><td id=righttd style=width:" . $forty . "%;><textarea style=width:100%;background-color:yellow; placeholder='Folder listing of ...' rows=1 cols=120 id=jc>" . $resis . "</textarea><div title='Folder listing of ...' id=djc onmousemove=rez(this);></div></td><td id=lefttd style=text-align:right;vertical-align:top;></td><td id=midtd style=vertical-align:top;></td></tr>
</table>
<input type=submit style=display:none; id=fsub value=" . $fifteen . "></input>
</form>
<iframe scrolling=yes frameborder=0 name=myif id=myif src=/About_Us.html style=display:none;width:100%;height:80px;overflow-y:visible;></iframe>
<table id=mediatable style=width:100%;display:none;height:800px;>
<tr id=mymediatr><td id=myvideo></td><td id=myaudio></td><td id=mypdf></td><td id=mytext></td><td id=myimg></td></tr>
</table>
</body>
</html>";
    exit;
  } else if (isset($_GET['offdr'])) {
    $offdr=str_replace('+',' ',urldecode($_GET['offdr']));
    $extbit='*.txt';
    if (isset($_GET['extbit'])) { $extbit=str_replace('+',' ',urldecode($_GET['extbit'])); }
     $extbit='*.[tjpmwag][xpnopaid][etgvf34]*';
    $resis=str_replace($_SERVER['DOCUMENT_ROOT'],'',shell_exec('ls -lhgo ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $offdr . $extbit));
    if ($resis == '') {  $forty="15"; }
  } else {
    $offdr=str_replace('+',' ',urldecode($_POST['offdr']));
    $extbit='*.txt';
    if (isset($_POST['extbit'])) { $extbit=str_replace('+',' ',urldecode($_POST['extbit'])); }
     $extbit='*.[tjpmwag][xpnopaid][etgvf34]*';
    $resis=str_replace($_SERVER['DOCUMENT_ROOT'],'',shell_exec('ls -lhgo ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $offdr . $extbit));
    if ($resis == '') {  $forty="15"; }
  }
  
  echo "<html>
<head>
<title>Folder listing Relative to Document Root (brought to you by RJM Programming ... February, 2026)</title>
<style>
  #midtd { border-right: 2px dotted blue; border-top: 2px dotted blue;  border-bottom: 2px dotted blue; text-shadow:-1px 1px 1px #ff2d95;  }
  #lefttd { border-top: 2px dotted blue;  border-bottom: 2px dotted blue; text-shadow:-1px 1px 1px #ff2d95; }
  #extbit {  text-shadow:-1px 1px 1px #ff2d95; }
  #djc { overflow: hidden; }
</style>
<scr" . "ipt type=text/javascript>
  var fsub='fsub', divelem=null, gtao=null, mytrih='', anyway='&anyway=y';
  var xtypes = ['audio/x-m4r','audio/wav','audio/x-wav','audio/x-pn-realaudio','audio/x-mpegurl','audio/x-aiff','audio/mpeg','audio/mid',
      'audio/basic','audio/ogg','video/x-sgi-movie','video/x-msvideo','video/quicktime','audio/mp3','video/mp4','video/mpeg',
      'video/x-la-asf','video/ogg','video/webm','audio/mp4', 'image/jpeg', 'image/jpeg', 'image/png', 'image/gif', 'image/bmp', 'image/tif',
      'text/html', 'text/html', 'text/html', 'text/javascript', 'text/css', 'text/plain', 'text/xml', 'text/csv',
      'application/vnd.ms-word', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/x-php', 'application/pdf', 'IMAGE/pdf',
      'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/vnd.ms-powerpoint',
      'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'];
  var xexts = ['.m4r','.wav','.wav','.ram','.m3u','.aiff','.mp3','.rmi',
      '.snd','.ogg','.movie','.avi','.mov','.mp3','.m4v','.mpeg',
      '.lsx','.ogv','.webm','.m4a', '.jpg', '.jpeg', '.png', '.gif', '.bmp', '.tif',
      '.htm', '.html', '.htmls', '.js', '.css', '.txt', '.xml', '.csv',
      '.doc', '.docx', '.php', '.pdf', '.pdf',
      '.pptx', '.ppt',
      '.xls', '.xlsx'];
  var myt='mytable';
  var theblank='_blank';
  var pos='bottom right';
  if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i) && 1 == 1) {  myt='mymediatr'; theblank='theblank'; pos='top left'; }


  function showit(ioi) {
     document.getElementById('mymediatr').innerHTML=mytrih;
     if (ioi.outerHTML.indexOf('<span') != -1) {
     outwo(ioi.getAttribute('data-href'));
     } else {
     outwo(ioi.href);
     }
  }

  function hideit(ioi) {
     document.getElementById('mymediatr').innerHTML=mytrih;
  }
  
  function hideitlater(ioi) {
     if (2 == 5) {
     setTimeout(function(){
     document.getElementById('mymediatr').innerHTML=mytrih;
     }, 15000);
     }
  }
   
   
  function outwo(inchk) {
    for (var iut=0; iut<xexts.length; iut++) {
      if ((inchk).toLowerCase().indexOf(xexts[iut]) != -1) {
        if (xtypes[iut].indexOf('pdf') != -1) {
          document.getElementById('mediatable').style.display='block';
    if (document.getElementById('mymediatr').innerHTML.indexOf((inchk)) == -1) {
          document.getElementById('mymediatr').innerHTML=mytrih;
          document.getElementById('mypdf').innerHTML='<object data=\"' + (inchk) + '\" type=\"application/pdf\"></object>';
    }
          return 'application/';
        } else if (xtypes[iut].indexOf('image/') != -1) {
          document.getElementById(myt).style.background='url(' + inchk + ')';
          document.getElementById(myt).style.backgroundSize='contain';
          document.getElementById(myt).style.backgroundRepeat='no-repeat';
          document.getElementById(myt).style.backgroundPosition=pos;
          if (document.getElementById('theblank')) { document.getElementById('mediatable').style.display='block'; document.getElementById('theblank').style.display='block'; document.getElementById('theblank').src=inchk; return 'IMAGE/';  }
          return '';
        } else if (xtypes[iut].indexOf('video/') != -1) {
          document.getElementById('mediatable').style.display='block';
    if (document.getElementById('mymediatr').innerHTML.indexOf((inchk)) == -1) {
          document.getElementById('mymediatr').innerHTML=mytrih;
          document.getElementById('myvideo').innerHTML='<video controls><source type=\"' + xtypes[iut] + '\" src=\"' + (inchk) + '\"></source></video>';
    }
          return 'video/';
        } else if (xtypes[iut].indexOf('audio/') != -1) {
          document.getElementById('mediatable').style.display='block';
    if (document.getElementById('mymediatr').innerHTML.indexOf((inchk)) == -1) {
          document.getElementById('mymediatr').innerHTML=mytrih;
          document.getElementById('myaudio').innerHTML='<audio controls><source type=\"' + xtypes[iut] + '\" src=\"' + (inchk) + '\"></source></audio>';
    }
          return 'audio/';
        }
      }
    } 
          document.getElementById('mediatable').style.display='block';
    document.getElementById('mymediatr').innerHTML=mytrih;
    document.getElementById('mytext').innerHTML='<iframe frameborder=0 style=width:100%;height:1600px; src=\"' + (inchk) + '\"></iframe>';
    return '';
  }
  
  function getfsub() {
    document.getElementById('offdr').style.width='300px';
    return 'fsub';
  }

  function getid(ofw) {
    return document.getElementById(ofw).innerHTML;
  }
  
  function wbt(tao) {
    //alert(tao.value);
    if (tao) {
     if (!divelem) {
     gtao=tao;
     //document.getElementById('helpout').style.backgroundColor='yellow';
     //document.getElementById('dcont').style.backgroundColor='yellow';
     if (tao.value.trim() != '') {
     divelem = document.getElementById('djc');
     gtao=tao;
     var recto = tao.getBoundingClientRect();
     if (divelem) { // thanks to ideas off http://stackoverflow.com/questions/12266320/copy-div-content-to-textarea-or-text-with-the-same-font-family-style
      divelem.style.display='block'; //'flex';
    //divelem.style.alignItems='flex-end';
      divelem.style.overflowY='scroll';
      //divelem.style.flexFlow='column nowrap';
      divelem.style.flexDirection='column-reverse';
      divelem.style.fontFamily = 'Courier-New'; //window.getComputedStyle(tao,null).fontFamily || tao.style.fontFamily || tao.currentStyle.getCurrentProperty('font-family');
      divelem.style.fontSize = window.getComputedStyle(tao,null).fontSize || tao.style.fontSize || tao.currentStyle.getCurrentProperty('font-size');
      divelem.style.border = window.getComputedStyle(tao,null).border || tao.style.border || tao.currentStyle.getCurrentProperty('border');
      divelem.style.padding = window.getComputedStyle(tao,null).padding || tao.style.padding || tao.currentStyle.getCurrentProperty('padding');
      divelem.style.margin = window.getComputedStyle(tao,null).margin || tao.style.margin || tao.currentStyle.getCurrentProperty('margin');
      divelem.style.overflowX = 'hidden'; //window.getComputedStyle(tao,null).overflow || tao.style.overflow || tao.currentStyle.getCurrentProperty('overflow');
      divelem.style.position='absolute';
      divelem.style.left='' + recto.left + 'px';
      divelem.style.width='' + eval(-20 + recto.width) + 'px';
      divelem.style.height='' + recto.height + 'px';
      divelem.style.top='' + eval(-4 + recto.top) + 'px';
      //alert('' + recto.top + ' ' + recto.height + ' ' + ' ... ' + 'eval(-4 + recto.top + recto.height)=' + eval(-4 + recto.top + recto.height));
      //divelem.style.bottom='' + eval(-4 + recto.top + recto.height) + 'px';
      divelem.style.zIndex='999';
      divelem.style.whiteSpace='pre';
      //divelem.scrollTop=divelem.scrollHeight;
      //setTimeout(function(){ divelem.scrollTop=divelem.scrollHeight; }, 4000);
      tao.style.color='transparent';
      //var contis=massage(tao.value);
      //alert(contis);
      //while (contis.indexOf(String.fromCharCode(10)) != -1) {
      //  contis=contis.replace(String.fromCharCode(10), '<br>');
      //}
      //alert(contis);
      //divelem.innerHTML=contis;
     }
     }
     var taovalue=tao.value.replace(/\</g,'&lt;').replace(/\>/g,'&gt;');
     while (taovalue.indexOf(String.fromCharCode(10)) != -1) {
      taovalue=taovalue.replace(String.fromCharCode(10),'<br>');
     }
     document.getElementById('djc').innerHTML='<div id=indiv title=\"Report\" style=\"white-space:pre;text-shadow:-0.5px 0.5px 0.5px #ff0000;background: linear-gradient(to right, #e0eafc, #ffffff);\">' + massage(taovalue) + '</div>';
     var sps=document.getElementsByTagName('span');
     for (var isps=0; isps<sps.length; isps++) {
       if (('' + sps[isps].className) == 'sed') {
         //sps[isps].setAttribute('data-oit', encodeURIComponent(sps[isps].innerText.toHtmlEntities()).replace(/\%0A$/g,''));
         if (sps[isps].innerHTML.indexOf('   ') == 0) { 
           sps[isps].innerHTML=sps[isps].innerHTML.replace('   ','&nbsp;&nbsp;&nbsp;'); 
           //sps[isps].setAttribute('data-oit', encodeURIComponent(sps[isps].innerText.replace('   ','&nbsp;&nbsp;&nbsp;')).replace(/\%0A$/g,''));
           sps[isps].setAttribute('data-oit', encodeURIComponent(sps[isps].innerHTML).replace(/\%0A$/g,''));
         } else {
           sps[isps].setAttribute('data-oit', encodeURIComponent(sps[isps].innerText.toHtmlEntities()).replace(/\%0A$/g,''));
         }
       }
     }
     }
    }
    return '';
  }
  
 
function resizeSelect(sel) { // thanks to https://www.google.com/search?q=make+select+element+width+in+sympathy+with+length+of+its+value&rlz=1C5OZZY_en&oq=make+select+element+width+in+sympathy+with+length+of+its+value&gs_lcrp=EgZjaHJvbWUyBggAEEUYOdIBCTI3MzEzajBqNKgCALACAQ&sourceid=chrome&ie=UTF-8
  // 1. Create a temporary span to measure text width
  var tempSpan = document.createElement('span');
  tempSpan.style.visibility = 'hidden';
  tempSpan.style.position = 'absolute';
  tempSpan.style.whiteSpace = 'pre';
  // 2. Set font styles to match the select box
  tempSpan.style.font = window.getComputedStyle(sel).font;
  // 3. Set content to selected text
  tempSpan.innerText = sel.options[sel.selectedIndex].text;
  document.body.appendChild(tempSpan);
  
  // 4. Update width (with extra space for the dropdown arrow)
  sel.style.width = (tempSpan.offsetWidth + 30) + 'px';
  document.body.removeChild(tempSpan);
}

  function leftize() {
  //alert(8);
     if (window.opener) {
  //alert(84);
     document.getElementById('lefttd').innerHTML=window.opener.getid('lefttd');
  //alert(document.getElementById('lefttd').innerHTML);
     document.getElementById('midtd').innerHTML=window.opener.getid('midtd');
  //alert(document.getElementById('midtd').innerHTML);
     } else {
  //alert(80);
     document.getElementById('lefttd').innerHTML=parent.document.getElementById('lefttd').innerHTML;
     document.getElementById('midtd').innerHTML=parent.document.getElementById('midtd').innerHTML;
     }
     document.getElementById('offdr').value='" . $offdr . "'; 
     document.getElementById('offdr').style.width='" . $fifteen . "px';
     document.getElementById('fsub').name='fsub';
     document.getElementById('jc').title=\"" . str_replace("\n","\" + String.fromCharCode(10) + \"",str_replace($_SERVER['DOCUMENT_ROOT'],'',$resis)) . "\"; 
     resizeSelect(document.getElementById('offdr'));
     " . $more . "
     wbt(document.getElementById('jc'));  
  }
  
  function rez(ota) {
     if (divelem && ota == gtao) { // thanks to ideas off http://stackoverflow.com/questions/12266320/copy-div-content-to-textarea-or-text-with-the-same-font-family-style
//alert(1);
      var recto = gtao.getBoundingClientRect();
      var jrecto = document.getElementById('jcont').getBoundingClientRect();
      var drecto = document.getElementById('dcont').getBoundingClientRect();
//alert(12);
//alert(31);
      if (eval('' + recto.width) > eval('' + drecto.width)) {
//alert(31);
        document.getElementById('dcont').style.width='' + eval(30 + eval('' + recto.width)) + 'px';
      }
       if (eval('' + recto.height) > eval('' + drecto.height)) {
//alert(31);
        document.getElementById('dcont').style.height='' + eval(30 + eval('' + recto.height)) + 'px';
      }
      if (eval('' + recto.width) > eval('' + jrecto.width)) {
//alert(41);
        document.getElementById('jcont').style.width='' + eval(20 + eval('' + recto.width)) + 'px';
      }
      if (eval('' + recto.height) > eval('' + jrecto.height)) {
//alert(41);
        document.getElementById('jcont').style.height='' + eval(20 + eval('' + recto.height)) + 'px';
      }
      divelem.style.left='' + recto.left + 'px';
//alert(41);
      divelem.style.width='' + eval(-20 + recto.width) + 'px';
//alert(51);
      divelem.style.height='' + recto.height + 'px';
//alert(61);
      //divelem.style.top='' + eval(-4 + recto.top) + 'px';
      //divelem.style.bottom='' + eval(-4 + recto.top + recto.height) + 'px';
      divelem.style.zIndex='999';
      divelem.style.whiteSpace='pre';
//alert(71);
      gtao.style.color='transparent';
//alert(81);
     }
  }
  
  
  function massage(tv) {
    var tscnt=0, itv=0, ihis='', uids=[];
    var tlls=tv.split('<br>');
    for (itv=eval(-1 + tlls.length); itv>=0; itv--) {
      if (tlls[itv].indexOf(' /') != -1) {
       uids=tlls[itv].split(' /');
       ihis=tlls[itv].replace(tlls[itv].split(' /')[0] + ' ','');
       if (eval('' + uids.length) == 3) {
       if (outwo('/' + uids[2]) == 'IMAGE/' && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i) && 1 == 1) {  
              tv=tv.replace(tlls[itv].split(' /')[0] + ' ' + ihis, tlls[itv].split(' /')[0] + '&#9;<span title=\"\" style=text-decoration:underline; onmouseover=showit(this); onmouseout=hideit(this); ontouchmove=showit(this); ontouchend=hideitlater(this); href=# data-href=\"/' + uids[2] + '\">' + ihis.split('%20-')[0].split(' -')[0] + '</span>');
       } else {
              tv=tv.replace(tlls[itv].split(' /')[0] + ' ' + ihis, tlls[itv].split(' /')[0] + '&#9;<a title=\"\" target=_blank onmouseover=showit(this); onmouseout=hideit(this); ontouchmove=showit(this); ontouchend=hideitlater(this); href=\"/' + uids[2] + '\">' + ihis.split('%20-')[0].split(' -')[0] + '</a>');
       }
       } else {
       if (outwo(ihis.split('%20-')[0].split(' -')[0]) == 'IMAGE/' && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i) && 1 == 1) {  
              tv=tv.replace(tlls[itv].split(' /')[0] + ' ' + ihis, tlls[itv].split(' /')[0] + '&#9;<span title=\"\" style=text-decoration:underline; onmouseover=showit(this); onmouseout=hideit(this); ontouchmove=showit(this); ontouchend=hideitlater(this); href=# data-href=\"' + ihis.split('%20-')[0].split(' -')[0] + '\">' + ihis.split('%20-')[0].split(' -')[0] + '</span>');
       } else {
              tv=tv.replace(tlls[itv].split(' /')[0] + ' ' + ihis, tlls[itv].split(' /')[0] + '&#9;<a title=\"\" target=_blank onmouseover=showit(this); onmouseout=hideit(this); ontouchmove=showit(this); ontouchend=hideitlater(this); href=\"' + ihis.split('%20-')[0].split(' -')[0] + '\">' + ihis.split('%20-')[0].split(' -')[0] + '</a>');
       }
       }
      }
    }
    setInterval(function(){ var onerect=document.getElementById('djc').getBoundingClientRect(), tworect=document.getElementById('jc').getBoundingClientRect();   if (Math.abs(eval(eval(('' + onerect.height) - eval('' + tworect.height)))) > 20) {  document.getElementById('djc').style.height='' + tworect.height + 'px';  document.getElementById('djc').style.width='' + eval(-20 + tworect.width) + 'px'; } }, 6000);
    return tv;
  }
  
  function mobit(inid) {
    if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i) && 1 == 1) {  
      document.getElementById('myimg').innerHTML='<iframe frameborder=0 name=theblank id=theblank style=display:none;height:1600px; src=/About_Us.html></iframe>';
      myt='mymediatr'; theblank='theblank'; 
    }
    return inid;
  }

</scr" . "ipt>
</head>
<body id=xbody onload=\"mytrih=document.getElementById(mobit('mymediatr')).innerHTML; leftize();\" title='Folder listing relative to Document Root (brought to you by RJM Programming ... February, 2026)'>
<form id=myform onsubmit=\"document.getElementById('myform').style.display='none'; document.getElementById('myif').style.display='block'; return true; \" method=POST target=myif action='./one_line_find.php'>
<table id=mytable style=width:100%;>
<tr id=mytr><td id=righttd style=width:" . $forty . "%;><textarea style=width:100%;background-color:yellow; placeholder='Folder listing of ...' rows=1 cols=120 id=jc>" . $resis . "</textarea><div title='Folder listing of ...' id=djc onmousemove=rez(this);></div></td><td id=lefttd style=vertical-align:top;text-align:right;></td><td id=midtd style=vertical-align:top;></td></tr>
</table>
<input type=submit style=display:none; id=fsub value=" . $fifteen . "></input>
</form>
<iframe scrolling=yes frameborder=0 name=myif id=myif src=/About_Us.html style=display:none;width:100%;height:80px;overflow-y:visible;></iframe>
<table id=mediatable style=width:100%;display:none;height:1800px;>
<tr id=mymediatr><td id=myvideo></td><td id=myaudio></td><td id=mypdf></td><td id=mytext></td><td id=myimg></td></tr>
</table>
</body>
</html>";
?>