$len ? substr($str, 0, $len).'..' : $str; } if(isset($_GET['p'])) { $pagetitle = ucfirst("- ".$_GET['ptitle']); } /** * saveAsDateTime() * * Saves the value of a date and timefield * in a DATETIME field of MySQL. * * @since: 06-12-2005 * @version: FormHandler v1.2 * @param FormHandler $form: Object of the form * @param string $datefield: The name of the datefield in the form * @param string $timefield: The name of the timefield in the form * @param string $saveInField: The name of the DATETIME field in the table! * @author Teye Heimans * @access public */ function saveAsDateTime( &$form, $datefield, $timefield, $saveInField ) { // when the form is an edit form if( $form->edit && !$form->isPosted() ) { $value = $form->value( $saveInField ); if( !empty( $value ) ) { // get the value of the datetime field list($date, $time) = explode(' ', $value, 2 ); // set the values for the date and time field in the form $form->setValue( $datefield, $date ); $form->setValue( $timefield, $time ); } } // only save the data ofter the form is posted... if( $form->isPosted() ) { $date = $form->value( $datefield ); $time = $form->value( $timefield ); // lege waardes in de velden ? if( $date == '' && $time == '') { $form->addValue( $saveInField, 'NULL', true); } else { // lege waarde voor de datum? Gebruik dan 0000-00-00 if( $date == '') { $date = '0000-00-00'; } else { list( $y, $m, $d ) = $form->getAsArray( $datefield ); $date = "$y-$m-$d"; } // lege waarde voor de tijd ? if( $time == '' ) { $time = '00:00'; } $value = $date ." ". $time; $form->addValue( $saveInField, $value ); } } } function getUrlFriendlyString( $p_sValue ) { $l_sUrl = strtolower( $p_sValue ); $l_aFind = array(' ', '&', '\r\n', '\n', '+'); $l_sUrl = str_replace ($l_aFind, '-', $l_sUrl); $l_aFind = array('/[^a-z0-9\-<>]/', '/[\-]+/', '/<[^>]*>/'); $l_aRepl = array('', '-', ''); $l_sUrl = preg_replace ($l_aFind, $l_aRepl, $l_sUrl); return $l_sUrl; } ?> Onderhoud, renovatie, verbouwing, nieuwbouw | van den Oosten Bouw & interieur 's-gravendeel
'; } else { if(file_exists("./pages/".$_GET['p'].".php")){ include("./pages/".$_GET['p'].".php");} else{ echo "pagina niet gevonden";} } ?>