Commit f0e28465 authored by G.K.V.S.S.R.PAVAN's avatar G.K.V.S.S.R.PAVAN

Replace updated php code

parent 64d09399
......@@ -12,8 +12,8 @@ if ($conn->connect_error) {
}
if ((isset($_POST['submit'])))
{
//echo "HI";
//echo "<br>";
echo ".......................................................................................................CITYBUS<--->APSTRC...................................................................................................... ";
echo "<br>";
$presentlocation = $_POST['presentlocation'];
$destination = $_POST['destination'];
echo "present location-$presentlocation";
......@@ -24,7 +24,20 @@ $sqlw = "DELETE FROM `destination` WHERE `destination`.`destination` <= $present
$resu=mysqli_query($conn,$sqlw);
$sqlww = "SELECT MAX(seatnum) as max_seatnum FROM destination";
$count="SELECT * FROM destination";
$resulttt=mysqli_query($conn,$count);
//echo "value2-$resulttt"."<br>";
$num_rows=mysqli_num_rows($resulttt);
echo "Strength-$num_rows \n";
echo "<br>";
if($num_rows<"40")
{echo "seats are available";
echo "<br>";}
else
{echo "seats are not available";
echo "<br>";}
$sqlww = "SELECT MAX(seatnum) as max_seatnum FROM destination";
$resultt=mysqli_query($conn,$sqlww);
if (!$resultt) {
printf("Error: %s\n", mysqli_error($conn));
......@@ -41,35 +54,28 @@ $seat=$row['max_seatnum'];
$seat=$seat+1;
echo "seatnum=$seat";
echo "<br>";
if($seat>"40")
{echo "need to add more code";}
else{echo "seatnum=$seat";
echo "<br>";}
$sql = "INSERT INTO destination (present,destination,seatnum) VALUES('$presentlocation','$destination','$seat')";
$result=mysqli_query($conn,$sql);
if (!$result) {
printf("Error: %s\n", mysqli_error($conn));
exit();
}
echo "...............................................................................................THANKS FOR USING APSTRC...................................................................................................... ";
//echo "value2-$result"."<br>";
//$x++;
$count="SELECT * FROM destination";
$resulttt=mysqli_query($conn,$count);
//echo "value2-$resulttt"."<br>";
$num_rows=mysqli_num_rows($resulttt);
echo "Strength-$num_rows \n";
echo "<br>";
if($num_rows<"40")
{echo "seats are available";
echo "<br>";}
else
{echo "seats are not available";
echo "<br>";}
$Seatnum=110178;
$sql = "INSERT INTO seatnumt (Seatnum) VALUES('$Seatnum')";
$result=mysqli_query($conn,$sql);
// $Seatnum=110178;
//$sql = "INSERT INTO seatnumt (Seatnum) VALUES('$Seatnum')";
//$result=mysqli_query($conn,$sql);
//echo "hlooo";
}
......@@ -79,4 +85,4 @@ $resulttt=mysqli_query($conn,$count);
echo "Error: " . $sql . "<br>" . $conn->error;
}*/
?>
\ No newline at end of file
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment