-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproses.php
42 lines (39 loc) · 890 Bytes
/
proses.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
include 'koneksi.php';
if(isset($_POST['submit'])){
$qry='select id from tb_gejala where ';
array_pop($_POST);
$rule_input=array();
foreach ($_POST as $where) {
$qry.=$where."=1 and ";
array_push($rule_input,$where);
}
$qry.="1=1";
$data=mysqli_query($kon,$qry);
$id='';
$rule=array(
array("GD01","GD02","GD03","GD04","GD05","GD06"));
$status=false;
for ($i=0; $i <1 ; $i++) {
$result=($rule_input==$rule[$i]);
if ($result) {
$status=true;
}
}
if($status==true){
while ($d=mysqli_fetch_array($data)) {
$id=$d['id'];
}
$cari_penyakit="select * from tb_penyakit where id=$id";
$db=mysqli_query($kon,$cari_penyakit);
while ($d=mysqli_fetch_array($db)) {
$penyakit=$d['penyakit'];
$info=$d['info'];
$solusi=$d['solusi'];
include 'hasil.php';
}
}else{
include 'error.php';
}
}
?>