Example #1
0
require_once '../preheader.php';
// <-- this include file MUST go first before any HTML/output
#the code for the class
include_once '../ajaxCRUD.class.php';
// <-- this include file MUST go first before any HTML/output
#create an instance of the class
$tblFriend = new ajaxCRUD("Friend", "tblFriend", "pkFriendID", "../");
?>
<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

		<?php 
$tblFriend->insertHeader();
?>

		<!-- these js/css includes are ONLY to make the calendar widget work (fldDateMet);
			 these includes are not necessary for the class to work!! -->
		<link rel="stylesheet" href="includes/jquery.ui.all.css">
		<script src="includes/jquery.ui.core.js"></script>
		<!--script src="includes/jquery.ui.widget.js"></script-->
		<script src="includes/jquery.ui.datepicker.js"></script>
	</head>

<?php 
#change orientation (if desired/needed for large number of fields in a table)
//$tblFriend->setOrientation("vertical"); //if you want the table to arrange vertically
#i can define a relationship to another table
#the 1st field is the fk in the table, the 2nd is the second table, the 3rd is the pk in the second table, the 4th is field i want to retrieve as the dropdown value
Example #2
0
include '../../ajaxCRUD.class.php';
#Create an instance of the class
$tblEvent = new ajaxCRUD("Event", "tblEvent", "pkEventID", "../");
$tblEvent->setCSSFile("cuscosky.css");
$viewPastEvents = FALSE;
if ($_REQUEST['eventFilter'] == 'pastEvents') {
    $viewPastEvents = TRUE;
}
?>
<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<?php 
$tblEvent->insertHeader();
?>

		<!-- these js/css includes are ONLY to make the calendar widget work
			 these includes are not necessary for the class to work!! -->
		<link rel="stylesheet" href="../includes/jquery.ui.all.css">
		<script src="../includes/jquery.ui.core.js"></script>
		<script src="../includes/jquery.ui.datepicker.js"></script>
	</head>

<?php 
include 'header.php';
if (!$viewPastEvents) {
    echo "<h2>Upcoming Events:</h2>\n";
} else {
    echo "<h2>Previous/Past Events:</h2>\n";