Bus Reservation and Ticket Booking Project PHP code download.
Download Bus Reservation and Ticket Book PHP code
delete_bus.php
1 2 3 4 5 6 7 |
<?php include('db_connect.php'); extract($_POST); $remove = $conn->query("UPDATE bus set status = 0 where id =".$id); if($remove) echo 1; |
delete_location.php
1 2 3 4 5 6 7 |
<?php include('db_connect.php'); extract($_POST); $remove = $conn->query("UPDATE location set status = 0 where id =".$id); if($remove) echo 1; |
delete_schedule.php
1 2 3 4 5 6 7 |
<?php include('db_connect.php'); extract($_POST); $remove = $conn->query("UPDATE schedule_list set status = 0 where id =".$id); if($remove) echo 1; |
load_booked.php
1 2 3 4 5 6 7 8 9 10 |
<?php include 'db_connect.php'; $query = $conn->query("SELECT b.*,(s.price * b.qty) as amount from booked b inner join schedule_list s on s.id = b.schedule_id order by date(b.date_updated) desc "); $data = array(); while($row = $query->fetch_assoc()){ $data[] = $row; } echo json_encode($data); ?> |
load_bus.php
1 2 3 4 5 6 7 8 9 |
<?php include 'db_connect.php'; $qry = $conn->query("SELECT * FROM bus where status = 1 order by bus_number asc"); $data = array(); while($row = $qry->fetch_assoc()){ $data[]= $row; } echo json_encode($data); |
load_location.php
1 2 3 4 5 6 7 8 9 |
<?php include 'db_connect.php'; $qry = $conn->query("SELECT * FROM location where status = 1 order by terminal_name asc,city asc,state asc"); $data = array(); while($row = $qry->fetch_assoc()){ $data[]= $row; } echo json_encode($data); |
manage_bus.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 |
<?php include('db_connect.php'); if(isset($_GET['id']) && !empty($_GET['id']) ){ $qry = $conn->query("SELECT * FROM bus where id = ".$_GET['id'])->fetch_array(); foreach($qry as $k => $val){ $meta[$k] = $val; } } ?> <div class="container-fluid"> <form id="manage_bus"> <div class="col-md-12"> <div class="form-group mb-2"> <label for="name" class="control-label">Bus Name</label> <input type="hidden" class="form-control" id="id" name="id" value='<?php echo isset($_GET['id']) ? $_GET['id'] : '' ?>' required=""> <input type="text" class="form-control" id="name" name="name" required="" value="<?php echo isset($meta['name']) ? $meta['name'] : '' ?>"> </div> <div class="form-group mb-2"> <label for="bus_number" class="control-label">Bus Number</label> <input type="number" class="form-control" id="bus_number" name="bus_number" required value="<?php echo isset($meta['bus_number']) ? $meta['bus_number'] : '' ?>"> </div> </div> </form> </div> <script> $('#manage_bus').submit(function(e){ e.preventDefault() start_load() $.ajax({ url:'./save_bus.php', method:'POST', data:$(this).serialize(), error:err=>{ console.log(err) end_load() alert_toast('An error occured','danger'); }, success:function(resp){ if(resp == 1){ end_load() $('.modal').modal('hide') alert_toast('Data successfully saved','success'); load_bus() } } }) }) </script> |
manage_bus.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 |
<?php include('db_connect.php'); if(isset($_GET['id']) && !empty($_GET['id']) ){ $qry = $conn->query("SELECT * FROM location where id = ".$_GET['id'])->fetch_array(); foreach($qry as $k => $val){ $meta[$k] = $val; } } ?> <div class="container-fluid"> <form id="manage_location"> <div class="col-md-12"> <div class="form-group mb-2"> <label for="terminal_name" class="control-label">Terminal Name</label> <input type="hidden" class="form-control" id="id" name="id" value='<?php echo isset($_GET['id']) ? $_GET['id'] : '' ?>' required=""> <input type="text" class="form-control" id="terminal_name" name="terminal_name" required="" value="<?php echo isset($meta['terminal_name']) ? $meta['terminal_name'] : '' ?>"> </div> <div class="form-group mb-2"> <label for="city" class="control-label">City</label> <input type="text" class="form-control" id="city" name="city" required="" value="<?php echo isset($meta['city']) ? $meta['city'] : '' ?>"> </div> <div class="form-group mb-2"> <label for="state" class="control-label">Province</label> <input type="text" class="form-control" id="state" name="state" required="" value="<?php echo isset($meta['state']) ? $meta['state'] : '' ?>"> </div> </div> </form> </div> <script> $('#manage_location').submit(function(e){ e.preventDefault() start_load() $.ajax({ url:'./save_location.php', method:'POST', data:$(this).serialize(), error:err=>{ console.log(err) end_load() alert_toast('An error occured','danger'); }, success:function(resp){ if(resp == 1){ end_load() $('.modal').modal('hide') alert_toast('Data successfully saved','success'); load_location() } } }) }) </script> |
Bus Reservation PHP Code, Bus ticket booking PHP Code, Bus Seat Reservation PHP source Code, PHP script of Bus Reservation, and Ticket Booking Project PHP code download.