<?php
//error_reporting(0);
session_start();
$id_user=$_SESSION['id_user'];
$nama_lengkap=$_SESSION['nama_lengkap'];
?>
<?php 
include_once "library/inc.connection.php";
include_once "library/inc.library.php";

if(isset($_POST['btnKonsultasi'])){
	if(isset($_POST['cekGejala'])) {
		$dataGejala  = $_POST['cekGejala']; // Datanya Array dari CekBox
		include_once "konsultasi_hitung_user.php";
		exit;
	}
	else {
		// Jika cekGejala (cekbox gejala) belum ada yang dipilih
		include_once "konfirmasi_user.php";
	}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
Template Name: Internet Business
Author: <a href="http://www.os-templates.com/">OS Templates</a>
Author URI: http://www.os-templates.com/
Licence: Free to use under our free template licence terms
Licence URI: http://www.os-templates.com/template-terms
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Internet Business | Style Demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="layout/styles/layout.css" type="text/css" />
<link rel="stylesheet" href="form.css" type="text/css" />
<link rel="stylesheet" href="table.css" type="text/css" />

</head>
<body id="top">
<div id="header">
  <div class="wrapper">
    <div class="fl_left">
      <h1><a href="index.html">Sistem Cerdas</a></h1>
      <p>Deteksi Dini Penyakit Jantung</p>
    </div>
    <div class="fl_right"> <a href="#"><img src="images/demo/468x60.gif" alt="" /></a> </div>
    <br class="clear" />
  </div>
</div>
<!-- ####################################################################################################### -->
<div id="topbar">
  <div class="wrapper">
    <div id="topnav">
      <ul>
       <li ><a href="index_user.php">Home</a></li>
       
       
        <li class="active"><a href="diagnosa_user.php">Diagnosa</a></li>
        <li><a href="index.html">Log Out</a></li>
        
      </ul>
    </div>
    <div id="search">
      <form action="#" method="post">
        <fieldset>
          <legend>Site Search</legend>
            
        </fieldset>
      </form>
    </div>
    <br class="clear" />
  </div>
</div>
<!-- ####################################################################################################### -->
<div id="breadcrumb">
  <div class="wrapper">
    <ul>
      <li class="first">You Are Here</li>
      <li>&#187;</li>
      <li><a href="#">Gejala</a></li>
      <li>&#187;</li>
      <li><a href="tabel_gejala.php">Tabel gejala</a></li>
    </ul>
  </div>
</div>
<!-- ####################################################################################################### -->
<div id="container">
  <div class="wrapper">
    <div id="content">
	
<h3>Selamat Datang <b><?php Echo $nama_lengkap; ?></b>..!</h3>Pilihlah beberapa gejala berikut ini sesuai dengan kondisi yang anda alami untuk Memeriksa Kesehatan Jantung anda.
<div class="table">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr bgcolor='brown'>
								<th width="10"><font color='white'>Pilih</font></th>
								<th width="70"><font color='white'>Id Gejala</font></th>
								<th><font color='white'>Nama Gejala</font></th>
								
				<form name="form1" method="post" action="diagnosa_user.php">
<?php
include_once "library/inc.connection.php";

$query = mysql_query("SELECT * FROM gejala");
if(!$query){
	die( mysql_error() );
}
$i=1;
while($row = mysql_fetch_array($query)){
   
    echo "<tr >
				  <td >
				  <div class='checkbox checkbox-success'>
				   
                        <input name='cekGejala[]'  value=".$row['id_gejala']." id='checkbox3' class='styled' type='checkbox'>
                        <label >
                         
                        </label>
                    </div>
				  <td >".$row['id_gejala']."</td>
				<td >".$row['nama_gejala']."</td>";
				
		   echo "</tr>";
			
		}	
	echo "	<td colspan='4' align='right'>
   <input name='btnKonsultasi' type='submit' value='Diagnosa' class='btn btn-success' >
   <input type='reset' name='reset' value='Batal' class='btn btn-warning'></td>
</tr>";
	    echo "</table>";
			
		
	
			 
	?>	
		
	
	
	</div>
	
	
	
	
	
	
	
	
	
			<br></br>
        <thead>
         
        </thead>
        <tbody>
          
        </tbody>
      </table>
      <div id="comments">
        </ul>
      </div>
      <h2>Write A Comment</h2>
      <div id="respond">
        <form action="#" method="post">
          <p>
            <input type="text" name="name" id="name" value="" size="22" />
            <label for="name"><small>Name (required)</small></label>
          </p>
          <p>
            <input type="text" name="email" id="email" value="" size="22" />
            <label for="email"><small>Mail (required)</small></label>
          </p>
          <p>
            <textarea name="comment" id="comment" cols="100%" rows="10"></textarea>
            <label for="comment" style="display:none;"><small>Comment (required)</small></label>
          </p>
          <p>
            <input name="submit" type="submit" id="submit" value="Submit Form" />
            &nbsp;
            <input name="reset" type="reset" id="reset" tabindex="5" value="Reset Form" />
          </p>
        </form>
      </div>
    </div>
    <div id="column">
      <div class="subnav">
        <h2>Riwayat Kesehatan Anda</h2>
		        <ul>
		<?php
		$query = mysql_query("SELECT * FROM riwayat where id_user='$id_user' order by id_riwayat desc limit 10");
			while ($row = mysql_fetch_array($query) ) {
		
		echo "<li>Anda Telah melakukan Diagnosa Pada ".$row['tanggal']." Dengan Diagnosa Penyakit adalah :<h3>".$row['penyakit']."</h3></li>";
		}
		?>	

          
         .
        </ul>
      </div> 
      <div class="holder">
        
        
      </div>
    </div>
    <br class="clear" />
  </div>
</div>
<!-- ####################################################################################################### -->
<div id="footer">
  <div class="wrapper">
    <div id="newsletter">
      <h2>Stay In The Know !</h2>
      <p>Please enter your email to join our mailing list</p>
      <form action="#" method="post">
        <fieldset>
          <legend>News Letter</legend>
          <input type="text" value="Enter Email Here&hellip;"  onfocus="this.value=(this.value=='Enter Email Here&hellip;')? '' : this.value ;" />
          <input type="submit" name="news_go" id="news_go" value="GO" />
        </fieldset>
      </form>
      <p>To unsubscribe please <a href="#">click here &raquo;</a></p>
    </div>
    <div class="footbox">
      <h2>Lacus interdum</h2>
      <ul>
        <li><a href="#">Praesent et eros</a></li>
        <li><a href="#">Praesent et eros</a></li>
        <li><a href="#">Lorem ipsum dolor</a></li>
        <li><a href="#">Suspendisse in neque</a></li>
        <li class="last"><a href="#">Praesent et eros</a></li>
      </ul>
    </div>
    <div class="footbox">
      <h2>Lacus interdum</h2>
      <ul>
        <li><a href="#">Praesent et eros</a></li>
        <li><a href="#">Praesent et eros</a></li>
        <li><a href="#">Lorem ipsum dolor</a></li>
        <li><a href="#">Suspendisse in neque</a></li>
        <li class="last"><a href="#">Praesent et eros</a></li>
      </ul>
    </div>
    <div class="footbox">
      <h2>Lacus interdum</h2>
      <ul>
        <li><a href="#">Praesent et eros</a></li>
        <li><a href="#">Praesent et eros</a></li>
        <li><a href="#">Lorem ipsum dolor</a></li>
        <li><a href="#">Suspendisse in neque</a></li>
        <li class="last"><a href="#">Praesent et eros</a></li>
      </ul>
    </div>
    <br class="clear" />
  </div>
</div>
<!-- ####################################################################################################### -->
<div id="copyright">
  <div class="wrapper">
    <p class="fl_left">Copyright &copy; 2014 - All Rights Reserved - <a href="#">Domain Name</a></p>
    <p class="fl_right">Template by <a target="_blank" href="http://www.os-templates.com/" title="Free Website Templates">OS Templates</a></p>
    <br class="clear" />
  </div>
</div>
</body>
</html>