function saveClass($option) { global $mainframe; $postrow = JRequest::get('post'); $classID = $postrow[classID]; if ($classID == 0) { $loggedin = CbodbMember::loggedInList(TRUE); HTML_cbodb::startClass($option, $loggedin, $postrow[memberID], "You must select a class!"); } else { if ($postrow[classdate][day] == 0 && $postrow[startsnow] != 'on') { $loggedin = CbodbMember::loggedInList(TRUE); HTML_cbodb::startClass($option, $loggedin, $postrow[memberID], "You must select a date or choose 'today'!"); } else { recordClass($postrow[memberID], $postrow[classID], strcmp($postrow[startsnow], "on") ? 0 : 1, $postrow[classdate], $postrow[duration], $postrow[students]); $mainframe->redirect('index.php?option=' . $option . '&task=shop&key=3b767559374f5132236f6e68256b2529#top', 'Class data recorded, thank you!'); } } }