-
Notifications
You must be signed in to change notification settings - Fork 0
/
home-reportemer.php
109 lines (105 loc) · 5.56 KB
/
home-reportemer.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
<?php
include("include/home-header.php");
?>
<!--MAIN Content-->
<div class="container-fluid">
<div class="vertical-align-middle ">
<div class="row clearfix">
<div class="row-lg-3 col-md-12 col-sm-12">
<div class="card">
<div class="body text-center">
<!--blank space top-->
</div>
</div>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-lg-6 col-md-12">
<div class="card">
<div class="header">
<h2>Emergency Contact</h2>
</div>
<div class="body">
<li class="list-group-item">
<i class="icon-call-out"></i><span> Hospital Phone : +91 6548923465</span>
</li>
<li class="list-group-item">
<i class="icon-call-out"></i><span> Ambulance Phone1 : +91 9876543210
</li>
<li class="list-group-item">
<i class="icon-call-out"></i><span> Ambulance Phone2 : +91 1234567891
</li>
</div>
</div>
</div>
<div class="col-lg-6 col-md-12">
<div class="card">
<div class="header">
<h2>Emergency Report</h2>
<small>Fill by Ambulance Staff</small>
</div>
<form action="#" method="post">
<div class="body">
<div class="form-group">
<label>Check That Necessory</label>
<br/>
<label class="fancy-checkbox">
<input type="checkbox" name="checkbox1" value="1" required data-parsley-errors-container="#error-checkbox" checked="true">
<span>Emergency Staff</span>
</label>
<label class="fancy-checkbox">
<input type="checkbox" name="checkbox2" value="1">
<span>Ready Operating Theater</span>
</label>
<label class="fancy-checkbox">
<input type="checkbox" name="checkbox3" value="1">
<span>Ready ICU</span>
</label>
<p id="error-checkbox"></p>
</div>
<hr>
<div class="col-sm-12">
<div class="form-group">
<label><small>Enter Your ID Number</small></label>
<input type="text" class="form-control" placeholder="id" name="id">
</div>
</div>
<div class="col-sm-12">
<div class="form-group">
<label><small>Some details About Emergency</small></label>
<input type="text" class="form-control" placeholder="Remark" name="remark">
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<button type="submit" class="btn btn-success " data-type="success" name="Submit">Report</button>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<?php
include("include/home-footer.php");
if(isset($_POST['Submit']))
{
$check1 = $_POST["checkbox1"];
if(isset($_POST['checkbox2'])){$check2 = $_POST["checkbox2"];}else $check2 =0;
if(isset($_POST['checkbox3'])){$check3 = $_POST["checkbox3"];}else $check3 =0;
$staffid= $_POST["id"];
$remark= $_POST["remark"];
$result = mysqli_query($conn,"SELECT * FROM hospital.hospitalstaff where hsid='$staffid';");
if(mysqli_num_rows($result)!=0)
{
$sql= "INSERT INTO `hospital`.`emergrncy` (`reportingStaffId`, `esFlag`, `otFlag`, `icuFlag`, `remark`) VALUES ('$staffid', '$check1', '$check2', '$check3', '$remark')";
$insert = mysqli_query($conn,$sql);
if($insert)
{
echo"<script>window.alert('Reported Successfully');</script>";
}else echo"<script>window.alert('An Error occur');</script>";
}else echo"<script>window.alert('You are Not from Hospital Staff To Report');</script>";
}
?>