Location: PHPKode > projects > MyDB > webide/submenu2_inc.php
<?php  
/*************************************************************
 * The MyDB librairy and applications are product of SQLFusion
 * It may be used and/or distributed under the terms of the Q Public
 * License (QPL) version 1.0, enclosed in the file licence.txt.
 ****************************************************************/
/** MyDB IDE Version 0.4    **/ 
/** Author Philippe Lewicki **/
 

   /* Getting information from the registry for the hidden tables */
$rregistry= mysql_db_query($conx->db, "select rtable, rdata from registry where rtype='hidetable'") ; 
if ($rregistry >0) {
     while (list($rtable, $rdata) = mysql_fetch_row($rregistry)) {
        $hidetable[$rtable]=$rdata ; 
   }
}
?>
<script language="javascript">
 <!--
browserName = navigator.appName;
browserVer  = parseInt(navigator.appVersion);

if (browserName == "Netscape" && browserVer >= 3)
  version = "ver1";
else
  version = "ver2";

     function StartAll() {
        MM_goToURL('parent','');
        return document.MM_returnValue
        }
<?php
   $filenameselfarray = explode("/", $PHP_SELF); 
   $filenameself = $filenameselfarray[count($filenameselfarray)-1];        
?>
     function OpenPopup() {
       var openpopup = window.open("tbl_sql_searchbuilder.php?resultpage=<?php echo $filenameself; ?>&table=<? echo $tablename; ?>&db=<? echo $databasename; ?>","popupwin","width=550,height=250,left=190,top=300,resizable=yes,scrollbars=yes");
       if ( version == "ver1" ) { 
              openpopup.focus(); 
       	window.main.name = "opener";
	}  
       return false; 
         }

     function OpenGlobalVar() {
       var openglobalvar = window.open("myglobalvar.php?resultpage=<?php echo $filenameself; ?>&table=<? echo $tablename; ?>&db=<? echo $databasename; ?>","popupvar","width=250,height=250,left=190,top=300,resizable=yes,scrollbars=yes");
       if ( version == "ver1" ) { 
		openglobalvar.focus(); 
       		window.main.name = "opener";  
        }
       return false; 
         }

function MM_goToURL() { //v2.0
  for (var i=0; i< (MM_goToURL.arguments.length - 1); i+=2) //with arg pairs
    eval(MM_goToURL.arguments[i]+".location='"+MM_goToURL.arguments[i+1]+"'");
  document.MM_returnValue = false;
}
//-->

</script>    


   <table width="100%" border="0" cellspacing="0" cellpadding="3"> 
<!----      <td colspan=2 align=center> <?php echo $strQuery ?>
   </td>
   --->
<?php
  $menuconx = new mydataconnect ; 
  $menuconx->hostname = $conx->hostname ;
  $menuconx->login = $conx->login ;
  $menuconx->password = $conx->password ;
  $menuconx->start(); 
  $menuconx->sql_query = "select * from ".$cfgSavedQuery; 
  $menuconx->db = $conx->db; 
  $menuconx->query(); 
  while($sq = $menuconx->fetch())  {
?>  
<tr> 
          <td>
                 <img src="images/puce1.gif" width="15" height="10" hspace="3">
          </td> 
          <td><a class="menu" HREF="displaytable.php?sql_query=<? echo urlencode($sq->query) ?>&sql_order=<?php echo urlencode($sq->qorder) ;?>&pos=<? echo $sq->qpos; ?>&qname=<? echo urlencode($sq->qname); ?>&idquery=<? echo $sq->idsavedquery; ?>&sqselect=on"><? echo $sq->qname; ?></a><br>
         </td> 
</tr>   
 <?php
      } 
   
echo "</table>" ;     
?>
      <DIV align="left"> <img src="images/puce2.gif" width="149" height="9"><br> 
        <br> 

   <table width="100%" border="0" cellspacing="0" cellpadding="3"> 

   
   <?php
   $liste_tables = mysql_list_tables($conx->db);
   $num_tables = @mysql_numrows($liste_tables);
   for ($j=0; $j<$num_tables; $j++)
       {
       $name_table = mysql_tablename($liste_tables, $j);
      if (!$hidetable[$name_table]) {       
         if (!isset($tablename)) { 
	$tablename = $name_table; 
	session_register("tablename") ; 
	}
     ?>  
<tr> 
          <td>
                 <img src="images/puce1.gif" width="15" height="10" hspace="3">
          </td> 
          <td>
               <a class="menu" HREF="displaytable.php?newtablename=<? echo $name_table ?>"><?php echo $name_table;?></a><br>
         </td> 
</tr>   
 <?php
      } 
       }
echo "</table>" ;     
   ?>
 </div>
 <DIV align="left"> <img src="images/puce2.gif" width="149" height="9">
 <br> 
 <table width="100%" border="0" cellspacing="0" cellpadding="3"> 
 <tr> 
   <td>
     <img src="images/puce1.gif" width="15" height="10" hspace="3">
   </td> 
   <td class=menu>
    <A href="<?php echo basename($REQUEST_URI); ?>" onclick="OpenPopup();"><?php echo $strCreateQuery; ?> </a><BR>
   </td>
  </tr>
  <tr> 
   <td>
    <img src="images/puce1.gif" width="15" height="10" hspace="3">
   </td> 
   <td class=menu>
    <A href="<?php echo basename($REQUEST_URI); ?>" onclick="OpenGlobalVar();"><? echo $strGlobalVars; ?></a><BR>
   </td>
  </tr>
  <tr> 
  <td>
   <img src="images/puce1.gif" width="15" height="10" hspace="3">
   </td> 
   <td class=menu>
    <A href="./tbl_spl_csv.php?db=<? echo $conx->db; ?>&table=<? echo $conx->table; ?>&sql_query=<? echo urlencode($conx->sql_query); ?>"><?php echo $strUpload ; ?></a><BR>
   </td>
  </tr>
</table>


Return current item: MyDB