Ejemplo n.º 1
0
#I could add filter boxes to the top, but have chosen not to do so; commenting these out
//$tblEventAttendee->addAjaxFilterBox("fldFirstName");
//$tblEventAttendee->addAjaxFilterBox("fldLastName");
//$tblEventAttendee->addAjaxFilterBox("fldAttending");
//using addValueOnInsert so when someone signs up it will automatically add them to this event
$tblEventAttendee->addValueOnInsert("fkEventID", $eventID);
//using addValueOnInsert to track their IP address
$tblEventAttendee->addValueOnInsert("fldIPAddress", $_SERVER["REMOTE_ADDR"]);
$tblEventAttendee->setTextboxWidth("fldTimeArriving", 8);
$tblEventAttendee->setTextboxWidth("fldLastName", 25);
$tblEventAttendee->setTextareaHeight("fldComments", 70);
//comment field should be a bit wider height
#set the number of rows to display (per page)
$tblEventAttendee->setLimit(25);
//after 25 people, the resultset will paginate
$tblEventAttendee->setAddPlaceholderText("fldTimeArriving", $fldTime);
$tblEventAttendee->setAddFieldNote("fldTimeArriving", "Leave blank if you'll be on time.");
$tblEventAttendee->setAddFieldNote("fldWillBeLate", "If you will be arriving late, please enter the time in the next box.");
$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) {
Ejemplo n.º 2
0
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();
include 'footer.php';
function highlightDate($date)
{
    if ($date == "0000-00-00") {
        return "NOT YET SET";
    }