hey everyone. i am creating a seating system using php. it is to determine which people to their seats in the event. the problem is if I want to visualize the position of the seating using pictures in php is it possible? if yes, how can i do this?

The pictures was based from the record from database. the pictures of the seating will link to the current record for update.

i hope you guys can help me. thanks in advance.

Recommended Answers

All 10 Replies

it's possible, just design your database schema to accept pictures and link the seats and people tables via foreign key

Actually I was thinking something like this. view my diagram in attachments.

This should be in view seating page. then when user click the seat, then it will forward to other pages related to the seat based on the record.

Let say i click the A1 seat, then it display the records about this seat.

how do i link the picture to the record? and then the picture was draw based on how many records on the database.

thanks again.

records? you mean information about that seats? then all you need to do is create a table for seats which will store the information about the seats, then query them to display on the seating page, maybe a small image and a link, then upon clicking each seats, you will redirect to it's detailed page displaying the full information, you can do this by passing the id of the selected seat

to be honest i don't know if im really helping you, so i suggest you should start designing your database and start coding then you can come back here with codes so we can further examine your code, because right now, i think were imagining things

its all right. actually i have completed the code for viewing the record. but i am just displaying the data using tables. so instead of showing this, i want it to be displaying images like that with a link to the records.

<?php
$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
$db_selected = mysql_select_db("seating_arrangement",$con);
$sql = "SELECT * FROM seatdb ;";
$result = mysql_query($sql,$con);
$row = mysql_num_rows($result);

echo "<div><h2>View seat</h2><br>";
echo "<form action=\"?pages=5\" method=POST><input type=\"submit\" value=\"Search\" /></form>";
echo "<table border=1 cellpadding=\"2\" cellspacing=\"2\" width=\"100%\"><tr><th>ID</th><th>Name</th><th>IC Number</th><th>Seat number</th><th>Availability</th></tr>";

if ($result)
  {
    for ($i = 0;$i < $row; $i++){
          $id = mysql_result($result, $i, "ID");
          $name = mysql_result($result, $i, "name");
          $noic = mysql_result($result, $i, "noic");
          $seatno = mysql_result($result, $i, "seatno");
          $filled = mysql_result($result, $i, "filled");
          if($filled == 0){
                     $att = "Empty";
                     echo "<tr><td>", $id , "</td><td>",$name, "</td><td>" ,$noic, "</td><td>",$seatno, "</td><td>", $att, "</td></tr>";
          }
          else if($filled == 1){
                     $att = "Filled";
                     echo "<tr><td>", $id , "</td><td>",$name, "</td><td>" ,$noic, "</td><td>",$seatno, "</td><td>", $att, "</td></tr>";
          }
    }
    
  }
mysql_close($con);

echo "</table></div><br>";
echo "<p>Search done: Found " . $i . " results of " . $row . "</p>";

?>

thanks again for willing to help me :)

okay so what you can do here is, add new field on the table seatdb to store the image path, then you can create a hyperlinks to each seats then pass an id variable, the link will redirect into a php page where you can do your work there like detail page. example

echo "<tr><td><a href='/detail_view.php?id=".$id."'><img src='".$your_image_path."' /></a></td></tr>";

okay so what you can do here is, add new field on the table seatdb to store the image path, then you can create a hyperlinks to each seats then pass an id variable, the link will redirect into a php page where you can do your work there like detail page. example

echo "<tr><td><a href='/detail_view.php?id=".$id."'><img src='".$your_image_path."' /></a></td></tr>";

so it means that i have to create a lot of images for a lot of seats?
let say that i have 30 seats, then i need to have 30 images for the link or what?

sorry i am quite not clear about this.

i am imagine that i want to create the view like the design. the small circle represents the seats in the records. so the number of the circle is based on how many seats in the record. then the circle have links to the details of the seat.

i guess it was something similar to the jquery maphilight.

thanks for your help.

Or try using HTML map and area tags, with each area containing a link to the page with the seat information.

It might however be quite time consuming to add all of the areas.

Or try using HTML map and area tags, with each area containing a link to the page with the seat information.

It might however be quite time consuming to add all of the areas.

i was thinking the same. but there should be a problem, because how could i link the map area to the certain seats in the records. if it was predefined, then should be easy, but how will i know how much seats would the user entered and how can i link for each seats based on how much number of seats in the database records.

thanks for your help

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.