Advertisement
Guest User

php5 code

a guest
Jun 30th, 2015
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.66 KB | None | 0 0
  1.     <form name="fLicSearch" method="post" onsubmit="document.getElementById('Submit').disabled=1;"><p>Search scope:
  2. <select name="path" ><option value="/export/raid5/licenses/FlexLM8.3/" selected="selected">All Licenses</option><option value="/export/raid5/licenses/FlexLM8.3/Eval/">Eval</option><option value="/export/raid5/licenses/FlexLM8.3/Companies/">Companies</option><o
  3. ption value="/export/raid5/licenses/FlexLM8.3/Individual/">Individual</option><option value="/export/raid5/licenses/FlexLM8.3/Academic/">Academic</option><option value="/export/raid5/licenses/FlexLM8.3/Government/">Government</option>
  4. </select>
  5. <br><br>
  6. Enter expiration date or text to search licenses for:
  7. <input type="text" name="sDate" value="<?php if (!isset($_POST[sDate])){ echo date('M-Y'); } else { echo $_POST[sDate]; } ?>">
  8. </p><br>
  9. <input type="submit" name="Submit" id="Submit" value="Submit">
  10. </form>
  11. <br><br>
  12. <p>Results:</p>
  13.           <?php
  14.         //debugging turned on for this temporarily
  15.         ini_set('display_errors', 'On');
  16.         error_reporting(E_ALL);
  17.  
  18.         echo $_POST[path] . "<br><br>";            
  19.         ?>
  20.        
  21.     <table width="100%" border="0" cellspacing="0" cellpadding="0" id="expandable_table">
  22.  
  23.     <TR><TD scope="col" bgcolor="#999999" width="90%" align="center">File</TD></TR>
  24.  
  25.           <?php
  26.          
  27.         $path = $_POST[path];              
  28.         $tHTML = "";
  29.        
  30.         if (isset($_POST[path])) {         
  31.  
  32.             $path = realpath($_POST[path]); //set variable to actual path on filesystem
  33.             $objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST);
  34.  
  35.             $i = 0;
  36.             foreach($objects as $name => $object){
  37.                
  38.                 if (is_dir($name) == false && stristr($name,"_Archived") == false && stristr($name,"_programs") == false && stristr($name,"_old") == false && stristr($name,"notes.txt") == false ) {
  39. // the below INCLUDES archive searches
  40. //              if (is_dir($name) == false && stristr($name,"_programs") == false) {
  41.                     //echo "$name<br>";                    
  42.                     $sopenfile = file_get_contents($name);
  43.                     if (stristr($sopenfile,$_POST[sDate])) {
  44.                         echo '<tbody><tr><td><a href="#" onclick="return toggleTbody(\'div'.$i.'\');">';
  45.                         echo str_replace($path,"",$name)."</a>";
  46.                         echo "</td></tr></tbody><tbody id='div$i' class='off'>";
  47.                         echo "<tr><td>";
  48. //                      echo "<span style='display:none;' name='div$i'>";
  49.  
  50.                         // converts the \n chars to html
  51.                         $convert = explode("\n",$sopenfile);
  52.                         for ($xc=0; $xc<count($convert);$xc++)
  53.                         {
  54.                             //echo "$sopenfile";
  55.                             echo $convert[$xc].'<br>';
  56.                         }
  57. //                      echo "</span>";
  58.                         echo "</td></tr></tbody>";
  59.                     }
  60.                     $i++;                  
  61.                 }
  62.                
  63.            
  64.             }  
  65.                
  66.         }
  67. ?> 
  68.    
  69. </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement