限时优惠活动
亲爱的苦力吧用户,我们为了回馈新老用户一直以来的鼎力支持,即日起(2025-02-06至2025-03-06)凡是购买苦力吧VIP/充值K币的新老用户,都直接可获得买一送一的优惠馈赠。例如:购买一个月的VIP会员可直接获得两个月的VIP会员;充值100K币可直接获得200K币,以此类推!有任何疑问可联系在线客服,感谢各位用户对苦力吧素材的信任与厚爱,我们将一如既往的给大家上新更多优质的素材源码,祝大家开工大吉、工作顺利、心想事成。

PHP+AJAX创建的动态网页在线日历

所属分类: PHP源码-PHP笔记    2024-01-22 06:01:37

PHP+AJAX创建的动态网页在线日历 ie兼容6

PHP+AJAX创建的动态网页在线日历(共4个文件)

    • calendar-ajax.php
    • index.php
    • jquery-1.11.2.min.js
    • style.css
    • loading.gif
    • class.calendar.php

使用方法

currentYear = date ( "Y", time () );
		$this->currentMonth = date ( "m", time () );
		
		if (! empty ( $_POST ['year'] )) {
			$this->currentYear = $_POST ['year'];
		}
		if (! empty ( $_POST ['month'] )) {
			$this->currentMonth = $_POST ['month'];
		}
		$this->currentMonthStart = $this->currentYear . '-' . $this->currentMonth . '-01';
		$this->currentMonthDaysLength = date ( 't', strtotime ( $this->currentMonthStart ) );
	}
	
	function getCalendarHTML() {
		$calendarHTML = '
'; $calendarHTML .= '
' . $this->getCalendarNavigation() . '
'; $calendarHTML .= '
    ' . $this->getWeekDayName () . '
'; $calendarHTML .= '
    ' . $this->getWeekDays () . '
'; $calendarHTML .= '
'; return $calendarHTML; } function getCalendarNavigation() { $prevMonthYear = date ( 'm,Y', strtotime ( $this->currentMonthStart. ' -1 Month' ) ); $prevMonthYearArray = explode(",",$prevMonthYear); $nextMonthYear = date ( 'm,Y', strtotime ( $this->currentMonthStart . ' +1 Month' ) ); $nextMonthYearArray = explode(",",$nextMonthYear); $navigationHTML = ' '; $navigationHTML .= '' . date ( 'M', strtotime ( $this->currentMonthStart ) ) . ''; $navigationHTML .= ''. date ( 'Y', strtotime ( $this->currentMonthStart ) ) . ''; $navigationHTML .= ' '; return $navigationHTML; } function getWeekDayName() { $WeekDayName= ''; foreach ( $this->weekDayName as $dayname ) { $WeekDayName.= '
  • ' . $dayname . '
  • '; } return $WeekDayName; } function getWeekDays() { $weekLength = $this->getWeekLengthByMonth (); $firstDayOfTheWeek = date ( 'N', strtotime ( $this->currentMonthStart ) ); $weekDays = ""; for($i = 0; $i < $weekLength; $i ++) { for($j = 1; $j <= 7; $j ++) { $cellIndex = $i * 7 + $j; $cellValue = null; if ($cellIndex == $firstDayOfTheWeek) { $this->currentDay = 1; } if (! empty ( $this->currentDay ) && $this->currentDay <= $this->currentMonthDaysLength) { $cellValue = $this->currentDay; $this->currentDay ++; } $weekDays .= '
  • ' . $cellValue . '
  • '; } } return $weekDays; } function getWeekLengthByMonth() { $weekLength = intval ( $this->currentMonthDaysLength / 7 ); if($this->currentMonthDaysLength % 7 > 0) { $weekLength++; } $monthStartDay= date ( 'N', strtotime ( $this->currentMonthStart) ); $monthEndingDay= date ( 'N', strtotime ( $this->currentYear . '-' . $this->currentMonth . '-' . $this->currentMonthDaysLength) ); if ($monthEndingDay < $monthStartDay) { $weekLength++; } return $weekLength; } } ?>

    站长提示:
    1. 苦力吧素材官方QQ群:950875342
    2. 平台上所有素材资源,需注册登录会员方能正常下载。
    3. 会员用户积极反馈网站、素材资源BUG或错误问题,每次奖励2K币
    4. PHP源码类素材,如需协助安装调试,或你有二次开发需求,可联系苦力吧客服。
    5. 付费素材资源,需充值后方能下载,如有任何疑问可直接联系苦力吧客服
    相关资源 / PHP笔记

    PHP+MySQL实现简单的用户注册登录系统源码

    一款简单实现会员登录注册PHP源码,主要核心功能:用户登录、用户注册、登录验证、注册新增插入数据、登录成功跳转到会员中心。
      PHP笔记
     4594  0

    PHP+MYSQL增加和删除数据表数据实现源码

    一款简单实现mysql数据添加删除程序代码,表单提交添加信息入库和点击按钮执行删除数据库信息,非常适合初学者学习。
      PHP笔记
     3475  0

    PHP上传图片生成多张不同尺寸缩略图示例源码

    此源码基于PHP+AJAX上传图片二进制文件,ajax请求将调用PHP程序来创建具有指定尺寸的缩略图。在创建缩略图之前,增加了上传文件的验证,如是否为图片扩展名及符合的尺寸大小等。生成了三种尺寸缩略图,各自保存在不同的文件夹。
      PHP笔记
     2292  0

    PHP实现星级评分实时保存到Mysql代码

    这是一款支持三种不同图标形状的php评分源码,包括:星星图标、爱心图标、emoji图标三种图标可自定义设置。
      PHP笔记
     7423  0

    评论数(0) 回复有机会获得K币 用户协议

    ^_^ 还没有人评论,快来抢个沙发!
    😀
    • 😀
    • 😊
    • 😂
    • 😍
    • 😑
    • 😷
    • 😵
    • 😛
    • 😣
    • 😱
    • 😋
    • 😎
    • 😵
    • 😕
    • 😶
    • 😚
    • 😜
    • 😭
    发表评论