Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.34 KB | None | 0 0
  1. <?php if($check_login == true) { ?>
  2. <section style="margin-top: -40px;" class="slider">
  3. <img src="http://vdalairlines.com/new/images/booked.png" /></section>
  4. <br />
  5.  
  6.         <?php if($_GET[m] == 1) { ?>
  7.                                     <div class="alert alert-success">
  8.                     <span class="icon-info-sign fl"></span> Flight successfully booked.</div>
  9.                 <?php } ?>
  10.                         <?php if($_GET[m] == 2) { ?>
  11.                                     <div class="alert alert-success">
  12.                     <span class="icon-info-sign fl"></span> Flight successfully removed.</div>
  13.                 <?php } ?>
  14. <?php
  15. $bid_q = mysql_query("SELECT * FROM bids WHERE pid='$info_id'");
  16. $count = mysql_num_rows($bid_q);
  17. if($count == 0) { echo '<center>Sorry! You currently have no booked flights!</center><br />';
  18. } else {
  19. ?>
  20. <?php
  21. $dt = explode(":", $route[deptime]);
  22. $dt2 = preg_replace("/[^0-9 ]/", '', $dt[1]);
  23. function minute($dec)
  24. {
  25.     $hour = floor($dec);
  26.     $min = round(60*($dec - $hour));
  27.     return $min;
  28. }
  29. function hour($dec)
  30. {
  31.     $hour = floor($dec);
  32.     $min = round(60*($dec - $hour));
  33.     return $hour;
  34. }
  35. ?>
  36. <table class="table table-striped">
  37. <thead>
  38. <tr cellpadding='2'>
  39.     <th class='tablehead' align="center" height="23">Flight</th>
  40.     <th class='tablehead' align="center" height="23">Departure</th>
  41.     <th class='tablehead' align="center" height="23">Departure Time</th>
  42.     <th class='tablehead' align="center" height="23">Arrival</th>
  43.     <th class='tablehead' align="center" height="23">Arrival Time</th>
  44.     <th class='tablehead' align="center" height="23">Aircraft</th>
  45.     <th class='tablehead' align="center" height="23">Duration</th>
  46.     <th class='tablehead' align="center" height="23">Dispatch</th>
  47.     <th class='tablehead' align="center" height="23">Cancel</th>
  48. </tr></thead>
  49. <tbody>
  50. <?php
  51. while($bid = mysql_fetch_assoc($bid_q))
  52. {
  53. $bids_q = mysql_query("SELECT * FROM schedules WHERE id='$bid[fid]'");
  54. $route = mysql_fetch_assoc($bids_q);
  55. ?>
  56. <tr>
  57. <td cellpadding='2' align="center" class='tablemed' height='23'>
  58. <?php echo $route[code] . $route[flightnum]; ?>
  59. </td>
  60. <td cellpadding='2' align="center" class='tablemed'  height='23'>
  61. <?php
  62. $depicao = $route[depicao];
  63. $depname = mysql_query("SELECT * FROM airports WHERE icao='$depicao'");
  64. while($row = mysql_fetch_array($depname))
  65. {
  66. echo '<abbr title="'.$row[name].'">'.$row['icao'].'</abbr>';
  67. }
  68. ?>
  69. </td>
  70. <td cellpadding='2' align="center" class='tablemed' height='23'>
  71. <?php echo $route[deptime];?>
  72. </td>
  73. <td cellpadding='2' align="center" class='tablemed' height='23'>
  74. <?php
  75. $arricao = $route[arricao];
  76. $arrname = mysql_query("SELECT * FROM airports WHERE icao='$arricao'");
  77. while($row = mysql_fetch_array($arrname))
  78. {
  79. echo '<abbr title="'.$row[name].'">'.$row['icao'].'</abbr>';
  80. }
  81. ?>
  82. </td>
  83.  
  84. <td cellpadding='2' align="center" class='tablemed' height='23'>
  85. <?php echo $route[arrtime];?>
  86. </td>
  87. <td cellpadding='2' align="center" class='tablemed' height='23'>
  88. <?php
  89. $ac = $route[aircraft];
  90. $sel = mysql_query("SELECT * FROM aircraft WHERE id='$ac'");
  91. $d = mysql_fetch_assoc($sel);
  92. echo '<abbr title="'.$d[name].'">'.$d[icao].'</abbr>'; ?>
  93. </td>
  94. <td cellpadding='2' align="center" class='tablemed' height='23'>
  95. <?php echo $route[flighttime]; ?>
  96. </td>
  97. <td>
  98.  
  99. <a id="<?php echo $route[id]; ?>" class="addbid" href="http://www.simbrief.com/system/dispatch.php?airline=AAL&fltnum=<?=$route[flightnum]; ?>&type=<?=$d[icao]?>&orig=<?=$route[depicao]?>&dest=<?=$route[arricao]?>&date=<?=strtoupper(date("dMy"))?>&deph=<?=$dt[0];?>&depm=<?=$dt2;?>&planformat=LIDO&units=lbs&steh=<?=hour($route[flighttime])?>&stem=<?=minute($route[flighttime])?>&fl=auto&altn=auto">Dispatch</a>
  100. </td>
  101. <td cellpadding='2' align="center" class='tablemed' height='23'>
  102. <?php
  103.             if ($check_login == true)
  104.             {
  105.              ?>
  106.  
  107.                 <a id="<?php echo $route[id]; ?>" style="text-decoration:none !important;border:none;"  class="addbid" href="./base/unbook.php?id=<?php echo $bid[id]; ?>"><center></center><img style="text-decoration:none;height:20px;width:20px;" src="http://www.clker.com/cliparts/a/6/e/8/119498563188281957tasto_8_architetto_franc_01.svg.med.png"></center></a>
  108.             <?php            
  109.             }
  110.         ?>
  111. </td>
  112. </tr>
  113. <?php
  114.  /* END OF ONE TABLE ROW */
  115.  
  116. }
  117. ?>
  118. </tbody>
  119. </table><?php } ?>
  120.    
  121.             </section> <!-- END company-info -->
  122.            
  123.         </section> <!-- END main -->
  124.         </section> <!-- END container -->
  125.         <?php } ?>
  126.         </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement