Location: PHPKode > projects > MyDB > webide/displaytable.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 **/

 require("mydbconfig.inc.php");  

 if (isset($globalvars)) {
   for ($i=1; $i<= count($globalvars) ; $i++) {
     $globalvars[$i]["name"]."="  ; 
     $$globalvars[$i]["name"] = $globalvars[$i]["value"] ; 
   }
 }
 if (isset($newtablename)) {
   $tablename = $newtablename; 
 }
 $menu = "query" ; 
 include("hd_inc.php"); 
 $conx->table = $tablename; 
 $conx->sql_query = stripslashes($sql_query);
 $conx->sql_order = stripslashes($sql_order) ; 
 $conx->max_rows = 30 ; 
 $conx->pos = $pos ;     
?>
<TABLE width="400" border="0" cellspacing="0" cellpadding="0" align="center">
<tr><TD width="15" height="25" align="center">
||
</td><TD width="370" height="25" bgcolor="#ffcc33" align="center" class="titrearticle">
<? if (strlen($qname)>0) {
	echo $qname; 
	if ($idquery) { 
		$squery = new SavedQuery; 
		$squery->id = $idquery; 
//		$squery->getquery($conx) ; 
		$resultsavedquery = $squery->doquery($conx) ; 
                }
	} elseif (strlen($sql_query)>0) { 
		if (strlen($sql_order)>0) {
			echo stripslashes($sql_query)." ".stripslashes($sql_order) ; 
		} else {
			echo stripslashes($sql_query); 
		}
	} else { echo $tablename ;  
          }
?>
</td><TD width="15" height="25" align="center">
||
</td>
</tr>
</table><BR>
<?	
              $table = new mydataTable; 
              $table->cfgBgcolorOne = "#D0F5C5" ;
              $table->cfgBgcolorTwo = "#C7F5E7" ;
              $table->cfgShowBlob = true; 
              $table->cfgLinkTableRecord = true ; 
			  $table->cfgEditPage = "mydataedit.php" ;
			  $table->cfgAddPage = "mydataedit.php" ;
			  $table->cfgDeletePage = "mydatadelete.php" ;
			  $table->cfgLinkTablePage = "mydatalinktable.php" ;
			  $table->strNoRecords =  $strNoRecords ; 
              $table->strShowingRecords	= $strShowingRecords ;
              $table->strTotal		= $strTotal ;
              $table->strEdit		= $strEdit ;
              $table->strPrevious	=  $strPrevious;
              $table->strNext		= $strNext ; 
              $table->strDelete		= $strDelete  ;
              $table->strDeleted		= $strDeleted ;
              $table->strLinkedTable 	=  $strLinkedTable; 
              $table->strPos1                	=  $strPos1 ;
              $table->strEnd                 	= $strEnd;
              $table->strInsertNewRow	=  $strInsertNewRow ;
              $table->strYes		= $strYes ;
              $table->strNo		=  $strNo ;
              $table->strDoYouReallyDelete =  $strDoYouReallyDelete;  
			  
              $result = $conx->query() ; 
              $conx->getnum_rows(); 
	if ($resultsavedquery) { 
                   $table->displaytable($conx, $resultsavedquery) ; 
	} else {
                   $table->displaytable($conx, $result) ; 
	}
?><BR>
<?
    if(strlen($sql_query) >0) { 
            if ($sqselect == "on") { ?>	
   <FORM method="get" action="ffsavsq.php">
	<input name="resultpage" value="<? echo $filenameself; ?>" type="hidden">
	<input name="idquery" value="<? echo $idquery; ?>" type="hidden">
  <table><tr><td>
                  <?php echo $strQueryName ; ?> 
                </td><td>
               <INPUT name="qname" value="<? echo stripslashes($qname); ?>" type="text">
	</td></tr>
                <tr><td>
                  <?php echo $strSQLQuery; ?> 
                </td><td>
               <textarea cols=40 rows=5 name="sql_query"><? echo stripslashes($sql_query); ?> </textarea>
	</td></tr><tr><td>
                   <?php echo $strOrder ; ?> 
              </td><td>
	<INPUT name="sql_order" value="<? echo stripslashes($sql_order); ?>" type="text">
	</td></tr><tr><td>
                   <?php echo $strPosition; ?> 
                </td><td>
	<INPUT name="pos" value="<? echo $pos; ?>" type="text">
	</td></tr><tr><td>
            <INPUT value="<?  echo $strFBSubmitOptions; ?>" type="submit" name="update">   
                </td><td>
            <INPUT value="<?  echo $strDeleteQuery; ?>" type="submit" name="delete">   	
	</td></tr>
</table>	

	
      </FORM><BR><BR>
       <? } else {  ?>
     <!---   <?  echo $strMsgSaveQuery; ?> --->
      <FORM enctype="application/x-www-form-urlencoded" action="ffsavsq.php">
	<INPUT name="sql_query" value="<? echo stripslashes($sql_query); ?>" type="hidden">
	<INPUT name="sql_order" value="<? echo stripslashes($sql_order); ?>" type="hidden">
	<INPUT name="sql_pos" value="<? echo $pos; ?>" type="hidden">
	<?  echo $strQueryName; ?> <INPUT name="qname" type="text">
	<INPUT value="<?  echo $strFBSubmitOptions; ?>" type="submit" name="add">

      </FORM><BR><BR>
  
	<? } ?>
       <!----  <a href="<? echo $filenameself; ?>"><? echo $strCancelQuery ; ?></a>--->
<? }         
?>          
<? include("ft_inc.php"); 
?>


Return current item: MyDB