Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html><head><title>Judulnya</title>
- <script type='text/javascript'>
- function showDetails(bookURL){
- window.open(bookURL,"bookDetails","width=900,height=4000");
- }
- </script>
- </head>
- <body>
- <?php
- include('kontrak_search.php');
- ?>
- <table width="100%" class="table table-hover" border="0" cellspacing="0" cellpadding="0">
- <tr class="">
- <th width="2%">NO</th>
- <th width="5%">ID KONTRAK</th>
- <th width="10%">NO KONTRAK</th>
- <th width="8%">TANGGAL</th>
- <th width="5%">THN BUKU</th>
- <th width="39%">NAMA KONTRAK</th>
- <th width="6%">NILAI KONTRAK</th>
- <th width="6%">LIMIT KONTRAK</th>
- <th width="6%">KREDIT</th>
- <th width="4%">STATUS</th>
- <th width="5%">DIVISI</th>
- <th width="10%">CTRL</th>
- </tr>
- <?php
- $batas=15;
- $halaman=$_GET['halaman'];
- if (empty($halaman)) {
- $posisi=0;
- $halaman=1;
- } else {
- $posisi=($halaman-1)*$batas;
- }
- $query = "SELECT k.kontrak_id, k.no_kontrak, k.company, kk.tgl_mulai, k.tgl_selesai,
- k.nama_kontrak, k.nilai_kontrak, k.limit_kontrak,
- (select sum(f.kredit) from finance f where f.kontrak_id=k.kontrak_id) kredit,
- k.deskripsi, k.username, k.status, k.thn_buku, e.nama_lengkap
- FROM kontrak k
- JOIN employ e ON e.username=k.username
- WHERE k.status!='KASBON' ORDER BY k.kontrak_id asc limit $posisi,$batas";
- $tampil=mysql_query($query);
- $no=0;
- while ($data=mysql_fetch_array($tampil)) {
- $nilai_kontrak=number_format($data['nilai_kontrak'],0,",",",");
- $limit_kontrak=number_format($data['limit_kontrak'],0,",",",");
- $kredit=number_format($data['kredit'],0,",",",");
- ?>
- <tr>
- <td><?php echo $no=$no+1;?></td>
- <td><?php echo $data['kontrak_id']; ?></td>
- <td><?php echo $data['no_kontrak']; ?></td>
- <td><?php echo $data['tgl_mulai']; ?></td>
- <td>
- <?php
- if ( $data['thn_buku'] < date("Y") ) {
- echo '<font color="red"> '.$data ['thn_buku'].'</font>';
- } else {
- echo '<font color="green"> '.$data ['thn_buku'].'</font>';
- }
- ?>
- </td>
- <td><?php echo $data['nama_kontrak']; ?></td>
- <td align="right"><?php echo $nilai_kontrak; ?></td>
- <td align="right"><?php echo $limit_kontrak; ?></td>
- <td align="right"><?php echo $kredit; ?></td>
- <td>
- <?php
- switch($data['status']) {
- case TERBAYAR: $color="green"; break;
- case PROSES: $color="blue"; break;
- case TAGIHAN: $color="orange"; break;
- case BAHAN: $color="red"; break;
- default: $color="black";
- }
- echo '<font color="$color"> '.$data ['status'].'</font>';
- ?>
- </td>
- <td><?php echo $data['nama_lengkap']; ?></td>
- <td>
- <a href="?page=m.kontrak/kontrak_edit&kontrak_id=<?php echo $data['kontrak_id']; ?>">E</a>
- <a href="kontrak_print.php?kontrak_id=<?php $data['kontrak_id']; ?>" target="_blank">P</a>
- </td>
- </tr>
- <?php
- }
- ?>
- <tr><td colspan="11" align="center">
- <?php
- echo "<br>Page :";
- $tampil2="select*from kontrak";
- $hasil2=mysql_query ($tampil2);
- $jmldata=mysql_num_rows($hasil2);
- $jumhal=ceil($jmldata/$batas);
- for ($i=1;$i<=$jumhal;$i++)
- if ($i!=$halaman) {
- echo"<a >$i</a> <a href=''>|</a> ";
- } else {
- echo"<b>$i</b> | ";
- }
- ?>
- </td>
- </tr>
- </table>
- <a href="?page=m.kontrak/kontrak_input">New</a>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment