Hi All,
Since a few days I'm experimenting with the calendar popup but encounter problems with it.
When I include the calendar popup I cannot write a record to the database. If I remove it, it works again.
Using all latest CVS code.
I've included my code below.
Anybody?
Cheers Ben
| Code: |
Table definitions:
CREATE TABLE `telefoonlijst` (
`USERID` varchar(8) NOT NULL default '',
`NAAM` varchar(50) NOT NULL default '',
`VOORNAAM` varchar(15) default NULL,
`ACHTERNAAM` varchar(25) default NULL,
`FUNCTIE` varchar(25) default NULL,
`AFDELING` varchar(20) NOT NULL default '',
`TELEFOON` varchar(15) NOT NULL default '',
`VERKORT` varchar(5) default NULL,
`MOBIEL` varchar(15) default NULL,
`REGELNR` int(8) default '0',
`MEDEWERKER` set('YES','NO') default 'NO',
`OMSCHRIJVING` longtext,
`ID` int(11) NOT NULL auto_increment,
PRIMARY KEY (`ID`),
UNIQUE KEY `NAAM` (`NAAM`,`TELEFOON`)
) TYPE=MyISAM;
CREATE TABLE `afwezig` (
`id` int(11) NOT NULL auto_increment,
`naam` varchar(25) NOT NULL default '',
`type` varchar(15) NOT NULL default 'VAKANTIE',
`begin` date NOT NULL default '0000-00-00',
`eind` date NOT NULL default '0000-00-00',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=73 ;
The code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Vakantie Kalender</title>
<script type="text/javascript" src="/java/jscalendar/calendar.js"></script>
<script type="text/javascript" src="/java/jscalendar/lang/calendar-en.js"></script>
<script type="text/javascript" src="/java/jscalendar/calendar-setup.js"></script>
<link rel="stylesheet"type="text/css" media="screen" href="/java/jscalendar/calendar-system.css">
</head>
</HTML>
<?php
// Name of field which is the unique key
$opts['key'] = 'id';
// Type of key field (int/real/string/date etc.)
$opts['key_type'] = 'int';
// Sorting field(s)
$opts['sort_field'] = array('naam');
// Number of records to display on the screen
// Value of -1 lists all records in a table
$opts['inc'] = 28;
// Options you wish to give the users
// A - add, C - change, P - copy, V - view, D - delete,
// F - filter, I - initial sort suppressed
$opts['options'] = 'ACPVDF';
// Number of lines to display on multiple selection filters
$opts['multiple'] = '4';
// Navigation style: B - buttons (default), T - text links, G - graphic links
// Buttons position: U - up, D - down (default)
$opts['navigation'] = 'GU';
// Display special page elements
$opts['display'] = array(
'form' => true,
'query' => true,
'sort' => true,
'time' => true,
'tabs' => true
);
$opts['fdd']['id'] = array(
'name' => 'ID',
'select' => 'T',
'options' => 'AVCPDR', // auto increment
'maxlen' => 11,
'default' => '0',
'sort' => true
);
$opts['fdd']['naam']['values']['table'] = 'telefoonlijst';
$opts['fdd']['naam']['values']['column'] = 'naam';
$opts['fdd']['naam']['name'] = 'Medewerker';
$opts['fdd']['naam']['select'] = 'D';
$opts['fdd']['naam']['sort'] = 'true';
$opts['fdd']['naam']['values']['filters']='medewerker = "yes"';
$opts['fdd']['type'] = array(
'name' => 'Type',
'select' => 'T',
'maxlen' => 15,
'default'=>'VAKANTIE',
'required' => false,
'sort' => true
);
$opts['fdd']['begin'] = array(
'name' => 'Begin',
'select' => 'T',
'maxlen' => 10,
'options' => 'ACPVDL',
'calendar' => true,
'required' => true,
'sort' => true
);
$opts['fdd']['eind'] = array(
'name' => 'Eind',
'select' => 'T',
'maxlen' => 10,
'options' => 'ACPVDL',
'calendar' => true,
'required' => true,
'sort' => true
);
require_once '/Windows/public/intranet/phpMyEdit/extensions/phpMyEdit-calpopup.class.php';
require_once '/Windows/public/intranet/apps/default.inc';
new phpMyEdit_calpopup($opts);
?> |
|