Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. <?php
  2.  
  3. include('db_core.php');
  4. include('station_info.php');
  5.  
  6. function sourceName($no,$conn) {
  7. $results=exec_query_table("select name from station_info where station_key='$no';",$conn);
  8. foreach ($results as $result){
  9. $result['name'];
  10. }
  11. return $result['name'];
  12. }
  13.  
  14. function changeSrc($source,$destination,$src_nm,$dest_nm,$conn)
  15. {
  16. $results=exec_query_table("select * from bus_info where src=$source and dest=$destination;",$conn);
  17.  
  18. foreach($results as $result)
  19. {
  20. $result['src']=$src_nm;
  21. $result['dest']=$dest_nm;
  22. print $result['bus_no'].$result['seats'].$result['src'].$result['dest'].$result['fare'].$result['seat_style'].$result['bus_type'].$result['seats'].$result['arrival_time'].$result['dep_time'].$result['halt_service_date'].$result['halt_duration'].$result['vendor_name'];
  23. print "<br>";
  24. }
  25.  
  26. }
  27. $conn=connectToDb('localhost','root','','inktat');
  28.  
  29. if($_GET['source'] && $_GET['dest'])
  30. {
  31. $src= sourceName($_GET['source'],$conn);
  32. $dest= sourceName($_GET['dest'],$conn);
  33. changeSrc($_GET['source'],$_GET['dest'],$src,$dest,$conn);
  34. mysql_close($conn);
  35. return 0;
  36. }
  37.  
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement