PageRenderTime 65ms CodeModel.GetById 37ms RepoModel.GetById 0ms app.codeStats 0ms

/neticketing/routelist.php

https://bitbucket.org/mac_pasha/neticketing
PHP | 167 lines | 158 code | 9 blank | 0 comment | 19 complexity | d14617b7abb605e38b267147694b6b07 MD5 | raw file
  1. <?php require_once('Connections/neticketing.php'); ?>
  2. <?php
  3. if (!isset($_SESSION)) {
  4. session_start();
  5. }
  6. if (!function_exists("GetSQLValueString")) {
  7. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  8. {
  9. if (PHP_VERSION < 6) {
  10. $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  11. }
  12. $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  13. switch ($theType) {
  14. case "text":
  15. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  16. break;
  17. case "long":
  18. case "int":
  19. $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  20. break;
  21. case "double":
  22. $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
  23. break;
  24. case "date":
  25. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  26. break;
  27. case "defined":
  28. $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  29. break;
  30. }
  31. return $theValue;
  32. }
  33. }
  34. mysql_select_db($database_neticketing, $neticketing);
  35. $query_routelist = "SELECT distinct source FROM launch_info";
  36. $routelist = mysql_query($query_routelist, $neticketing) or die(mysql_error());
  37. $row_routelist = mysql_fetch_assoc($routelist);
  38. $totalRows_routelist = mysql_num_rows($routelist);
  39. ?>
  40. <!-------------------Banner START---------------------->
  41. <?php include('include/banner.php');?>
  42. <!-------------------Banner END---------------------->
  43. <script>
  44. function get_stn_to(str)
  45. {
  46. if (str=="")
  47. {
  48. document.getElementById("stn_to_list").innerHTML="";
  49. return;
  50. }
  51. if (window.XMLHttpRequest)
  52. {// code for IE7+, Firefox, Chrome, Opera, Safari
  53. xmlhttp=new XMLHttpRequest();
  54. }
  55. else
  56. {// code for IE6, IE5
  57. xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  58. }
  59. xmlhttp.onreadystatechange=function()
  60. {
  61. if (xmlhttp.readyState==4 && xmlhttp.status==200)
  62. {
  63. document.getElementById("stn_to_list").innerHTML=xmlhttp.responseText;
  64. }
  65. }
  66. xmlhttp.open("GET","routelist/getStationTo.php?q="+str,true);
  67. xmlhttp.send();
  68. }
  69. </script>
  70. </head>
  71. <body>
  72. <!-------------------HEADER START---------------------->
  73. <?php include('include/header.php');?>
  74. <!-------------------HEADER END---------------------->
  75. <!-------------------BODY START---------------------->
  76. <div id="signup_body" class="account_body" style="padding-top: 0px;">
  77. <div id="tabs">
  78. <!--main menu-->
  79. <?php include('include/navigation.php');?>
  80. <!--main menu-->
  81. <!-- DIV start for Dashboard -->
  82. <div id="trainroute" style="margin-top: 30px;">
  83. <div id="train_route_div">
  84. <fieldset class="signup_fieldset">
  85. <legend id="legend">&nbsp;Launch ROUTE &nbsp;</legend>
  86. <form class="box login" id='train_route' action='routelist/routelistResult.php'
  87. method='post' accept-charset='UTF-8'>
  88. <table width="80%" id="" style="margin: auto; font-size: 16px;">
  89. <tr>
  90. <td colspan="2" id="label" width="130px"><label
  91. for='journey_date'>Journey Date :</label></td>
  92. <td><div id="select">
  93. <select class="input_train_info" name="journey_date"
  94. id="journey_date" required>
  95. <option value="0">===SELECT JOURNEY DATE===</option>
  96. <?php for($i=1;$i<=7;$i++){
  97. $bookingTime = mktime(0,0,0,date("m"),date("d")+$i,date("Y"));
  98. ?>
  99. <option value="<?php echo date("d-m-Y", $bookingTime);?>"> <?php echo date("d-m-Y", $bookingTime);?> </option>
  100. <?php }?>
  101. </select>
  102. </div></td>
  103. </tr>
  104. <tr>
  105. <td colspan="2" id="label"><label for='station_from'>Station From :</label></td>
  106. <td>
  107. <div id="select">
  108. <select name="station_from" id="station_from" class="input_train_info"
  109. tabindex="2" onchange="get_stn_to(this.value)">
  110. <option value="0" label="===SELECT STATION==="> ===SELECT STATION===</option>
  111. <?php
  112. do { ?>
  113. <option value="<?php echo $row_routelist['source']?>"<?php if (!(strcmp($row_routelist['source'], $row_routelist['source'])))?>> <?php echo $row_routelist['source']?> </option>
  114. <?php } while ($row_routelist = mysql_fetch_assoc($routelist));
  115. $rows = mysql_num_rows($routelist);
  116. if($rows > 0) {
  117. mysql_data_seek($routelist, 0);
  118. $row_routelist = mysql_fetch_assoc($routelist);
  119. }
  120. ?>
  121. </select>
  122. </div></td>
  123. </tr>
  124. <tr>
  125. <td colspan="2" id="label"><label for='station_to'>Station To :</label></td>
  126. <td><div id="select"> <font id="stn_to_list">
  127. <select id="input_train_info" name="stn_to_list">
  128. <option value="0" />===NONE===</option>
  129. </select>
  130. </font> </div></td>
  131. </tr>
  132. </table>
  133. <div align="center">
  134. <input type="submit" name="train_route" value="Show Route"
  135. id="button1" tabindex="5" />
  136. </div>
  137. </form>
  138. </fieldset>
  139. </div>
  140. </div>
  141. <!-- DIV end for Dashboard -->
  142. </div>
  143. </div>
  144. <!-------------------FOOTER START---------------------->
  145. <div style="height: 10px;"></div>
  146. <div id="footer_woh">
  147. <div id="float_left">
  148. <footer id="copyright"> <a class="personal_info">&COPY;</a> <a
  149. href="http://www.csejnu02.wodrpress.com" target="_blank">Pasha &
  150. Abir</a> <a> 2012-2013</a> </footer>
  151. <?php
  152. mysql_free_result($routelist);
  153. ?>
  154. </div>
  155. </div>
  156. <!-------------------FOOTER END---------------------->
  157. </body>
  158. </html>