What's new

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

Status
Not open for further replies.

Hamz13

Forum Veteran
Joined
Jul 16, 2016
Posts
2,273
Reaction
787
Points
721
20180208_162047.jpg Helph po guys pls...
Panu po gumawa ng table ng seat numbers which is detailed kung reserved ang seat number or available. Tnx !
 

Attachments

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

Back
Top