-
Notifications
You must be signed in to change notification settings - Fork 0
/
create-medical.php
196 lines (192 loc) · 11.8 KB
/
create-medical.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
session_start();
if (isset($_SESSION['profile']) && $_SESSION['profile'] == 'logon') {
include 'php/config/autoload.inc.php';
} else {
echo "
<script type='text/javascript'>
alert('กรุณาเข้าสู่ระบบก่อนกรอกประวัติการรักษา');
window.location = 'signin.php';
</script>
";
exit;
}
use classes as cls;
use config as cfg;
$db = new cfg\database;
$ht = new cls\hospitals;
$hospital_option = "";
foreach ($ht->get() as $k => $v) {
$hospital_option .= "<option value='" . $v['hospital_id'] . "'>" . $v['hospital_name'] . "</option>";
}
$typeofmedical_option = "";
foreach ($ht->get_typeofmedical() as $k => $v) {
$typeofmedical_option .= "<option value='" . $v['medical_type_id'] . "'>" . $v['medical_name'] . "</option>";
}
$typeofmedical_option .= "<option value='9999'>อื่นๆ</option>";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>เพิ่มประวัติการรักษาพยาบาล</title>
<link rel="stylesheet" href="js/jquery-ui-1.11.4.custom/jquery-ui.min.css">
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="css/mine.css">
</head>
<body>
<?php include 'header.php';?>
<article class="container">
<section class="header">
<header>
<hgroup>
<h1>ประวัติการรักษาพยาบาล</h1>
<h5>แบบฟอร์มประวัติการรักษาพยาบาล</h5>
</hgroup>
</header>
</section>
<section class="content">
<div class="row">
<div class="col-md-12">
<form action="php/insert_medical.php" method="POST" class="">
<div class="form-group">
<label for="hospital" class="control-label">โรงพยาบาล *</label>
<select name="hospital" id="hospital" class="form-control" required>
<option value="">เลือกโรงพยาบาล</option>
<?=$hospital_option;?>
</select>
</div>
<div class="form-group">
<label for="typeofmedical" class="control-label">ลักษณะการรักษา *</label>
<select name="typeofmedical" id="typeofmedical" class="form-control" required>
<option value="">เลือกความชำนาญการ</option>
<?=$typeofmedical_option;?>
</select>
<span class="help-block" id="typeofmedical-help">กรณีไม่มีความชำนาญที่ต้องการให้เลือก "อื่นๆ" จากนั้นใส่รายละเอียดในช่องอาการด้านล่าง</span>
</div>
<div class="form-group">
<label for="organ" class="control-label">อาการ *</label>
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-stethoscope"></i></div>
<input type="text" id="organ" class="form-control" name="organ" aria-describedby="organ-help-block" required>
</div>
<span class="help-block" id="organ-help-block">เช่น เป็นไข้หวัด, ผ่าตัดไส้ติ่ง, ท้องอืด เป็นต้น</span>
</div>
<div class="form-group">
<label for="date_start" class="control-label">วันที่เข้ารักษา</label>
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-calendar"></i></div>
<input type="date" name="date_start" id="date_start" class="form-control" aria-describedby="date_help-block">
</div>
<span class="help-block" id="date_help-block">วัน/เดือน/ปี (ค.ศ.)</span>
</div>
<div class="form-group">
<label for="date_end" class="control-label">ถึง</label>
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-calendar"></i></div>
<input type="date" id="date_end" name="date_end" class="form-control" aria-describedby="date_help-block">
</div>
<span class="help-block" id="date_help-block">วัน/เดือน/ปี (ค.ศ.)</span>
</div>
<div class="form-group">
<label for="cost" class="control-label">ค่ารักษาพยาบาล *</label>
<div class="input-group">
<div class="input-group-addon">฿</div>
<input type="number" name="cost" id="cost" required="" class="form-control">
</div>
</div>
<div class="form-group medicine_order">
<label for="amountofmedicine" class="control-label">จำนวนยา</label>
<select name="amountofmedicine" id="amountofmedicine" class="form-control" aria-describedby="amountofmedicine-block">
<option value="">เลือกจำนวนยา</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
<span class="help-block" id="amountofmedicine-block">สูงสุด 10 ตัวยา</span>
</div>
<div class="form-group">
<label for="rating" class="control-label">ความพึงพอใจ *</label>
<div class="radio">
<label>
<input type="radio" name="rating" id="rating" value="5" checked> ดีมาก
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="rating" id="rating" value="4"> ดี
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="rating" id="rating" value="3"> ปานกลาง
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="rating" id="rating" value="2"> พอใช้
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="rating" id="rating" value="1"> ปรับปรุง
</label>
</div>
</div>
<div class="form-group">
<label for="comment" class="control-label">ความคิดเห็นเพิ่มเติม</label>
<textarea name="comment" id="comment" class="form-control" rows="3"></textarea>
</div>
<div class="form-group text-center">
<button class="btn btn-success" type="submit" onclick="return confirm('ยืนยันการบันทึกข้อมูล ?');">บันทึกข้อมูล</button>
<button class="btn btn-danger" type="reset">ล้างข้อมูล</button>
</div>
</form>
</div>
</div>
</section>
</article>
<?php include 'footer.php';?>
<script src="js/jquery-1.11.3.min.js"></script>
<script src="js/jquery-ui-1.11.4.custom/jquery-ui.min.js"></script>
<script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<script type="text/javascript">
$(function() {
$("#typeofmedical").change(function() {
if ($(this).val() == 9999) {
$("#organ").select();
}
});
$("#amountofmedicine").change(function() {
$('.sub-medicine').remove();
// alert($(this).val());
var s = $(this).val();
if (s !== "") {
$.ajax({
url: 'php/get_medicine.php',
type: 'POST',
dataType: 'html',
data: {
s: $(this).val(),
rt: 'html'
}
})
.done(function(ele) {
$(ele).insertAfter('#amountofmedicine-block');
});
}
});
});
</script>
</body>
</html>