برگزیده های پرشین تولز

اسکریپت تقویم

balabala

کاربر قدیمی پرشین تولز
کاربر قدیمی پرشین تولز
تاریخ عضویت
22 می 2005
نوشته‌ها
8,362
لایک‌ها
5,745
سن
41
محل سکونت
یه خورده اونورتر
سلام


یه اسکریپ پی اچ پی میخوام که تقویم یک ماه رو نشون بده (میلادی). یک چیزی شبیه به Date & Time ویندوز.


تشکر
 

FireFly

کاربر تازه وارد
تاریخ عضویت
27 مارس 2005
نوشته‌ها
466
لایک‌ها
1
محل سکونت
تهران
لیست اسکریپت های PHP مربوط به تقویم :
http://hotscripts.com/PHP/Scripts_and_Programs/Calendars/index.html


یک سری نمونه :

PHP Event Calendar :
http://calendar.codewalkers.com/

دمو :
http://calendar.codewalkers.com/calendar.php


myCalendar :
http://mywebland.com/download.php?id=1



PHP:
function calendar(date)
         {
         //If no parameter is passed use the current date.
         if(date == null)
            date = new Date();
         
         day = date.getDate();
         month = date.getMonth();
         year = date.getFullYear();
         
         months = new Array('January',
                            'February',
                            'March',
                            'April',
                            'May',
                            'June',
                            'July',
                            'August',
                            'September',
                            'October',
                            'November',
                            'December');
         
         this_month = new Date(year, month, 1);
         next_month = new Date(year, month + 1, 1);
         
         //Find out when this month starts and ends.         
         first_week_day = this_month.getDay();
         days_in_this_month = Math.floor((next_month.getTime() - this_month.getTime()) / (1000 * 60 * 60 * 24));
         
         calendar_html = '<table style="background-color:666699; color:ffffff;">';
         
         calendar_html += '<tr><td colspan="7" align="center" style="background-color:9999cc; color:000000;">' + 
                          months[month] + ' ' + year + '</td></tr>';
         
         calendar_html += '<tr>';
          
         //Fill the first week of the month with the appropriate number of blanks.       
         for(week_day = 0; week_day < first_week_day; week_day++)
            {
            calendar_html += '<td style="background-color:9999cc; color:000000;"> </td>';   
            }
            
         week_day = first_week_day;
         for(day_counter = 1; day_counter <= days_in_this_month; day_counter++)
            {
            week_day %= 7;
            
            if(week_day == 0)
               calendar_html += '</tr><tr>';
            
            //Do something different for the current day.
            if(day == day_counter)   
               calendar_html += '<td align="center"><b>' + day_counter + '</b></td>';
            else
               calendar_html += '<td align="center" style="background-color:9999cc; color:000000;"> ' + 
                                day_counter + ' </td>';
            
            week_day++;
            }
            
         calendar_html += '</tr>';
         calendar_html += '</table>';
         
         //Display the calendar.     
         document.write(calendar_html);                  
         }
دمو :
http://scripts.franciscocharrua.com/calendar.php
 

balabala

کاربر قدیمی پرشین تولز
کاربر قدیمی پرشین تولز
تاریخ عضویت
22 می 2005
نوشته‌ها
8,362
لایک‌ها
5,745
سن
41
محل سکونت
یه خورده اونورتر
دستت درد نكنه فايرفلاي PHP Event Calendar همون چيزي هستش كه ميخواستم. :)

خيلي ممنون :rolleyes:
 

amirhoman

کاربر تازه وارد
تاریخ عضویت
25 آپریل 2005
نوشته‌ها
1,127
لایک‌ها
11
سن
55
محل سکونت
Tehran
اين كارا چيه شما ميكنين؟
 
بالا