EuroFlash Posted May 6, 2015 Share Posted May 6, 2015 Hey everyone,Last year I've been to Myanmar (Burma) and it's really a pain in the *** to get your way around there. There is no journey planner for trains and barely any bus schedules available online.This wonderful country has opened up in the last couple of years and more and more tourists are bringing a visit to the country.Some friends from Myanmar, and local travel agents collaborate together with me to develop a website with the best and accurate information on travelling in Myanmar.I do have train schedule and bus schedule information available. I'm still working with the guys in Myanmar trying to get the excel files complete including all information on arrival, departure times and fares.But the plan is to put this information in a journey planner and make it accessible for people.This is an example of information I have: Basically I want people to be able to search on your website: FROM: RangoonTO: BaganAnd then get information of departure and arrival times, fares. etc. Same for all other routes in the country.Is it difficult to create such script? Or is somebody willing to help me with this great project? I could do things for you in return.I'm a great (web)designer, and I've got my own marketing company. I'm just not that good at programming.Who could help me out! :-)Thanks in advance! Quote Link to comment Share on other sites More sharing options...
ginerjm Posted May 6, 2015 Share Posted May 6, 2015 If you are looking for a coder perhaps you should look in the jobs or 'coding for hire' forums. We're here to help those who are trying to program Quote Link to comment Share on other sites More sharing options...
EuroFlash Posted May 6, 2015 Author Share Posted May 6, 2015 If you think I could do this on my own. I'd be glad to receive some help. I just really don't know where to start. Quote Link to comment Share on other sites More sharing options...
ginerjm Posted May 6, 2015 Share Posted May 6, 2015 I didn't say you could do it on your own. I said if you had some code then people here would help you, but if you don't know where to begin then perhaps you need to hire someone. Quote Link to comment Share on other sites More sharing options...
ginerjm Posted May 6, 2015 Share Posted May 6, 2015 Do your trains/buses have intermediate stop? Or do they simply go from Bagan to Yangon without stopping anywhere in the middle? If so you need to be able to identify the train that they need to get on. Do you have to concerned about how many seats are available for any bus/train? If so you need to keep track of how many tickets have been sold for each train/bus Things to think about. Quote Link to comment Share on other sites More sharing options...
QuickOldCar Posted May 7, 2015 Share Posted May 7, 2015 First thing you need to do is load this information into a database. I would save the excel as a csv file (tab delimited is probably less prone for errors in parsing) and use load data infile into mysql Make a form with dropdown selects with departure and arrival locations. The POST information from the form would be dynamic values for a select query pdo or mysqli for the database connection It's important to use prepared statements or escaped user input if(isset($_POST)){ if(isset($_POST['departure']){ $departure = strtolower(trim($_POST['departure'])); } if(isset($_POST['arrival']){ $arrival = strtolower(trim($_POST['arrival'])); } if($departure && $arrival){ //mysql connection credentials $sql_host = "localhost"; // MySQL Host $sql_user = "user_name"; // MySql UserName $sql_pass = "user_password"; // MySql Password $sql_db = "my_database"; // MySql Database $sql_table = "my_table";// MySql Table //mysql connection $con=mysqli_connect($sql_host, $sql_user, $sq_pass, $sql_db); if (mysqli_connect_errno()) { die("Connection failed: ".mysqli_error($con)); } //escape the variables if using mysqli, will do it in select statement $query = "SELECT * FROM `$sql_table` WHERE `departure`='".mysqli_real_escape_string ($con,$departure)."' AND `arrival`='".mysqli_real_escape_string ($con,$arrival)."'"; //perform a mysql query $result = mysqli_query($con, $query); //if results returned display the data, else show was no data if(mysqli_num_rows($result) > 0){ while($row = mysqli_fetch_array($result)) { //show the data echo $row['departure'] . "<br />"; echo $row['arrival'] . "<br />"; } } else { echo "No results found"; } //close the connection mysqli_close($con); } You could also do a single dropdown and display any departing or arriving a certain location. $query = "SELECT * FROM `$sql_table` WHERE `departure`='".mysqli_real_escape_string ($con,$location)."' OR `arrival`='".mysqli_real_escape_string ($con,$location)."'"; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.