Esempio n. 1
0
//$tblEventAttendee->displayAs("pkAttendeeID","User ID");
$tblEventAttendee->displayAs("fldFirstName", "First Name");
$tblEventAttendee->displayAs("fldLastName", "Last Name");
$tblEventAttendee->displayAs("fldPhone", "Phone #");
$tblEventAttendee->displayAs("fldWillBeLate", "Will You Be Late?");
$tblEventAttendee->displayAs("fldTimeArriving", "Arrival Time");
$tblEventAttendee->displayAs("fldComments", "Comments/Other");
$tblEventAttendee->displayAs("fldIPAddress", "IPAddress");
$tblEventAttendee->omitFieldCompletely("fldIPAddress");
$tblEventAttendee->omitFieldCompletely("fkEventID");
$tblEventAttendee->omitFieldCompletely("fldPhone");
$tblEventAttendee->omitFieldCompletely("fldAttending");
$tblEventAttendee->validateDeleteWithFunction("canRowBeModifiedOrDeleted");
$tblEventAttendee->validateUpdateWithFunction("canRowBeModifiedOrDeleted");
$tblEventAttendee->defineCheckbox("fldWillBeLate");
$tblEventAttendee->addOrderBy("ORDER BY fldFirstName ASC");
#Add WHERE clause so we only display information specific to the event that was selected
$tblEventAttendee->addWhereClause("WHERE fkEventID = {$eventID}");
#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)
Esempio n. 2
0
#modify field with class
$tblFriend->modifyFieldWithClass("fldDateMet", "datepicker");
$tblFriend->modifyFieldWithClass("fldZip", "zip required");
$tblFriend->modifyFieldWithClass("fldPhone", "phone required");
$tblFriend->modifyFieldWithClass("fldEmail", "email");
#set allowable values for certain fields
$ratingVals = array("0", "1", "2", "3", "4", "5");
$tblFriend->defineAllowableValues("fldFriendRating", $ratingVals);
$states = array(array("AL", "Alabama"), array("AK", "Alaska"), array("AZ", "Arizona"), array("AR", "Arkansas"), array("CA", "California"), array("CO", "Colorado"), array("CT", "Connecticut"), array("DE", "Delaware"), array("DC", "District Of Columbia"), array("FL", "Florida"), array("GA", "Georgia"), array("HI", "Hawaii"), array("ID", "Idaho"), array("IL", "Illinois"), array("IN", "Indiana"), array("IA", "Iowa"), array("KS", "Kansas"), array("KY", "Kentucky"), array("LA", "Louisiana"), array("ME", "Maine"), array("MD", "Maryland"), array("MA", "Massachusetts"), array("MI", "Michigan"), array("MN", "Minnesota"), array("MS", "Mississippi"), array("MO", "Missouri"), array("MT", "Montana"), array("NE", "Nebraska"), array("NV", "Nevada"), array("NH", "New Hampshire"), array("NJ", "New Jersey"), array("NM", "New Mexico"), array("NY", "New York"), array("NC", "North Carolina"), array("ND", "North Dakota"), array("OH", "Ohio"), array("OK", "Oklahoma"), array("OR", "Oregon"), array("PA", "Pennsylvania"), array("RI", "Rhode Island"), array("SC", "South Carolina"), array("SD", "South Dakota"), array("TN", "Tennessee"), array("TX", "Texas"), array("UT", "Utah"), array("VT", "Vermont"), array("VA", "Virginia"), array("WA", "Washington"), array("WV", "West Virginia"), array("WI", "Wisconsin"), array("WY", "Wyoming"));
$tblFriend->defineAllowableValues("fldState", $states);
#show CSV export button
$tblFriend->showCSVExportOption();
#use if you want to move the add form to the top of the page
//$tblFriend->displayAddFormTop();
#order the table by any field you want
$tblFriend->addOrderBy("ORDER BY fldName");
#add a button at the bottom of the table which simply goes to another page
$tblFriend->addButton("No More Friends. Take Me Home", "./");
//$tblFriend->turnOffSorting(); //turns off ajax sorting by pressing header links
//$tblFriend->disableTableHeaders(); //disables table headers from displaying
//$tblFriend->turnOffAjaxEditing(); //turns of ajax editing of all data
#some logic if we want to add a field automatically on add
$state = "";
if (isset($_REQUEST['state'])) {
    $state = $_REQUEST['state'];
}
if ($state) {
    $tblFriend->addWhereClause("WHERE fldState = \"{$state}\"");
    $tblFriend->omitAddField("fldState");
    $tblFriend->addValueOnInsert("fldState", $state);
}
Esempio n. 3
0
<?php 
//$tblEvent->omitPrimaryKey();
#Create custom display fields
$tblEvent->displayAs("pkEventID", "Event ID");
$tblEvent->displayAs("fldTitle", "Title");
$tblEvent->displayAs("fldDate", "Date");
$tblEvent->displayAs("fldTime", "Time");
$tblEvent->displayAs("fldLocation", "Location");
$tblEvent->displayAs("fldAdditionalInformation", "Additional Information");
$tblEvent->displayAs("fldImage", "Image");
$tblEvent->displayAs("fldType", "Public/Private?");
$tblEvent->disallowDelete();
$validValues = array("Public", "Private");
$tblEvent->defineAllowableValues("fldType", $validValues);
//$tblEvent->category_required['fldType'] = FALSE;
$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();