Export to pdf pe pagina
Scris: Dum Mar 30, 2014 2:09 am
Buna sera
Am nevoie de putin ajutor daca se poate. Am o pagina php pe care vreau sa o pot exporta (cu link gen save to pdf)
Am incercat cu mpdf dar variabilele si ce este completat in casutele text si butoane radio nu sunt trecute in pdf exportat
Aici am codul de preluare pdf
iar aici am pagina pe care vreau sa o fac ca pdf
Va rog ajutati-ma ca nu mai dorm noaptea.
Am nevoie de putin ajutor daca se poate. Am o pagina php pe care vreau sa o pot exporta (cu link gen save to pdf)
Am incercat cu mpdf dar variabilele si ce este completat in casutele text si butoane radio nu sunt trecute in pdf exportat
Aici am codul de preluare pdf
Cod: Selectaţi tot
<?php
include("pdf\mpdf.php");
$mpdf=new mPDF('win-1252','A4','','',15,10,16,10,10,10);//A4 page in portrait for landscape add -L.
$mpdf->SetHeader('Topanel');
$mpdf->setFooter('{PAGENO}');// Giving page number to your footer.
$mpdf->useOnlyCoreFonts = true; // false is default
$mpdf->SetDisplayMode('fullpage');
// Buffer the following html with PHP so we can store it to a variable later
ob_start();
?>
<?php include "lansare_p.php";
//This is your php page ?>
<?php
$html = ob_get_contents();
ob_end_clean();
// send the captured HTML from the output buffer to the mPDF class for processing
$mpdf->WriteHTML($html);
//$mpdf->SetProtection(array(), 'user', 'password'); uncomment to protect your pdf page with password.
$mpdf->Output();
exit;
?>iar aici am pagina pe care vreau sa o fac ca pdf
Cod: Selectaţi tot
<?php
include("conn.php");
$nrctr = $_POST['nrctr'];
$sql=mysql_query("SELECT * FROM anexa1 WHERE nrctr='$nrctr'");
while($row=mysql_fetch_row($sql)) {
$cantitate = $row[2];
$explicatie = $row[3];
$produs = $row[4];
$detalii = $row[5];
$pret = $row[6];
$valoare = $row[7];
}
$sql1=mysql_query("SELECT * FROM contracte WHERE nrctr='$nrctr'");
while($row=mysql_fetch_row($sql1)) {
$data = $row[2];
$client = $row[3];
$tip = $row[4];
$termen = $row[5];
$avans = $row[6];
$rest = $row[7];
$modalitate = $row[8];
$scadenta = $row[9];
}
$sql2=mysql_query("SELECT * FROM firme WHERE client='$client'");
while($row=mysql_fetch_row($sql2)) {
$agent = $row[1];
$adresa = $row[3];
$telefon = $row[4];
$email = $row[5];
$RC = $row[6];
$cui = $row[7];
$atribut = $row[8];
$cont = $row[9];
$banca = $row[10];
$reprezentant = $row[11];
$calitate = $row[12];
}
$data1 = date('d-m-Y');
?>
<font face="arial">
<font size="3">
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<body background=backsig.jpg>
<div style="position: absolute; left: 1px; top: 1px">
<img src="h.jpg" width="950" height="100">
</div>
<form action="lansare_tb.php" method="post">
<br><br><br><br><br><br>
<select name="agent"><option>Gisberto George</option></select><br><br><br><br>
Societatea :SC <?php print $client; ?><br>
Adresa :<?php print $adresa; ?><br>
Nr.Reg com :<?php print $RC; ?><br>
Cod fiscal :<?php print $cui; ?><br>
Contract nr :<input type="text" name="nrctr" size="3" value="<?php print $nrctr; ?>"> / <?php print $data; ?><br><br><br><br>
Stimate Domnule Director,<br>
  Va rugam sa lansati in productie urmatoarele pozitii:<br><br><br>
<center>
<?php $sql3=mysql_query("SELECT * FROM `anexa1` WHERE nrctr='$nrctr'");
echo "<table border=2>";
echo "<tr><th>Cantitate</th>
<th>Explicatie</th>
<th>Produs</th>
<th>Detalii</th>
<th>Pret</th>
</tr>";
while ($row=mysql_fetch_row($sql3)) {
echo "<tr><center><td>$row[2]</td><td>$row[3]</td><td>$row[4]</td><td>$row[5]</td><td>$row[6]</td><center></tr>";
}
echo "</table>";
?>
</center><br><br><br>
<input type="radio" name="piata" value="Export">Export <input type="radio" name="piata" value="Intern">Intern
<br><br>
Tip contract :<input type="text" name="tip" value="<?php print $tip; ?>">
<br><br>
Transport Topanel: <input type="radio" name="transport" value="Da">DA <input type="radio" name="transport" value="Nu">NU
<br><br>
Transport inclus in pret: <input type="text" name="tr_pret" value="">
<br><br>
Nr. Camioane: <input type="text" name="nr_tir" value="">
<br><br>
Preturi speciale: <input type="radio" name="special" value="Da">DA <input type="radio" name="special" value="Nu">NU
<br><br>
Modalitate de plata: <input type="text" name="modalitate" value="<?php print $modalitate; ?>">
<br><br>
Termen contractual: <input type="text" name="mod" value="<?php print $termen; ?>">
<br><br>
Observatii: <input type="text" size="40" name="obs" value="">
<br><br><br><br>
Client,<br> SC <input type="text" name="client" value="<?php print $client; ?>"> <center>Director Vanzari</center><br>
<style type="text/css">
.button {
width: 150px;
height: 45px;
-webkit-border-radius: 5;
-moz-border-radius: 5;
border-radius: 5px;
text-shadow: 4px 3px 2px #666666;
font-family: Arial;
color: #525252;
font-size: 18px;
background: #c0c1c2;
padding: 10px 20px 10px 20px;
text-decoration: none;
}
.button:hover {
background: #6e6e6e;
text-decoration: none;
}
.button:active{
background: #B0C4DE;
text-decoration: none;
}
</style>
<input type="submit" target="_parent" value="Preia datele" class="button">
<br><a href=pdf.php>pdf</a>
</form>
Va rog ajutati-ma ca nu mai dorm noaptea.