-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
51 lines (45 loc) · 1.58 KB
/
functions.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
43
44
45
46
47
48
49
50
51
<?php
error_reporting(~E_NOTICE);
session_start();
include 'config.php';
include 'includes/db.php';
$db = new DB($config['server'], $config['username'], $config['password'], $config['database_name']);
include 'includes/general.php';
$mod = $_GET['m'];
$act = $_GET['act'];
$JK = array(
'Laki-laki' => 'Laki-laki',
'Perempuan' => 'Perempuan',
);
function get_jk_option($selected = ''){
global $JK;
foreach($JK as $key => $val){
if($key==$selected)
$a.="<option value='$key' selected>$val</option>";
else
$a.="<option value='$key'>$val</option>";
}
return $a;
}
function get_diagnosa_option($selected = ''){
global $db;
$rows = $db->get_results("SELECT kode_diagnosa, nama_diagnosa FROM tb_diagnosa ORDER BY kode_diagnosa");
foreach($rows as $row){
if($row->kode_diagnosa==$selected)
$a.="<option value='$row->kode_diagnosa' selected>[$row->kode_diagnosa] $row->nama_diagnosa</option>";
else
$a.="<option value='$row->kode_diagnosa'>[$row->kode_diagnosa] $row->nama_diagnosa</option>";
}
return $a;
}
function get_gejala_option($selected = ''){
global $db;
$rows = $db->get_results("SELECT kode_gejala, nama_gejala FROM tb_gejala ORDER BY kode_gejala");
foreach($rows as $row){
if($row->kode_gejala==$selected)
$a.="<option value='$row->kode_gejala' selected>[$row->kode_gejala] $row->nama_gejala</option>";
else
$a.="<option value='$row->kode_gejala'>[$row->kode_gejala] $row->nama_gejala</option>";
}
return $a;
}