<?php 
include 'functions.php';
error_reporting(E_ALL ^ (E_NOTICE | E_WARNING));
?>
<style type="text/css">
  .judul{
    font-size: 20px;
  }
</style>
<body onLoad="window.print()">
  <table border="0" align="center">
    <tr> 
      <td><p align="center" class="judul"><b>SISTEM PAKAR DIAGNOSA KANKER</b></p></td>
    </tr>
    <tr> 
      <td><p align="center" class="judul"><b>MENGGUNAKAN METODE FORWARD CHAINING DAN CERTAINTY FACTOR</b></p></td>
    </tr>
  </table>
  <hr width="100%" align="center" color="#000">
  <br>
  <table width="1042" height="79" border="1" cellpadding="2" cellspacing="2">
    <tr>
    <td width="50" align="center" valign="middle"><b>No</b></td>
    <td width="150" align="center" valign="middle"><b>Nama</b></td>
    <td width="150" align="center" valign="middle"><b>Email</b></td>
    <td width="100" align="center" valign="middle"><b>No. Hp</b></td>
    <td width="100" align="center" valign="middle"><b>Jenis Kelamin</b></td>
    <td width="150" align="center" valign="middle"><b>Usia</b></td>
    <td width="100" align="center" valign="middle"><b>Alamat</b></td>
    <td width="150" align="center" valign="middle"><b>Tanggal Konsultasi</b></td>
    <td width="70" align="center" valign="middle"><b>Hasil Konsultasi</b></td>
    <td width="150" align="center" valign="middle"><b>Nilai Kepercayaan</b></td>
    </tr>
    <?php
 require_once'functions.php';
    $q = esc_field(@$_GET['q']);
    $rows = $db->get_results("SELECT DISTINCT nama,email,no_hp,jk,usia,alamat,tanggal_konsultasi,hasil_konsultasi,kepercayaan FROM tb_hasil");
    $no=0;
    $rows = $db->get_results("SELECT * FROM tb_hasil 
    WHERE nama LIKE '%$q%' OR kepercayaan > 10
    ORDER BY id");
    foreach($rows as $row):?>
    <tr>
    <td align="center" valign="middle"><?=++$no?></td>
    <td valign="middle"> <?=$row->nama ?></td>
    <td valign="middle"> <?=$row->email ?></td>
    <td valign="middle"> <?=$row->no_hp ?></td>
    <td valign="middle"> <?=$row->jk ?></td>
    <td valign="middle"> <?=$row->usia ?></td>
    <td valign="middle"> <?=$row->alamat ?></td>
    <td valign="middle"> <?=$row->tanggal_konsultasi ?></td>
    <td valign="middle"> <?=$row->hasil_konsultasi ?></td>
    <td align="center" valign="middle"><?=$row->kepercayaan ?>%</td>
    <td align="center" valign="middle" class="nw">
            <a class="btn btn-xs btn-danger" href="aksi.php?act=laporan_hapus&ID=<?=$row->id?>" onClick="return confirm('Hapus data?')"><span class="glyphicon glyphicon-trash"></span></a>
        </td>
  </tr>
  <?php endforeach;
    ?>
  </table>
</body>
