WebSite-PHP Framework PHP
Multi language
Simple Ajax mode
No HTML, no JavaScript
URL rewriting
Mail sending
Sitemap - RSS - Web service
Download WebSite-PHP FrameWork now
 


Loading
 


Tutorial Calendar

Tutorials

>

Tutorial Calendar



Tutorial 1 : Simple Calendar
File: /pages/tutorials/calendar/calendar-01.php

<?php
class Calendar01 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Simple Calendar";
        
        
$this->render = new Calendar($this);
    }
}
?>


Tutorial 2 : Calendar with advance properties
File: /pages/tutorials/calendar/calendar-02.php

<?php
class Calendar02 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Calendar 
                                with advance properties"
;
        
        
$this->render = new Calendar($this);
        
        
// set current date
        
$now = new DateTime();
        
$this->render->setValue($now);
        
        
// display buttons "today" and "done"
        
$this->render->showButtonPanel();
        
        
// display combobox to change month
        
$this->render->changeMonth();
        
        
// display combobox to change year
        
$this->render->changeYear();
        
        
// display days of months before and after
        
$this->render->showOtherMonths();
        
        
// display week number
        
$this->render->showWeek();
        
        
// define min date
        
$now->modify("-3 days");
        
$this->render->setMinDate($now);
        
        
// define opening animation
        
$this->render->setShowAnim(Calendar::ANIMATION_BOUNCE);
    }
}
?>


Tutorial 3 : Calendar with form, callback method on change in AJAX
File: /pages/tutorials/calendar/calendar-03.php

<?php
class Calendar03 extends Page {
    private 
$edt_date null;
    
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Calendar with form, 
                        callback method on change in AJAX"
;
        
        
$form = new Form($this);
        
        
$this->edt_date = new Calendar($form);
        
$this->edt_date->onChange("onChangeCalendar");
        
$this->edt_date->setAjaxEvent();
        
        
$form->setContent($this->edt_date);
        
$this->render $form;
    }
    
    public function 
onChangeCalendar($sender) {
        if (
get_class($this->edt_date->getValue()) == "DateTime") {
            
$dialog = new DialogBox("onChangeCalendar"
                    
$this->edt_date->getValue()->format("m-d-Y"));
            
$this->addObject($dialog);
        }
    }
}
?>


Tutorial 4 : Calendar with LiveValidation
File: /pages/tutorials/calendar/calendar-04.php

<?php
class Calendar04 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Calendar with LiveValidation";
        
        
$form = new Form($this);
        
        
$edt_date = new Calendar($form);
        
$lv = new LiveValidation();
        
$lv->addValidateCalendar($edt_date->getDateFormat());
        
$edt_date->setLiveValidation($lv);
        
        
$form->setContent($edt_date);
        
$this->render $form;
    }
}
?>



Share

 


Copyright © 2009-2024 WebSite-PHP Framework PHP
Home Documentation Download Quick start Tutorials Wiki Issue Tracker