$tblEventAttendee->modifyFieldWithClass("fldTimeArriving", "time"); $tblEventAttendee->modifyFieldWithClass("fldLastName", "required"); $tblEventAttendee->modifyFieldWithClass("fldFirstName", "required"); $tblEventAttendee->formatFieldWithFunction("fldWillBeLate", "displayWillBeLate"); $tblEventAttendee->formatFieldWithFunctionAdvanced("fldTimeArriving", "displayArrivalTime"); $tblEventAttendee->emptyTableMessage = "No one has signed up yet! Press the '<b>Add Person</b>' button below to sign up for this event."; $tblEventAttendee->addMessage = "You have been added to this event."; $tblEventAttendee->setCSSFile("cuscosky.css"); //i liked this table feel; but any css can be used from http://icant.co.uk/csstablegallery #implement a callback function on signing up to create cookie $tblEventAttendee->onAddExecuteCallBackFunction("onAddCallBackFunction"); //if event expired, do not allow people to sign up for it or change who had attended if ($eventExpired) { $tblEventAttendee->disallowAdd(); $tblEventAttendee->disallowDelete(); $tblEventAttendee->turnOffAjaxEditing(); $tblEventAttendee->omitFieldCompletely("fldWillBeLate"); $tblEventAttendee->omitFieldCompletely("fldTimeArriving"); } //this needs to be very low in the excution path to ensure the obj is loaded correctly with every other piece of logic //typically doAction is called within the showTable() method, but i do not want to do that because i modify headers with my onAdd callback function if (isset($_REQUEST['action']) && $_REQUEST['action'] != '') { $tblEventAttendee->doAction($_REQUEST['action']); } include 'header.php'; if ($eventExpired) { displayExpiration(); } echo "<h3><u>{$fldType}</u> Event: {$fldTitle} - " . date("M d, Y", strtotime($fldDate)) . " @ {$fldTime}</h3>\n"; if ($fldType == "Public") { echo "<div class=\"highlight\"><img src='youre-invited.png' width='150' hspace='10' align='left' /><center style='color: blue;font-size: 14px'><i>YOU'RE</i> invited! Who me? Yes, you! Can friends come?? YES!! All are welcome. <br />This is a <b><i>PUBLIC</i></b> event. You are welcome to join. Don't feel an invitation is required. Just sign up below to let us know you'll be there. :-)</center></div><br />";
$tblEvent->addOrderBy("ORDER BY fldDate ASC"); #Add filter boxes (if i wanted them) //$tblEvent->addAjaxFilterBox("fldFirstName"); //$tblEvent->addAjaxFilterBox("fldLastName"); //$tblEvent->addAjaxFilterBox("fldAttending"); $today = date("Y-m-d"); if (!$viewPastEvents) { #Add Where clause - only show future events $tblEvent->addWhereClause("WHERE (fldDate >= \"{$today}\") OR fldDate = \"0000-00-00\""); $signupText = "Sign up for Event"; $tblEvent->setFileUpload("fldImage", "uploads/", "uploads/"); } else { #Add Where clause - only show past events $tblEvent->addWhereClause("WHERE (fldDate < \"{$today}\") AND fldDate != \"0000-00-00\""); $signupText = "View Who Signed Up"; $tblEvent->turnOffAjaxEditing(); } $tblEvent->addButtonToRow($signupText, "index.php"); $tblEvent->setTextareaHeight("fldAdditionalInformation", 70); #set the number of rows to display (per page) //$tblEvent->setLimit(25); $tblEvent->setAddPlaceholderText("fldDate", "YYYY-mm-dd"); $tblEvent->setAddPlaceholderText("fldTime", "7:00pm"); $tblEvent->setAddFieldNote("fldDate", "Make sure to enter in format <b>YYYY-mm-dd</b>."); $tblEvent->setAddFieldNote("fldImage", "If you want to add an image to the event (optional)."); $tblEvent->setAddFieldNote("fldType", "Public means anyone can come; Private means you want this event to be exclusive."); //$tblEvent->addButtonToRowWindowOpen = "same"; //this is default behavior so i have it commented out $tblEvent->formatFieldWithFunction("fldDate", "highlightDate"); $tblEvent->formatFieldWithFunction("fldImage", "showImage"); $tblEvent->modifyFieldWithClass("fldDate", "datepicker"); $tblEvent->showTable();