Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- global $db;
- $obat_rows = $db->get_result("
- SELECT DISTINCT b.id_obat, b.kode_obat, b.nama_obat
- FROM smis_frm_obat_masuk a INNER JOIN smis_frm_dobat_masuk b ON a.id = b.id_obat_masuk
- ORDER BY b.kode_obat ASC, b.nama_obat ASC
- ");
- echo "<table border='0'>";
- echo "<tr>";
- echo "<th>Nomor</th>";
- echo "<th>ID Data</th>";
- echo "<th>Farmalkes ID</th>";
- echo "<th>Nama Obat/Medsupp</th>";
- echo "<th>Kemasan</th>";
- echo "<th>Satuan</th>";
- echo "<th>Isi</th>";
- echo "<th>Harga Netto</th>";
- echo "<th>Produsen</th>";
- echo "<th>PBF</th>";
- echo "</tr>";
- $nomor = 1;
- if ($obat_rows != null) {
- foreach ($obat_rows as $obat_row) {
- $id_obat = $obat_row->id_obat;
- $kode_obat = $obat_row->kode_obat;
- $nama_obat = $obat_row->nama_obat;
- $satuan = "";
- $harga = 0;
- $pabrik = "";
- $pbf = "";
- $last_data = $db->get_row("
- SELECT a.nama_vendor, c.produsen, c.satuan
- FROM (smis_frm_obat_masuk a INNER JOIN smis_frm_dobat_masuk b ON a.id = b.id_obat_masuk) INNER JOIN smis_frm_stok_obat c ON b.id = c.id_dobat_masuk
- WHERE a.prop = '' AND b.prop = '' AND c.prop = '' AND b.id_obat = '" . $id_obat . "'
- ORDER BY c.id DESC
- ");
- if ($last_data != null) {
- $pabrik = $last_data->produsen;
- $pbf = $last_data->nama_vendor;
- $satuan = $last_data->satuan;
- }
- $harga_data = $db->get_row("
- SELECT MAX(c.hna) hna
- FROM (smis_frm_obat_masuk a INNER JOIN smis_frm_dobat_masuk b ON a.id = b.id_obat_masuk) INNER JOIN smis_frm_stok_obat c ON b.id = c.id_dobat_masuk
- WHERE a.prop = '' AND b.prop = '' AND c.prop = '' AND b.id_obat = '" . $id_obat . "'
- ");
- if ($harga_data != null)
- $harga = $harga_data->hna;
- echo "<tr>";
- echo "<td>" . $nomor++ . "</td>";
- echo "<td>" . $id_obat . "</td>";
- echo "<td>" . $kode_obat . "</td>";
- echo "<td>" . $nama_obat . "</td>";
- echo "<td></td>";
- echo "<td>" . $satuan . "</td>";
- echo "<td></td>";
- echo "<td>" . $harga . "</td>";
- echo "<td>" . $pabrik . "</td>";
- echo "<td>" . $pbf . "</td>";
- echo "</tr>";
- }
- echo "</table>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement