| Current Path : /var/www/cesa.co.za/cceadmin/ |
| Current File : /var/www/cesa.co.za/cceadmin/cstPaymentslist.php |
<?php
session_start(); // Initialize Session data
ob_start(); // Turn on output buffering
?>
<?php include "ewcfg7.php" ?>
<?php include "ewmysql7.php" ?>
<?php include "phpfn7.php" ?>
<?php include "cstPaymentsinfo.php" ?>
<?php include "CCEUsersinfo.php" ?>
<?php include "userfn7.php" ?>
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Always modified
header("Cache-Control: private, no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
?>
<?php
// Create page object
$cstPayments_list = new ccstPayments_list();
$Page =& $cstPayments_list;
// Page init
$cstPayments_list->Page_Init();
// Page main
$cstPayments_list->Page_Main();
?>
<?php include "header.php" ?>
<?php if ($cstPayments->Export == "") { ?>
<script type="text/javascript">
<!--
// Create page object
var cstPayments_list = new ew_Page("cstPayments_list");
// page properties
cstPayments_list.PageID = "list"; // page ID
cstPayments_list.FormID = "fcstPaymentslist"; // form ID
var EW_PAGE_ID = cstPayments_list.PageID; // for backward compatibility
// extend page with Form_CustomValidate function
cstPayments_list.Form_CustomValidate =
function(fobj) { // DO NOT CHANGE THIS LINE!
// Your custom validation code here, return false if invalid.
return true;
}
<?php if (EW_CLIENT_VALIDATE) { ?>
cstPayments_list.ValidateRequired = true; // uses JavaScript validation
<?php } else { ?>
cstPayments_list.ValidateRequired = false; // no JavaScript validation
<?php } ?>
//-->
</script>
<link rel="stylesheet" type="text/css" media="all" href="calendar/calendar-win2k-cold-1.css" title="win2k-1">
<script type="text/javascript" src="calendar/calendar.js"></script>
<script type="text/javascript" src="calendar/lang/calendar-en.js"></script>
<script type="text/javascript" src="calendar/calendar-setup.js"></script>
<script type="text/javascript">
<!--
var ew_DHTMLEditors = [];
//-->
</script>
<script language="JavaScript" type="text/javascript">
<!--
// Write your client script here, no need to add script tags.
// To include another .js script, use:
// ew_ClientScriptInclude("my_javascript.js");
//-->
</script>
<?php } ?>
<?php if ($cstPayments->Export == "") { ?>
<?php } ?>
<?php
$bSelectLimit = EW_SELECT_LIMIT;
if ($bSelectLimit) {
$cstPayments_list->lTotalRecs = $cstPayments->SelectRecordCount();
} else {
if ($rs = $cstPayments_list->LoadRecordset())
$cstPayments_list->lTotalRecs = $rs->RecordCount();
}
$cstPayments_list->lStartRec = 1;
if ($cstPayments_list->lDisplayRecs <= 0 || ($cstPayments->Export <> "" && $cstPayments->ExportAll)) // Display all records
$cstPayments_list->lDisplayRecs = $cstPayments_list->lTotalRecs;
if (!($cstPayments->Export <> "" && $cstPayments->ExportAll))
$cstPayments_list->SetUpStartRec(); // Set up start record position
if ($bSelectLimit)
$rs = $cstPayments_list->LoadRecordset($cstPayments_list->lStartRec-1, $cstPayments_list->lDisplayRecs);
?>
<p><span class="phpmaker" style="white-space: nowrap;"><?php echo $Language->Phrase("TblTypeCUSTOMVIEW") ?><?php echo $cstPayments->TableCaption() ?>
<?php if ($cstPayments->Export == "" && $cstPayments->CurrentAction == "") { ?>
<a href="<?php echo $cstPayments_list->ExportPrintUrl ?>"><img src="images/print.gif" alt="<?php echo ew_HtmlEncode($Language->Phrase("PrinterFriendly")) ?>" title="<?php echo ew_HtmlEncode($Language->Phrase("PrinterFriendly")) ?>" width="16" height="16" border="0"></a>
<a href="<?php echo $cstPayments_list->ExportExcelUrl ?>"><img src='images/exportxls.gif' alt='<?php echo ew_HtmlEncode($Language->Phrase("ExportToExcel")) ?>' title='<?php echo ew_HtmlEncode($Language->Phrase("ExportToExcel")) ?>' width='16' height='16' border='0'></a>
<a href="<?php echo $cstPayments_list->ExportWordUrl ?>"><img src='images/exportdoc.gif' alt='<?php echo ew_HtmlEncode($Language->Phrase("ExportToWord")) ?>' title='<?php echo ew_HtmlEncode($Language->Phrase("ExportToWord")) ?>' width='16' height='16' border='0'></a>
<?php } ?>
</span></p>
<?php
if (EW_DEBUG_ENABLED)
echo ew_DebugMsg();
$cstPayments_list->ShowMessage();
?>
<br>
<table cellspacing="0" class="ewGrid"><tr><td class="ewGridContent">
<form name="fcstPaymentslist" id="fcstPaymentslist" class="ewForm" action="" method="post">
<div id="gmp_cstPayments" class="ewGridMiddlePanel">
<?php if ($cstPayments_list->lTotalRecs > 0) { ?>
<table cellspacing="0" rowhighlightclass="ewTableHighlightRow" rowselectclass="ewTableSelectRow" roweditclass="ewTableEditRow" class="ewTable ewTableSeparate">
<?php echo $cstPayments->TableCustomInnerHtml ?>
<thead><!-- Table header -->
<tr class="ewTableHeader">
<?php
// Render list options
$cstPayments_list->RenderListOptions();
// Render list options (header, left)
$cstPayments_list->ListOptions->Render("header", "left");
?>
<?php if ($cstPayments->Delegate->Visible) { // Delegate ?>
<?php if ($cstPayments->SortUrl($cstPayments->Delegate) == "") { ?>
<td><?php echo $cstPayments->Delegate->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstPayments->SortUrl($cstPayments->Delegate) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstPayments->Delegate->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstPayments->Delegate->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstPayments->Delegate->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php if ($cstPayments->Organisation->Visible) { // Organisation ?>
<?php if ($cstPayments->SortUrl($cstPayments->Organisation) == "") { ?>
<td><?php echo $cstPayments->Organisation->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstPayments->SortUrl($cstPayments->Organisation) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstPayments->Organisation->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstPayments->Organisation->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstPayments->Organisation->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php if ($cstPayments->EmailAddress->Visible) { // EmailAddress ?>
<?php if ($cstPayments->SortUrl($cstPayments->EmailAddress) == "") { ?>
<td><?php echo $cstPayments->EmailAddress->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstPayments->SortUrl($cstPayments->EmailAddress) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstPayments->EmailAddress->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstPayments->EmailAddress->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstPayments->EmailAddress->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php if ($cstPayments->InvoiceNo->Visible) { // InvoiceNo ?>
<?php if ($cstPayments->SortUrl($cstPayments->InvoiceNo) == "") { ?>
<td><?php echo $cstPayments->InvoiceNo->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstPayments->SortUrl($cstPayments->InvoiceNo) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstPayments->InvoiceNo->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstPayments->InvoiceNo->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstPayments->InvoiceNo->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php if ($cstPayments->AmountDue->Visible) { // AmountDue ?>
<?php if ($cstPayments->SortUrl($cstPayments->AmountDue) == "") { ?>
<td><?php echo $cstPayments->AmountDue->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstPayments->SortUrl($cstPayments->AmountDue) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstPayments->AmountDue->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstPayments->AmountDue->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstPayments->AmountDue->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php if ($cstPayments->AmountPaid->Visible) { // AmountPaid ?>
<?php if ($cstPayments->SortUrl($cstPayments->AmountPaid) == "") { ?>
<td><?php echo $cstPayments->AmountPaid->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstPayments->SortUrl($cstPayments->AmountPaid) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstPayments->AmountPaid->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstPayments->AmountPaid->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstPayments->AmountPaid->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php if ($cstPayments->DatePaid->Visible) { // DatePaid ?>
<?php if ($cstPayments->SortUrl($cstPayments->DatePaid) == "") { ?>
<td><?php echo $cstPayments->DatePaid->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstPayments->SortUrl($cstPayments->DatePaid) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstPayments->DatePaid->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstPayments->DatePaid->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstPayments->DatePaid->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php if ($cstPayments->CreditNoteNo->Visible) { // CreditNoteNo ?>
<?php if ($cstPayments->SortUrl($cstPayments->CreditNoteNo) == "") { ?>
<td><?php echo $cstPayments->CreditNoteNo->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstPayments->SortUrl($cstPayments->CreditNoteNo) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstPayments->CreditNoteNo->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstPayments->CreditNoteNo->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstPayments->CreditNoteNo->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php if ($cstPayments->CCECourseID->Visible) { // CCECourseID ?>
<?php if ($cstPayments->SortUrl($cstPayments->CCECourseID) == "") { ?>
<td><?php echo $cstPayments->CCECourseID->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstPayments->SortUrl($cstPayments->CCECourseID) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstPayments->CCECourseID->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstPayments->CCECourseID->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstPayments->CCECourseID->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php if ($cstPayments->CCECourseName->Visible) { // CCECourseName ?>
<?php if ($cstPayments->SortUrl($cstPayments->CCECourseName) == "") { ?>
<td><?php echo $cstPayments->CCECourseName->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstPayments->SortUrl($cstPayments->CCECourseName) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstPayments->CCECourseName->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstPayments->CCECourseName->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstPayments->CCECourseName->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php if ($cstPayments->StudentID->Visible) { // StudentID ?>
<?php if ($cstPayments->SortUrl($cstPayments->StudentID) == "") { ?>
<td><?php echo $cstPayments->StudentID->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstPayments->SortUrl($cstPayments->StudentID) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstPayments->StudentID->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstPayments->StudentID->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstPayments->StudentID->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php if ($cstPayments->Telephone->Visible) { // Telephone ?>
<?php if ($cstPayments->SortUrl($cstPayments->Telephone) == "") { ?>
<td><?php echo $cstPayments->Telephone->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstPayments->SortUrl($cstPayments->Telephone) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstPayments->Telephone->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstPayments->Telephone->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstPayments->Telephone->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php if ($cstPayments->Cellphone->Visible) { // Cellphone ?>
<?php if ($cstPayments->SortUrl($cstPayments->Cellphone) == "") { ?>
<td><?php echo $cstPayments->Cellphone->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstPayments->SortUrl($cstPayments->Cellphone) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstPayments->Cellphone->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstPayments->Cellphone->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstPayments->Cellphone->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php
// Render list options (header, right)
$cstPayments_list->ListOptions->Render("header", "right");
?>
</tr>
</thead>
<?php
if ($cstPayments->ExportAll && $cstPayments->Export <> "") {
$cstPayments_list->lStopRec = $cstPayments_list->lTotalRecs;
} else {
$cstPayments_list->lStopRec = $cstPayments_list->lStartRec + $cstPayments_list->lDisplayRecs - 1; // Set the last record to display
}
$cstPayments_list->lRecCount = $cstPayments_list->lStartRec - 1;
if ($rs && !$rs->EOF) {
$rs->MoveFirst();
if (!$bSelectLimit && $cstPayments_list->lStartRec > 1)
$rs->Move($cstPayments_list->lStartRec - 1);
}
// Initialize aggregate
$cstPayments->RowType = EW_ROWTYPE_AGGREGATEINIT;
$cstPayments_list->RenderRow();
$cstPayments_list->lRowCnt = 0;
while (($cstPayments->CurrentAction == "gridadd" || !$rs->EOF) &&
$cstPayments_list->lRecCount < $cstPayments_list->lStopRec) {
$cstPayments_list->lRecCount++;
if (intval($cstPayments_list->lRecCount) >= intval($cstPayments_list->lStartRec)) {
$cstPayments_list->lRowCnt++;
// Init row class and style
$cstPayments->CssClass = "";
$cstPayments->CssStyle = "";
$cstPayments->RowAttrs = array('onmouseover'=>'ew_MouseOver(event, this);', 'onmouseout'=>'ew_MouseOut(event, this);', 'onclick'=>'ew_Click(event, this);');
if ($cstPayments->CurrentAction == "gridadd") {
$cstPayments_list->LoadDefaultValues(); // Load default values
} else {
$cstPayments_list->LoadRowValues($rs); // Load row values
}
$cstPayments->RowType = EW_ROWTYPE_VIEW; // Render view
// Render row
$cstPayments_list->RenderRow();
// Render list options
$cstPayments_list->RenderListOptions();
?>
<tr<?php echo $cstPayments->RowAttributes() ?>>
<?php
// Render list options (body, left)
$cstPayments_list->ListOptions->Render("body", "left");
?>
<?php if ($cstPayments->Delegate->Visible) { // Delegate ?>
<td<?php echo $cstPayments->Delegate->CellAttributes() ?>>
<div<?php echo $cstPayments->Delegate->ViewAttributes() ?>><?php echo $cstPayments->Delegate->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($cstPayments->Organisation->Visible) { // Organisation ?>
<td<?php echo $cstPayments->Organisation->CellAttributes() ?>>
<div<?php echo $cstPayments->Organisation->ViewAttributes() ?>><?php echo $cstPayments->Organisation->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($cstPayments->EmailAddress->Visible) { // EmailAddress ?>
<td<?php echo $cstPayments->EmailAddress->CellAttributes() ?>>
<div<?php echo $cstPayments->EmailAddress->ViewAttributes() ?>><?php echo $cstPayments->EmailAddress->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($cstPayments->InvoiceNo->Visible) { // InvoiceNo ?>
<td<?php echo $cstPayments->InvoiceNo->CellAttributes() ?>>
<div<?php echo $cstPayments->InvoiceNo->ViewAttributes() ?>><?php echo $cstPayments->InvoiceNo->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($cstPayments->AmountDue->Visible) { // AmountDue ?>
<td<?php echo $cstPayments->AmountDue->CellAttributes() ?>>
<div<?php echo $cstPayments->AmountDue->ViewAttributes() ?>><?php echo $cstPayments->AmountDue->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($cstPayments->AmountPaid->Visible) { // AmountPaid ?>
<td<?php echo $cstPayments->AmountPaid->CellAttributes() ?>>
<div<?php echo $cstPayments->AmountPaid->ViewAttributes() ?>><?php echo $cstPayments->AmountPaid->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($cstPayments->DatePaid->Visible) { // DatePaid ?>
<td<?php echo $cstPayments->DatePaid->CellAttributes() ?>>
<div<?php echo $cstPayments->DatePaid->ViewAttributes() ?>><?php echo $cstPayments->DatePaid->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($cstPayments->CreditNoteNo->Visible) { // CreditNoteNo ?>
<td<?php echo $cstPayments->CreditNoteNo->CellAttributes() ?>>
<div<?php echo $cstPayments->CreditNoteNo->ViewAttributes() ?>><?php echo $cstPayments->CreditNoteNo->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($cstPayments->CCECourseID->Visible) { // CCECourseID ?>
<td<?php echo $cstPayments->CCECourseID->CellAttributes() ?>>
<div<?php echo $cstPayments->CCECourseID->ViewAttributes() ?>><?php echo $cstPayments->CCECourseID->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($cstPayments->CCECourseName->Visible) { // CCECourseName ?>
<td<?php echo $cstPayments->CCECourseName->CellAttributes() ?>>
<div<?php echo $cstPayments->CCECourseName->ViewAttributes() ?>><?php echo $cstPayments->CCECourseName->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($cstPayments->StudentID->Visible) { // StudentID ?>
<td<?php echo $cstPayments->StudentID->CellAttributes() ?>>
<div<?php echo $cstPayments->StudentID->ViewAttributes() ?>><?php echo $cstPayments->StudentID->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($cstPayments->Telephone->Visible) { // Telephone ?>
<td<?php echo $cstPayments->Telephone->CellAttributes() ?>>
<div<?php echo $cstPayments->Telephone->ViewAttributes() ?>><?php echo $cstPayments->Telephone->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($cstPayments->Cellphone->Visible) { // Cellphone ?>
<td<?php echo $cstPayments->Cellphone->CellAttributes() ?>>
<div<?php echo $cstPayments->Cellphone->ViewAttributes() ?>><?php echo $cstPayments->Cellphone->ListViewValue() ?></div>
</td>
<?php } ?>
<?php
// Render list options (body, right)
$cstPayments_list->ListOptions->Render("body", "right");
?>
</tr>
<?php
}
if ($cstPayments->CurrentAction <> "gridadd")
$rs->MoveNext();
}
?>
</tbody>
</table>
<?php } ?>
</div>
</form>
<?php
// Close recordset
if ($rs)
$rs->Close();
?>
<?php if ($cstPayments->Export == "") { ?>
<div class="ewGridLowerPanel">
<?php if ($cstPayments->CurrentAction <> "gridadd" && $cstPayments->CurrentAction <> "gridedit") { ?>
<form name="ewpagerform" id="ewpagerform" class="ewForm" action="<?php echo ew_CurrentPage() ?>">
<table border="0" cellspacing="0" cellpadding="0" class="ewPager">
<tr>
<td nowrap>
<?php if (!isset($cstPayments_list->Pager)) $cstPayments_list->Pager = new cPrevNextPager($cstPayments_list->lStartRec, $cstPayments_list->lDisplayRecs, $cstPayments_list->lTotalRecs) ?>
<?php if ($cstPayments_list->Pager->RecordCount > 0) { ?>
<table border="0" cellspacing="0" cellpadding="0"><tr><td><span class="phpmaker"><?php echo $Language->Phrase("Page") ?> </span></td>
<!--first page button-->
<?php if ($cstPayments_list->Pager->FirstButton->Enabled) { ?>
<td><a href="<?php echo $cstPayments_list->PageUrl() ?>start=<?php echo $cstPayments_list->Pager->FirstButton->Start ?>"><img src="images/first.gif" alt="<?php echo $Language->Phrase("PagerFirst") ?>" width="16" height="16" border="0"></a></td>
<?php } else { ?>
<td><img src="images/firstdisab.gif" alt="<?php echo $Language->Phrase("PagerFirst") ?>" width="16" height="16" border="0"></td>
<?php } ?>
<!--previous page button-->
<?php if ($cstPayments_list->Pager->PrevButton->Enabled) { ?>
<td><a href="<?php echo $cstPayments_list->PageUrl() ?>start=<?php echo $cstPayments_list->Pager->PrevButton->Start ?>"><img src="images/prev.gif" alt="<?php echo $Language->Phrase("PagerPrevious") ?>" width="16" height="16" border="0"></a></td>
<?php } else { ?>
<td><img src="images/prevdisab.gif" alt="<?php echo $Language->Phrase("PagerPrevious") ?>" width="16" height="16" border="0"></td>
<?php } ?>
<!--current page number-->
<td><input type="text" name="<?php echo EW_TABLE_PAGE_NO ?>" id="<?php echo EW_TABLE_PAGE_NO ?>" value="<?php echo $cstPayments_list->Pager->CurrentPage ?>" size="4"></td>
<!--next page button-->
<?php if ($cstPayments_list->Pager->NextButton->Enabled) { ?>
<td><a href="<?php echo $cstPayments_list->PageUrl() ?>start=<?php echo $cstPayments_list->Pager->NextButton->Start ?>"><img src="images/next.gif" alt="<?php echo $Language->Phrase("PagerNext") ?>" width="16" height="16" border="0"></a></td>
<?php } else { ?>
<td><img src="images/nextdisab.gif" alt="<?php echo $Language->Phrase("PagerNext") ?>" width="16" height="16" border="0"></td>
<?php } ?>
<!--last page button-->
<?php if ($cstPayments_list->Pager->LastButton->Enabled) { ?>
<td><a href="<?php echo $cstPayments_list->PageUrl() ?>start=<?php echo $cstPayments_list->Pager->LastButton->Start ?>"><img src="images/last.gif" alt="<?php echo $Language->Phrase("PagerLast") ?>" width="16" height="16" border="0"></a></td>
<?php } else { ?>
<td><img src="images/lastdisab.gif" alt="<?php echo $Language->Phrase("PagerLast") ?>" width="16" height="16" border="0"></td>
<?php } ?>
<td><span class="phpmaker"> <?php echo $Language->Phrase("of") ?> <?php echo $cstPayments_list->Pager->PageCount ?></span></td>
</tr></table>
</td>
<td> </td>
<td>
<span class="phpmaker"><?php echo $Language->Phrase("Record") ?> <?php echo $cstPayments_list->Pager->FromIndex ?> <?php echo $Language->Phrase("To") ?> <?php echo $cstPayments_list->Pager->ToIndex ?> <?php echo $Language->Phrase("Of") ?> <?php echo $cstPayments_list->Pager->RecordCount ?></span>
<?php } else { ?>
<?php if ($Security->CanList()) { ?>
<?php if ($cstPayments_list->sSrchWhere == "0=101") { ?>
<span class="phpmaker"><?php echo $Language->Phrase("EnterSearchCriteria") ?></span>
<?php } else { ?>
<span class="phpmaker"><?php echo $Language->Phrase("NoRecord") ?></span>
<?php } ?>
<?php } else { ?>
<span class="phpmaker"><?php echo $Language->Phrase("NoPermission") ?></span>
<?php } ?>
<?php } ?>
</td>
</tr>
</table>
</form>
<?php } ?>
<?php //if ($cstPayments_list->lTotalRecs > 0) { ?>
<span class="phpmaker">
</span>
<?php //} ?>
</div>
<?php } ?>
</td></tr></table>
<?php if ($cstPayments->Export == "" && $cstPayments->CurrentAction == "") { ?>
<?php } ?>
<?php if ($cstPayments->Export == "") { ?>
<script language="JavaScript" type="text/javascript">
<!--
// Write your table-specific startup script here
// document.write("page loaded");
//-->
</script>
<?php } ?>
<?php include "footer.php" ?>
<?php
$cstPayments_list->Page_Terminate();
?>
<?php
//
// Page class
//
class ccstPayments_list {
// Page ID
var $PageID = 'list';
// Table name
var $TableName = 'cstPayments';
// Page object name
var $PageObjName = 'cstPayments_list';
// Page name
function PageName() {
return ew_CurrentPage();
}
// Page URL
function PageUrl() {
$PageUrl = ew_CurrentPage() . "?";
global $cstPayments;
if ($cstPayments->UseTokenInUrl) $PageUrl .= "t=" . $cstPayments->TableVar . "&"; // Add page token
return $PageUrl;
}
// Page URLs
var $AddUrl;
var $EditUrl;
var $CopyUrl;
var $DeleteUrl;
var $ViewUrl;
var $ListUrl;
// Export URLs
var $ExportPrintUrl;
var $ExportHtmlUrl;
var $ExportExcelUrl;
var $ExportWordUrl;
var $ExportXmlUrl;
var $ExportCsvUrl;
// Update URLs
var $InlineAddUrl;
var $InlineCopyUrl;
var $InlineEditUrl;
var $GridAddUrl;
var $GridEditUrl;
var $MultiDeleteUrl;
var $MultiUpdateUrl;
// Message
function getMessage() {
return @$_SESSION[EW_SESSION_MESSAGE];
}
function setMessage($v) {
if (@$_SESSION[EW_SESSION_MESSAGE] <> "") { // Append
$_SESSION[EW_SESSION_MESSAGE] .= "<br>" . $v;
} else {
$_SESSION[EW_SESSION_MESSAGE] = $v;
}
}
// Show message
function ShowMessage() {
$sMessage = $this->getMessage();
$this->Message_Showing($sMessage);
if ($sMessage <> "") { // Message in Session, display
echo "<p><span class=\"ewMessage\">" . $sMessage . "</span></p>";
$_SESSION[EW_SESSION_MESSAGE] = ""; // Clear message in Session
}
}
// Validate page request
function IsPageRequest() {
global $objForm, $cstPayments;
if ($cstPayments->UseTokenInUrl) {
if ($objForm)
return ($cstPayments->TableVar == $objForm->GetValue("t"));
if (@$_GET["t"] <> "")
return ($cstPayments->TableVar == $_GET["t"]);
} else {
return TRUE;
}
}
//
// Page class constructor
//
function __construct() {
global $conn, $Language;
// Language object
$Language = new cLanguage();
// Table object (cstPayments)
$GLOBALS["cstPayments"] = new ccstPayments();
// Initialize URLs
$this->ExportPrintUrl = $this->PageUrl() . "export=print";
$this->ExportExcelUrl = $this->PageUrl() . "export=excel";
$this->ExportWordUrl = $this->PageUrl() . "export=word";
$this->ExportHtmlUrl = $this->PageUrl() . "export=html";
$this->ExportXmlUrl = $this->PageUrl() . "export=xml";
$this->ExportCsvUrl = $this->PageUrl() . "export=csv";
$this->AddUrl = $GLOBALS["cstPayments"]->AddUrl();
$this->InlineAddUrl = $this->PageUrl() . "a=add";
$this->GridAddUrl = $this->PageUrl() . "a=gridadd";
$this->GridEditUrl = $this->PageUrl() . "a=gridedit";
$this->MultiDeleteUrl = "cstPaymentsdelete.php";
$this->MultiUpdateUrl = "cstPaymentsupdate.php";
// Table object (CCEUsers)
$GLOBALS['CCEUsers'] = new cCCEUsers();
// Page ID
if (!defined("EW_PAGE_ID"))
define("EW_PAGE_ID", 'list', TRUE);
// Table name (for backward compatibility)
if (!defined("EW_TABLE_NAME"))
define("EW_TABLE_NAME", 'cstPayments', TRUE);
// Start timer
$GLOBALS["gsTimer"] = new cTimer();
// Open connection
$conn = ew_Connect();
// List options
$this->ListOptions = new cListOptions();
}
//
// Page_Init
//
function Page_Init() {
global $gsExport, $gsExportFile, $UserProfile, $Language, $Security, $objForm;
global $cstPayments;
// Security
$Security = new cAdvancedSecurity();
if (!$Security->IsLoggedIn()) $Security->AutoLogin();
if (!$Security->IsLoggedIn()) {
$Security->SaveLastUrl();
$this->Page_Terminate("login.php");
}
$Security->TablePermission_Loading();
$Security->LoadCurrentUserLevel($this->TableName);
$Security->TablePermission_Loaded();
if (!$Security->IsLoggedIn()) {
$Security->SaveLastUrl();
$this->Page_Terminate("login.php");
}
if (!$Security->CanList()) {
$Security->SaveLastUrl();
$this->Page_Terminate("login.php");
}
// Get export parameters
if (@$_GET["export"] <> "") {
$cstPayments->Export = $_GET["export"];
} elseif (ew_IsHttpPost()) {
if (@$_POST["exporttype"] <> "")
$cstPayments->Export = $_POST["exporttype"];
} else {
$cstPayments->setExportReturnUrl(ew_CurrentUrl());
}
$gsExport = $cstPayments->Export; // Get export parameter, used in header
$gsExportFile = $cstPayments->TableVar; // Get export file, used in header
if ($cstPayments->Export == "excel") {
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename=' . $gsExportFile .'.xls');
}
if ($cstPayments->Export == "word") {
header('Content-Type: application/vnd.ms-word');
header('Content-Disposition: attachment; filename=' . $gsExportFile .'.doc');
}
// Global Page Loading event (in userfn*.php)
Page_Loading();
// Page Load event
$this->Page_Load();
}
//
// Page_Terminate
//
function Page_Terminate($url = "") {
global $conn;
// Page Unload event
$this->Page_Unload();
// Global Page Unloaded event (in userfn*.php)
Page_Unloaded();
// Close connection
$conn->Close();
// Go to URL if specified
$this->Page_Redirecting($url);
if ($url <> "") {
if (!EW_DEBUG_ENABLED && ob_get_length())
ob_end_clean();
header("Location: " . $url);
}
exit();
}
// Class variables
var $ListOptions; // List options
var $lDisplayRecs = 500;
var $lStartRec;
var $lStopRec;
var $lTotalRecs = 0;
var $lRecRange = 10;
var $sSrchWhere = ""; // Search WHERE clause
var $lRecCnt = 0; // Record count
var $lEditRowCnt;
var $lRowCnt;
var $lRowIndex; // Row index
var $lRecPerRow = 0;
var $lColCnt = 0;
var $sDbMasterFilter = ""; // Master filter
var $sDbDetailFilter = ""; // Detail filter
var $bMasterRecordExists;
var $sMultiSelectKey;
var $RestoreSearch;
//
// Page main
//
function Page_Main() {
global $objForm, $Language, $gsSearchError, $Security, $cstPayments;
// Search filters
$sSrchAdvanced = ""; // Advanced search filter
$sSrchBasic = ""; // Basic search filter
$sFilter = "";
if ($this->IsPageRequest()) { // Validate request
// Handle reset command
$this->ResetCmd();
// Set up list options
$this->SetupListOptions();
// Set up sorting order
$this->SetUpSortOrder();
}
// Restore display records
if ($cstPayments->getRecordsPerPage() <> "") {
$this->lDisplayRecs = $cstPayments->getRecordsPerPage(); // Restore from Session
} else {
$this->lDisplayRecs = 500; // Load default
}
// Load Sorting Order
$this->LoadSortOrder();
// Build filter
$sFilter = "";
if (!$Security->CanList())
$sFilter = "(0=1)"; // Filter all records
if ($this->sDbDetailFilter <> "")
$sFilter = ($sFilter <> "") ? "(" . $sFilter . ") AND (" . $this->sDbDetailFilter . ")" : $this->sDbDetailFilter;
if ($this->sSrchWhere <> "")
$sFilter = ($sFilter <> "") ? "(" . $sFilter . ") AND (". $this->sSrchWhere . ")" : $this->sSrchWhere;
// Set up filter in session
$cstPayments->setSessionWhere($sFilter);
$cstPayments->CurrentFilter = "";
// Export data only
if (in_array($cstPayments->Export, array("html","word","excel","xml","csv","email"))) {
$this->ExportData();
if ($cstPayments->Export <> "email")
$this->Page_Terminate(); // Terminate response
exit();
}
}
// Set up sort parameters
function SetUpSortOrder() {
global $cstPayments;
// Check for Ctrl pressed
$bCtrl = (@$_GET["ctrl"] <> "");
// Check for "order" parameter
if (@$_GET["order"] <> "") {
$cstPayments->CurrentOrder = ew_StripSlashes(@$_GET["order"]);
$cstPayments->CurrentOrderType = @$_GET["ordertype"];
$cstPayments->UpdateSort($cstPayments->Delegate, $bCtrl); // Delegate
$cstPayments->UpdateSort($cstPayments->Organisation, $bCtrl); // Organisation
$cstPayments->UpdateSort($cstPayments->EmailAddress, $bCtrl); // EmailAddress
$cstPayments->UpdateSort($cstPayments->InvoiceNo, $bCtrl); // InvoiceNo
$cstPayments->UpdateSort($cstPayments->AmountDue, $bCtrl); // AmountDue
$cstPayments->UpdateSort($cstPayments->AmountPaid, $bCtrl); // AmountPaid
$cstPayments->UpdateSort($cstPayments->DatePaid, $bCtrl); // DatePaid
$cstPayments->UpdateSort($cstPayments->CreditNoteNo, $bCtrl); // CreditNoteNo
$cstPayments->UpdateSort($cstPayments->CCECourseID, $bCtrl); // CCECourseID
$cstPayments->UpdateSort($cstPayments->CCECourseName, $bCtrl); // CCECourseName
$cstPayments->UpdateSort($cstPayments->StudentID, $bCtrl); // StudentID
$cstPayments->UpdateSort($cstPayments->Telephone, $bCtrl); // Telephone
$cstPayments->UpdateSort($cstPayments->Cellphone, $bCtrl); // Cellphone
$cstPayments->setStartRecordNumber(1); // Reset start position
}
}
// Load sort order parameters
function LoadSortOrder() {
global $cstPayments;
$sOrderBy = $cstPayments->getSessionOrderBy(); // Get ORDER BY from Session
if ($sOrderBy == "") {
if ($cstPayments->SqlOrderBy() <> "") {
$sOrderBy = $cstPayments->SqlOrderBy();
$cstPayments->setSessionOrderBy($sOrderBy);
}
}
}
// Reset command
// cmd=reset (Reset search parameters)
// cmd=resetall (Reset search and master/detail parameters)
// cmd=resetsort (Reset sort parameters)
function ResetCmd() {
global $cstPayments;
// Get reset command
if (@$_GET["cmd"] <> "") {
$sCmd = $_GET["cmd"];
// Reset sorting order
if (strtolower($sCmd) == "resetsort") {
$sOrderBy = "";
$cstPayments->setSessionOrderBy($sOrderBy);
$cstPayments->Delegate->setSort("");
$cstPayments->Organisation->setSort("");
$cstPayments->EmailAddress->setSort("");
$cstPayments->InvoiceNo->setSort("");
$cstPayments->AmountDue->setSort("");
$cstPayments->AmountPaid->setSort("");
$cstPayments->DatePaid->setSort("");
$cstPayments->CreditNoteNo->setSort("");
$cstPayments->CCECourseID->setSort("");
$cstPayments->CCECourseName->setSort("");
$cstPayments->StudentID->setSort("");
$cstPayments->Telephone->setSort("");
$cstPayments->Cellphone->setSort("");
}
// Reset start position
$this->lStartRec = 1;
$cstPayments->setStartRecordNumber($this->lStartRec);
}
}
// Set up list options
function SetupListOptions() {
global $Security, $cstPayments;
// Call ListOptions_Load event
$this->ListOptions_Load();
if ($cstPayments->Export <> "" ||
$cstPayments->CurrentAction == "gridadd" ||
$cstPayments->CurrentAction == "gridedit")
$this->ListOptions->HideAllOptions();
}
// Render list options
function RenderListOptions() {
global $Security, $Language, $cstPayments;
$this->ListOptions->LoadDefault();
$this->RenderListOptionsExt();
// Call ListOptions_Rendered event
$this->ListOptions_Rendered();
}
function RenderListOptionsExt() {
global $Security, $Language, $cstPayments;
}
// Set up starting record parameters
function SetUpStartRec() {
global $cstPayments;
if ($this->lDisplayRecs == 0)
return;
if ($this->IsPageRequest()) { // Validate request
if (@$_GET[EW_TABLE_START_REC] <> "") { // Check for "start" parameter
$this->lStartRec = $_GET[EW_TABLE_START_REC];
$cstPayments->setStartRecordNumber($this->lStartRec);
} elseif (@$_GET[EW_TABLE_PAGE_NO] <> "") {
$this->nPageNo = $_GET[EW_TABLE_PAGE_NO];
if (is_numeric($this->nPageNo)) {
$this->lStartRec = ($this->nPageNo-1)*$this->lDisplayRecs+1;
if ($this->lStartRec <= 0) {
$this->lStartRec = 1;
} elseif ($this->lStartRec >= intval(($this->lTotalRecs-1)/$this->lDisplayRecs)*$this->lDisplayRecs+1) {
$this->lStartRec = intval(($this->lTotalRecs-1)/$this->lDisplayRecs)*$this->lDisplayRecs+1;
}
$cstPayments->setStartRecordNumber($this->lStartRec);
}
}
}
$this->lStartRec = $cstPayments->getStartRecordNumber();
// Check if correct start record counter
if (!is_numeric($this->lStartRec) || $this->lStartRec == "") { // Avoid invalid start record counter
$this->lStartRec = 1; // Reset start record counter
$cstPayments->setStartRecordNumber($this->lStartRec);
} elseif (intval($this->lStartRec) > intval($this->lTotalRecs)) { // Avoid starting record > total records
$this->lStartRec = intval(($this->lTotalRecs-1)/$this->lDisplayRecs)*$this->lDisplayRecs+1; // Point to last page first record
$cstPayments->setStartRecordNumber($this->lStartRec);
} elseif (($this->lStartRec-1) % $this->lDisplayRecs <> 0) {
$this->lStartRec = intval(($this->lStartRec-1)/$this->lDisplayRecs)*$this->lDisplayRecs+1; // Point to page boundary
$cstPayments->setStartRecordNumber($this->lStartRec);
}
}
// Load recordset
function LoadRecordset($offset = -1, $rowcnt = -1) {
global $conn, $cstPayments;
// Call Recordset Selecting event
$cstPayments->Recordset_Selecting($cstPayments->CurrentFilter);
// Load List page SQL
$sSql = $cstPayments->SelectSQL();
if ($offset > -1 && $rowcnt > -1)
$sSql .= " LIMIT $offset, $rowcnt";
// Load recordset
$rs = ew_LoadRecordset($sSql);
// Call Recordset Selected event
$cstPayments->Recordset_Selected($rs);
return $rs;
}
// Load row based on key values
function LoadRow() {
global $conn, $Security, $cstPayments;
$sFilter = $cstPayments->KeyFilter();
// Call Row Selecting event
$cstPayments->Row_Selecting($sFilter);
// Load SQL based on filter
$cstPayments->CurrentFilter = $sFilter;
$sSql = $cstPayments->SQL();
$res = FALSE;
$rs = ew_LoadRecordset($sSql);
if ($rs && !$rs->EOF) {
$res = TRUE;
$this->LoadRowValues($rs); // Load row values
// Call Row Selected event
$cstPayments->Row_Selected($rs);
$rs->Close();
}
return $res;
}
// Load row values from recordset
function LoadRowValues(&$rs) {
global $conn, $cstPayments;
$cstPayments->StartDate->setDbValue($rs->fields('StartDate'));
$cstPayments->EndDate->setDbValue($rs->fields('EndDate'));
$cstPayments->Delegate->setDbValue($rs->fields('Delegate'));
$cstPayments->Organisation->setDbValue($rs->fields('Organisation'));
$cstPayments->EmailAddress->setDbValue($rs->fields('EmailAddress'));
$cstPayments->InvoiceNo->setDbValue($rs->fields('InvoiceNo'));
$cstPayments->AmountDue->setDbValue($rs->fields('AmountDue'));
$cstPayments->AmountPaid->setDbValue($rs->fields('AmountPaid'));
$cstPayments->DatePaid->setDbValue($rs->fields('DatePaid'));
$cstPayments->CreditNoteNo->setDbValue($rs->fields('CreditNoteNo'));
$cstPayments->CCECourseID->setDbValue($rs->fields('CCECourseID'));
$cstPayments->CCECourseName->setDbValue($rs->fields('CCECourseName'));
$cstPayments->StudentID->setDbValue($rs->fields('StudentID'));
$cstPayments->Telephone->setDbValue($rs->fields('Telephone'));
$cstPayments->Cellphone->setDbValue($rs->fields('Cellphone'));
}
// Render row values based on field settings
function RenderRow() {
global $conn, $Security, $Language, $cstPayments;
// Initialize URLs
$this->ViewUrl = $cstPayments->ViewUrl();
$this->EditUrl = $cstPayments->EditUrl();
$this->InlineEditUrl = $cstPayments->InlineEditUrl();
$this->CopyUrl = $cstPayments->CopyUrl();
$this->InlineCopyUrl = $cstPayments->InlineCopyUrl();
$this->DeleteUrl = $cstPayments->DeleteUrl();
// Call Row_Rendering event
$cstPayments->Row_Rendering();
// Common render codes for all row types
// Delegate
$cstPayments->Delegate->CellCssStyle = ""; $cstPayments->Delegate->CellCssClass = "";
$cstPayments->Delegate->CellAttrs = array(); $cstPayments->Delegate->ViewAttrs = array(); $cstPayments->Delegate->EditAttrs = array();
// Organisation
$cstPayments->Organisation->CellCssStyle = ""; $cstPayments->Organisation->CellCssClass = "";
$cstPayments->Organisation->CellAttrs = array(); $cstPayments->Organisation->ViewAttrs = array(); $cstPayments->Organisation->EditAttrs = array();
// EmailAddress
$cstPayments->EmailAddress->CellCssStyle = ""; $cstPayments->EmailAddress->CellCssClass = "";
$cstPayments->EmailAddress->CellAttrs = array(); $cstPayments->EmailAddress->ViewAttrs = array(); $cstPayments->EmailAddress->EditAttrs = array();
// InvoiceNo
$cstPayments->InvoiceNo->CellCssStyle = ""; $cstPayments->InvoiceNo->CellCssClass = "";
$cstPayments->InvoiceNo->CellAttrs = array(); $cstPayments->InvoiceNo->ViewAttrs = array(); $cstPayments->InvoiceNo->EditAttrs = array();
// AmountDue
$cstPayments->AmountDue->CellCssStyle = ""; $cstPayments->AmountDue->CellCssClass = "";
$cstPayments->AmountDue->CellAttrs = array(); $cstPayments->AmountDue->ViewAttrs = array(); $cstPayments->AmountDue->EditAttrs = array();
// AmountPaid
$cstPayments->AmountPaid->CellCssStyle = ""; $cstPayments->AmountPaid->CellCssClass = "";
$cstPayments->AmountPaid->CellAttrs = array(); $cstPayments->AmountPaid->ViewAttrs = array(); $cstPayments->AmountPaid->EditAttrs = array();
// DatePaid
$cstPayments->DatePaid->CellCssStyle = ""; $cstPayments->DatePaid->CellCssClass = "";
$cstPayments->DatePaid->CellAttrs = array(); $cstPayments->DatePaid->ViewAttrs = array(); $cstPayments->DatePaid->EditAttrs = array();
// CreditNoteNo
$cstPayments->CreditNoteNo->CellCssStyle = ""; $cstPayments->CreditNoteNo->CellCssClass = "";
$cstPayments->CreditNoteNo->CellAttrs = array(); $cstPayments->CreditNoteNo->ViewAttrs = array(); $cstPayments->CreditNoteNo->EditAttrs = array();
// CCECourseID
$cstPayments->CCECourseID->CellCssStyle = ""; $cstPayments->CCECourseID->CellCssClass = "";
$cstPayments->CCECourseID->CellAttrs = array(); $cstPayments->CCECourseID->ViewAttrs = array(); $cstPayments->CCECourseID->EditAttrs = array();
// CCECourseName
$cstPayments->CCECourseName->CellCssStyle = ""; $cstPayments->CCECourseName->CellCssClass = "";
$cstPayments->CCECourseName->CellAttrs = array(); $cstPayments->CCECourseName->ViewAttrs = array(); $cstPayments->CCECourseName->EditAttrs = array();
// StudentID
$cstPayments->StudentID->CellCssStyle = ""; $cstPayments->StudentID->CellCssClass = "";
$cstPayments->StudentID->CellAttrs = array(); $cstPayments->StudentID->ViewAttrs = array(); $cstPayments->StudentID->EditAttrs = array();
// Telephone
$cstPayments->Telephone->CellCssStyle = ""; $cstPayments->Telephone->CellCssClass = "";
$cstPayments->Telephone->CellAttrs = array(); $cstPayments->Telephone->ViewAttrs = array(); $cstPayments->Telephone->EditAttrs = array();
// Cellphone
$cstPayments->Cellphone->CellCssStyle = ""; $cstPayments->Cellphone->CellCssClass = "";
$cstPayments->Cellphone->CellAttrs = array(); $cstPayments->Cellphone->ViewAttrs = array(); $cstPayments->Cellphone->EditAttrs = array();
if ($cstPayments->RowType == EW_ROWTYPE_VIEW) { // View row
// Delegate
$cstPayments->Delegate->ViewValue = $cstPayments->Delegate->CurrentValue;
$cstPayments->Delegate->CssStyle = "";
$cstPayments->Delegate->CssClass = "";
$cstPayments->Delegate->ViewCustomAttributes = "";
// Organisation
$cstPayments->Organisation->ViewValue = $cstPayments->Organisation->CurrentValue;
$cstPayments->Organisation->CssStyle = "";
$cstPayments->Organisation->CssClass = "";
$cstPayments->Organisation->ViewCustomAttributes = "";
// EmailAddress
$cstPayments->EmailAddress->ViewValue = $cstPayments->EmailAddress->CurrentValue;
$cstPayments->EmailAddress->CssStyle = "";
$cstPayments->EmailAddress->CssClass = "";
$cstPayments->EmailAddress->ViewCustomAttributes = "";
// InvoiceNo
$cstPayments->InvoiceNo->ViewValue = $cstPayments->InvoiceNo->CurrentValue;
$cstPayments->InvoiceNo->CssStyle = "";
$cstPayments->InvoiceNo->CssClass = "";
$cstPayments->InvoiceNo->ViewCustomAttributes = "";
// AmountDue
$cstPayments->AmountDue->ViewValue = $cstPayments->AmountDue->CurrentValue;
$cstPayments->AmountDue->CssStyle = "";
$cstPayments->AmountDue->CssClass = "";
$cstPayments->AmountDue->ViewCustomAttributes = "";
// AmountPaid
$cstPayments->AmountPaid->ViewValue = $cstPayments->AmountPaid->CurrentValue;
$cstPayments->AmountPaid->CssStyle = "";
$cstPayments->AmountPaid->CssClass = "";
$cstPayments->AmountPaid->ViewCustomAttributes = "";
// DatePaid
$cstPayments->DatePaid->ViewValue = $cstPayments->DatePaid->CurrentValue;
$cstPayments->DatePaid->ViewValue = ew_FormatDateTime($cstPayments->DatePaid->ViewValue, 5);
$cstPayments->DatePaid->CssStyle = "";
$cstPayments->DatePaid->CssClass = "";
$cstPayments->DatePaid->ViewCustomAttributes = "";
// CreditNoteNo
$cstPayments->CreditNoteNo->ViewValue = $cstPayments->CreditNoteNo->CurrentValue;
$cstPayments->CreditNoteNo->CssStyle = "";
$cstPayments->CreditNoteNo->CssClass = "";
$cstPayments->CreditNoteNo->ViewCustomAttributes = "";
// CCECourseID
$cstPayments->CCECourseID->ViewValue = $cstPayments->CCECourseID->CurrentValue;
$cstPayments->CCECourseID->CssStyle = "";
$cstPayments->CCECourseID->CssClass = "";
$cstPayments->CCECourseID->ViewCustomAttributes = "";
// CCECourseName
$cstPayments->CCECourseName->ViewValue = $cstPayments->CCECourseName->CurrentValue;
$cstPayments->CCECourseName->CssStyle = "";
$cstPayments->CCECourseName->CssClass = "";
$cstPayments->CCECourseName->ViewCustomAttributes = "";
// StudentID
$cstPayments->StudentID->ViewValue = $cstPayments->StudentID->CurrentValue;
$cstPayments->StudentID->CssStyle = "";
$cstPayments->StudentID->CssClass = "";
$cstPayments->StudentID->ViewCustomAttributes = "";
// Telephone
$cstPayments->Telephone->ViewValue = $cstPayments->Telephone->CurrentValue;
$cstPayments->Telephone->CssStyle = "";
$cstPayments->Telephone->CssClass = "";
$cstPayments->Telephone->ViewCustomAttributes = "";
// Cellphone
$cstPayments->Cellphone->ViewValue = $cstPayments->Cellphone->CurrentValue;
$cstPayments->Cellphone->CssStyle = "";
$cstPayments->Cellphone->CssClass = "";
$cstPayments->Cellphone->ViewCustomAttributes = "";
// Delegate
$cstPayments->Delegate->HrefValue = "";
$cstPayments->Delegate->TooltipValue = "";
// Organisation
$cstPayments->Organisation->HrefValue = "";
$cstPayments->Organisation->TooltipValue = "";
// EmailAddress
$cstPayments->EmailAddress->HrefValue = "";
$cstPayments->EmailAddress->TooltipValue = "";
// InvoiceNo
$cstPayments->InvoiceNo->HrefValue = "";
$cstPayments->InvoiceNo->TooltipValue = "";
// AmountDue
$cstPayments->AmountDue->HrefValue = "";
$cstPayments->AmountDue->TooltipValue = "";
// AmountPaid
$cstPayments->AmountPaid->HrefValue = "";
$cstPayments->AmountPaid->TooltipValue = "";
// DatePaid
$cstPayments->DatePaid->HrefValue = "";
$cstPayments->DatePaid->TooltipValue = "";
// CreditNoteNo
$cstPayments->CreditNoteNo->HrefValue = "";
$cstPayments->CreditNoteNo->TooltipValue = "";
// CCECourseID
$cstPayments->CCECourseID->HrefValue = "";
$cstPayments->CCECourseID->TooltipValue = "";
// CCECourseName
$cstPayments->CCECourseName->HrefValue = "";
$cstPayments->CCECourseName->TooltipValue = "";
// StudentID
$cstPayments->StudentID->HrefValue = "";
$cstPayments->StudentID->TooltipValue = "";
// Telephone
$cstPayments->Telephone->HrefValue = "";
$cstPayments->Telephone->TooltipValue = "";
// Cellphone
$cstPayments->Cellphone->HrefValue = "";
$cstPayments->Cellphone->TooltipValue = "";
}
// Call Row Rendered event
if ($cstPayments->RowType <> EW_ROWTYPE_AGGREGATEINIT)
$cstPayments->Row_Rendered();
}
// Export data in HTML/CSV/Word/Excel/XML/Email format
function ExportData() {
global $cstPayments;
$utf8 = FALSE;
$bSelectLimit = EW_SELECT_LIMIT;
// Load recordset
if ($bSelectLimit) {
$this->lTotalRecs = $cstPayments->SelectRecordCount();
} else {
if ($rs = $this->LoadRecordset())
$this->lTotalRecs = $rs->RecordCount();
}
$this->lStartRec = 1;
// Export all
if ($cstPayments->ExportAll) {
$this->lDisplayRecs = $this->lTotalRecs;
$this->lStopRec = $this->lTotalRecs;
} else { // Export one page only
$this->SetUpStartRec(); // Set up start record position
// Set the last record to display
if ($this->lDisplayRecs < 0) {
$this->lStopRec = $this->lTotalRecs;
} else {
$this->lStopRec = $this->lStartRec + $this->lDisplayRecs - 1;
}
}
if ($bSelectLimit)
$rs = $this->LoadRecordset($this->lStartRec-1, $this->lDisplayRecs);
if (!$rs) {
header("Content-Type:"); // Remove header
header("Content-Disposition:");
$this->ShowMessage();
return;
}
if ($cstPayments->Export == "xml") {
$XmlDoc = new cXMLDocument(EW_XML_ENCODING);
$XmlDoc->AddRoot();
} else {
$ExportDoc = new cExportDocument($cstPayments, "h");
$ExportDoc->ExportHeader();
if ($ExportDoc->Horizontal) { // Horizontal format, write header
$ExportDoc->BeginExportRow();
$ExportDoc->ExportCaption($cstPayments->Delegate);
$ExportDoc->ExportCaption($cstPayments->Organisation);
$ExportDoc->ExportCaption($cstPayments->EmailAddress);
$ExportDoc->ExportCaption($cstPayments->InvoiceNo);
$ExportDoc->ExportCaption($cstPayments->AmountDue);
$ExportDoc->ExportCaption($cstPayments->AmountPaid);
$ExportDoc->ExportCaption($cstPayments->DatePaid);
$ExportDoc->ExportCaption($cstPayments->CreditNoteNo);
$ExportDoc->ExportCaption($cstPayments->CCECourseID);
$ExportDoc->ExportCaption($cstPayments->CCECourseName);
$ExportDoc->ExportCaption($cstPayments->StudentID);
$ExportDoc->ExportCaption($cstPayments->Telephone);
$ExportDoc->ExportCaption($cstPayments->Cellphone);
$ExportDoc->EndExportRow();
}
}
// Move to first record
$this->lRecCnt = $this->lStartRec - 1;
if (!$rs->EOF) {
$rs->MoveFirst();
if (!$bSelectLimit && $this->lStartRec > 1)
$rs->Move($this->lStartRec - 1);
}
while (!$rs->EOF && $this->lRecCnt < $this->lStopRec) {
$this->lRecCnt++;
if (intval($this->lRecCnt) >= intval($this->lStartRec)) {
$this->LoadRowValues($rs);
// Render row
$cstPayments->CssClass = "";
$cstPayments->CssStyle = "";
$cstPayments->RowType = EW_ROWTYPE_VIEW; // Render view
$this->RenderRow();
if ($cstPayments->Export == "xml") {
$XmlDoc->AddRow();
$XmlDoc->AddField('Delegate', $cstPayments->Delegate->ExportValue($cstPayments->Export, $cstPayments->ExportOriginalValue));
$XmlDoc->AddField('Organisation', $cstPayments->Organisation->ExportValue($cstPayments->Export, $cstPayments->ExportOriginalValue));
$XmlDoc->AddField('EmailAddress', $cstPayments->EmailAddress->ExportValue($cstPayments->Export, $cstPayments->ExportOriginalValue));
$XmlDoc->AddField('InvoiceNo', $cstPayments->InvoiceNo->ExportValue($cstPayments->Export, $cstPayments->ExportOriginalValue));
$XmlDoc->AddField('AmountDue', $cstPayments->AmountDue->ExportValue($cstPayments->Export, $cstPayments->ExportOriginalValue));
$XmlDoc->AddField('AmountPaid', $cstPayments->AmountPaid->ExportValue($cstPayments->Export, $cstPayments->ExportOriginalValue));
$XmlDoc->AddField('DatePaid', $cstPayments->DatePaid->ExportValue($cstPayments->Export, $cstPayments->ExportOriginalValue));
$XmlDoc->AddField('CreditNoteNo', $cstPayments->CreditNoteNo->ExportValue($cstPayments->Export, $cstPayments->ExportOriginalValue));
$XmlDoc->AddField('CCECourseID', $cstPayments->CCECourseID->ExportValue($cstPayments->Export, $cstPayments->ExportOriginalValue));
$XmlDoc->AddField('CCECourseName', $cstPayments->CCECourseName->ExportValue($cstPayments->Export, $cstPayments->ExportOriginalValue));
$XmlDoc->AddField('StudentID', $cstPayments->StudentID->ExportValue($cstPayments->Export, $cstPayments->ExportOriginalValue));
$XmlDoc->AddField('Telephone', $cstPayments->Telephone->ExportValue($cstPayments->Export, $cstPayments->ExportOriginalValue));
$XmlDoc->AddField('Cellphone', $cstPayments->Cellphone->ExportValue($cstPayments->Export, $cstPayments->ExportOriginalValue));
} else {
$ExportDoc->BeginExportRow(TRUE); // Allow CSS styles if enabled
$ExportDoc->ExportField($cstPayments->Delegate);
$ExportDoc->ExportField($cstPayments->Organisation);
$ExportDoc->ExportField($cstPayments->EmailAddress);
$ExportDoc->ExportField($cstPayments->InvoiceNo);
$ExportDoc->ExportField($cstPayments->AmountDue);
$ExportDoc->ExportField($cstPayments->AmountPaid);
$ExportDoc->ExportField($cstPayments->DatePaid);
$ExportDoc->ExportField($cstPayments->CreditNoteNo);
$ExportDoc->ExportField($cstPayments->CCECourseID);
$ExportDoc->ExportField($cstPayments->CCECourseName);
$ExportDoc->ExportField($cstPayments->StudentID);
$ExportDoc->ExportField($cstPayments->Telephone);
$ExportDoc->ExportField($cstPayments->Cellphone);
$ExportDoc->EndExportRow();
}
}
$rs->MoveNext();
}
if ($cstPayments->Export <> "xml")
$ExportDoc->ExportFooter();
// Close recordset
$rs->Close();
// Clean output buffer
if (!EW_DEBUG_ENABLED && ob_get_length())
ob_end_clean();
// Write BOM if utf-8
if ($utf8 && !in_array($cstPayments->Export, array("email", "xml")))
echo "\xEF\xBB\xBF";
// Write debug message if enabled
if (EW_DEBUG_ENABLED)
echo ew_DebugMsg();
// Output data
if ($cstPayments->Export == "xml") {
header("Content-Type: text/xml");
echo $XmlDoc->XML();
} elseif ($cstPayments->Export == "email") {
$this->ExportEmail($ExportDoc->Text);
$this->Page_Terminate($cstPayments->ExportReturnUrl());
} else {
echo $ExportDoc->Text;
}
}
// Page Load event
function Page_Load() {
//echo "Page Load";
global $cstPayments_list;
//echo "Page Load";
$cstPayments_list->ExportPrintUrl .= "&EventID=".$_GET["EventID"]."\" target=\"_blank";
$cstPayments_list->ExportExcelUrl .= "&EventID=".$_GET["EventID"];
$cstPayments_list->ExportWordUrl .= "&EventID=".$_GET["EventID"];
}
// Page Unload event
function Page_Unload() {
//echo "Page Unload";
}
// Page Redirecting event
function Page_Redirecting(&$url) {
// Example:
//$url = "your URL";
}
// Message Showing event
function Message_Showing(&$msg) {
// Example:
//$msg = "your new message";
}
// Form Custom Validate event
function Form_CustomValidate(&$CustomError) {
// Return error message in CustomError
return TRUE;
}
// ListOptions Load event
function ListOptions_Load() {
// Example:
//$this->ListOptions->Add("new");
//$this->ListOptions->Items["new"]->OnLeft = TRUE; // Link on left
//$this->ListOptions->MoveItem("new", 0); // Move to first column
}
// ListOptions Rendered event
function ListOptions_Rendered() {
// Example:
//$this->ListOptions->Items["new"]->Body = "xxx";
}
}
?>