WebSite-PHP Framework PHP
Multi langues
Mode Ajax simple
Aucun HTML, aucun JavaScript
URL rewrinting
Envoi d'email
Sitemap - RSS - Web service
Télécharger le Framework WebSite-PHP maintenant
 


Loading
 


Tutoriel Calendar

Tutoriels

>

Tutoriel Calendar



Tutoriel 1 : Simple Calendar
Fichier: /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);
    }
}
?>


Tutoriel 2 : Calendar with advance properties
Fichier: /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);
    }
}
?>


Tutoriel 3 : Calendar with form, callback method on change in AJAX
Fichier: /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);
        }
    }
}
?>


Tutoriel 4 : Calendar with LiveValidation
Fichier: /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
Accueil Documentation Télécharger Quick start Tutoriels Wiki Issue Tracker