Create dynamic calendar using jQuery, Ajax and PHP

Create dynamic calendar using jQuery, Ajax and PHP

In this Post We Will Explain About is Create dynamic calendar using jQuery, Ajax and PHP With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Create a jQuery calendar with AJAX, PHP, and MySQL Example

In this post we will show you Best way to implement Create Simple Dynamic Calendar Using Jquery and HTML, hear for Build an event calendar using jQuery, Ajax and PHPwith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

how to Create dynamic calendar using jQuery, Ajax and PHP

The simple event calendar is a very most useful element for a simple scedules web project as well as web-application. Using it we can put the all the event to the calendar and reminder along with the some respective date. Today we’ll some discuss how can we create a PHP simple Event Calendar easily using jQuery and Ajax.

Now we are going to simple creating an All the event calendar using Ajax jQuery, Ajax, PHP and MySQL db.

index.php





Live24u Create dynamic calendar using jQuery, Ajax and PHP


Step by step Create dynamic calendar in jQuery, Ajax and PHP




Create dynamic calendar using jQuery, Ajax and PHP
LiveCalcHtml(); echo $CalcHTMLData; ?>

calendar-ajax.php

LiveCalcHtml();
echo $CalcHTMLData;
?>

class.calendar.php

liveCyear = date ( "Y", time () );
        $this->liveCmonth = date ( "m", time () );
         
        if (! empty ( $_POST ['year'] )) {
            $this->liveCyear = $_POST ['year'];
        }
        if (! empty ( $_POST ['month'] )) {
            $this->liveCmonth = $_POST ['month'];
        }
        $this->liveCmonthstart = $this->liveCyear . '-' . $this->liveCmonth . '-01';
        $this->liveCmonthDaysLength = date ( 't', strtotime ( $this->liveCmonthstart ) );
    }
    //Pakainfo.com LiveCalcHtml function
    function LiveCalcHtml() {
        $CalcHTMLData = '
'; $CalcHTMLData .= '
' . $this->LiveCalcNav() . '
'; $CalcHTMLData .= '
    ' . $this->getWeekDayName () . '
'; $CalcHTMLData .= '
    ' . $this->getWeekDays () . '
'; $CalcHTMLData .= '
'; return $CalcHTMLData; } //Pakainfo.com LiveCalcNav function function LiveCalcNav() { $lastMonthYear = date ( 'm,Y', strtotime ( $this->liveCmonthstart. ' -1 Month' ) ); $lastMonthYearArray = explode(",",$lastMonthYear); $nextMonthYear = date ( 'm,Y', strtotime ( $this->liveCmonthstart . ' +1 Month' ) ); $getnextMyear = explode(",",$nextMonthYear); $navigationHTML = '
<
'; $navigationHTML .= '' . date ( 'M', strtotime ( $this->liveCmonthstart ) ) . ''; $navigationHTML .= ''. date ( 'Y', strtotime ( $this->liveCmonthstart ) ) . ''; $navigationHTML .= ''; return $navigationHTML; } //Pakainfo.com getWeekDayName function function getWeekDayName() { $WeekDayName= ''; foreach ( $this->weekDayName as $dayname ) { $WeekDayName.= '
  • ' . $dayname . '
  • '; } return $WeekDayName; } //Pakainfo.com getWeekDays function function getWeekDays() { $calWeekLan = $this->getWeekLengthByMonth (); $firstDayOfTheWeek = date ( 'N', strtotime ( $this->liveCmonthstart ) ); $totalWkday = ""; for($i = 0; $i < $calWeekLan; $i ++) { for($j = 1; $j <= 7; $j ++) { $cellIndex = $i * 7 + $j; $cellValue = null; if ($cellIndex == $firstDayOfTheWeek) { $this->liveCday = 1; } if (! empty ( $this->liveCday ) && $this->liveCday <= $this->liveCmonthDaysLength) { $cellValue = $this->liveCday; $this->liveCday ++; } $totalWkday .= '
  • ' . $cellValue . '
  • '; } } return $totalWkday; } //Pakainfo.com getWeekLengthByMonth function function getWeekLengthByMonth() { $calWeekLan = intval ( $this->liveCmonthDaysLength / 7 ); if($this->liveCmonthDaysLength % 7 > 0) { $calWeekLan++; } $getmonthSdate= date ( 'N', strtotime ( $this->liveCmonthstart) ); $monthEndingDay= date ( 'N', strtotime ( $this->liveCyear . '-' . $this->liveCmonth . '-' . $this->liveCmonthDaysLength) ); if ($monthEndingDay < $getmonthSdate) { $calWeekLan++; } return $calWeekLan; } } ?>

    style.css

    .next,.last{cursor:pointer;display:inline-block}.next,.last,.week-day-cell li{display:inline-block}body{font-family:calihri}#calc-outer{width:574px}#calc-outer ul{margin:0;padding:0}#calc-outer ul li{margin:0;padding:0;list-style-type:none}.last{float:left}.next{float:right}:focus{outline:0;background:#ff8e8e}div.calendar-nav{background-color:#ff8e8e;border-radius:4px;text-align:center;padding:10px;color:#FFF;box-sizing:border-box;font-weight:700}#calc-outer .week-name-title li{display:inline-block;padding:10px 27px;color:#90918b;font-size:.95em;font-weight:600}.week-day-cell li{width:80px;height:80px;text-align:center;line-height:80px;vertical-align:middle;background-color:#f6ffc6;color:#ff8e8e;border:1px solid #f1f0f0;border-radius:4px;font-size:1.2em}#body-overlay{background-color:rgba(0,0,0,.6);z-index:999;position:absolute;left:0;top:0;width:100%;height:100%;display:none}#body-overlay div{position:absolute;left:50%;top:50%;margin-top:-32px;margin-left:-32px}
    

    Example

    I hope you have Got What is Add Event to Calendar using jQuery Ajax and PHP And how it works.I would Like to have FeadBack From My Blog(Pakainfo.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(Pakainfo.com) Are Most Always Welcome.

    Leave a Comment