-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbook.php
201 lines (182 loc) · 6.95 KB
/
book.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
197
198
199
200
201
<?php include('include/header.php');
$id=$_GET['id'];
$avl=array();
if(!isset($_SESSION['client']['status']))
{
header("location:login.php");
}
$qry2=mysqli_query($con,"select * from shows where show_id=$id");
$show=mysqli_fetch_array($qry2);
$_SESSION['show']=$id;
$mid=$show['show_m'];
$_SESSION['movie']=$mid;
$m_res=mysqli_query($con,"select * from movies where m_id=$mid");
$m_row=mysqli_fetch_assoc($m_res);
?>
<div class="content">
<style type="text/css">
.redBackground{
background-color:red;
}
</style>
<div class="wrap">
<div class="content-top" >
<div class="container">
<div class="col-md-10">
<div class="section group">
<div class="about span_1_of_21">
<center><h3 style="color:blue;text-transform:uppercase;font-weight:bold;">Movie Name : <?php echo $m_row['m_nm']; ?></h3> </center>
<div class="about-top">
<div class="grid images_3_of_2">
<img src="upload/<?php echo $m_row['m_banner']; ?>" alt="banner" width="400px" height="300px"/>
</div>
<div class="desc span_3_of_2">
<p class="p-link" style="font-size:15px;margin-left:10px"><b>Cast : </b><?php echo $m_row['m_cnm']; ?></p>
<p class="p-link" style="font-size:15px;margin-left:10px"><b>Release Date : </b><?php echo $m_row['m_date']; ?></p>
<p style="font-size:15px;margin-left:10px"><b>About : </b><?php echo $m_row['m_des']; ?></p>
</div>
<div class="clear"></div>
</div>
<table class="table table-hover table-bordered text-center">
<?php
$s=mysqli_query($con,"select * from shows where show_id=$id ");
$shw=mysqli_fetch_array($s);
$t=mysqli_query($con,"select * from theatre where t_id='".$show['show_t']."'");
$theatre=mysqli_fetch_array($t);
$_SESSION['theatre']=$theatre['t_id'];
?>
<tr>
<td class="col-md-6">
<strong>Theatre</strong>
</td>
<td>
<?php echo $theatre['t_nm'].", ".$theatre['t_city'];?>
</td>
</tr>
<tr>
<td>
<strong>Screen</strong>
</td>
<td>
<?php
$sn=mysqli_query($con,"select * from screen where s_id='".$show['show_s']."'");
$screen=mysqli_fetch_array($sn);
echo $screen['s_nm'];
?>
</td>
</tr>
<tr>
<td>
<strong>Date</strong>
</td>
<td>
<?php
echo$show['show_date'];
?>
</td>
</tr>
<tr>
<td>
<strong>Show Time</strong>
</td>
<td>
<?php echo $show['show_time'];?> Show
</td>
</tr>
<tr>
<div class="col-md-12">
<div class="row">
<div class="col-md-4">
<td>
<strong>Booking Seats </strong><br><br>
<i class="fa fa-ban" aria-hidden="true" style="color:red; font-size:20px;"></i> <b>Already Booked</b><br><br>
<i class="fa fa-square-o" aria-hidden="true" style=" font-size:20px;"></i> <strong>Available </strong><br><br>
<i class="fa fa-check-square-o" aria-hidden="true" style=" font-size:20px;"></i> <strong>Selected </strong><br><br>
<div style="h3 after:hover{color:blue};">
</div>
</td>
</div>
<div class="col-md-8">
<td>
<form action="process_booking.php" method="post" id="devel-generate-content-form">
<input type="hidden" name="screen" value="<?php echo $show['show_s'];?>"/>
<div class="form-item form-type-checkbox form-item-node-types-forum col-md-11">
<?php
$ses=mysqli_query($con,"select * from seat where seat_show=$id");
while($srow=mysqli_fetch_array($ses))
{
?>
<div class="col-md-2" style="display:inline-block;">
<input type="checkbox" id="edit-node-types-article" name="seats[]" <?php if($srow['seat_uid'] != 0){?> style="display:inline-block; height:20px; width:20px;background-color: #a77e2d !important;
color: #ffffff !important;"<?php }else {?> style="display:inline-block; background: red; height:20px;width:20px"<?php } ?> class="form-control" value="<?php echo $srow['seat_id'];?>" <?php if($srow['seat_uid'] != 0){ echo ' disabled'; } ?>>
<?php echo $srow['seat_row'].''.$srow['seat_col'].'</div>';}
?>
</div>
<input type="hidden" name="amount" id="hm" value="<?php echo $show['show_price'];?>"/>
<input type="hidden" name="seat" min="1" id="seat" value=""/>
<input type="hidden" name="seats" min="1" id="seats" value=""/>
<input type="hidden" name="date" value="<?php echo $show['show_date'];?>"/>
<input type="hidden" name="time" value="<?php echo $show['show_time'];?>"/>
</td>
</div>
</div>
</tr>
<tr>
<td>
Amount
</td>
<td id="amount" style="font-weight:bold;font-size:18px">
Rs <?php echo $show['show_price']; ?>
</td>
</tr>
<tr>
<td colspan="2"><?php if($show['show_seat']==0){?><button type="button" class="btn btn-danger" style="width:100%">House Full</button><?php } else { ?>
<button class="btn btn-info" type="submit" style="width:100%">Book Now</button>
<?php } ?>
</form>
</td>
</tr>
<table>
<tr>
<td></td>
</tr>
</table>
</div>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<?php include('include/footer.php');?>
<script type="text/javascript">
$(document).ready(function(){
$('input[type=checkbox]:checked').css('background-color','black');
$("form").submit(function(){
if($('input[type=checkbox]:checked').length<1)
{
alert("Please Select The Seat");
return false;
}
});
var $checkboxes = $('#devel-generate-content-form input[type="checkbox"]');
$checkboxes.change(function(){
var countCheckedCheckboxes = $checkboxes.filter(':checked').length;
$('#count-checked-checkboxes').text(countCheckedCheckboxes);
$('#seats').val(countCheckedCheckboxes);
var charge=<?php echo $show['show_price'];?>;
amount=charge*countCheckedCheckboxes;
$('#amount').html("Rs "+amount);
$('#hm').val(amount);
$('#seats').val(countCheckedCheckboxes);
//Create an Array.
var selected = new Array();
//Reference the CheckBoxes and insert the checked CheckBox value in Array.
$("#devel-generate-content-form input[type=checkbox]:checked").each(function () {
selected.push(this.value);
});
$('#seat').val(selected);
console.log(selected);
});
});
</script>