\n"; $bOk = false; } // $sTour = htmlspecialchars( $_POST["route"] ); //get the tour $sTour = str_replace( array( "\r\n", "\r", "\n" ), //replace all kinds of "", $sTour ); // newlines with "nothing" if( strlen( $sTour ) < 4 ) //is no tour given? { // no, then... echo "\n"; $bOk = false; } // /* $sPass = htmlspecialchars( $_POST["pass"] ); //get the password if( true === $bOk ) //all data ok? { // yes, then... $sPassword = getPassword( $sCsvFile ); // get the password if( $sPassword != $sPass ) // password match? { // no, then... echo "\n"; $bOk = false; // set error } } */ // if( true === $bOk ) //any error? { // no, then... $fFile = fopen( $sCsvFile, "a" ); // open csv file if( false !== $fFile ) // csv file open? { // yes, then... fputs( $fFile, $sDate.";" ); // make entry fputs( $fFile, htmlspecialchars( $_POST["bike"] ).";" ); fputs( $fFile, $sTour.";" ); fputs( $fFile, htmlspecialchars( $_POST["alt"] ).";" ); fputs( $fFile, htmlspecialchars( $_POST["km"] ).";" ); fputs( $fFile, $nPicIdxBeg.";" ); fputs( $fFile, $nPicIdxEnd.";" ); fputs( $fFile, "\n" ); fclose( $fFile ); // close open file } else // csv file is NOT open! { // then... echo "\n"; $bOk = false; // output an error } } return $bOk; } /** * This function returns the * @param $sPagePlusDatabase page * @return only the page title without database */ function getPageTitle( $sPagePlusDatabase, $nGerman ) { $sSearch = array( 'ue', 'oe', 'ae' ); $sReplace = array( 'ü', 'ö', 'ä' ); $aParts = explode( "|", $sPagePlusDatabase ); $sTitle = $aParts[0]; if( $nGerman != 0 ) { $sTitle = str_replace( $sSearch, $sReplace, $aParts[0] ); } return $sTitle; } /** * This function adds an entry to the * running log-book. */ function addRunEntry() { global $_FILES; //global variables global $max_file_size; global $aCsv; // $bOk = true; //ok flag $sDate = ""; //date $sTour = ""; //tour data $nPicIdxBeg = 0; //picture begin index $nPicIdxEnd = 0; //picture end index $sCsvFile = $aCsv["run"]; //setup csv filename // //28. Jul. 13;RR;Arberradmarathon TourC;1200;126; $sDate = htmlspecialchars( $_POST["date_day"] ); $sDate .= "."; $sDate .= htmlspecialchars( $_POST["date_mon"] ); $sDate .= "."; $sDate .= htmlspecialchars( $_POST["date_year"] ); if( ( strlen( $sDate ) < 8 ) || //is the date ( strlen( $sDate ) > 10 ) ) // okay? { // no, then... echo "\n"; $bOk = false; } // $sShoe = htmlspecialchars( $_POST["shoe"] ); //get the shoe // $sTour = htmlspecialchars( $_POST["route"] ); //get the tour $sTour = str_replace( array( "\r\n", "\r", "\n" ), //replace all kinds of "", $sTour ); // newlines with "nothing" // /* $sPass = htmlspecialchars( $_POST["pass"] ); //get the password if( true === $bOk ) //all data ok? { // yes, then... $sPassword = getPassword( $sCsvFile ); // get the password if( $sPassword != $sPass ) // password match? { // no, then... echo "\n"; $bOk = false; // set error } } */ // if( true === $bOk ) //any error? { // no, then... $fFile = fopen( $sCsvFile, "a" ); // open csv file if( false !== $fFile ) // csv file open? { // yes, then... fputs( $fFile, $sDate.";" ); // make entry fputs( $fFile, $sShoe.";" ); fputs( $fFile, $sTour.";" ); fputs( $fFile, htmlspecialchars( $_POST["km"] ).";" ); fputs( $fFile, $nPicIdxBeg.";" ); fputs( $fFile, $nPicIdxEnd.";" ); fputs( $fFile, "\n" ); fclose( $fFile ); // close open file } else // csv file is NOT open! { // then... echo "\n"; $bOk = false; // output an error } } return $bOk; } /* * This method writes the page * @param $nActivePage number of active page * @param $aPages array of the names of the available pages */ function writePage( $nActivePage, $aPages ) { global $aUser; global $aCsv; // $sPage = $aPages[$nActivePage]; // echo "
\n"; echo " \n"; echo "