| Current Path : /var/www/cesa.co.za/ccmadmin/ |
| Current File : /var/www/cesa.co.za/ccmadmin/CCMStudentProgresslist.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 "CCMStudentProgressinfo.php" ?>
<?php include "CCMStudentsinfo.php" ?>
<?php include "CCMUsersinfo.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
$CCMStudentProgress_list = new cCCMStudentProgress_list();
$Page =& $CCMStudentProgress_list;
// Page init
$CCMStudentProgress_list->Page_Init();
// Page main
$CCMStudentProgress_list->Page_Main();
?>
<?php include "header.php" ?>
<?php if ($CCMStudentProgress->Export == "") { ?>
<script type="text/javascript">
<!--
// Create page object
var CCMStudentProgress_list = new ew_Page("CCMStudentProgress_list");
// page properties
CCMStudentProgress_list.PageID = "list"; // page ID
CCMStudentProgress_list.FormID = "fCCMStudentProgresslist"; // form ID
var EW_PAGE_ID = CCMStudentProgress_list.PageID; // for backward compatibility
// extend page with Form_CustomValidate function
CCMStudentProgress_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) { ?>
CCMStudentProgress_list.ValidateRequired = true; // uses JavaScript validation
<?php } else { ?>
CCMStudentProgress_list.ValidateRequired = false; // no JavaScript validation
<?php } ?>
//-->
</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 ($CCMStudentProgress->Export == "") { ?>
<?php
$gsMasterReturnUrl = "CCMStudentslist.php";
if ($CCMStudentProgress_list->sDbMasterFilter <> "" && $CCMStudentProgress->getCurrentMasterTable() == "CCMStudents") {
if ($CCMStudentProgress_list->bMasterRecordExists) {
if ($CCMStudentProgress->getCurrentMasterTable() == $CCMStudentProgress->TableVar) $gsMasterReturnUrl .= "?" . EW_TABLE_SHOW_MASTER . "=";
?>
<?php include "CCMStudentsmaster.php" ?>
<?php
}
}
?>
<?php } ?>
<?php
$bSelectLimit = EW_SELECT_LIMIT;
if ($bSelectLimit) {
$CCMStudentProgress_list->lTotalRecs = $CCMStudentProgress->SelectRecordCount();
} else {
if ($rs = $CCMStudentProgress_list->LoadRecordset())
$CCMStudentProgress_list->lTotalRecs = $rs->RecordCount();
}
$CCMStudentProgress_list->lStartRec = 1;
if ($CCMStudentProgress_list->lDisplayRecs <= 0 || ($CCMStudentProgress->Export <> "" && $CCMStudentProgress->ExportAll)) // Display all records
$CCMStudentProgress_list->lDisplayRecs = $CCMStudentProgress_list->lTotalRecs;
if (!($CCMStudentProgress->Export <> "" && $CCMStudentProgress->ExportAll))
$CCMStudentProgress_list->SetUpStartRec(); // Set up start record position
if ($bSelectLimit)
$rs = $CCMStudentProgress_list->LoadRecordset($CCMStudentProgress_list->lStartRec-1, $CCMStudentProgress_list->lDisplayRecs);
?>
<p><span class="phpmaker" style="white-space: nowrap;"><?php echo $Language->Phrase("TblTypeTABLE") ?><?php echo $CCMStudentProgress->TableCaption() ?>
<?php if ($CCMStudentProgress->Export == "" && $CCMStudentProgress->CurrentAction == "") { ?>
<a href="<?php echo $CCMStudentProgress_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 $CCMStudentProgress_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 $CCMStudentProgress_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>
<a name="emf_CCMStudentProgress" id="emf_CCMStudentProgress" href="javascript:void(0);" onclick="ew_EmailDialogShow({lnk:'emf_CCMStudentProgress',hdr:ewLanguage.Phrase('ExportToEmail'),f:document.fCCMStudentProgresslist,sel:false});"><img src='images/exportemail.gif' alt='<?php echo ew_HtmlEncode($Language->Phrase("ExportToEmail")) ?>' title='<?php echo ew_HtmlEncode($Language->Phrase("ExportToEmail")) ?>' width='16' height='16' border='0'></a>
<?php } ?>
</span></p>
<?php
if (EW_DEBUG_ENABLED)
echo ew_DebugMsg();
$CCMStudentProgress_list->ShowMessage();
?>
<br>
<table cellspacing="0" class="ewGrid"><tr><td class="ewGridContent">
<?php if ($CCMStudentProgress->Export == "") { ?>
<div class="ewGridUpperPanel">
<?php if ($CCMStudentProgress->CurrentAction <> "gridadd" && $CCMStudentProgress->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($CCMStudentProgress_list->Pager)) $CCMStudentProgress_list->Pager = new cPrevNextPager($CCMStudentProgress_list->lStartRec, $CCMStudentProgress_list->lDisplayRecs, $CCMStudentProgress_list->lTotalRecs) ?>
<?php if ($CCMStudentProgress_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 ($CCMStudentProgress_list->Pager->FirstButton->Enabled) { ?>
<td><a href="<?php echo $CCMStudentProgress_list->PageUrl() ?>start=<?php echo $CCMStudentProgress_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 ($CCMStudentProgress_list->Pager->PrevButton->Enabled) { ?>
<td><a href="<?php echo $CCMStudentProgress_list->PageUrl() ?>start=<?php echo $CCMStudentProgress_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 $CCMStudentProgress_list->Pager->CurrentPage ?>" size="4"></td>
<!--next page button-->
<?php if ($CCMStudentProgress_list->Pager->NextButton->Enabled) { ?>
<td><a href="<?php echo $CCMStudentProgress_list->PageUrl() ?>start=<?php echo $CCMStudentProgress_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 ($CCMStudentProgress_list->Pager->LastButton->Enabled) { ?>
<td><a href="<?php echo $CCMStudentProgress_list->PageUrl() ?>start=<?php echo $CCMStudentProgress_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 $CCMStudentProgress_list->Pager->PageCount ?></span></td>
</tr></table>
</td>
<td> </td>
<td>
<span class="phpmaker"><?php echo $Language->Phrase("Record") ?> <?php echo $CCMStudentProgress_list->Pager->FromIndex ?> <?php echo $Language->Phrase("To") ?> <?php echo $CCMStudentProgress_list->Pager->ToIndex ?> <?php echo $Language->Phrase("Of") ?> <?php echo $CCMStudentProgress_list->Pager->RecordCount ?></span>
<?php } else { ?>
<?php if ($Security->CanList()) { ?>
<?php if ($CCMStudentProgress_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 } ?>
<span class="phpmaker">
</span>
</div>
<?php } ?>
<form name="fCCMStudentProgresslist" id="fCCMStudentProgresslist" class="ewForm" action="" method="post">
<div id="gmp_CCMStudentProgress" class="ewGridMiddlePanel">
<?php if ($CCMStudentProgress_list->lTotalRecs > 0) { ?>
<table cellspacing="0" rowhighlightclass="ewTableHighlightRow" rowselectclass="ewTableSelectRow" roweditclass="ewTableEditRow" class="ewTable ewTableSeparate">
<?php echo $CCMStudentProgress->TableCustomInnerHtml ?>
<thead><!-- Table header -->
<tr class="ewTableHeader">
<?php
// Render list options
$CCMStudentProgress_list->RenderListOptions();
// Render list options (header, left)
$CCMStudentProgress_list->ListOptions->Render("header", "left");
?>
<?php if ($CCMStudentProgress->CCMStudentID->Visible) { // CCMStudentID ?>
<?php if ($CCMStudentProgress->SortUrl($CCMStudentProgress->CCMStudentID) == "") { ?>
<td><?php echo $CCMStudentProgress->CCMStudentID->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCMStudentProgress->SortUrl($CCMStudentProgress->CCMStudentID) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCMStudentProgress->CCMStudentID->FldCaption() ?></td><td style="width: 10px;"><?php if ($CCMStudentProgress->CCMStudentID->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCMStudentProgress->CCMStudentID->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php if ($CCMStudentProgress->CCMMilestoneNum->Visible) { // CCMMilestoneNum ?>
<?php if ($CCMStudentProgress->SortUrl($CCMStudentProgress->CCMMilestoneNum) == "") { ?>
<td><?php echo $CCMStudentProgress->CCMMilestoneNum->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCMStudentProgress->SortUrl($CCMStudentProgress->CCMMilestoneNum) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCMStudentProgress->CCMMilestoneNum->FldCaption() ?></td><td style="width: 10px;"><?php if ($CCMStudentProgress->CCMMilestoneNum->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCMStudentProgress->CCMMilestoneNum->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php if ($CCMStudentProgress->CCMMilestonePaid->Visible) { // CCMMilestonePaid ?>
<?php if ($CCMStudentProgress->SortUrl($CCMStudentProgress->CCMMilestonePaid) == "") { ?>
<td><?php echo $CCMStudentProgress->CCMMilestonePaid->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCMStudentProgress->SortUrl($CCMStudentProgress->CCMMilestonePaid) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCMStudentProgress->CCMMilestonePaid->FldCaption() ?></td><td style="width: 10px;"><?php if ($CCMStudentProgress->CCMMilestonePaid->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCMStudentProgress->CCMMilestonePaid->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)
$CCMStudentProgress_list->ListOptions->Render("header", "right");
?>
</tr>
</thead>
<?php
if ($CCMStudentProgress->ExportAll && $CCMStudentProgress->Export <> "") {
$CCMStudentProgress_list->lStopRec = $CCMStudentProgress_list->lTotalRecs;
} else {
$CCMStudentProgress_list->lStopRec = $CCMStudentProgress_list->lStartRec + $CCMStudentProgress_list->lDisplayRecs - 1; // Set the last record to display
}
$CCMStudentProgress_list->lRecCount = $CCMStudentProgress_list->lStartRec - 1;
if ($rs && !$rs->EOF) {
$rs->MoveFirst();
if (!$bSelectLimit && $CCMStudentProgress_list->lStartRec > 1)
$rs->Move($CCMStudentProgress_list->lStartRec - 1);
}
// Initialize aggregate
$CCMStudentProgress->RowType = EW_ROWTYPE_AGGREGATEINIT;
$CCMStudentProgress_list->RenderRow();
$CCMStudentProgress_list->lRowCnt = 0;
while (($CCMStudentProgress->CurrentAction == "gridadd" || !$rs->EOF) &&
$CCMStudentProgress_list->lRecCount < $CCMStudentProgress_list->lStopRec) {
$CCMStudentProgress_list->lRecCount++;
if (intval($CCMStudentProgress_list->lRecCount) >= intval($CCMStudentProgress_list->lStartRec)) {
$CCMStudentProgress_list->lRowCnt++;
// Init row class and style
$CCMStudentProgress->CssClass = "";
$CCMStudentProgress->CssStyle = "";
$CCMStudentProgress->RowAttrs = array('onmouseover'=>'ew_MouseOver(event, this);', 'onmouseout'=>'ew_MouseOut(event, this);', 'onclick'=>'ew_Click(event, this);');
if ($CCMStudentProgress->CurrentAction == "gridadd") {
$CCMStudentProgress_list->LoadDefaultValues(); // Load default values
} else {
$CCMStudentProgress_list->LoadRowValues($rs); // Load row values
}
$CCMStudentProgress->RowType = EW_ROWTYPE_VIEW; // Render view
// Render row
$CCMStudentProgress_list->RenderRow();
// Render list options
$CCMStudentProgress_list->RenderListOptions();
?>
<tr<?php echo $CCMStudentProgress->RowAttributes() ?>>
<?php
// Render list options (body, left)
$CCMStudentProgress_list->ListOptions->Render("body", "left");
?>
<?php if ($CCMStudentProgress->CCMStudentID->Visible) { // CCMStudentID ?>
<td<?php echo $CCMStudentProgress->CCMStudentID->CellAttributes() ?>>
<div<?php echo $CCMStudentProgress->CCMStudentID->ViewAttributes() ?>><?php echo $CCMStudentProgress->CCMStudentID->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($CCMStudentProgress->CCMMilestoneNum->Visible) { // CCMMilestoneNum ?>
<td<?php echo $CCMStudentProgress->CCMMilestoneNum->CellAttributes() ?>>
<div<?php echo $CCMStudentProgress->CCMMilestoneNum->ViewAttributes() ?>><?php echo $CCMStudentProgress->CCMMilestoneNum->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($CCMStudentProgress->CCMMilestonePaid->Visible) { // CCMMilestonePaid ?>
<td<?php echo $CCMStudentProgress->CCMMilestonePaid->CellAttributes() ?>>
<div<?php echo $CCMStudentProgress->CCMMilestonePaid->ViewAttributes() ?>><?php echo $CCMStudentProgress->CCMMilestonePaid->ListViewValue() ?></div>
</td>
<?php } ?>
<?php
// Render list options (body, right)
$CCMStudentProgress_list->ListOptions->Render("body", "right");
?>
</tr>
<?php
}
if ($CCMStudentProgress->CurrentAction <> "gridadd")
$rs->MoveNext();
}
?>
</tbody>
</table>
<?php } ?>
</div>
</form>
<?php
// Close recordset
if ($rs)
$rs->Close();
?>
<?php if ($CCMStudentProgress_list->lTotalRecs > 0) { ?>
<?php if ($CCMStudentProgress->Export == "") { ?>
<div class="ewGridLowerPanel">
<?php if ($CCMStudentProgress->CurrentAction <> "gridadd" && $CCMStudentProgress->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($CCMStudentProgress_list->Pager)) $CCMStudentProgress_list->Pager = new cPrevNextPager($CCMStudentProgress_list->lStartRec, $CCMStudentProgress_list->lDisplayRecs, $CCMStudentProgress_list->lTotalRecs) ?>
<?php if ($CCMStudentProgress_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 ($CCMStudentProgress_list->Pager->FirstButton->Enabled) { ?>
<td><a href="<?php echo $CCMStudentProgress_list->PageUrl() ?>start=<?php echo $CCMStudentProgress_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 ($CCMStudentProgress_list->Pager->PrevButton->Enabled) { ?>
<td><a href="<?php echo $CCMStudentProgress_list->PageUrl() ?>start=<?php echo $CCMStudentProgress_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 $CCMStudentProgress_list->Pager->CurrentPage ?>" size="4"></td>
<!--next page button-->
<?php if ($CCMStudentProgress_list->Pager->NextButton->Enabled) { ?>
<td><a href="<?php echo $CCMStudentProgress_list->PageUrl() ?>start=<?php echo $CCMStudentProgress_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 ($CCMStudentProgress_list->Pager->LastButton->Enabled) { ?>
<td><a href="<?php echo $CCMStudentProgress_list->PageUrl() ?>start=<?php echo $CCMStudentProgress_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 $CCMStudentProgress_list->Pager->PageCount ?></span></td>
</tr></table>
</td>
<td> </td>
<td>
<span class="phpmaker"><?php echo $Language->Phrase("Record") ?> <?php echo $CCMStudentProgress_list->Pager->FromIndex ?> <?php echo $Language->Phrase("To") ?> <?php echo $CCMStudentProgress_list->Pager->ToIndex ?> <?php echo $Language->Phrase("Of") ?> <?php echo $CCMStudentProgress_list->Pager->RecordCount ?></span>
<?php } else { ?>
<?php if ($Security->CanList()) { ?>
<?php if ($CCMStudentProgress_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 ($CCMStudentProgress_list->lTotalRecs > 0) { ?>
<span class="phpmaker">
</span>
<?php //} ?>
</div>
<?php } ?>
<?php } ?>
</td></tr></table>
<?php if ($CCMStudentProgress->Export == "" && $CCMStudentProgress->CurrentAction == "") { ?>
<?php } ?>
<?php if ($CCMStudentProgress->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
$CCMStudentProgress_list->Page_Terminate();
?>
<?php
//
// Page class
//
class cCCMStudentProgress_list {
// Page ID
var $PageID = 'list';
// Table name
var $TableName = 'CCMStudentProgress';
// Page object name
var $PageObjName = 'CCMStudentProgress_list';
// Page name
function PageName() {
return ew_CurrentPage();
}
// Page URL
function PageUrl() {
$PageUrl = ew_CurrentPage() . "?";
global $CCMStudentProgress;
if ($CCMStudentProgress->UseTokenInUrl) $PageUrl .= "t=" . $CCMStudentProgress->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, $CCMStudentProgress;
if ($CCMStudentProgress->UseTokenInUrl) {
if ($objForm)
return ($CCMStudentProgress->TableVar == $objForm->GetValue("t"));
if (@$_GET["t"] <> "")
return ($CCMStudentProgress->TableVar == $_GET["t"]);
} else {
return TRUE;
}
}
//
// Page class constructor
//
function cCCMStudentProgress_list() {
global $conn, $Language;
// Language object
$Language = new cLanguage();
// Table object (CCMStudentProgress)
$GLOBALS["CCMStudentProgress"] = new cCCMStudentProgress();
// 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["CCMStudentProgress"]->AddUrl();
$this->InlineAddUrl = $this->PageUrl() . "a=add";
$this->GridAddUrl = $this->PageUrl() . "a=gridadd";
$this->GridEditUrl = $this->PageUrl() . "a=gridedit";
$this->MultiDeleteUrl = "CCMStudentProgressdelete.php";
$this->MultiUpdateUrl = "CCMStudentProgressupdate.php";
// Table object (CCMStudents)
$GLOBALS['CCMStudents'] = new cCCMStudents();
// Table object (CCMUsers)
$GLOBALS['CCMUsers'] = new cCCMUsers();
// 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", 'CCMStudentProgress', 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 $CCMStudentProgress;
// 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"] <> "") {
$CCMStudentProgress->Export = $_GET["export"];
} elseif (ew_IsHttpPost()) {
if (@$_POST["exporttype"] <> "")
$CCMStudentProgress->Export = $_POST["exporttype"];
} else {
$CCMStudentProgress->setExportReturnUrl(ew_CurrentUrl());
}
$gsExport = $CCMStudentProgress->Export; // Get export parameter, used in header
$gsExportFile = $CCMStudentProgress->TableVar; // Get export file, used in header
if ($CCMStudentProgress->Export == "excel") {
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename=' . $gsExportFile .'.xls');
}
if ($CCMStudentProgress->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 = 20;
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, $CCMStudentProgress;
// Search filters
$sSrchAdvanced = ""; // Advanced search filter
$sSrchBasic = ""; // Basic search filter
$sFilter = "";
if ($this->IsPageRequest()) { // Validate request
// Handle reset command
$this->ResetCmd();
// Set up master detail parameters
$this->SetUpMasterDetail();
// Set up list options
$this->SetupListOptions();
// Set up sorting order
$this->SetUpSortOrder();
}
// Restore display records
if ($CCMStudentProgress->getRecordsPerPage() <> "") {
$this->lDisplayRecs = $CCMStudentProgress->getRecordsPerPage(); // Restore from Session
} else {
$this->lDisplayRecs = 20; // Load default
}
// Load Sorting Order
$this->LoadSortOrder();
// Build filter
$sFilter = "";
if (!$Security->CanList())
$sFilter = "(0=1)"; // Filter all records
// Restore master/detail filter
$this->sDbMasterFilter = $CCMStudentProgress->getMasterFilter(); // Restore master filter
$this->sDbDetailFilter = $CCMStudentProgress->getDetailFilter(); // Restore detail filter
if ($this->sDbDetailFilter <> "")
$sFilter = ($sFilter <> "") ? "(" . $sFilter . ") AND (" . $this->sDbDetailFilter . ")" : $this->sDbDetailFilter;
if ($this->sSrchWhere <> "")
$sFilter = ($sFilter <> "") ? "(" . $sFilter . ") AND (". $this->sSrchWhere . ")" : $this->sSrchWhere;
// Load master record
if ($CCMStudentProgress->getMasterFilter() <> "" && $CCMStudentProgress->getCurrentMasterTable() == "CCMStudents") {
global $CCMStudents;
$rsmaster = $CCMStudents->LoadRs($this->sDbMasterFilter);
$this->bMasterRecordExists = ($rsmaster && !$rsmaster->EOF);
if (!$this->bMasterRecordExists) {
$CCMStudentProgress->setMasterFilter(""); // Clear master filter
$CCMStudentProgress->setDetailFilter(""); // Clear detail filter
$this->setMessage($Language->Phrase("NoRecord")); // Set no record found
$this->Page_Terminate($CCMStudentProgress->getReturnUrl()); // Return to caller
} else {
$CCMStudents->LoadListRowValues($rsmaster);
$CCMStudents->RowType = EW_ROWTYPE_MASTER; // Master row
$CCMStudents->RenderListRow();
$rsmaster->Close();
}
}
// Set up filter in session
$CCMStudentProgress->setSessionWhere($sFilter);
$CCMStudentProgress->CurrentFilter = "";
// Export data only
if (in_array($CCMStudentProgress->Export, array("html","word","excel","xml","csv","email"))) {
$this->ExportData();
if ($CCMStudentProgress->Export <> "email")
$this->Page_Terminate(); // Terminate response
exit();
}
}
// Set up sort parameters
function SetUpSortOrder() {
global $CCMStudentProgress;
// Check for Ctrl pressed
$bCtrl = (@$_GET["ctrl"] <> "");
// Check for "order" parameter
if (@$_GET["order"] <> "") {
$CCMStudentProgress->CurrentOrder = ew_StripSlashes(@$_GET["order"]);
$CCMStudentProgress->CurrentOrderType = @$_GET["ordertype"];
$CCMStudentProgress->UpdateSort($CCMStudentProgress->CCMStudentID, $bCtrl); // CCMStudentID
$CCMStudentProgress->UpdateSort($CCMStudentProgress->CCMMilestoneNum, $bCtrl); // CCMMilestoneNum
$CCMStudentProgress->UpdateSort($CCMStudentProgress->CCMMilestonePaid, $bCtrl); // CCMMilestonePaid
$CCMStudentProgress->setStartRecordNumber(1); // Reset start position
}
}
// Load sort order parameters
function LoadSortOrder() {
global $CCMStudentProgress;
$sOrderBy = $CCMStudentProgress->getSessionOrderBy(); // Get ORDER BY from Session
if ($sOrderBy == "") {
if ($CCMStudentProgress->SqlOrderBy() <> "") {
$sOrderBy = $CCMStudentProgress->SqlOrderBy();
$CCMStudentProgress->setSessionOrderBy($sOrderBy);
$CCMStudentProgress->CCMStudentID->setSort("ASC");
$CCMStudentProgress->CCMMilestoneNum->setSort("ASC");
}
}
}
// Reset command
// cmd=reset (Reset search parameters)
// cmd=resetall (Reset search and master/detail parameters)
// cmd=resetsort (Reset sort parameters)
function ResetCmd() {
global $CCMStudentProgress;
// Get reset command
if (@$_GET["cmd"] <> "") {
$sCmd = $_GET["cmd"];
// Reset master/detail keys
if (strtolower($sCmd) == "resetall") {
$CCMStudentProgress->getCurrentMasterTable = ""; // Clear master table
$CCMStudentProgress->setMasterFilter(""); // Clear master filter
$this->sDbMasterFilter = "";
$CCMStudentProgress->setDetailFilter(""); // Clear detail filter
$this->sDbDetailFilter = "";
$CCMStudentProgress->CCMStudentID->setSessionValue("");
}
// Reset sorting order
if (strtolower($sCmd) == "resetsort") {
$sOrderBy = "";
$CCMStudentProgress->setSessionOrderBy($sOrderBy);
$CCMStudentProgress->CCMStudentID->setSort("");
$CCMStudentProgress->CCMMilestoneNum->setSort("");
$CCMStudentProgress->CCMMilestonePaid->setSort("");
}
// Reset start position
$this->lStartRec = 1;
$CCMStudentProgress->setStartRecordNumber($this->lStartRec);
}
}
// Set up list options
function SetupListOptions() {
global $Security, $CCMStudentProgress;
// "view"
$this->ListOptions->Add("view");
$item =& $this->ListOptions->Items["view"];
$item->CssStyle = "white-space: nowrap;";
$item->Visible = $Security->CanView();
$item->OnLeft = FALSE;
// "edit"
$this->ListOptions->Add("edit");
$item =& $this->ListOptions->Items["edit"];
$item->CssStyle = "white-space: nowrap;";
$item->Visible = $Security->CanEdit();
$item->OnLeft = FALSE;
// Call ListOptions_Load event
$this->ListOptions_Load();
if ($CCMStudentProgress->Export <> "" ||
$CCMStudentProgress->CurrentAction == "gridadd" ||
$CCMStudentProgress->CurrentAction == "gridedit")
$this->ListOptions->HideAllOptions();
}
// Render list options
function RenderListOptions() {
global $Security, $Language, $CCMStudentProgress;
$this->ListOptions->LoadDefault();
// "view"
$oListOpt =& $this->ListOptions->Items["view"];
if ($Security->CanView() && $oListOpt->Visible)
$oListOpt->Body = "<a href=\"" . $this->ViewUrl . "\">" . "<img src=\"images/view.gif\" alt=\"" . ew_HtmlEncode($Language->Phrase("ViewLink")) . "\" title=\"" . ew_HtmlEncode($Language->Phrase("ViewLink")) . "\" width=\"16\" height=\"16\" border=\"0\">" . "</a>";
// "edit"
$oListOpt =& $this->ListOptions->Items["edit"];
if ($Security->CanEdit() && $oListOpt->Visible) {
$oListOpt->Body = "<a href=\"" . $this->EditUrl . "\">" . "<img src=\"images/edit.gif\" alt=\"" . ew_HtmlEncode($Language->Phrase("EditLink")) . "\" title=\"" . ew_HtmlEncode($Language->Phrase("EditLink")) . "\" width=\"16\" height=\"16\" border=\"0\">" . "</a>";
}
$this->RenderListOptionsExt();
// Call ListOptions_Rendered event
$this->ListOptions_Rendered();
}
function RenderListOptionsExt() {
global $Security, $Language, $CCMStudentProgress;
}
// Set up starting record parameters
function SetUpStartRec() {
global $CCMStudentProgress;
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];
$CCMStudentProgress->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;
}
$CCMStudentProgress->setStartRecordNumber($this->lStartRec);
}
}
}
$this->lStartRec = $CCMStudentProgress->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
$CCMStudentProgress->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
$CCMStudentProgress->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
$CCMStudentProgress->setStartRecordNumber($this->lStartRec);
}
}
// Load recordset
function LoadRecordset($offset = -1, $rowcnt = -1) {
global $conn, $CCMStudentProgress;
// Call Recordset Selecting event
$CCMStudentProgress->Recordset_Selecting($CCMStudentProgress->CurrentFilter);
// Load List page SQL
$sSql = $CCMStudentProgress->SelectSQL();
if ($offset > -1 && $rowcnt > -1)
$sSql .= " LIMIT $offset, $rowcnt";
// Load recordset
$rs = ew_LoadRecordset($sSql);
// Call Recordset Selected event
$CCMStudentProgress->Recordset_Selected($rs);
return $rs;
}
// Load row based on key values
function LoadRow() {
global $conn, $Security, $CCMStudentProgress;
$sFilter = $CCMStudentProgress->KeyFilter();
// Call Row Selecting event
$CCMStudentProgress->Row_Selecting($sFilter);
// Load SQL based on filter
$CCMStudentProgress->CurrentFilter = $sFilter;
$sSql = $CCMStudentProgress->SQL();
$res = FALSE;
$rs = ew_LoadRecordset($sSql);
if ($rs && !$rs->EOF) {
$res = TRUE;
$this->LoadRowValues($rs); // Load row values
// Call Row Selected event
$CCMStudentProgress->Row_Selected($rs);
$rs->Close();
}
return $res;
}
// Load row values from recordset
function LoadRowValues(&$rs) {
global $conn, $CCMStudentProgress;
$CCMStudentProgress->CCMStudentProgressID->setDbValue($rs->fields('CCMStudentProgressID'));
$CCMStudentProgress->CCMStudentID->setDbValue($rs->fields('CCMStudentID'));
$CCMStudentProgress->CCMMilestoneNum->setDbValue($rs->fields('CCMMilestoneNum'));
$CCMStudentProgress->CCMMilestonePaid->setDbValue($rs->fields('CCMMilestonePaid'));
$CCMStudentProgress->CCMMilestoneDate->setDbValue($rs->fields('CCMMilestoneDate'));
}
// Render row values based on field settings
function RenderRow() {
global $conn, $Security, $Language, $CCMStudentProgress;
// Initialize URLs
$this->ViewUrl = $CCMStudentProgress->ViewUrl();
$this->EditUrl = $CCMStudentProgress->EditUrl();
$this->InlineEditUrl = $CCMStudentProgress->InlineEditUrl();
$this->CopyUrl = $CCMStudentProgress->CopyUrl();
$this->InlineCopyUrl = $CCMStudentProgress->InlineCopyUrl();
$this->DeleteUrl = $CCMStudentProgress->DeleteUrl();
// Call Row_Rendering event
$CCMStudentProgress->Row_Rendering();
// Common render codes for all row types
// CCMStudentID
$CCMStudentProgress->CCMStudentID->CellCssStyle = ""; $CCMStudentProgress->CCMStudentID->CellCssClass = "";
$CCMStudentProgress->CCMStudentID->CellAttrs = array(); $CCMStudentProgress->CCMStudentID->ViewAttrs = array(); $CCMStudentProgress->CCMStudentID->EditAttrs = array();
// CCMMilestoneNum
$CCMStudentProgress->CCMMilestoneNum->CellCssStyle = ""; $CCMStudentProgress->CCMMilestoneNum->CellCssClass = "";
$CCMStudentProgress->CCMMilestoneNum->CellAttrs = array(); $CCMStudentProgress->CCMMilestoneNum->ViewAttrs = array(); $CCMStudentProgress->CCMMilestoneNum->EditAttrs = array();
// CCMMilestonePaid
$CCMStudentProgress->CCMMilestonePaid->CellCssStyle = ""; $CCMStudentProgress->CCMMilestonePaid->CellCssClass = "";
$CCMStudentProgress->CCMMilestonePaid->CellAttrs = array(); $CCMStudentProgress->CCMMilestonePaid->ViewAttrs = array(); $CCMStudentProgress->CCMMilestonePaid->EditAttrs = array();
if ($CCMStudentProgress->RowType == EW_ROWTYPE_VIEW) { // View row
// CCMStudentProgressID
$CCMStudentProgress->CCMStudentProgressID->ViewValue = $CCMStudentProgress->CCMStudentProgressID->CurrentValue;
$CCMStudentProgress->CCMStudentProgressID->CssStyle = "";
$CCMStudentProgress->CCMStudentProgressID->CssClass = "";
$CCMStudentProgress->CCMStudentProgressID->ViewCustomAttributes = "";
// CCMStudentID
if (strval($CCMStudentProgress->CCMStudentID->CurrentValue) <> "") {
$sFilterWrk = "`CCMStudentID` = " . ew_AdjustSql($CCMStudentProgress->CCMStudentID->CurrentValue) . "";
$sSqlWrk = "SELECT `Surname`, `FirstName` FROM `CCMStudents`";
$sWhereWrk = "";
if ($sFilterWrk <> "") {
if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
$sWhereWrk .= "(" . $sFilterWrk . ")";
}
if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
$rswrk = $conn->Execute($sSqlWrk);
if ($rswrk && !$rswrk->EOF) { // Lookup values found
$CCMStudentProgress->CCMStudentID->ViewValue = $rswrk->fields('Surname');
$CCMStudentProgress->CCMStudentID->ViewValue .= ew_ValueSeparator(0) . $rswrk->fields('FirstName');
$rswrk->Close();
} else {
$CCMStudentProgress->CCMStudentID->ViewValue = $CCMStudentProgress->CCMStudentID->CurrentValue;
}
} else {
$CCMStudentProgress->CCMStudentID->ViewValue = NULL;
}
$CCMStudentProgress->CCMStudentID->CssStyle = "";
$CCMStudentProgress->CCMStudentID->CssClass = "";
$CCMStudentProgress->CCMStudentID->ViewCustomAttributes = "";
// CCMMilestoneNum
$CCMStudentProgress->CCMMilestoneNum->ViewValue = $CCMStudentProgress->CCMMilestoneNum->CurrentValue;
$CCMStudentProgress->CCMMilestoneNum->CssStyle = "";
$CCMStudentProgress->CCMMilestoneNum->CssClass = "";
$CCMStudentProgress->CCMMilestoneNum->ViewCustomAttributes = "";
// CCMMilestonePaid
if (strval($CCMStudentProgress->CCMMilestonePaid->CurrentValue) <> "") {
switch ($CCMStudentProgress->CCMMilestonePaid->CurrentValue) {
case "1":
$CCMStudentProgress->CCMMilestonePaid->ViewValue = "Yes";
break;
case "0":
$CCMStudentProgress->CCMMilestonePaid->ViewValue = "No";
break;
default:
$CCMStudentProgress->CCMMilestonePaid->ViewValue = $CCMStudentProgress->CCMMilestonePaid->CurrentValue;
}
} else {
$CCMStudentProgress->CCMMilestonePaid->ViewValue = NULL;
}
$CCMStudentProgress->CCMMilestonePaid->CssStyle = "";
$CCMStudentProgress->CCMMilestonePaid->CssClass = "";
$CCMStudentProgress->CCMMilestonePaid->ViewCustomAttributes = "";
// CCMMilestoneDate
$CCMStudentProgress->CCMMilestoneDate->ViewValue = $CCMStudentProgress->CCMMilestoneDate->CurrentValue;
$CCMStudentProgress->CCMMilestoneDate->ViewValue = ew_FormatDateTime($CCMStudentProgress->CCMMilestoneDate->ViewValue, 5);
$CCMStudentProgress->CCMMilestoneDate->CssStyle = "";
$CCMStudentProgress->CCMMilestoneDate->CssClass = "";
$CCMStudentProgress->CCMMilestoneDate->ViewCustomAttributes = "";
// CCMStudentID
$CCMStudentProgress->CCMStudentID->HrefValue = "";
$CCMStudentProgress->CCMStudentID->TooltipValue = "";
// CCMMilestoneNum
$CCMStudentProgress->CCMMilestoneNum->HrefValue = "";
$CCMStudentProgress->CCMMilestoneNum->TooltipValue = "";
// CCMMilestonePaid
$CCMStudentProgress->CCMMilestonePaid->HrefValue = "";
$CCMStudentProgress->CCMMilestonePaid->TooltipValue = "";
}
// Call Row Rendered event
if ($CCMStudentProgress->RowType <> EW_ROWTYPE_AGGREGATEINIT)
$CCMStudentProgress->Row_Rendered();
}
// Export data in HTML/CSV/Word/Excel/XML/Email format
function ExportData() {
global $CCMStudentProgress;
$utf8 = FALSE;
$bSelectLimit = EW_SELECT_LIMIT;
// Load recordset
if ($bSelectLimit) {
$this->lTotalRecs = $CCMStudentProgress->SelectRecordCount();
} else {
if ($rs = $this->LoadRecordset())
$this->lTotalRecs = $rs->RecordCount();
}
$this->lStartRec = 1;
// Export all
if ($CCMStudentProgress->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 ($CCMStudentProgress->Export == "xml") {
$XmlDoc = new cXMLDocument(EW_XML_ENCODING);
$XmlDoc->AddRoot();
} else {
$ExportDoc = new cExportDocument($CCMStudentProgress, "h");
$ExportDoc->ExportHeader();
if ($ExportDoc->Horizontal) { // Horizontal format, write header
$ExportDoc->BeginExportRow();
$ExportDoc->ExportCaption($CCMStudentProgress->CCMStudentProgressID);
$ExportDoc->ExportCaption($CCMStudentProgress->CCMStudentID);
$ExportDoc->ExportCaption($CCMStudentProgress->CCMMilestoneNum);
$ExportDoc->ExportCaption($CCMStudentProgress->CCMMilestonePaid);
$ExportDoc->ExportCaption($CCMStudentProgress->CCMMilestoneDate);
$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
$CCMStudentProgress->CssClass = "";
$CCMStudentProgress->CssStyle = "";
$CCMStudentProgress->RowType = EW_ROWTYPE_VIEW; // Render view
$this->RenderRow();
if ($CCMStudentProgress->Export == "xml") {
$XmlDoc->AddRow();
$XmlDoc->AddField('CCMStudentProgressID', $CCMStudentProgress->CCMStudentProgressID->ExportValue($CCMStudentProgress->Export, $CCMStudentProgress->ExportOriginalValue));
$XmlDoc->AddField('CCMStudentID', $CCMStudentProgress->CCMStudentID->ExportValue($CCMStudentProgress->Export, $CCMStudentProgress->ExportOriginalValue));
$XmlDoc->AddField('CCMMilestoneNum', $CCMStudentProgress->CCMMilestoneNum->ExportValue($CCMStudentProgress->Export, $CCMStudentProgress->ExportOriginalValue));
$XmlDoc->AddField('CCMMilestonePaid', $CCMStudentProgress->CCMMilestonePaid->ExportValue($CCMStudentProgress->Export, $CCMStudentProgress->ExportOriginalValue));
$XmlDoc->AddField('CCMMilestoneDate', $CCMStudentProgress->CCMMilestoneDate->ExportValue($CCMStudentProgress->Export, $CCMStudentProgress->ExportOriginalValue));
} else {
$ExportDoc->BeginExportRow(TRUE); // Allow CSS styles if enabled
$ExportDoc->ExportField($CCMStudentProgress->CCMStudentProgressID);
$ExportDoc->ExportField($CCMStudentProgress->CCMStudentID);
$ExportDoc->ExportField($CCMStudentProgress->CCMMilestoneNum);
$ExportDoc->ExportField($CCMStudentProgress->CCMMilestonePaid);
$ExportDoc->ExportField($CCMStudentProgress->CCMMilestoneDate);
$ExportDoc->EndExportRow();
}
}
$rs->MoveNext();
}
if ($CCMStudentProgress->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($CCMStudentProgress->Export, array("email", "xml")))
echo "\xEF\xBB\xBF";
// Write debug message if enabled
if (EW_DEBUG_ENABLED)
echo ew_DebugMsg();
// Output data
if ($CCMStudentProgress->Export == "xml") {
header("Content-Type: text/xml");
echo $XmlDoc->XML();
} elseif ($CCMStudentProgress->Export == "email") {
$this->ExportEmail($ExportDoc->Text);
$this->Page_Terminate($CCMStudentProgress->ExportReturnUrl());
} else {
echo $ExportDoc->Text;
}
}
// Export email
function ExportEmail($EmailContent) {
global $Language, $CCMStudentProgress;
$sSender = @$_GET["sender"];
$sRecipient = @$_GET["recipient"];
$sCc = @$_GET["cc"];
$sBcc = @$_GET["bcc"];
$sContentType = @$_GET["contenttype"];
// Subject
$sSubject = ew_StripSlashes(@$_GET["subject"]);
$sEmailSubject = $sSubject;
// Message
$sContent = ew_StripSlashes(@$_GET["message"]);
$sEmailMessage = $sContent;
// Check sender
if ($sSender == "") {
$this->setMessage($Language->Phrase("EnterSenderEmail"));
return;
}
if (!ew_CheckEmail($sSender)) {
$this->setMessage($Language->Phrase("EnterProperSenderEmail"));
return;
}
// Check recipient
if (!ew_CheckEmailList($sRecipient, EW_MAX_EMAIL_RECIPIENT)) {
$this->setMessage($Language->Phrase("EnterProperRecipientEmail"));
return;
}
// Check cc
if (!ew_CheckEmailList($sCc, EW_MAX_EMAIL_RECIPIENT)) {
$this->setMessage($Language->Phrase("EnterProperCcEmail"));
return;
}
// Check bcc
if (!ew_CheckEmailList($sBcc, EW_MAX_EMAIL_RECIPIENT)) {
$this->setMessage($Language->Phrase("EnterProperBccEmail"));
return;
}
// Check email sent count
if (!isset($_SESSION[EW_EXPORT_EMAIL_COUNTER]))
$_SESSION[EW_EXPORT_EMAIL_COUNTER] = 0;
if (intval($_SESSION[EW_EXPORT_EMAIL_COUNTER]) > EW_MAX_EMAIL_SENT_COUNT) {
$this->setMessage($Language->Phrase("ExceedMaxEmailExport"));
return;
}
if ($sEmailMessage <> "") {
$sEmailMessage = ew_RemoveXSS($sEmailMessage);
$sEmailMessage .= ($sContentType == "url") ? "\r\n\r\n" : "<br><br>";
}
if ($sContentType == "url") {
$sUrl = ew_ConvertFullUrl(ew_CurrentPage() . "?" . $this->ExportQueryString());
$sEmailMessage .= $sUrl; // send URL only
} else {
$sEmailMessage .= $EmailContent; // send HTML
}
// Send email
$Email = new cEmail();
$Email->Sender = $sSender; // Sender
$Email->Recipient = $sRecipient; // Recipient
$Email->Cc = $sCc; // Cc
$Email->Bcc = $sBcc; // Bcc
$Email->Subject = $sEmailSubject; // Subject
$Email->Content = $sEmailMessage; // Content
$Email->Format = ($sContentType == "url") ? "text" : "html";
$Email->Charset = EW_EMAIL_CHARSET;
$EventArgs = array();
$bEmailSent = FALSE;
if ($CCMStudentProgress->Email_Sending($Email, $EventArgs))
$bEmailSent = $Email->Send();
// Check email sent status
if ($bEmailSent) {
// Update email sent count
$_SESSION[EW_EXPORT_EMAIL_COUNTER]++;
// Sent email success
$this->setMessage($Language->Phrase("SendEmailSuccess"));
} else {
// Sent email failure
$this->setMessage($Email->SendErrDescription);
}
}
// Export QueryString
function ExportQueryString() {
global $CCMStudentProgress;
// Initialize
$sQry = "export=html";
// Build QueryString for search
// Build QueryString for pager
$sQry .= "&" . EW_TABLE_REC_PER_PAGE . "=" . $CCMStudentProgress->getRecordsPerPage() . "&" . EW_TABLE_START_REC . "=" . $CCMStudentProgress->getStartRecordNumber();
return $sQry;
}
// Add search QueryString
function AddSearchQueryString(&$Qry, &$Fld) {
global $CCMStudentProgress;
$FldParm = substr($Fld->FldVar, 2);
$FldSearchValue = $CCMStudentProgress->GetAdvancedSearch("x_" . $FldParm);
if (strval($FldSearchValue) <> "") {
$Qry .= "&x_" . $FldParm . "=" . FldSearchValue .
"&z_" . $FldParm . "=" . $CCMStudentProgress->GetAdvancedSearch("z_" . $FldParm);
}
$FldSearchValue2 = $CCMStudentProgress->GetAdvancedSearch("y_" . $FldParm);
if (strval($FldSearchValue2) <> "") {
$Qry .= "&v_" . $FldParm . "=" . $CCMStudentProgress->GetAdvancedSearch("v_" . $FldParm) .
"&y_" . $FldParm . "=" . $FldSearchValue2 .
"&w_" . $FldParm . "=" . $CCMStudentProgress->GetAdvancedSearch("w_" . $FldParm);
}
}
// Set up master/detail based on QueryString
function SetUpMasterDetail() {
global $CCMStudentProgress;
$bValidMaster = FALSE;
// Get the keys for master table
if (@$_GET[EW_TABLE_SHOW_MASTER] <> "") {
$sMasterTblVar = $_GET[EW_TABLE_SHOW_MASTER];
if ($sMasterTblVar == "") {
$bValidMaster = TRUE;
$this->sDbMasterFilter = "";
$this->sDbDetailFilter = "";
}
if ($sMasterTblVar == "CCMStudents") {
$bValidMaster = TRUE;
$this->sDbMasterFilter = $CCMStudentProgress->SqlMasterFilter_CCMStudents();
$this->sDbDetailFilter = $CCMStudentProgress->SqlDetailFilter_CCMStudents();
if (@$_GET["CCMStudentID"] <> "") {
$GLOBALS["CCMStudents"]->CCMStudentID->setQueryStringValue($_GET["CCMStudentID"]);
$CCMStudentProgress->CCMStudentID->setQueryStringValue($GLOBALS["CCMStudents"]->CCMStudentID->QueryStringValue);
$CCMStudentProgress->CCMStudentID->setSessionValue($CCMStudentProgress->CCMStudentID->QueryStringValue);
if (!is_numeric($GLOBALS["CCMStudents"]->CCMStudentID->QueryStringValue)) $bValidMaster = FALSE;
$this->sDbMasterFilter = str_replace("@CCMStudentID@", ew_AdjustSql($GLOBALS["CCMStudents"]->CCMStudentID->QueryStringValue), $this->sDbMasterFilter);
$this->sDbDetailFilter = str_replace("@CCMStudentID@", ew_AdjustSql($GLOBALS["CCMStudents"]->CCMStudentID->QueryStringValue), $this->sDbDetailFilter);
} else {
$bValidMaster = FALSE;
}
}
}
if ($bValidMaster) {
// Save current master table
$CCMStudentProgress->setCurrentMasterTable($sMasterTblVar);
// Reset start record counter (new master key)
$this->lStartRec = 1;
$CCMStudentProgress->setStartRecordNumber($this->lStartRec);
$CCMStudentProgress->setMasterFilter($this->sDbMasterFilter); // Set up master filter
$CCMStudentProgress->setDetailFilter($this->sDbDetailFilter); // Set up detail filter
// Clear previous master key from Session
if ($sMasterTblVar <> "CCMStudents") {
if ($CCMStudentProgress->CCMStudentID->QueryStringValue == "") $CCMStudentProgress->CCMStudentID->setSessionValue("");
}
} else {
$this->sDbMasterFilter = $CCMStudentProgress->getMasterFilter(); // Restore master filter
$this->sDbDetailFilter = $CCMStudentProgress->getDetailFilter(); // Restore detail filter
}
}
// Page Load event
function Page_Load() {
//echo "Page Load";
}
// 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";
}
}
?>