Simple Cinema Ticket Booking

File Structure:


index.php

<!DOCTYPE html>
<html>
<head>
<title>QFX Threater</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/script.js"></script>
</head>
<body>
<div class="screen">
<img src="poster.jpg"/>
</div>
<hr/>
<div class="seat">
<?php 

function book($seat){
$db = mysql_connect('localhost','root','');
mysql_select_db("db_utility",$db);
$sql = "select * from qfx_threater where seat_no ='$seat'";
$result= mysql_query($sql,$db);
$row = mysql_fetch_array($result);
if($row){
return 1;

return 0;
}
?>
<?php for($i=1;$i<=5;$i++) { 
$status = book($i);
if($status){
?>
<div class="no red" data-no="<?php echo $i; ?>">0<?php echo $i; ?></div>
<?php 
}  else { 
?>
<div class="no" data-no="<?php echo $i; ?>">0<?php echo $i; ?></div>
<?php 
}

?>
<div class="clr"></div>
</div>
</body>

</html>

Download 

Share on Google Plus

About Ram Pukar

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment

0 comments:

Post a Comment