Advertisement
Guest User

invoice

a guest
Jan 20th, 2020
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.76 KB | None | 0 0
  1.  
  2. <?php
  3.  
  4. cek_status_login($_SESSION['idpelanggan']);
  5.  
  6. $aksi = "Upload";
  7. ?>
  8. <section class="main-content">
  9.  
  10.     <div class="row">
  11.         <div class="span9">
  12.  
  13.  
  14.  
  15.  
  16.     <h4 id="headings"> Data invoice</h4>
  17.     <!--<a href='index.php?mod=invoice&pg=peta'><i class="icon-map-marker"></i>Map View</a>-->
  18.     <table  class="table table-striped table-condensed">
  19.         <thead>
  20.             <th><td><b>Nama </b></td><td><b>Kd Invoice</b></td><td><b>Tanggal Transaksi</b></td><td><b>Total Transaksi</b></td><td><b>Pembayaran</b></td><td><b>Upload Bukti Transfer</b></td><td><b>Link Downlad</b></td></th>
  21.         </thead>
  22.         <tbody>
  23. <?php
  24.  
  25. $id=$_SESSION['idpelanggan'];
  26. if(isset($_GET['id'])) {
  27.     $aksi = "Upload";
  28.     $id = $_GET['id'];
  29. }
  30. $query="SELECT invoice.*,pelanggan.nama from invoice,pelanggan where invoice.idpelanggan=pelanggan.idpelanggan and pelanggan.idpelanggan='$id'";
  31. $result=mysql_query($query) or die(mysql_error());
  32. $no=1;
  33. $link="";
  34.  
  35. //proses menampilkan data
  36. while($rows=mysql_fetch_object($result)){
  37.  
  38.             ?>
  39.             <tr>
  40.                 <td><?php echo "posisi" +$no
  41.                 ?></td>
  42.  
  43.                 <td><?php echo $rows -> nama; ?></td>
  44.             <td><a href='index.php?mod=chart&pg=invoice_detail&id=<?php echo $rows -> noinvoice; ?>'><?php echo $rows -> noinvoice; ?></a></td>
  45.  
  46.             <td><?php echo $rows -> tanggal; ?></td>
  47.                 <td><?php echo format_rupiah($rows ->totalbayar); ?></td>
  48.  
  49.             <td><?php echo get_status_invoice($rows -> transfer); ?></td>
  50.             <td>
  51.  
  52.                 <?php
  53.  
  54.                 if ($rows->buktitf==null) {
  55.  
  56.                  ?>
  57.                 <form  class="form-horizontal" method="POST"  enctype="multipart/form-data" action="chart/invoice_action.php">
  58.                     <input type='hidden' name='id' value="<?=$id?>">
  59.                     <input type='hidden' name='noinvoice' value="<?php echo $rows -> noinvoice; ?>">
  60.                 <div class="">
  61.                         <label class="" for="foto">Belum Upload</label>
  62.                         <div class="">
  63.                             <input type="file" name='foto'>
  64.                         </div>
  65.                     </div>
  66.  
  67.                     <div class="">
  68.                         <div class="">
  69.                             <button type="submit" class="btn-xs btn-success" name='aksi' value='<?=$aksi?>'>
  70.                             <?=$aksi?>
  71.                             </button>
  72.                         </div>
  73.                     </div>
  74.  
  75.                 </form>
  76.  
  77.             <?php }else{ ?>
  78.                 <form  class="form-horizontal" method="POST"  enctype="multipart/form-data" action="chart/invoice_action.php">
  79.                     <input type='hidden' name='id' value="<?=$id?>">
  80.                     <input type='hidden' name='noinvoice' value="<?php echo $rows -> noinvoice; ?>">
  81.  
  82.                     <img src='upload/buktitransfer/<?php echo $rows ->buktitf ?> 'width='128px' height='128px' alt="" >
  83.                 <div class="">
  84.                         <label class="" for="foto"><?php echo $rows ->buktitf ?></label>
  85.                         <div class="">
  86.                             <input type="file" name='foto'>
  87.                         </div>
  88.                     </div>
  89.  
  90.                     <div class="">
  91.                         <div class="">
  92.                             <button type="submit" class="btn-xs btn-success" name='aksi' value='<?=$aksi?>'>
  93.                             Edit
  94.                             </button>
  95.                         </div>
  96.                     </div>
  97.  
  98.                 </form>
  99.  
  100.             <?php } ?>
  101.                 </td>
  102.  
  103.  
  104.                 <?php
  105.  
  106.                 if ($rows->transfer==1) {
  107.  
  108.                 $query="SELECT noinvoice from invoice where idpelanggan='$id'";
  109.                 $result=mysql_query($query) or die(mysql_error());
  110.                 $noinvoice=mysql_fetch_object($result);
  111.                 //while($rows=mysql_fetch_object($noinvoice)){
  112.                     $query2="SELECT * FROM transaksi INNER JOIN produk ON transaksi.idproduk=produk.idproduk WHERE noinvoice='$noinvoice->noinvoice'";
  113.                         $result2=mysql_query($query2) or die(mysql_error());
  114.                         $rows=mysql_fetch_object($result2)
  115.                             ?>
  116.                             <td>
  117.                                 <a href= <?php echo $rows->link ?> >Downlad</a>
  118.                             </td>
  119.                             <?php
  120.  
  121.                 //}
  122.                 ?>
  123.  
  124.  
  125.                 <?php
  126.  
  127.  
  128.             }else{?>
  129.  
  130.                 <td>
  131.                     <span>Anda Harus Melunasi Pembayaran</span>
  132.                 </td>
  133.  
  134.              <?php } ?>
  135.  
  136.  
  137.  
  138.             </tr>
  139.             <?php $no++;
  140.                 }
  141.             ?>
  142.  
  143.  
  144.         </tbody>
  145.     </table>
  146.  
  147.  
  148. </div>
  149.  
  150.  
  151. <?php
  152. include('inc/sidebar-front.php');
  153. ?>
  154.     </div>
  155. </section>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement