Hi..

Can anyone help me about the Online Bus Ticketing System, i'm using php language and i dont have any idea on how to make a code.
the choices will be like this....
1. place origin
2. destination
3. passenger fare
4. set reservation
5. time departure
6. bus terminal
7. paypal for credit card

You have an outline, so start coding. If you get stuck, post your code and specific questions.

Hi..

Can anyone help me about the Online Bus Ticketing System, i'm using php language and i dont have any idea on how to make a code.
the choices will be like this....
1. place origin
2. destination
3. passenger fare
4. set reservation
5. time departure
6. bus terminal
7. paypal for credit card

this is the main form for the bus ticketing...
ticket.php

<div id="topics">
			<div class="thirds">
			  <p class="style1"><?php echo "".$username=$_POST['username'];?><br />
				</p>
			</div>
			<div class="thirds">
			  <p>&nbsp;</p>
			  <p><strong><span class="style7">On-line Reservation:</span></strong></p>
			</div>
	        <div class="thirds"></div>
	  </div>
		<div id="search">
		
			<form method="post" action="www.google.com.ph">
				<p><input type="text" name="search" class="search" /> <input type="submit" value="Search" class="button" /></p>
			</form>
		</div>
							
		<div id="left">
		  <div class="left_articles">
        
		  
 <form id="form1" method="post" action="ticketverify.php">
 
	 <p align="center" class="style8">Select the origin and destination for your travel.</p>
    <p>&nbsp;</p>
    <table border="0" cellpadding="1" cellspacing="1"><tr><td><strong>Choose Bus terminal Location:</strong></td>
    <td><select name="des1" SIZE="1"><option>----------</option><option name="cag">Cagayan De Oro</option><option value="ili">Iligan</option><option value="kap">Kapatagan</option><option value="pag">Pagadian</option><option value="ipi">Ipil</option><option value="Zam">Zamboanga</option><option value="Osa">Osamiz</option><option value="oro">Oroquieta</option><option value="dip">Dipolog</option><option value="dap">Dapitan</option><option value="mal">Malaybalay</option><option value="val">Valencia</option><option value="Bud">Buda</option><option value="wao">Wao</option><option value="kib">Kibawe</option><option value="gin">Gingoog</option><option value="but">Butuan</option><option value="sur">Surigao</option><option value="dav">Davao</option><option value="sia">Siargao</option><option value="kor">Koronadal</option><option value="gen">Geneneral Santos</option><option value="cot">Cotabato</option><option value="cabt">Cabadbaran</option><option value="kid">Kidapawan</option><option value="tag">Tagum</option><option value="pan">Panabo</option><option value="dig">Digos</option><option value="mat">Mati</option><option value="bis">Bislig</option></select></td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Route Destination:</strong></td>
    <td><select name="des2" SIZE="1"><option>----------</option><option value="cag1">Cagayan De Oro</option><option value="ili1">Iligan</option><option value="kap1">Kapatagan</option><option value="pag1">Pagadian</option><option value="ipi1">Ipil</option><option value="Zam1">Zamboanga</option><option value="Osa1">Osamiz</option><option value="oro1">Oroquieta</option><option value="dip1">Dipolog</option><option value="dap1">Dapitan</option><option value="mal1">Malaybalay</option><option value="val1">Valencia</option><option value="Bud1">Buda</option><option value="wao1">Wao</option><option value="kib1">Kibawe</option><option value="gin1">Gingoog</option><option value="but1">Butuan</option><option value="sur1">Surigao</option><option value="dav1">Davao</option><option value="sia1">Siargao</option><option value="kor">Koronadal</option><option value="gen1">Geneneral Santos</option><option value="cot1">Cotabato</option><option value="cab1">Cabadbaran</option><option value="kid1">Kidapawan</option><option value="tag1">Tagum</option><option value="pan1">Panabo</option><option value="dig1">Digos</option><option value="mat1">Mati</option><option value="bis1">Bislig</option></select></td></tr>
	    <tr><td><strong>Time Departure:</strong></td>
    <td><select name="des3" SIZE="1"><option value="1am">1:30 AM</option><option value="2am">2:00 AM</option><option value="3am">3:00 AM</option><option value="4am">4:00 AM</option><option value="5am">5:00 AM</option><option value="6am">6:00 AM</option><option value="7am">7:00 AM</option><option value="8am">8:00 AM</option><option value="9am">9:00 AM</option><option value="10am">10:00 AM</option><option value="11am">11:00 AM</option><option value="12nn">12:00 NN</option><option value="1pm">1:00 PM</option><option value="2pm">2:00 PM</option><option value="3pm">3:00 PM</option><option value="4pm">4:00 PM</option><option value="4pm">4:00 PM</option><option value="5pm">5:00 PM</option><option value="6pm">6:00 PM</option><option value="7pm">7:00 PM</option><option value="8pm">8:00 PM</option><option value="9pm">9:00 PM</option><option value="10pm">10:00 PM</option><option value="11pm">11:00 PM</option><option value="12mn">12:00 MN</option></select></td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Bus Type:</strong></td><td><select name="des4" size="1"><option>----------</option><option value="nonair">Non-Aircon</option><option value="aircon">Aircon</option></select></td></tr>
        <tr><td><strong>Bus Set No.</strong></td> <td><select name="des5" size="1"><option value="set1">1</option><option value="set2">2</option><option value="set3">3</option><option value="set4">4</option><option value="set5">5</option><option value="set6">6</option><option value="set7">7</option><option value="set8">8</option><option value="set9">9</option><option value="set10">10</option><option value="set11">11</option><option value="set12">12</option><option value="set13">13</option><option value="set14">14</option><option value="set15">15</option><option value="set16">16</option><option value="set17">17</option><option value="set18">18</option><option value="set19">19</option><option value="set20">20</option><option value="set21">21</option><option value="set22">22</option><option value="set23">23</option><option value="set24">24</option><option value="set25">25</option><option value="set26">26</option><option value="set27">27</option><option value="set28">28</option><option value="set29">29</option><option value="set30">30</option><option value="set31">31</option><option value="set32">32</option><option value="set33">33</option><option value="set34">34</option><option value="set35">35</option><option value="set36">36</option><option value="set37">37</option><option value="set38">38</option><option value="set39">39</option><option value="set40">40</option><option value="set41">41</option><option value="set42">42</option><option value="set43">43</option><option value="set44">44</option><option value="set45">45</option><option value="set46">46</option><option value="set47">47</option><option value="set48">48</option><option value="set49">49</option><option value="set50">50</option><option value="backset">Backset</option></select></td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Credit Card Type:</strong></td><td><select name="cardmaster" size="1"><option>Master Card</option><option value="cardvisa">Visa</option><option value="cardmega">Megalink</option></select></td></tr>
<tr><td><strong>Passengers No SP.</strong></td>
    <td><select name="des6" SIZE="1"><option value="n0">0</option><option value="n1">1</option><option value="n2">2</option><option value="n3">3</option><option value="n4">4</option><option value="n5">5</option><option value="n6">6</option><option value="n7">7</option><option value="n8">8</option><option value="n9">9</option></select></td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Passengers SP.</strong></td>
    <td><select name="des7" SIZE="1"><option value="sp0">0</option><option value="sp1">1</option><option value="sp2">2</option><option value="sp3">3</option><option value="sp4">4</option><option value="sp5">5</option><option value="sp6">6</option><option value="sp7">7</option><option value="sp8">8</option><option value="sp9">9</option></select></td></tr><tr><td><br /><br /><center><input name="Submit" type="submit" value="submit" /><input name="reset" type="reset" /></center></td></tr>
        </table>
      
    </p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p class="style11">Member PDIC and Megalink:</p>
    <p><img src="../images/partners_metro.gif" alt="" width="150" height="37" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="../images/paypal_logo.gif" alt="" width="172" height="43" /><img src="../verisign.gif" alt="" width="120" height="73" /></p>
    <p>&nbsp;</p>
    <p class="style9">Note: Fare is subject to change without prior notice. And reservation is valid with in a day upon your transaction.(RTMI)</p>
  </form>
  </div>
	  </div>
		<div id="right">
			<div class="left_articles">RTMI (Rural Transit Management Incorporated) will accept any payment from the passengers who are not a credit card holder for they can avail the online reservation. The reservation of the ticket for the bus is allowed only a day upon you transact. if the passengers who are not ......
			  <p>&nbsp;</p>
			    <p>&nbsp;</p>
			    <p><img src="../images/ask-us.jpg" alt="" width="290" height="157" /></p>
			    <p>&nbsp;</p>
		  </div>
	  </div>

ticketverify.php

<p align="center" class="style8 style1">Verification</p>
     <?php
	 $origin = $_POST['des1'];
	 $destination = $_POST['des2'];
	 $departure = $_POST['des3'];
	 $btype = $_POST['des4'];
	 $bsetno = $_POST['des5'];
	 $cctype = $_POST['cardmaster'];
	 $ccno = $_POST['ccno'];
	 $passnosp =$_POST['des6'];
	 $passsp = $_POST['des7'];
	 $busno = $_POST['busno'];
     $dbhost = "localhost";
	$dbuser = "root";
		if ($origin == "" && $destination == "" && $departure == "" && $btype == "" && $bsetno == "" && $cctype == "" && $passnosp == "" && $ccno == "" && $passsp =="" && $busno == ""){
	echo "<br><br><br><br><center><font color='blue' size = '4'>Please fill-up the the blanks in the table.</font></center><br><br> <center><input type='button' value='Back' onClick='history.go(-1)'></center><br><br>";
	}
	else {
	$con=mysql_connect("$dbhost","$dbuser","") or die("Error connecting to mysql");
	
			$db=mysql_select_db("inform",$con) or die("Cannot connect to Charles Database");

			$row= mysql_query("Select * from reservation where origin = '".$origin."'") or die("Error on Query");
			
			$r=(mysql_fetch_array($row,MYSQL_ASSOC));
			
	
    if ($r["$origin"]=="" ) {
	
$sql=("INSERT INTO reservation(origin,destination,departure,btype,bsetno,cctype,ccno,passnosp,passsp,busno) VALUES ('$origin', '$destination', '$departure', '$btype', '$bsetno', '$cctype', '$ccno', '$passnosp', '$passsp', '$busno')")
 or die("Error on Query  $origin is already exist <br> <center><input type='button' value='Back' onClick='history.go(-1)'></center><br>");
						
				}
				else{
					print "Problem Connection";		
				}
	}
	?>
   <p class="style9">Note: Fare is subject to change without prior notice. And reservation is valid with in a day upon your transaction.(RTMI)</p>
  
  </div>
	  </div>
		<div id="right">
			<div class="left_articles">RTMI (Rural Transit Management Incorporated) will accept any payment from the passengers who are not a credit card holder for they can avail the online reservation. The reservation of the ticket for the bus is allowed only a day upon you transact. if the passengers who are not ......
			  <p>&nbsp;</p>
			    <p>&nbsp;</p>
			    <p><img src="../images/ask-us.jpg" alt="" width="290" height="157" /></p>
		      <p>&nbsp;</p>
		  </div>

this is for the verification..

i dont have any idea on how to process this.
if the customer want to know how fare they be paid, likewise it ask for the credit card no. for the payment and it will be the same to the user name to their credit name and no.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.