You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
139 lines
3.0 KiB
PHP
139 lines
3.0 KiB
PHP
<?php
|
|
session_start();
|
|
if($_SESSION['validUser'] !== TRUE)
|
|
{
|
|
header("location: ./index.php");
|
|
exit();
|
|
}
|
|
?>
|
|
|
|
<style type='text/css'>
|
|
*{font: 7pt Gill Sans MT, Tahoma, Helvetica, sans-serif;}
|
|
div.container{border: thin solid #000000; width:175px; height:80px; padding-top:8px; padding-bottom:5px; text-align:center;}
|
|
div.imgbarcode{margin-bottom:3px;}
|
|
div.nama{font-size:1em;}
|
|
div.harga{font-size:1.5em; font-weight:bold;}
|
|
</style>
|
|
|
|
<?php
|
|
/**
|
|
* Halaman untuk mencetak barcode
|
|
*
|
|
*/
|
|
|
|
if(isset($_POST["kkodebarang"]) && isset($_POST["kjml"]) && isset($_POST["knomorbarang"]))
|
|
{
|
|
$namabr = $_POST["knamabarang"];
|
|
$kode = $_POST["kkodebarang"];
|
|
$nomor = $_POST["knomorbarang"];
|
|
$hjual = $_POST["khjual"];
|
|
$jumlah = $_POST["kjml"];
|
|
|
|
$lebar_label = 175;
|
|
$tinggi_label = 90;
|
|
$label_per_baris = 3;
|
|
$baris_per_halaman = 7;
|
|
|
|
$baris=1; $kolom=1;
|
|
|
|
for ($i = 1; $i <= $jumlah; $i++) {
|
|
|
|
$clear = "";
|
|
$barcode = strtoupper($kode);
|
|
// cek posisi saat ini
|
|
if ($kolom > $label_per_baris) {
|
|
$kolom = 1;
|
|
$baris++;
|
|
$clear = " clear:left; ";
|
|
};
|
|
if ($baris > $baris_per_halaman) {
|
|
$baris = 1;
|
|
echo '<p style="page-break-after: always" />';
|
|
};
|
|
|
|
$namaBarang = $namabr;
|
|
|
|
// cetak label
|
|
echo "\n
|
|
|
|
<div style=\"
|
|
$clear float:left;
|
|
margin-right:20px;
|
|
margin-bottom:10px;
|
|
width:".$lebar_label."px;
|
|
height:".$tinggi_label."px\">
|
|
|
|
<div class='container'>
|
|
<div class='imgbarcode'><img src=\"./barcode.php?code=$barcode\"/></div>
|
|
<div class='nama'>".strtoupper($namaBarang)."</div>
|
|
<div class='harga'>Rp. ".number_format($hjual,0,',','.')."</div>
|
|
</div>
|
|
|
|
</div>
|
|
";
|
|
|
|
$kolom++;
|
|
} // end for
|
|
|
|
}
|
|
else if(isset($_POST["fkodebarang"]) && isset($_POST["fjml"]) && isset($_POST["count"]))
|
|
{
|
|
$kode = $_POST["fkodebarang"];
|
|
$namabr = $_POST["fnamabarang"];
|
|
$nomor = $_POST["fnomor"];
|
|
$jumlah = $_POST["fjml"];
|
|
$hjual = $_POST["fhjual"];
|
|
$count = $_POST["count"];
|
|
$lebar_label = 175;
|
|
$tinggi_label = 90;
|
|
$label_per_baris = 3;
|
|
$baris_per_halaman = 7;
|
|
$baris=1; $kolom=1;
|
|
|
|
for($i = 0; $i<$count; $i++)
|
|
{
|
|
$barcode = $kode[$i];
|
|
$namaBarang = $namabr[$i];
|
|
$hrgjual = $hjual[$i];
|
|
for($j = 0; $j<$jumlah[$i]; $j++)
|
|
{
|
|
$clear = "";
|
|
// cek posisi saat ini
|
|
if ($kolom > $label_per_baris) {
|
|
$kolom = 1;
|
|
$baris++;
|
|
$clear = " clear:left; ";
|
|
};
|
|
if ($baris > $baris_per_halaman) {
|
|
$baris = 1;
|
|
echo '<p style="page-break-after: always" />';
|
|
};
|
|
|
|
// cetak label
|
|
echo "\n
|
|
|
|
<div style=\"
|
|
$clear float:left;
|
|
margin-right:20px;
|
|
margin-bottom:10px;
|
|
width:".$lebar_label."px;
|
|
height:".$tinggi_label."px\">
|
|
|
|
<div class='container'>
|
|
<div class='imgbarcode'><img src=\"./barcode.php?code=$barcode\"/></div>
|
|
<div class='nama'>".strtoupper($namaBarang)."</div>
|
|
<div class='harga'>Rp. ".number_format($hrgjual,0,',','.')."</div>
|
|
</div>
|
|
|
|
</div>
|
|
";
|
|
|
|
$kolom++;
|
|
} // end for
|
|
|
|
}
|
|
}
|
|
|
|
|
|
?>
|