Tuesday, September 9, 2008

ASP Tutorial : How to add more than one Lecturer in Timetable Management

The form will look like this: ======================================================= Point 1: Structure of timetable tt_id primary key tt_date tt_batch_id topic_name lecture_short_code ================================== Code ==========================


<%
if objRs.eof then
%>
<tr>

<td colspan=6 align=center > <font size=3 color=RED> <B> NIL </B> </font>
The List is empty. </td>
</tr>
<%
else


i=1
while not objRs.eof
tt_id=ObjRs("tt_id")
first_start_time=cint(ObjRs("start_time"))
topic_name=ObjRs("topic_name")
topic_short_code=ObjRs("topic_short_code")
start_time=ObjRs("start_time")
end_time=ObjRs("end_time")
room_no=ObjRs("room_no")
lecturer_short_code= ObjRs("lecturer_short_code") & "<br>"
ObjRs.Movenext


If not ObjRs.Eof then
subsequent_start_time=cint(ObjRs("start_time"))
do while first_start_time=subsequent_start_time and not ObjRs.eof
lecturer_short_code=lecturer_short_code & ObjRs("lecturer_short_code") & "<a href=ddd.asp>(delete)</a><br>"
first_start_time=subsequent_start_time
objRs.MoveNext
If not objRs.eof Then
subsequent_start_time=cint(ObjRs("start_time"))
End If
loop
End If
%>
<tr bgcolor="<%=tr_bgcolor%>">
<td nowrap class="ctms_very_small">
<img style="cursor:hand" src="../images/edit_small.gif" alt="Edit" border="0" onClick="fnEdit('<%=tt_id%>')">
<img style="cursor:hand" src="../images/delete_small.gif" alt="Delete" border="0" name="delete<%=tt_id%>" onClick="fnDelete('<%=tt_id%>')">
</td>
<td class="ctms_very_small" align=right>
<%=i%>
</td>
<td class="ctms_very_small" align=right>
<%=topic_name%>
</td>

<td class="ctms_very_small" align=right>
<%=topic_short_code%>
</td>


<td class="ctms_very_small" align=right>
<%=lecturer_short_code%>
<a href="tt_management4.asp?job=addMoreLecturer&start_time=<%=start_time%>">addMore</a>
</td>

<td class="ctms_very_small" align=right>
<%=room_no%>
</td>
<td class="ctms_very_small" align=right>
<%=convert_time(start_time)%> - <%=convert_time(end_time)%>
</td>
</tr>
<%
i=i+1
wend
end if
%>
</tbody>
</table>

<%
end if
%>

 

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

No comments: