home *** CD-ROM | disk | FTP | other *** search
/ PC World 2008 February (DVD) / PCWorld_2008-02_DVD.iso / v cisle / PHP / PHP.exe / EasyPHP-2.0b1-setup.exe / {app} / sqlitemanager / left.php < prev    next >
Encoding:
PHP Script  |  2006-04-18  |  4.4 KB  |  106 lines

  1. <?php
  2. /**
  3. * Web based SQLite management
  4. * Show navigation into databases
  5. * @package SQLiteManager
  6. * @author FrΘdΘric HENNINOT
  7. * @version $Id: left.php,v 1.35 2006/04/14 15:16:52 freddy78 Exp $ $Revision: 1.35 $
  8. */
  9.  
  10. include_once "include/defined.inc.php";
  11. include_once INCLUDE_LIB."config.inc.php";
  12. ?>
  13. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  14. <html>
  15. <head>
  16.     <title><?php echo $GLOBALS['traduct']->get(3)." ".$GLOBALS['SQLiteVersion'] ?></title>
  17.     <meta http-equiv="content-type" content="text/html;charset=<?php echo $charset ?>">
  18.     <style type="text/css">
  19.         div.logo { width: 100%; background: white; padding-top: 5px; padding-bottom: 5px; }
  20.         div.design { position:absolute; width: 98%; top:47px; text-align:right; color:Silver; font-size:7px; }
  21.     </style>
  22.     <link href="theme/<?php echo $localtheme ?>/left.css" rel="stylesheet" type="text/css">
  23. </head>
  24.  
  25. <body>
  26.     <div align="center" class="logo"><?php echo displayPics("sqlitemanager.png","SQLiteManager")?></div>
  27.     <div class="base" align="center" style="margin-top: 5px;">
  28.     <a href="index.php" class="base" target="_parent"><?php echo  $traduct->get(1); ?></a>
  29.     </div>
  30.     <table class="main" width="100%" border="0" cellspacing="0" cellpadding="0">
  31. <?php
  32. include_once INCLUDE_LIB . 'sqlite.class.php';
  33. $query = "SELECT * FROM database ORDER BY name";
  34. $tabDb = $db->array_query($query, SQLITE_ASSOC);
  35. if(is_array($tabDb)) {
  36.     foreach($tabDb as $ligne){
  37.         // get Database version
  38.         $versionNum = sqlite::getDbVersion($ligne["location"]);
  39.         $dbPics = 'database';
  40.         if(in_array($ligne['id'], $attachDbList)) {
  41.             $dbPics .= '_link';
  42.         } else {
  43.             $dbPics .= $versionNum;
  44.         }
  45.         $dbPics .= '.png';
  46.         if(isset($tempDb) && is_object($tempDb)) {
  47.             if($tempDb->dbVersion == 2) $tempDb->close();
  48.             else $tempDb = null;
  49.         }
  50.         
  51.         echo "\n\t".'<tr class="database" style="vertical-align: middle">'.
  52.                  "\n\t\t".'<td class="img_db" width="18">'.displayPics($dbPics, '', 0, 20).'</td>'.
  53.                  "\n\t\t".'<td class="name_db"><a href="index.php?dbsel='.$ligne['id'].'" target="_parent" class="dbsel">'.$ligne['name'].'</a></td>'.
  54.                  "\n\t".'</tr>';
  55.         if($dbsel == $ligne['id']){
  56.             include_once INCLUDE_LIB.'SQLiteDbConnect.class.php';
  57.             $tempDir = dirname($ligne['location']);
  58.             if($tempDir == '.') $baseLocation = DEFAULT_DB_PATH . $ligne['location'];
  59.             else $baseLocation = $ligne['location'];
  60.             $workDb = new SQLiteDbConnect($baseLocation);
  61.             if(is_resource($workDb->connId) || is_object($workDb->connId)){
  62.                 echo "\n\t".'<tr valign="middle"><td colspan="2" class="objects" align="right">'.
  63.                          "\n\t\t".'<table class="items" width="'.(LEFT_FRAME_WIDTH-25).'" border="0" cellspacing="0" cellpadding="0">';
  64.                 foreach($dbItems as $item){
  65.                     $list = $workDb->getPropList($item);
  66.                     if(is_array($list) && count($list)) foreach($list as $Name){
  67.                         $actionLink = '<a href="main.php?dbsel='.$dbsel.'&'.strtolower($item).'='.urlencode($Name).'" target="main" class="item">';
  68.                         echo "\n\t\t".'<tr>';
  69.                         echo '<td class="image" style="white-space: nowrap">'.$actionLink.displayPics(strtolower($item).'s.png').'</a>';
  70.                           if(($item!='Function') && ($item!='Trigger')) echo '<a href="main.php?dbsel='.$dbsel.'&'.strtolower($item).'='.urlencode($Name).'&action=browseItem" target="main">'.displayPics('browse.png', '', 0, 10).'</a>';
  71.                         else echo displayPics('nobrowse.png');
  72.                         echo '</td>';
  73.                         echo '<td class="item" style="white-space: nowrap">';
  74.                         echo $actionLink.$Name.'</a></td>'.
  75.                              "\n\t\t".'</tr>';
  76.                     } elseif(DISPLAY_EMPTY_ITEM_LEFT) {
  77.                         $actionLink = '<a href="main.php?dbsel='.$dbsel.'&action=add_'.strtolower($item).'" target="main" class="item">';
  78.                         echo "\n\t\t".'<tr>'.
  79.                              '<td class="image" style="white-space: nowrap" width="35">'.$actionLink.displayPics(strtolower($item).'s.png').'</a>'.displayPics('nobrowse.png').'</td>'.
  80.                            '<td class="'.strtolower($item).'" style="white-space: nowrap">';
  81.                         if(!$workDb->isReadOnly() && displayCondition('properties')) echo $actionLink.'+ '.$itemTranslated[$item].'</a></td>';
  82.                         else echo '<span class="item"><i>+ '.$itemTranslated[$item].'</i></span>';
  83.                         echo "\n\t\t".'</tr>';;
  84.                     }
  85.                 }
  86.                 
  87.                 echo "\n\t\t".'</table>';
  88.           echo "\n\t".'</td></tr>';
  89.             }
  90.         }
  91.     }
  92. }
  93.  
  94. ?>
  95.  
  96.     </table>
  97.     <br/>
  98.     <?php if(isset($theme_author)):?>
  99.     <div class="design">
  100.     Theme designed by <?php echo $theme_author?>
  101.     </div>
  102.     <?php endif;?>
  103. </body>
  104. </html>
  105.  
  106.