Jump to content

Recommended Posts

Subj: Generate 24 hour time and display Data for each time

 

How would it be possible to display a 24hour time format in a html table.

I would like to have 1 column for names and 24 columns for $hour.

Each $hour, each person has time scheduled of things to do. and it could be he has a lot of things to do.

 

For now, i'm just trying to figure it out how each $things_to_do of each unique $person will display in its scheduled timein the HTML table.

 

I gathered these variables somwhere outhere.... ::)

...and a query ... just to give you idea...

 

$time_table = range(0, 23); #maybe for array time 00-23 that each sched will store into.
foreach ($time_table as $time) # i don't know how to use this one...


$sql2 = "SELECT name,
left(time_sched,2) as time,
date_sched
FROM
schedule
WHERE 
LEFT(time_sched, 2) = ". $time."  AND date_sched = '$SearchString'
GROUP BY name";

 

 

 

:( Should I use push_array? ??? or foreach?  ??? I really do not know what to do!!!  I Really Need Help Here!!! Thanks a lot guys!  :)

Link to comment
https://forums.phpfreaks.com/topic/85126-24-hour-schedule-prob/
Share on other sites

date("g") or date("G")?

 

no sir. don't worry with the date. i'll use any date maybe from a search input.

if you're willing to help me, just use any date. Or you could have your own idea of what i'm talkin' about here.

I just want to have an idea how it works... maybe with array[] or a aimple query and HTML table structure.

  ::)

Link to comment
https://forums.phpfreaks.com/topic/85126-24-hour-schedule-prob/#findComment-434255
Share on other sites

Then you can do something like:

Make a SQL database with 2 fields. 1 for the schedule and one for the time. So just 2 columns. The time is practically all you need. You can run a query to sort the time so you get the schedule that is most upcoming to the schedule that is least upcoming.

 

And generating the HTML table would be up to you.

Link to comment
https://forums.phpfreaks.com/topic/85126-24-hour-schedule-prob/#findComment-434272
Share on other sites

this is what i mean of the table...

i don't have any idea of  the code behind this. How the time will display into its proper column.

 

 

Name0           1             2               3...        23        

 

John00:30

00:45

01:15

01:30

01:55

[/td][td]23:00

23:45

 

 

Mike   02:00

02:30

02:45

03:30

03:45

03:55

 

 

Steve   02:10

02:30

02:45

03:30

03:00

03:25

 

 

 

??? ??? ???

Link to comment
https://forums.phpfreaks.com/topic/85126-24-hour-schedule-prob/#findComment-434297
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.