Location: PHPKode > projects > PHPfaces - User Interface Framework > demo/event_calendar/index.php
<?php

require('../../core/PHPfaces.class.php');
require('CalendarEvents.class.php');

$ui = new PHPfaces();

$form = new PForm('calendar');

$calendarEvent1 = new CalendarEvent1();

$locale = new PLocalization();

$locale->setLanguage('de');

$locale->importFromFile('en', 'text_en.resource');
$locale->importFromFile('de', 'text_de.resource');

$lblEvent = new PLabel('lblEvent', $locale->getText('event'));
$lblDate = new PLabel('lblDate', $locale->getText('date'));
$lblTime = new PLabel('lblTime', $locale->getText('time'));
$lblCity = new PLabel('lblCity', $locale->getText('city'));
$lblLocation = new PLabel('lblLocation', $locale->getText('location'));
$lblInfos = new PLabel('lblInfos', $locale->getText('infos'));
$lblLink = new PLabel('lblLink', $locale->getText('link'));
$lblAuthor = new PLabel('lblAuthor', $locale->getText('author'));

$txtEvent = new PTextField('txtEvent', '', 40, 40);
$txtDate = new PTextField('txtDate', '', 10, 10);
$txtTime = new PTextField('txtTime', '', 5, 5);
$txtCity = new PTextField('txtCity');
$txtLocation = new PTextField('txtLocation');
$txtInfos = new PTextField('txtInfos', '', 70);
$txtLink = new PTextField('txtLink', '', 40);
$txtAuthor = new PTextField('txtAuthor');
$butSubmit = new PButton('butSubmit', $locale->getText('submit'));

$butSubmit->setEvent($calendarEvent1);

$lblEventErr = new PLabel('lblEventErr', $locale->getText('entry_required'));
$lblEventErr->setProperty('STYLE', 'Error');
$lblEventErr->setVisible(FALSE);
$lblDateTimeErr = new PLabel('lblDateTimeErr', $locale->getText('date_required'));
$lblDateTimeErr->setProperty('STYLE', 'Error');
$lblDateTimeErr->setVisible(FALSE);
$lblCityErr = new PLabel('lblCityErr', $locale->getText('entry_required'));
$lblCityErr->setProperty('STYLE', 'Error');
$lblCityErr->setVisible(FALSE);

$eventTable = new PTable('eventTable', 0, 6);

$eventTable->setHeaderData(array($locale->getText('event'), $locale->getText('date'), $locale->getText('time'), $locale->getText('city').' / '.$locale->getText('location'), $locale->getText('infos'), $locale->getText('author')));

$eventTable->setHtmlActive(TRUE);
$eventTable->setColumnFormat(1, 'DMY');

// some demo data
$eventTable->addRow(array('Faces Party2', '10.02.2006', '20:00', 'MyCity / Disco', 'Faces demo party', 'uepselon'));
$eventTable->addRow(array('Faces Party1', '01.02.2006', '20:00', 'MyCity / Disco', 'Faces demo party', 'uepselon'));

$eventTable->sort(1);

$form->assign($lblEvent);
$form->assign($lblDate);
$form->assign($lblTime);
$form->assign($lblCity);
$form->assign($lblLocation);
$form->assign($lblInfos);
$form->assign($lblLink);
$form->assign($lblAuthor);

$form->assign($txtEvent);
$form->assign($txtDate);
$form->assign($txtTime);
$form->assign($txtCity);
$form->assign($txtLocation);
$form->assign($txtInfos);
$form->assign($txtLink);
$form->assign($txtAuthor);
$form->assign($butSubmit);
$form->assign($eventTable);

$form->assign($lblEventErr);
$form->assign($lblDateTimeErr);
$form->assign($lblCityErr);

$index = new Smarty();

$index->template_dir = "";
$index->force_compile = TRUE;
$index->compile_dir = $ui->getPath().'temp/smarty/templates_c';
$index->assign('head', $ui->fetchHeader());
$index->assign('form', $form->fetchForm());
		
$index->display('index.tpl');

?>
Return current item: PHPfaces - User Interface Framework