예제 #1
0
		</form>
	</div>
	<div style="clear: both;"></div><br />

<?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 {
예제 #2
0
$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) {
    $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") {
예제 #3
0
//$tblDemo->setFileUpload("poster", "uploads/");
#i can have a field automatically populate with a certain value (eg the current timestamp)
//$tblDemo->addValueOnInsert("fldField1", "NOW()");
#i can use a where field to better-filter my table
//$tblDemo->addWhereClause("WHERE (fldField1 = 'test')");
#i can order my table by whatever i want
//$tblDemo->addOrderBy("ORDER BY fldField1 ASC");
#i can set certain fields to only allow certain values
#http://ajaxcrud.com/api/index.php?id=defineAllowableValues
//$allowableValues = array("Allowable Value1", "Allowable Value2", "Dropdown Value", "CRUD");
// $tblDemo->defineAllowableValues("fldCertainFields", $allowableValues);
//set field fldCheckbox to be a checkbox
//$tblDemo->defineCheckbox("fldCheckbox");
#i can disallow deleting of rows from the table
#http://ajaxcrud.com/api/index.php?id=disallowDelete
$tblDemo->disallowDelete();
#i can disallow adding rows to the table
#http://ajaxcrud.com/api/index.php?id=disallowAdd
//$tblDemo->disallowAdd();
#i can add a button that performs some action deleting of rows for the entire table
#http://ajaxcrud.com/api/index.php?id=addButtonToRow
//$tblDemo->addButtonToRow("Add", "add_item.php", "all");
#set the number of rows to display (per page)
$tblDemo->setLimit(100);
#set a filter box at the top of the table
//$tblDemo->addAjaxFilterBox('fldField1');
#if really desired, a filter box can be used for all fields
//style$tblDemo->addAjaxFilterBoxAllFields();
#i can set the size of the filter box
//$tblDemo->setAjaxFilterBoxSize('fldField1', 3);
#i can format the data in cells however I want with formatFieldWithFunction