-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathroom.php
89 lines (79 loc) · 2.44 KB
/
room.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
<?php include("header.php");?>
<?php include('db_con.php');?>
<div class="container-fluid">
<div class="row" id="wrapper">
<?php require_once'menubar.php';?>
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-body">
<form action="room.php" method="post">
<div class="form-group">
<h3>Click button to see room details of the Department</h3>
<input type="submit" name="btn_submit" value="All Rooms" class="btn btn-danger">
</div>
</form><br/>
<script language="javascript">
function Clickheretoprint()
{
var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,";
disp_setting+="scrollbars=yes,width=400, height=400, left=100, top=25";
var content_vlue = document.getElementById("print_content").innerHTML;
var docprint=window.open("","",disp_setting);
docprint.document.open();
docprint.document.write('<html><head><title>Inel Power System</title>');
docprint.document.write('</head><body onLoad="self.print()" style="width: 400px; font-size:12px; font-family:arial;">');
docprint.document.write(content_vlue);
docprint.document.write('</body></html>');
docprint.document.close();
docprint.focus();
}
</script>
<?php
error_reporting(E_ERROR||E_WARNING);
if(isset($_POST['btn_submit'])){
$result=mysqli_query($conn,"SELECT * FROM room");
echo "<div id='print_content'>";
while($row=mysqli_fetch_array($result)){
echo "<hr>";
echo "<div class='container-fluid' style='background-color:#D8D8D8;'>";
echo "<div class='row'>";
echo "<div class='col-sm-12'>";
echo "<br/>";
echo "<table>";
echo "<tr>";
echo "<th><b>Room NO</b></th>";
echo "<th> : </th>";
echo "<td>".$row['room_no']."</td>";
echo "</tr>";
echo "<tr>";
echo "<th><b>Room Name</b></th>";
echo "<th> : </th>";
echo "<td>".$row['room_name']."</td>";
echo "</tr>";
echo "<tr>";
echo "<th><b>Room Type</b></th>";
echo "<th> : </th>";
echo "<td>".$row['room_type']."</td>";
echo "</tr>";
echo "<tr>";
echo "<th><b>Capacity</b></th>";
echo "<th> : </th>";
echo "<td>".$row['room_capacity']."</td>";
echo "</tr>";
echo "</table>";
echo "</div>";
echo "</div>";
echo "<br/>";
echo "</div>";
}
echo "</div>";
echo "<div class='col-sm-12'>";
echo "<a href='javascript:Clickheretoprint()' class='btn btn-info' style='float:right;'>Print</a>";
echo "</div>";
}
?>
</div>
</div>
</div>
</div>
</div>