Location: PHPKode > projects > MyDB > webide/editcurrency.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 ($edit) {
          $query3 = "delete from $conx->registryTable where idregistry='$edit'" ;
	$rinsertreg = mysql_db_query($conx->db, $query3, $idconx) ; 
	
	}

        /* Test if its a new external list */
	$query = "select * from $conx->registryTable where rfield='$fieldname'"  ; 
	$rverif =  mysql_db_query($conx->db, $query, $idconx) ; 

	if (mysql_num_rows($rverif) >0) {
	    list($idregistry, $rtable, $rfield, $rtype, $rdata) = mysql_fetch_array($rverif) ; 
	    list ($lktable, $primarykey, $tblfield) = explode (":", $rdata) ; 

	}  elseif (isset($lktable) && isset($tblfield)) {
		$rdata = "$lktable:id$lktable:$tblfield" ; 
             $query3 = "insert into $conx->registryTable values ('','$tablename', '$fieldname', 'list', '$rdata')" ;
	$rinsertreg = mysql_db_query($conx->db, $query3, $idconx) ; 
	$idregistry = mysql_insert_id(); 

	}

              require("hd_inc.php"); 

//echo "$fieldname  $lktable  $tblfield" ; 

	if (!isset($lktable)) {
	   $liste_tables = mysql_list_tables($conx->db);
	   $num_tables = @mysql_numrows($liste_tables);
	   ?>
                   Selectionné la table contenant les valeurs : <br>
                   <FORM method="get" action="ffeditlistboxextern.php">
	      <INPUT type="hidden" name="fieldname" value="<? echo $fieldname; ?>">
		<select name=lktable>"; 
                  <?
	   for ($j=0; $j<$num_tables; $j++)
	       {
		 $name_table = mysql_tablename($liste_tables, $j);
                    	 echo "<option> $name_table </option>\n";   
	      }
	   echo "\n</select><INPUT type=submit><br>"; 
       	}


	if (isset($lktable) && !isset($tblfield)) {
	$table_def = mysql_db_query($conx->db, "SHOW FIELDS FROM $lktable", $idconx);
              ?>	    Selectionner le champs de la table <? echo $lktable; ?> a afficher :<br>
		<FORM method="get" action="ffeditlistboxextern.php">
		<INPUT type="hidden" name="lktable" value="<? echo $lktable; ?>">
                            <INPUT type="hidden" name="fieldname" value="<? echo $fieldname; ?>">
		<select name="tblfield">
               <?
	   for ($i=0;$i<mysql_num_rows($table_def);$i++)
	   {
	       $row_table_def = mysql_fetch_array($table_def);
	       $field = $row_table_def["Field"];
                     $FieldType[$field] = $row_table_def["Type"] ;
	        echo "<option>$field</option>";
	   }
	       echo "</select><INPUT type=submit>"; 
	}



	$table_def = mysql_db_query($conx->db, "SHOW FIELDS FROM $tablename", $idconx);
	   for ($i=0;$i<mysql_num_rows($table_def);$i++)
	   {
	       $row_table_def = mysql_fetch_array($table_def);
	       $field = $row_table_def["Field"];
                     $FieldType[$field] = $row_table_def["Type"] ;
	   }


?>



         <!---- Debut du contenue de la page principal ---->       

<br><br>
<? if ($lktable) { ?>
Ce champs est liér à la table : <? echo $lktable; ?>
	<? if ($tblfield) { ?>
	Et affiche le champs : <? echo $tblfield; ?>
	<br>
	<a href="ffeditlistboxextern.php?fieldname=<? echo $fieldname; ?>&edit=<? echo $idregistry; ?>">Modifier</a>
	<? }; ?>
<? } ?>


<BR><br><br>
<a href="formbuilder.php"><?php echo $strFBReturnToFB; ?></a><BR>

       <!--- Fin du contenue de la page Principale --->         

<?php 
require("ft_inc.php"); 
?> 

Return current item: MyDB