Jump to content

Journey planner for Myanmar Railways/buses


EuroFlash

Recommended Posts

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:

 

6jje3l.jpg

 

Basically I want people to be able to search on your website: 

FROM: Rangoon
TO: Bagan

And 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!

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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)."'";
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.