🔒 Closed How to create seat inventory with seat numbers in php( bus seat inventory)

Status
Not open for further replies.

Hamz13

Forum Veteran
20180208_162047.webp Helph po guys pls...
Panu po gumawa ng table ng seat numbers which is detailed kung reserved ang seat number or available. Tnx !
 
siguro gawa ka nalang ng table na nag hahandle nung seat number and reservation status, then upon generating HTML, lagyan mo ng condition if that seat is already reserved.

example: you have a table in you database na parang ganito
Code:
+------------+-------------+-------------+
| bus_number | seat_number | is_reserved |
+------------+-------------+-------------+
|      12345 |           1 |           0 |
|      12345 |           2 |           1 |
|      12345 |           3 |           0 |
|      12345 |           4 |           1 |
+------------+-------------+-------------+

then create the HTML table and add a conditional statement.
I think the basic implementation would be like this.

HTML:
<table>
    <!--- loop ka sa list ng seats --->
    <tr>
          <!--- check mo kung ung seat na un is reserved (e.g: if ($is_reserved == 1)) --->
              <td>Reserved</td>
          <!--- else: --->
              <td>Available</td>
          <!--- end condition --->
    </tr>
    <!--- end loop here --->
</table>
 
siguro gawa ka nalang ng table na nag hahandle nung seat number and reservation status, then upon generating HTML, lagyan mo ng condition if that seat is already reserved.

example: you have a table in you database na parang ganito
Code:
+------------+-------------+-------------+
| bus_number | seat_number | is_reserved |
+------------+-------------+-------------+
|      12345 |           1 |           0 |
|      12345 |           2 |           1 |
|      12345 |           3 |           0 |
|      12345 |           4 |           1 |
+------------+-------------+-------------+

then create the HTML table and add a conditional statement.
I think the basic implementation would be like this.

HTML:
<table>
    <!--- loop ka sa list ng seats --->
    <tr>
          <!--- check mo kung ung seat na un is reserved (e.g: if ($is_reserved == 1)) --->
              <td>Reserved</td>
          <!--- else: --->
              <td>Available</td>
          <!--- end condition --->
    </tr>
    <!--- end loop here --->
</table>
Thanks for gelping i would try po :)
 
Status
Not open for further replies.

Similar threads

About this Thread

  • 4
    Replies
  • 693
    Views
  • 4
    Participants
Last reply from:
Hamz13

Trending Topics

Online now

Members online
1,039
Guests online
990
Total visitors
2,029

Forum statistics

Threads
2,278,688
Posts
28,985,145
Members
1,227,511
Latest member
ventgge
Back
Top