fadilzteria

print

Oct 10th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.82 KB | None | 0 0
  1. <?php
  2. session_start();
  3. $total = NULL;
  4. $post = $_POST;
  5.  
  6. $numrows_invoice_db = 1021;
  7. $invoice = $numrows_invoice_db + 1;
  8. ?>
  9.  
  10. <!DOCTYPE html>
  11.  <head>
  12.   <style type="text/css">
  13.   body{
  14.     background:#efefef;
  15.     font-family:arial;
  16.     line-height: 25px;
  17.   }
  18.  
  19.   #wrapshopcart{
  20.     width:70%;
  21.     margin:3em auto;
  22.     padding:30px;
  23.     background:#fff;
  24.     box-shadow:0 0 15px #ddd;
  25.   }
  26.  
  27.   h1{
  28.     margin:0;
  29.     padding:0;
  30.     font-size:2.5em;
  31.     font-weight:bold;
  32.   }
  33.  
  34.   p{
  35.     font-size:1em;
  36.     margin:0;
  37.   }
  38.  
  39.   table{
  40.     margin:2em 0 0 0;
  41.     border:1px solid #eee;
  42.     width:100%;
  43.     border-collapse: separate;
  44.     border-spacing:0;
  45.   }
  46.  
  47.   table th{
  48.     background:#fafafa;
  49.     border:none;
  50.     padding:20px ;
  51.     font-weight:normal;
  52.     text-align:left;
  53.   }
  54.  
  55.   table td{
  56.     background:#fff;
  57.     border:none;
  58.     padding:12px 20px;
  59.     font-weight:normal;
  60.     text-align:left;
  61.     border-top:1px solid #eee;
  62.   }
  63.  
  64.   table tr.total td{
  65.     font-size:1.5em;
  66.   }
  67.  
  68.   .btnsubmit{
  69.     display:inline-block;
  70.     padding:10px;
  71.     border:1px solid #ddd;
  72.     background:#eee;
  73.     color:#000;
  74.     text-decoration:none;
  75.     margin:2em 0;
  76.   }
  77.  
  78.   form{
  79.     margin:2em 0 0 0;
  80.   }
  81.  
  82.   label{
  83.     display:inline-block;
  84.     width:auto;
  85.   }
  86.  
  87.   input[type=text]{
  88.     border:1px solid #bbb;
  89.     padding:10px;
  90.     width:30em;
  91.   }
  92.  
  93.   textarea{
  94.     border:1px solid #bbb;
  95.     padding:10px;
  96.     width:30em;
  97.     height:5em;
  98.     vertical-align:text-top;
  99.     margin:0.3em 0 0 0;
  100.   }
  101.  
  102.   .submitbtn{
  103.     font-size:1.5em;
  104.     display:inline-block;
  105.     padding:10px;
  106.     border:1px solid #ddd;
  107.     background:#eee;color:#000;
  108.     text-decoration:none;
  109.     margin:0.5em 0 0 8em;
  110.   };
  111.    
  112.   </style>
  113.  </head>
  114.  
  115.  <body>
  116.   <div id="wrapshopcart">
  117.    <h1>Invoice <?php echo $invoice;?></h1>
  118.    <p>Silahkan simpan halaman ini ... </p>
  119.    
  120.    <h3>Berikut adalah data lengkap Anda : </h3>
  121.    <label>Nama            : <?php echo $post['nm'] ;?> </label> <br>
  122.    <label>Alamat          : <?php echo $post['al'] ;?> </label> <br>
  123.    <label>Kode            : <?php echo $post['kd'] ;?> </label> <br>
  124.    <label>Jenis Pelanggan : <?php echo $post['jp'] ;?> </label> <br>
  125.  
  126.    
  127.    <h3>Rekening Pembayaran : </h3>
  128.    <table>
  129.     <tr><th width="70%">Tanggungan</th><th width="10%">m3</th><th width="20%">Jumlah</th></tr>
  130.      
  131.     <?php foreach($_SESSION['cart'] as $row):?>
  132.      <?php
  133.      $jumlah = $_SESSION['price'][$row['productid']] * $row['qty'];
  134.      $total += $jumlah;
  135.     ?>
  136.      
  137.      <tr><td><?php echo $row['product'];?></td><td><?php echo $row['qty'];?></td><td><?php echo $jumlah; ?></td></tr>
  138.     <?php endforeach;?>
  139.      
  140.     <tr class="total"><td></td><td >Total</td><td><?php echo $total;?></td></tr>
  141.    </table>  
  142.   </div>
  143.  
  144.  </body>
  145. </html>
Advertisement
Add Comment
Please, Sign In to add comment