[wpkg_web] / packages.php Repository:
ViewVC logotype

View of /packages.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 42 - (download) (annotate)
Mon Jan 22 16:14:12 2007 UTC (11 years, 5 months ago) by linuxkidd
File size: 2651 byte(s)
Added Edit button for Package Commands page

<?php
  
include "connect.php";
  include 
"header.php";

  
$page='general';

  if(isset(
$_GET['pack_id'])) {
    if(isset(
$_GET['page'])) {
      
$page=$_GET['page'];
    }
    
$pack_id=$_GET['pack_id'];
    
$sql="select * from packages where id=" quote_smart($pack_id);
    
$sql_handle=mysql_query($sql) or error_report($sql,mysql_error());
    
$pack_info=mysql_fetch_array($sql_handle);
    
# 'id', 'name', 'version', 'obsolete', 'idtxt', 'reboot', 'priority', 'exeonce', 'notes'
  
} else {
    
$pack_id='0';
  }
?>
    <title><?php print $vocab['title-packman']; ?></title>
  </head>
  <body>
    <table class='tbl_main'>
      <tr>
<?php
  
switch($page) {
    case 
'downloads':
      
$key=array(5);
      break;
    case 
'checks':
      
$key=array(9,10,5);
      break;
    case 
'commands':
      
$key=array(7,8,6,5,11);
      break;
    case 
'extras':
      
$key=array(5);
      break;
  }
  include 
"sidebar.php";
?>
        <td valign='top'>
          <table class='tbl_mainsub'>
            <tr class='headline'>
              <td><?php
                
print $vocab['title-packman'];
                if(
$pack_id) {
                  print 
" - " $pack_info['idtxt'];
                }
              
?></td>
            </tr>
            <tr class='tr_main'>
              <td>
                <table class='tbl_sub2'>
                  <tr>
                  <?php
    $styles
=array('text-align: center; border: 1px solid;  border-width: 1px; background-color: #FFFF99;',
                  
'text-align: center; border: 1px dotted; border-width: 1px; background-color: #336699;');
    
$fontcolors=array('color: black; display: block;''color: white; display: block;');
    
$menu_width=floor(100/count($pages));
    foreach (
$pages as $page_data) {
      if(
$page_data[0]==$page) {
        
$pclass=1;
      } else {
        
$pclass=0;
      }
      if(isset(
$pack_id) && $pack_id>0) {
        
$link="<a style='{$fontcolors[$pclass]}' href='packages.php?pack_id={$pack_id}&page=" $page_data[0] . "'>";
        
$post_link="</a>";
      } else {
        
$link="<span style='{$fontcolors[$pclass]}'>";
        
$post_link="</span>";
      }
      print 
"<td style='{$styles[$pclass]}' width='{$menu_width}%'>{$link}{$page_data[1]}{$post_link}</a></td>\n";
    }
?>
                  </tr>
                </table>
              </td>
            </tr>
            <tr class='tr_main'>
              <td>
                <?php
                 
include "pack_" $page ".php";
                
?>
              </td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
    <?php include "footer.php"?>
  </body>
</html>

ViewVC Help
Powered by ViewVC 1.0.3