- Time Management -

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Curiousguy
New php-forum User
New php-forum User
Posts: 3
Joined: Thu Sep 04, 2003 7:48 am

- Time Management -

Postby Curiousguy » Sun Sep 07, 2003 2:39 am

How to create a time verification script like that .?


For Example: If There is three Classes, and "Class A" is only available between 10am - 1030am, and "Class B is only available between 1200pm - 1300pm... How do i using the Pull down menu to list out only the available class for the certain time, let say "Class A" is only available in the Pull down menu when the time is between 10am - 1030am?

is possible to create it in PHP or JaVa script??
where can i get this kind of sript?/?

PLs help ASAP .... thanks vry much


<?
$Connect = mysql_connect('localhost','root','');
mysql_select_db('mw');
$result=mysql_query("SELECT * FROM student where (username1='$username1')");
$number_of_array = mysql_num_rows($result);
echo '
<form name="main" method="POST" action="verify_attendance.php">
<table cellspacing="0" cellpadding="0" border="1" width=80% align=center>
<tr>
<td width=25% height=30 align=center>
Student ID
</td>
<td width=25% height=30 align=center>
Programme
</td>
<td width=25% height=30 align=center>
Subject
</td>
<td width=25% height=30 align=center>
Action
</td>
</tr>';
while ($number_of_array = mysql_fetch_array($result))
{

echo '
<tr>
<td align=center height=30>
'.$number_of_array['username1'].'
</td>
<td align=center height=30>
'.$number_of_array['programme'].'
<input type="hidden" name="programme" value="'.$number_of_array['programme'].'">

</td>
<td align=center height=30>
<select name="subject">
<option value="'.$number_of_array['subject1'].'">
'.$number_of_array['subject1'].'
</option>
<option value="'.$number_of_array['subject2'].'">
'.$number_of_array['subject2'].'
</option>
<option value="'.$number_of_array['subject3'].'">
'.$number_of_array['subject3'].'
</option>
<option value="'.$number_of_array['subject4'].'">
'.$number_of_array['subject4'].'
</option>
<option value="'.$number_of_array['subject5'].'">
'.$number_of_array['subject5'].'
</option>
</select>
</td>
<td align=center height=30>
<input type=submit name=Submit value="Mark Attendance" style=width:130>
</td>
</tr>';
}

echo '
</table>
</form>';
?>

User avatar
Redcircle
Moderator
Moderator
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Postby Redcircle » Sun Sep 07, 2003 11:13 am

Somethign like
$current_time = //current time of day since 12am
//start_time would be seconds since 12am
//length would be in seconds
$query = 'select * from classes left join class_time on classes.class_id = class_time.class_id where start_time > "'.$current_time.'" and (start_time+length)< '".$current_time.'" order by start_time asc';


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 1 guest

cron