uzytkownik widzi to
echo ' <form method="post" action="etykieta_druk.php" name="myform" target="_blank">';
<table cellpadding="3" border=0 id=tabelka style="margin-top:10px;" >';
while($r = mysql_fetch_assoc($wynik))
{
echo '<tr>';
echo "<td>".$r['MODEL']."</td>";
echo "<td>".$r['NR']."</td>";
echo '<td><label>Druk<input type="checkbox" name="druk'.$r['ID'].'" value="0" /></label></td>';
echo '<td><label>Stan<br><select type="text" name="stan'.$r['ID'].'" ><option> </option><option>Używany</option></select></label></td>';
echo '<td><label>uwagi<input type="text" name="uwagi'.$r['ID'].'" size="5" /></label></td>';
echo '<td
><label
>l
.kopi
<input type
="number" min="1" style
="width:40px;" pattern
="^\d+?" name
="kopie'.$r['ID'].'" value
="1" size
="1" /></label
></td
>'; echo '<td><label>Cena<input type="text" pattern="^\d+?" name="cena'.$r['ID'].'" size="5" /></label></td>';
echo '<input type="hidden" name="id" value="'.$r['ID'].'" />';
if($r['LOGO'] == null){echo '<td><img src="img/no.png"></td>';}else{echo '<td><img src="img/yes.png"></td>';}
echo "</tr>\n";
}
echo '</table>';
wysylane jest do tego
<?php
if (isset($_POST["drukujPDF"])) {
include('mpdf/mpdf.php');
$mpdf=new mPDF('BLANK','A4','','',10,5,10,25,5,5);
$tytul = 'Ety';
$max = 'SELECT max(ID) FROM telefony';
//$pyt = 'select * from telefony WHERE ID IN ( 1, 2, 3)';
include('sql.php');
//$wynik = mysql_query($pyt) or die('blad');
$tab ='';
$tab1 ='';
$nowy="Nowy VAT";
for($a=0; $a<=$maxid[0]; $a++)
{
if(isset($_POST['druk'.$a])) //sprawdza ktore zostaly zaznaczone do druku {
$pyt = "select * from telefony WHERE ID=$a";
if($_POST['stan'.$a]==$nowy){$stan='<div style="width:47mm; height:5mm; font-size:11pt; font-weight:bold;">Nowy <span style="font-weight:normal;">23% VAT</span></div>';}else{$stan='<div style="width:47mm; height:auto; font-size:11pt; font-weight:bold;">'.$_POST['stan'.$a].'<span style="font-weight:normal;"> '.$_POST['uwagi'.$a].'</span></div>';}
{
for($i=1; $i<=$_POST["kopie".$a]; $i++) //robi tyle kopi ile zaznaczylismy
{
$tab = '<div style="width:47mm; height:auto; border: 1px dotted #666; overflow:hidden; text-align:center; color:#000; font-family:verdana; float:left;">
<div style="width:47mm; height:14mm; //border-bottom:1px solid #ccc;"><img src="img/'.$_POST['SKLEP'].'.jpg"></div>
<div style="width:47mm;"><img src="'.$r['LOGO'].'" style="max-width:45mm; display:inline; margin-top:3px;"></div>
<div style="width:47mm; height:5mm; font-size:10pt; font-weight:bold;">'.$r['MODEL'].'</div>
<div style="width:47mm; height:17mm; font-size:9pt;">'.$r['OPIS'].'</div>
'.$stan.'
<div style="width:47mm; height:6mm; font-size:14pt; font-weight:bold; padding-bottom:4px; border-bottom:1px dotted #666;">'.$_POST['cena'.$a].',-</div>
</div>';
$tab1 .=$tab;
}
}
continue;
}
}
$mpdf->WriteHTML("$tab1");
$mpdf->Output('etykieta.pdf');
$mpdf->Output('etykietki.pdf','I');
}
?>