1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
| <?php
//conexion avec la base de donnée
$con=mysql_connect("localhost","root","") or die("impossible de se connecter au serveur");
mysql_select_db("projet",$con);
$requete="select Nom from table_name order by Nom ASC";
$table="select FLEX_VALUE_SET_ID,FLEX_VALUE_ID,FLEX_VALUE,LAST_UPDATE_DATE,SUMMARY_FLAG from fnd_flex_values_vl";
?>
<form id="formchoix" name="formchoix" action="index.php" method="post">
<p align="center">
<select name="liste" style='height: 26px' >
<?php // la liste deroulante
$res=mysql_query($requete);
while($data=mysql_fetch_array($res))
{
echo "<option value=\"".$data["Nom"]."\""; echo">" .$data['Nom']."</option>"; }
?>
</select>
<p align="center">
<input name="PDf" type="submit" class="Style3" value=" Consulter" style='width: 160px; height: 30px'/>
<?php
if (isset($_POST['PDf']))
{
ob_end_clean();
require('mysql_table.php');
class PDF extends PDF_MySQL_Table
{
function Header()
{
$req="select Nom from table_name where ID='2'";
$res=mysql_query($req);
while($data=mysql_fetch_row($res)){
//Titre
$this->SetFont('Arial','',20);
$this->Cell(190,10,"$data[0]",0,1,'C');
$this->Ln(10);
}
//Imprime l'en-tête du tableau si nécessaire
parent::Header();
}
}
$pdf=new PDF();
$pdf->AddPage();
$pdf->Table("$table");
$pdf->Output();
}
?>
</p>
</form>
</div> |
Partager