منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
عمل Calendar باستخدام ASP - عرض شهور - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : الأقسام التعليمية - المنتدى القديم (http://vb4arb.com/vb/forumdisplay.php?fid=90)
+--- قسم : مكتبة أكواد المنتدى (http://vb4arb.com/vb/forumdisplay.php?fid=111)
+---- قسم : مكتبة أكواد لغات الويب (http://vb4arb.com/vb/forumdisplay.php?fid=119)
+---- الموضوع : عمل Calendar باستخدام ASP - عرض شهور (/showthread.php?tid=6399)



عمل Calendar باستخدام ASP - عرض شهور - RaggiTech - 17-10-12

كاتب الموضوع : AhmedEssawy


كود :
[COLOR=#000080]<%
function tagdates
End function

function drawcalander
'===================== calculating values for drawing calander
if request.QueryString("date")="" then
current_date=date()
else
current_date=request.QueryString("date")
End if
current_month=month(current_date)
current_year=year(current_date)
current_day=day(current_date)
first_day_month=day(dateserial(current_year,current_month,01))
last_day_month=day(dateserial(current_year,current_month+1,1-1))
weekday_monthfirst=weekday(dateserial(current_year,current_month,01))
weekday_today=weekday(dateserial(current_year,current_month,current_day))
'======================================
'response.write "<br>current date ="&current_date&"<br>"
'response.write "<br>current month ="&current_month&"<br>"
'response.write "<br>year ="&current_year&"<br>"
'response.write "<br>todays date ="&current_day&"<br>"
''response.write "<br>first day of month ="&first_day_month&"<br>"
'response.write "<br>last day of month is ="&last_day_month&"<br>"
'response.write "<br>weekday position of first day=[color=#0000ff]"&weekday_monthfirst&"[/color]<br>"
'response.write "<br>weekday position of todayss day=[color=#0000ff]"&weekday_today&"[/color]<br>"
' response.write "<br>first day of fiven week is=[color=#0000ff]"&dateadd("[/color]d",-(weekday_today-1),current_date)&"<br>"
response.write "<table border=1>"
response.write "<tr>"
response.write "<td colspan=7>"
response.write "<a href=test.asp?date="&dateadd("m",-1,current_date)&"><<</a> "
response.write monthname(current_month)&", "&current_year
response.write " <a href=test.asp?date="&dateadd("m",+1,current_date)&">>></a>"
response.write "</td>"
response.write "</tr>"
response.write "<tr>"
response.write "<td>"
response.write "S"
response.write "</td>"
response.write "<td>"
response.write "M"
response.write "</td>"
response.write "<td>"
response.write "T"
response.write "</td>"
response.write "<td>"
response.write "W"
response.write "</td>"
response.write "<td>"
response.write "Th"
response.write "</td>"
response.write "<td>"
response.write "F"
response.write "</td>"
response.write "<td>"
response.write "Sa"
response.write "</td>"
response.write "</tr>"
response.write "<tr>"
for i=1 to 7
if i>[/COLOR]weekday_monthfirst-1 then
response.write "[color=#008080]<td>[/color]"
days=days+1
response.write days
response.write "[color=#008080]</td>[/color]"
else
response.write "[color=#008080]<td>[/color]"
response.write " "
response.write "[color=#008080]</td>[/color]"
End if
next
for j=1 to 5
response.write "[color=#008080]<tr>[/color]"
for i=1 to 7
if days<last_day_month then
days=days+1
response.write "[color=#008080]<td>[/color]"
response.write days
response.write "[color=#008080]</td>[/color]"
End if
Next
response.write "[color=#008080]</tr>[/color]"
Next
response.write "[color=#008080]</tr>[/color]"
response.write "[color=#008080]</table>[/color]"

End function

function najam
'response.write "inside function"
a="najam is great"
najam=a
end function
%>
[COLOR=#000080]<%
a=najam
drawcalander

%>[/COLOR]
منقول من هنا : http://www.dreamincode.net/code/snippet228.htm