Tampil Tidak Sesuai

Malam agan agan , jadi ane bikin web buat tugas tuh web reservasi / booking. nah si codingan di bawah ini seharus nya untuk nampilin rincian transaksi yang baru saya lakukan. Tapi yang muncul malah rincian transaksi dari transaksi saya yang pertama kali saya buat. Kira kira ada yang tau masalah nya kenapa?

  <?php
 $SQL =mysql_query("SELECT * FROM tbl_boking WHERE username_boking='$_SESSION[username]'");
 $_data=mysql_fetch_array($SQL);
 $tgl = region($_data['tgl_invoice']);
 $totalBayar=idr_f($_data['total_bayar']);
 echo"
  <div class='container'>
        <div class='jumbotron text-center bg-transparent margin-none'>
            <h1>RINCIAN TRANSAKSI ANDA</h1>
            <p></p>
        </div>
        <div class='page-section'>
            <div class='row'>
                <div class='col-md-12 col-lg-12'>
				 <h4 class='page-section-heading'></h4>
                    <div class='panel panel-default'>
                       <div class='panel-body'>
                            <table class='table'>
  <tbody>
    <tr>
      <td colspan='6' align='center'><h3><strong>#RINCIAN TRANSAKSI ANDA</strong></h3></td>
    </tr>
    <tr>
      <td width='30%'><h4><strong>STUDIO MUSIK BOGOR</strong></h4></td>
      <td colspan='2'><strong>RINCIAN IDENTITAS</strong></td>
      <td colspan='3'><strong>RINCIAN INVOICE</strong></td>
    </tr>
    <tr>
      <td>JL.MANTARENA ATAS BOGOR TENGAH BOGOR - 08787-3264-578</td>
      <td width='21%'>USERNAME MEMBER</td>
      <td width='15%'>$_data[username_boking]</td>
      <td width='15%'>NO INVOICE</td>
      <td colspan='2'><strong># $_data[no_invoice]</strong></td>
    </tr>
    <tr>
      <td>Silahkan Transfer Ke No. Rekening : <br>
      - BCA (071828282)<br>
       - BRI (829283838)<br>
       - BNI (83984490)</td>
      <td>ATAS NAMA</td>
      <td><strong><label class='label label-primary'>$_data[atas_nama]</label></strong></td>
      <td>STATUS</td>
      <td colspan='2'>";
	  if($_data['status_bayar']=="L"){
		  echo"<strong><label class='label label-success'>LUNAS</label></strong>";
		  }elseif($_data['status_bayar']=="B"){
			  echo"<strong><label class='label label-danger'>BELUM LUNAS</label></strong>";


			  }
	  echo"</td>
    </tr>
    <tr>
      <td> </td>
      <td>ALAMAT</td>
      <td>$_data[alamat]</td>
      <td>TGL. INVOICE</td>
      <td colspan='2'>$tgl</td>
    </tr>
    <tr>
      <td rowspan='2'><strong>RINCIAN BOKING</strong></td>
      <td>EMAIL</td>
      <td>$_data[email]</td>
      <td><h4><strong>TOTAL BAYAR</strong></h4></td>
      <td colspan='2'><h4><label class='label label-success'>Rp. $totalBayar</label></h4></td>
    </tr>
    <tr>
      <td>KONTAK</td>
      <td>$_data[kontak]</td>
      <td> </td>
      <td width='12%'> </td>
      <td width='7%'> </td>
    </tr>
    <tr>
      <td> </td>
      <td> </td>
      <td> </td>
      <td> </td>
      <td> </td>
      <td> </td>
    </tr>
    <tr>
      <td><strong>TGL.BOKING</strong></td>
      <td><strong>JAM</strong></td>
      <td><strong>NOMOR STUDIO</strong></td>
      <td><strong>HARGA</strong></td>
      <td colspan='2'><strong>SUBTOTAL</strong></td>
    </tr>";
	$rincian=mysql_query("SELECT * FROM tbl_rincianboking WHERE kode_boking='$_data[kode_boking]'");
	while($r=mysql_fetch_array($rincian)){
		$tglboking=region($r['tgl_boking']);
		$harga=idr_f($r['harga_boking']);
		$subtotal = idr_f($r['subtotal']);
		echo"
		<tr>
      <td><label class='label label-primary'><strong>$tglboking</strong></label></td>
      <td><label class='label label-primary'><strong>$r[jam_boking]</strong></label></td>
      <td><label class='label label-primary'><strong>$r[no_studio]</strong></label></td>
      <td><label class='label label-primary'><strong>Rp. $harga</strong></label></td>
      <td colspan='2'><label class='label label-danger'><strong>Rp. $subtotal</strong></label></td>
    </tr>

		";

		}
    echo"
    <tr>
      <td colspan='10' align='right'><a href='javascript:; onClick=window.print()'><button class='btn btn-primary'><i class='fa fa-print'></i> Cetak Transaksi</button></td>

    </tr>
  </tbody>
</table>

                        </div>


                    </div>
                </div>
            </div>
        </div>
    </div>




 ";

 ?>


avatar bagjamr
@bagjamr

10 Kontribusi 0 Poin

Diperbarui 6 tahun yang lalu

2 Jawaban:

avatar bagjamr
@bagjamr

10 Kontribusi 0 Poin

Dipost 6 tahun yang lalu

Jawaban Terpilih

dibagian sini diubah

 $SQL =mysql_query("SELECT * FROM tbl_boking WHERE username_boking='$_SESSION[username]'");

jadi

 $SQL =mysql_query("SELECT * FROM tbl_boking WHERE username_boking='$_SESSION[username]' ORDER BY id DESC");

semoga membantu ^^

avatar BroGoeh
@BroGoeh

121 Kontribusi 47 Poin

Dipost 6 tahun yang lalu

Login untuk ikut Jawaban