<?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");
session_unregister("table");
$menu = "report" ;
require("hd_inc.php");
if (isset($globalvars)) {
for ($i=1; $i<= count($globalvars) ; $i++) {
$$globalvars[$i]["name"] = $globalvars[$i]["value"] ;
}
}
// $dbconect = new mydataconnect ;
$conx->db = $db;
$conx->table = $table;
echo $table;
// $dbconect->start();
$formEdit = new mydataForm ;
$formEdit->submitPage = "mydataproced.php";
$formEdit->resultPage = $goto;
$formEdit->frmTextareaCols=70;
$formEdit->frmTextareaRows = 20 ;
$formEdit->secondary_key = $secondary_key ;
$formEdit->printform($conx, $wherequery);
?>
<TABLE border="1" cellspacing="5" cellpadding="5" align="center"><tr><td><B><?php echo $strFieldToInsert; ?></B></td><td><B><?php echo $strLabelMailingField; ?></B></td></tr>
<?php
/* Récupération des libellés des champs qu'il est possible d'insérer dans l'email
* Utilisation du wherequery pour récupérer le numéro de report puis le numéro de query
* Après l'execution du query on récuper le nom de la table et on liste les champs.
*/
$reportit = new Report ;
list($var, $idreport)= explode("=", stripslashes($wherequery)) ;
$idreport = ereg_replace("'", "", $idreport) ;
trim($idreport);
$reportit->id = $idreport ;
$reportvalue = $reportit->getreport($conx) ;
$sqdisp = new SavedQuery;
$sqdisp->id = $reportvalue->idquery ;
$sqdisp->doquery($conx) ;
$reg = new ExecRegistry ;
$reg->table = $sqdisp->table ;
$reg->getreg($conx) ;
$tablefield = $sqdisp->gettablefield($conx) ;
for ($i=0; $i<count($tablefield); $i++)
{
$field = $tablefield[$i] ;
echo "<tr><td>";
if (isset($reg->label[$field])) {
echo "[".$field."] </td><td>".$reg->label[$field] ;
} else {
echo "[".$field."] </td><td>".$field;
}
echo "</td></tr>";
}
echo "</table>";
include("ft_inc.php");
?>
</table>