Jump to content

Need Help To Print Large HTML Table


34drysdale

Recommended Posts

We have booking data in spreadsheet looks like table in below, and each booking is for a full week. 

 

      | wk1 | wk2 | wk3 | wk4 | wk5 |..........| wk52 |

==================================

E1  | resv |        |resv |        |resv |          |resv

E2  |        | resv |resv |resv  |

E3  | resv | resv |...............................................

E4  | resv |

E5  |

...  | resv | resv|....................................

...  |

E50|resv | resv |        | resv

 

It looks great excel but required one person to manage all bookings.  So we moved to web interface and allow users to make their own bookings.  Now, data moved to sql database with fields (id, wk#, room, other....),

and records like below.

01 wk1 E1

02 wk1 E3

03 wk1 E4

..... etc....

nn wk2 E2

nn wk2 E3

... and more

 

Now, I need a method in PHP to print above data in HTML table that looks like excel table in above.  It doesn't have to print 52 wks in one page, but at least something like 4 wks view and next page to show the next 4 wks.

At start it will print the first 4 wks from the current week (wk 11), and next page will print wk12 to wk15, etc.

 

      | wk1 | wk2 | wk3 | wk4

===================

E1  | resv |        |resv |       

E2  |        | resv |resv |resv 

E3  | resv | resv |...............

E4  | resv |

E5  |

more rows......

 

Can someone here give me a direction how to code this in PHP?

 

 

Thank you very much!

bobo

 

Link to comment
Share on other sites

Yes, it will query the database and print a table in pages.  I have data in sqlite db, but don't know how to code in PHP.  I just started learning PHP last week and am not a programmer.

I want to do something like when a user click to view bookings, the tool will show up 4 weeks view starting from the current week and click on next page will show the next 4 weeks, something like that.

 

Thank you!

Link to comment
Share on other sites

Looks like you have a lot to learn!  Especially as most tutorials deal with mysql rather than sqlite.  I would start out with a simple task like displaying a static html table from php.  Then display data from the table using fixed conditions (for example, display week 1 only).  Then extend it to display multiples weeks, and then to take the page number from a form.

 

You can probably find some useful information in the comments on this page: http://php.net/manual/en/book.sqlite.php

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.