loggedin.php 2.31 KB
<?php
 if (!isset($_SESSION) && !isset($_SESSION['username'])) {
        return;
    }


    $dockets = Array();
    $dockets_obj = json_decode($_SESSION['lookup']);
    foreach ($dockets_obj as $docket => $key) {
        $dockets[$docket] = $key;
    }
    ksort($dockets);
    $id = (isset($_GET['id']) ? '?id=' . $_GET['id'] : '&nbsp;');
          
    foreach ($dockets as $dir => $md5) {
          $client = explode("-",$dir); 
          $clientIds[] = $client[1];
          

          
    }
   $clientIdsGrouped = array_unique($clientIds, SORT_REGULAR);

           // var_dump($clientIdsGrouped);
         
    
?>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
   
        
         
<?php   $json =  file_get_contents('includes/names.json');
        $names = json_decode($json);
       
     
        ?>
      
<dl class="TzMenu">
    <dt><label for="client_menu">Clients</label></dt>
    <dd><select id="client_menu" name="client_menu">
      <option value="">Pick</option>
      <?php 
          /* Figure out clients */
         
          foreach ($clientIdsGrouped as $key => $clientId ) {
          if($names->$clientId == null){ $clientName = $clientId; }else{$clientName = $names->$clientId;};
          
            echo '<option value="' . $clientId. '"' .' '. '>' .$clientName . '</option>';
           }
          
      ?>
    </select></dd>
  </dl>


  <dl class="TzMenu">
    <dt><label for="menu">Project</label></dt>
    <dd><select id="menu" name="menu">
      <option value="home.html">Splash Page</option>
        <?php      
   
    ?>
    </select></dd>
  </dl>

  <dl class="TzMenu" id="TzURL">
    <dt style="font-weight: bold;">URL:</dt>
    <dd>http://<?php echo $_GET['d'];?>/<span><?php echo $id;?></span></dd>
  </dl>
  
  
 <script type = 'text/javascript'>
 
      $('#client_menu').on('change',function(){
 			populateSelect()
       });
       
       
   function populateSelect(){
  
    cat= $('#client_menu').val();
    menu = $.ajax({ url: 'includes/function.php',
         data: {id: cat},
         type: 'post',
         success: function(output) {
        // alert(output);
         $('#menu').html('');
         $('#menu').append(output)
        
                  }
});
   
  
    
    
   
}

 
 
 </script>

<script type="text/javascript" src="TzLinker.js"></script>