Solved

php mysql

Posted on 2009-03-30
2
538 Views
Last Modified: 2013-12-12
I get the code it work but I want to modify it
the first page allow user select records that user want to delete by check box
if i select many record and then click 'Delete Selected Records'
all record that select will delete

but I do not want to delete it i want to insert those record to into mysql database

So i use command print_r($_SESSION);
 
to check what is the variable was send the result is

Array ( [project3_aol_payment_plan_searchwhere] => [project3_aol_payment_plan_psearch] => [project3_aol_payment_plan_psearchtype] => [project3_aol_payment_plan_start] => 1 [project3_aol_payment_plan_where] => [project3_aol_payment_plan_MasterFilter] => [project3_aol_payment_plan_DetailFilter] => [project3_aol_payment_plan_x_id_SessionValue] => [project3_aol_grop_bill_payment_where] => [project3_aol_grop_bill_payment_start] => 1 )

I did not under stand it I think it should send the Id that i was selected
How can i get the Id that user select
<?php

session_start(); // Initialize session data

ob_start(); // Turn on output buffering

?>

<?php include "ewcfg6.php" ?>

<?php include "ewmysql6.php" ?>

<?php include "phpfn6.php" ?>

<?php include "aol_payment_planinfo.php" ?>

<?php include "aol_grop_bill_paymentinfo.php" ?>

<?php include "userfn6.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
 

// Define page object

$aol_payment_plan_list = new caol_payment_plan_list();

$Page =& $aol_payment_plan_list;
 

// Page init processing

$aol_payment_plan_list->Page_Init();
 

// Page main processing

$aol_payment_plan_list->Page_Main();

?>

<?php include "header.php" ?>

<?php if ($aol_payment_plan->Export == "") { ?>

<script type="text/javascript">

<!--
 

// Create page object

var aol_payment_plan_list = new ew_Page("aol_payment_plan_list");
 

// page properties

aol_payment_plan_list.PageID = "list"; // page ID

var EW_PAGE_ID = aol_payment_plan_list.PageID; // for backward compatibility
 

// extend page with Form_CustomValidate function

aol_payment_plan_list.Form_CustomValidate = 

 function(fobj) { // DO NOT CHANGE THIS LINE!
 

 	// Your custom validation code here, return false if invalid. 

 	return true;

 }

aol_payment_plan_list.SelectAllKey = function(elem) {

	ew_SelectAll(elem);

}

<?php if (EW_CLIENT_VALIDATE) { ?>

aol_payment_plan_list.ValidateRequired = true; // uses JavaScript validation

<?php } else { ?>

aol_payment_plan_list.ValidateRequired = false; // no JavaScript validation

<?php } ?>
 

//-->

</script>

<link rel="stylesheet" type="text/css" media="all" href="calendar/calendar-win2k-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 ($aol_payment_plan->Export == "") { ?>

<?php

$gsMasterReturnUrl = "aol_grop_bill_paymentlist.php";

if ($aol_payment_plan_list->sDbMasterFilter <> "" && $aol_payment_plan->getCurrentMasterTable() == "aol_grop_bill_payment") {

	if ($aol_payment_plan_list->bMasterRecordExists) {

		if ($aol_payment_plan->getCurrentMasterTable() == $aol_payment_plan->TableVar) $gsMasterReturnUrl .= "?" . EW_TABLE_SHOW_MASTER . "=";

?>

<?php include "aol_grop_bill_paymentmaster.php" ?>

<?php

	}

}

?>

<?php } ?>

<?php

	$bSelectLimit = ($aol_payment_plan->Export == "" && $aol_payment_plan->SelectLimit);

	if (!$bSelectLimit)

		$rs = $aol_payment_plan_list->LoadRecordset();

	$aol_payment_plan_list->lTotalRecs = ($bSelectLimit) ? $aol_payment_plan->SelectRecordCount() : $rs->RecordCount();

	$aol_payment_plan_list->lStartRec = 1;

	if ($aol_payment_plan_list->lDisplayRecs <= 0) // Display all records

		$aol_payment_plan_list->lDisplayRecs = $aol_payment_plan_list->lTotalRecs;

	if (!($aol_payment_plan->ExportAll && $aol_payment_plan->Export <> ""))

		$aol_payment_plan_list->SetUpStartRec(); // Set up start record position

	if ($bSelectLimit)

		$rs = $aol_payment_plan_list->LoadRecordset($aol_payment_plan_list->lStartRec-1, $aol_payment_plan_list->lDisplayRecs);

?>

<p><span class="phpmaker" style="white-space: nowrap;">TABLE: Aol Payment Plan

</span></p>

<?php if ($aol_payment_plan->Export == "" && $aol_payment_plan->CurrentAction == "") { ?>

<a href="javascript:ew_ToggleSearchPanel(aol_payment_plan_list);" style="text-decoration: none;"><img id="aol_payment_plan_list_SearchImage" src="images/collapse.gif" alt="" width="9" height="9" border="0"></a><span class="phpmaker">&nbsp;Search</span><br>

<div id="aol_payment_plan_list_SearchPanel">

<form name="faol_payment_planlistsrch" id="faol_payment_planlistsrch" class="ewForm" action="<?php echo ew_CurrentPage() ?>">

<input type="hidden" id="t" name="t" value="aol_payment_plan">

<table class="ewBasicSearch">

	<tr>

		<td><span class="phpmaker">

			<input type="text" name="<?php echo EW_TABLE_BASIC_SEARCH ?>" id="<?php echo EW_TABLE_BASIC_SEARCH ?>" size="20" value="<?php echo ew_HtmlEncode($aol_payment_plan->getBasicSearchKeyword()) ?>">

			<input type="Submit" name="Submit" id="Submit" value="Search (*)">&nbsp;

			<a href="<?php echo $aol_payment_plan_list->PageUrl() ?>cmd=reset">Show all</a>&nbsp;

		</span></td>

	</tr>

	<tr>

	<td><span class="phpmaker"><label><input type="radio" name="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" id="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" value=""<?php if ($aol_payment_plan->getBasicSearchType() == "") { ?> checked="checked"<?php } ?>>Exact phrase</label>&nbsp;&nbsp;<label><input type="radio" name="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" id="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" value="AND"<?php if ($aol_payment_plan->getBasicSearchType() == "AND") { ?> checked="checked"<?php } ?>>All words</label>&nbsp;&nbsp;<label><input type="radio" name="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" id="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" value="OR"<?php if ($aol_payment_plan->getBasicSearchType() == "OR") { ?> checked="checked"<?php } ?>>Any word</label></span></td>

	</tr>

</table>

</form>

</div>

<?php } ?>

<?php $aol_payment_plan_list->ShowMessage() ?>

<br>

<table cellspacing="0" class="ewGrid"><tr><td class="ewGridContent">

<div class="ewGridMiddlePanel">

<form name="faol_payment_planlist" id="faol_payment_planlist" class="ewForm" action="" method="post">

<?php if ($aol_payment_plan_list->lTotalRecs > 0) { ?>

<table cellspacing="0" rowhighlightclass="ewTableHighlightRow" rowselectclass="ewTableSelectRow" roweditclass="ewTableEditRow" class="ewTable ewTableSeparate">

<?php

	$aol_payment_plan_list->lOptionCnt = 0;

	$aol_payment_plan_list->lOptionCnt++; // view

	$aol_payment_plan_list->lOptionCnt++; // edit

	$aol_payment_plan_list->lOptionCnt++; // copy

	$aol_payment_plan_list->lOptionCnt++; // Multi-select

	$aol_payment_plan_list->lOptionCnt += count($aol_payment_plan_list->ListOptions->Items); // Custom list options

?>

<?php echo $aol_payment_plan->TableCustomInnerHtml ?>

<thead><!-- Table header -->

	<tr class="ewTableHeader">

<?php if ($aol_payment_plan->id->Visible) { // id ?>

	<?php if ($aol_payment_plan->SortUrl($aol_payment_plan->id) == "") { ?>

		<td>Id</td>

	<?php } else { ?>

		<td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $aol_payment_plan->SortUrl($aol_payment_plan->id) ?>',1);">

			<table cellspacing="0" class="ewTableHeaderBtn"><tr><td>Id</td><td style="width: 10px;"><?php if ($aol_payment_plan->id->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($aol_payment_plan->id->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>

		</td>

	<?php } ?>

<?php } ?>		

<?php if ($aol_payment_plan->name->Visible) { // name ?>

	<?php if ($aol_payment_plan->SortUrl($aol_payment_plan->name) == "") { ?>

		<td>Name</td>

	<?php } else { ?>

		<td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $aol_payment_plan->SortUrl($aol_payment_plan->name) ?>',1);">

			<table cellspacing="0" class="ewTableHeaderBtn"><tr><td>Name&nbsp;(*)</td><td style="width: 10px;"><?php if ($aol_payment_plan->name->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($aol_payment_plan->name->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>

		</td>

	<?php } ?>

<?php } ?>		

<?php if ($aol_payment_plan->DateOnBill->Visible) { // DateOnBill ?>

	<?php if ($aol_payment_plan->SortUrl($aol_payment_plan->DateOnBill) == "") { ?>

		<td>Date On Bill</td>

	<?php } else { ?>

		<td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $aol_payment_plan->SortUrl($aol_payment_plan->DateOnBill) ?>',1);">

			<table cellspacing="0" class="ewTableHeaderBtn"><tr><td>Date On Bill</td><td style="width: 10px;"><?php if ($aol_payment_plan->DateOnBill->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($aol_payment_plan->DateOnBill->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>

		</td>

	<?php } ?>

<?php } ?>		

<?php if ($aol_payment_plan->DateDUE->Visible) { // DateDUE ?>

	<?php if ($aol_payment_plan->SortUrl($aol_payment_plan->DateDUE) == "") { ?>

		<td>Date DUE</td>

	<?php } else { ?>

		<td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $aol_payment_plan->SortUrl($aol_payment_plan->DateDUE) ?>',1);">

			<table cellspacing="0" class="ewTableHeaderBtn"><tr><td>Date DUE</td><td style="width: 10px;"><?php if ($aol_payment_plan->DateDUE->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($aol_payment_plan->DateDUE->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>

		</td>

	<?php } ?>

<?php } ?>		

<?php if ($aol_payment_plan->DateExpectToplay->Visible) { // DateExpectToplay ?>

	<?php if ($aol_payment_plan->SortUrl($aol_payment_plan->DateExpectToplay) == "") { ?>

		<td>Date Expect Toplay</td>

	<?php } else { ?>

		<td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $aol_payment_plan->SortUrl($aol_payment_plan->DateExpectToplay) ?>',1);">

			<table cellspacing="0" class="ewTableHeaderBtn"><tr><td>Date Expect Toplay</td><td style="width: 10px;"><?php if ($aol_payment_plan->DateExpectToplay->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($aol_payment_plan->DateExpectToplay->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>

		</td>

	<?php } ?>

<?php } ?>		

<?php if ($aol_payment_plan->DATE_payment->Visible) { // DATE_payment ?>

	<?php if ($aol_payment_plan->SortUrl($aol_payment_plan->DATE_payment) == "") { ?>

		<td>DATE Payment</td>

	<?php } else { ?>

		<td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $aol_payment_plan->SortUrl($aol_payment_plan->DATE_payment) ?>',1);">

			<table cellspacing="0" class="ewTableHeaderBtn"><tr><td>DATE Payment</td><td style="width: 10px;"><?php if ($aol_payment_plan->DATE_payment->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($aol_payment_plan->DATE_payment->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>

		</td>

	<?php } ?>

<?php } ?>		

<?php if ($aol_payment_plan->PayMentId->Visible) { // PayMentId ?>

	<?php if ($aol_payment_plan->SortUrl($aol_payment_plan->PayMentId) == "") { ?>

		<td>Pay Ment Id</td>

	<?php } else { ?>

		<td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $aol_payment_plan->SortUrl($aol_payment_plan->PayMentId) ?>',1);">

			<table cellspacing="0" class="ewTableHeaderBtn"><tr><td>Pay Ment Id</td><td style="width: 10px;"><?php if ($aol_payment_plan->PayMentId->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($aol_payment_plan->PayMentId->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>

		</td>

	<?php } ?>

<?php } ?>		

<?php if ($aol_payment_plan->DateArrive->Visible) { // DateArrive ?>

	<?php if ($aol_payment_plan->SortUrl($aol_payment_plan->DateArrive) == "") { ?>

		<td>Date Arrive</td>

	<?php } else { ?>

		<td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $aol_payment_plan->SortUrl($aol_payment_plan->DateArrive) ?>',1);">

			<table cellspacing="0" class="ewTableHeaderBtn"><tr><td>Date Arrive</td><td style="width: 10px;"><?php if ($aol_payment_plan->DateArrive->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($aol_payment_plan->DateArrive->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>

		</td>

	<?php } ?>

<?php } ?>		

<?php if ($aol_payment_plan->datetimestampt->Visible) { // datetimestampt ?>

	<?php if ($aol_payment_plan->SortUrl($aol_payment_plan->datetimestampt) == "") { ?>

		<td>Datetimestampt</td>

	<?php } else { ?>

		<td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $aol_payment_plan->SortUrl($aol_payment_plan->datetimestampt) ?>',1);">

			<table cellspacing="0" class="ewTableHeaderBtn"><tr><td>Datetimestampt</td><td style="width: 10px;"><?php if ($aol_payment_plan->datetimestampt->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($aol_payment_plan->datetimestampt->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>

		</td>

	<?php } ?>

<?php } ?>		

<?php if ($aol_payment_plan->Billno->Visible) { // Billno ?>

	<?php if ($aol_payment_plan->SortUrl($aol_payment_plan->Billno) == "") { ?>

		<td>Billno</td>

	<?php } else { ?>

		<td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $aol_payment_plan->SortUrl($aol_payment_plan->Billno) ?>',1);">

			<table cellspacing="0" class="ewTableHeaderBtn"><tr><td>Billno&nbsp;(*)</td><td style="width: 10px;"><?php if ($aol_payment_plan->Billno->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($aol_payment_plan->Billno->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>

		</td>

	<?php } ?>

<?php } ?>		

<?php if ($aol_payment_plan->Amount->Visible) { // Amount ?>

	<?php if ($aol_payment_plan->SortUrl($aol_payment_plan->Amount) == "") { ?>

		<td>Amount</td>

	<?php } else { ?>

		<td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $aol_payment_plan->SortUrl($aol_payment_plan->Amount) ?>',1);">

			<table cellspacing="0" class="ewTableHeaderBtn"><tr><td>Amount</td><td style="width: 10px;"><?php if ($aol_payment_plan->Amount->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($aol_payment_plan->Amount->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>

		</td>

	<?php } ?>

<?php } ?>		

<?php if ($aol_payment_plan->Remark->Visible) { // Remark ?>

	<?php if ($aol_payment_plan->SortUrl($aol_payment_plan->Remark) == "") { ?>

		<td>Remark</td>

	<?php } else { ?>

		<td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $aol_payment_plan->SortUrl($aol_payment_plan->Remark) ?>',1);">

			<table cellspacing="0" class="ewTableHeaderBtn"><tr><td>Remark&nbsp;(*)</td><td style="width: 10px;"><?php if ($aol_payment_plan->Remark->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($aol_payment_plan->Remark->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>

		</td>

	<?php } ?>

<?php } ?>		

<?php if ($aol_payment_plan->Export == "") { ?>

<td style="white-space: nowrap;">&nbsp;</td>

<td style="white-space: nowrap;">&nbsp;</td>

<td style="white-space: nowrap;">&nbsp;</td>

<td style="white-space: nowrap;"><input type="checkbox" name="key" id="key" class="phpmaker" onclick="aol_payment_plan_list.SelectAllKey(this);"></td>

<?php
 

// Custom list options

foreach ($aol_payment_plan_list->ListOptions->Items as $ListOption) {

	if ($ListOption->Visible)

		echo $ListOption->HeaderCellHtml;

}

?>

<?php } ?>

	</tr>

</thead>

<?php

if ($aol_payment_plan->ExportAll && $aol_payment_plan->Export <> "") {

	$aol_payment_plan_list->lStopRec = $aol_payment_plan_list->lTotalRecs;

} else {

	$aol_payment_plan_list->lStopRec = $aol_payment_plan_list->lStartRec + $aol_payment_plan_list->lDisplayRecs - 1; // Set the last record to display

}

$aol_payment_plan_list->lRecCount = $aol_payment_plan_list->lStartRec - 1;

if ($rs && !$rs->EOF) {

	$rs->MoveFirst();

	if (!$aol_payment_plan->SelectLimit && $aol_payment_plan_list->lStartRec > 1)

		$rs->Move($aol_payment_plan_list->lStartRec - 1);

}

$aol_payment_plan_list->lRowCnt = 0;

while (($aol_payment_plan->CurrentAction == "gridadd" || !$rs->EOF) &&

	$aol_payment_plan_list->lRecCount < $aol_payment_plan_list->lStopRec) {

	$aol_payment_plan_list->lRecCount++;

	if (intval($aol_payment_plan_list->lRecCount) >= intval($aol_payment_plan_list->lStartRec)) {

		$aol_payment_plan_list->lRowCnt++;
 

	// Init row class and style

	$aol_payment_plan->CssClass = "";

	$aol_payment_plan->CssStyle = "";

	$aol_payment_plan->RowClientEvents = "onmouseover='ew_MouseOver(event, this);' onmouseout='ew_MouseOut(event, this);' onclick='ew_Click(event, this);'";

	if ($aol_payment_plan->CurrentAction == "gridadd") {

		$aol_payment_plan_list->LoadDefaultValues(); // Load default values

	} else {

		$aol_payment_plan_list->LoadRowValues($rs); // Load row values

	}

	$aol_payment_plan->RowType = EW_ROWTYPE_VIEW; // Render view
 

	// Render row

	$aol_payment_plan_list->RenderRow();

?>

	<tr<?php echo $aol_payment_plan->RowAttributes() ?>>

	<?php if ($aol_payment_plan->id->Visible) { // id ?>

		<td<?php echo $aol_payment_plan->id->CellAttributes() ?>>

<div<?php echo $aol_payment_plan->id->ViewAttributes() ?>><?php echo $aol_payment_plan->id->ListViewValue() ?></div>

</td>

	<?php } ?>

	<?php if ($aol_payment_plan->name->Visible) { // name ?>

		<td<?php echo $aol_payment_plan->name->CellAttributes() ?>>

<div<?php echo $aol_payment_plan->name->ViewAttributes() ?>><?php echo $aol_payment_plan->name->ListViewValue() ?></div>

</td>

	<?php } ?>

	<?php if ($aol_payment_plan->DateOnBill->Visible) { // DateOnBill ?>

		<td<?php echo $aol_payment_plan->DateOnBill->CellAttributes() ?>>

<div<?php echo $aol_payment_plan->DateOnBill->ViewAttributes() ?>><?php echo $aol_payment_plan->DateOnBill->ListViewValue() ?></div>

</td>

	<?php } ?>

	<?php if ($aol_payment_plan->DateDUE->Visible) { // DateDUE ?>

		<td<?php echo $aol_payment_plan->DateDUE->CellAttributes() ?>>

<div<?php echo $aol_payment_plan->DateDUE->ViewAttributes() ?>><?php echo $aol_payment_plan->DateDUE->ListViewValue() ?></div>

</td>

	<?php } ?>

	<?php if ($aol_payment_plan->DateExpectToplay->Visible) { // DateExpectToplay ?>

		<td<?php echo $aol_payment_plan->DateExpectToplay->CellAttributes() ?>>

<div<?php echo $aol_payment_plan->DateExpectToplay->ViewAttributes() ?>><?php echo $aol_payment_plan->DateExpectToplay->ListViewValue() ?></div>

</td>

	<?php } ?>

	<?php if ($aol_payment_plan->DATE_payment->Visible) { // DATE_payment ?>

		<td<?php echo $aol_payment_plan->DATE_payment->CellAttributes() ?>>

<div<?php echo $aol_payment_plan->DATE_payment->ViewAttributes() ?>><?php echo $aol_payment_plan->DATE_payment->ListViewValue() ?></div>

</td>

	<?php } ?>

	<?php if ($aol_payment_plan->PayMentId->Visible) { // PayMentId ?>

		<td<?php echo $aol_payment_plan->PayMentId->CellAttributes() ?>>

<div<?php echo $aol_payment_plan->PayMentId->ViewAttributes() ?>><?php echo $aol_payment_plan->PayMentId->ListViewValue() ?></div>

</td>

	<?php } ?>

	<?php if ($aol_payment_plan->DateArrive->Visible) { // DateArrive ?>

		<td<?php echo $aol_payment_plan->DateArrive->CellAttributes() ?>>

<div<?php echo $aol_payment_plan->DateArrive->ViewAttributes() ?>><?php echo $aol_payment_plan->DateArrive->ListViewValue() ?></div>

</td>

	<?php } ?>

	<?php if ($aol_payment_plan->datetimestampt->Visible) { // datetimestampt ?>

		<td<?php echo $aol_payment_plan->datetimestampt->CellAttributes() ?>>

<div<?php echo $aol_payment_plan->datetimestampt->ViewAttributes() ?>><?php echo $aol_payment_plan->datetimestampt->ListViewValue() ?></div>

</td>

	<?php } ?>

	<?php if ($aol_payment_plan->Billno->Visible) { // Billno ?>

		<td<?php echo $aol_payment_plan->Billno->CellAttributes() ?>>

<div<?php echo $aol_payment_plan->Billno->ViewAttributes() ?>><?php echo $aol_payment_plan->Billno->ListViewValue() ?></div>

</td>

	<?php } ?>

	<?php if ($aol_payment_plan->Amount->Visible) { // Amount ?>

		<td<?php echo $aol_payment_plan->Amount->CellAttributes() ?>>

<div<?php echo $aol_payment_plan->Amount->ViewAttributes() ?>><?php echo $aol_payment_plan->Amount->ListViewValue() ?></div>

</td>

	<?php } ?>

	<?php if ($aol_payment_plan->Remark->Visible) { // Remark ?>

		<td<?php echo $aol_payment_plan->Remark->CellAttributes() ?>>

<div<?php echo $aol_payment_plan->Remark->ViewAttributes() ?>><?php echo $aol_payment_plan->Remark->ListViewValue() ?></div>

</td>

	<?php } ?>

<?php if ($aol_payment_plan->Export == "") { ?>

<td style="white-space: nowrap;"><span class="phpmaker">

<a href="<?php echo $aol_payment_plan->ViewUrl() ?>">View</a>

</span></td>

<td style="white-space: nowrap;"><span class="phpmaker">

<a href="<?php echo $aol_payment_plan->EditUrl() ?>">Edit</a>

</span></td>

<td style="white-space: nowrap;"><span class="phpmaker">

<a href="<?php echo $aol_payment_plan->CopyUrl() ?>">Copy</a>

</span></td>

<td style="white-space: nowrap;"><span class="phpmaker">

<input type="checkbox" name="key_m[]" id="key_m[]"  value="<?php echo ew_HtmlEncode($aol_payment_plan->id->CurrentValue) ?>" class="phpmaker" onclick='ew_ClickMultiCheckbox(this);'>

</span></td>

<?php
 

// Custom list options

foreach ($aol_payment_plan_list->ListOptions->Items as $ListOption) {

	if ($ListOption->Visible)

		echo $ListOption->BodyCellHtml;

}

?>

<?php } ?>

	</tr>

<?php

	}

	if ($aol_payment_plan->CurrentAction <> "gridadd")

		$rs->MoveNext();

}

?>

</tbody>

</table>

<?php } ?>

</form>

<?php
 

// Close recordset

if ($rs)

	$rs->Close();

?>

</div>

<?php if ($aol_payment_plan->Export == "") { ?>

<div class="ewGridLowerPanel">

<?php if ($aol_payment_plan->CurrentAction <> "gridadd" && $aol_payment_plan->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($aol_payment_plan_list->Pager)) $aol_payment_plan_list->Pager = new cPrevNextPager($aol_payment_plan_list->lStartRec, $aol_payment_plan_list->lDisplayRecs, $aol_payment_plan_list->lTotalRecs) ?>

<?php if ($aol_payment_plan_list->Pager->RecordCount > 0) { ?>

	<table border="0" cellspacing="0" cellpadding="0"><tr><td><span class="phpmaker">Page&nbsp;</span></td>

<!--first page button-->

	<?php if ($aol_payment_plan_list->Pager->FirstButton->Enabled) { ?>

	<td><a href="<?php echo $aol_payment_plan_list->PageUrl() ?>start=<?php echo $aol_payment_plan_list->Pager->FirstButton->Start ?>"><img src="images/first.gif" alt="First" width="16" height="16" border="0"></a></td>

	<?php } else { ?>

	<td><img src="images/firstdisab.gif" alt="First" width="16" height="16" border="0"></td>

	<?php } ?>

<!--previous page button-->

	<?php if ($aol_payment_plan_list->Pager->PrevButton->Enabled) { ?>

	<td><a href="<?php echo $aol_payment_plan_list->PageUrl() ?>start=<?php echo $aol_payment_plan_list->Pager->PrevButton->Start ?>"><img src="images/prev.gif" alt="Previous" width="16" height="16" border="0"></a></td>

	<?php } else { ?>

	<td><img src="images/prevdisab.gif" alt="Previous" 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 $aol_payment_plan_list->Pager->CurrentPage ?>" size="4"></td>

<!--next page button-->

	<?php if ($aol_payment_plan_list->Pager->NextButton->Enabled) { ?>

	<td><a href="<?php echo $aol_payment_plan_list->PageUrl() ?>start=<?php echo $aol_payment_plan_list->Pager->NextButton->Start ?>"><img src="images/next.gif" alt="Next" width="16" height="16" border="0"></a></td>	

	<?php } else { ?>

	<td><img src="images/nextdisab.gif" alt="Next" width="16" height="16" border="0"></td>

	<?php } ?>

<!--last page button-->

	<?php if ($aol_payment_plan_list->Pager->LastButton->Enabled) { ?>

	<td><a href="<?php echo $aol_payment_plan_list->PageUrl() ?>start=<?php echo $aol_payment_plan_list->Pager->LastButton->Start ?>"><img src="images/last.gif" alt="Last" width="16" height="16" border="0"></a></td>	

	<?php } else { ?>

	<td><img src="images/lastdisab.gif" alt="Last" width="16" height="16" border="0"></td>

	<?php } ?>

	<td><span class="phpmaker">&nbsp;of <?php echo $aol_payment_plan_list->Pager->PageCount ?></span></td>

	</tr></table>

	</td>	

	<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>

	<td>

	<span class="phpmaker">Records <?php echo $aol_payment_plan_list->Pager->FromIndex ?> to <?php echo $aol_payment_plan_list->Pager->ToIndex ?> of <?php echo $aol_payment_plan_list->Pager->RecordCount ?></span>

<?php } else { ?>

	<?php if ($aol_payment_plan_list->sSrchWhere == "0=101") { ?>

	<span class="phpmaker">Please enter search criteria</span>

	<?php } else { ?>

	<span class="phpmaker">No records found</span>

	<?php } ?>

<?php } ?>

		</td>

	</tr>

</table>

</form>

<?php } ?>

<?php //if ($aol_payment_plan_list->lTotalRecs > 0) { ?>

<span class="phpmaker">

<a href="<?php echo $aol_payment_plan->AddUrl() ?>">Add</a>&nbsp;&nbsp;

<?php if ($aol_payment_plan_list->lTotalRecs > 0) { ?>

<a href="" onclick="if (!ew_KeySelected(document.faol_payment_planlist)) alert('No records selected'); else {document.faol_payment_planlist.action='aol_payment_plandelete1.php';document.faol_payment_planlist.encoding='application/x-www-form-urlencoded';document.faol_payment_planlist.submit();};return false;">Delete Selected Records</a>&nbsp;&nbsp;

<?php } ?>

</span>

<?php //} ?>

</div>

<?php } ?>

</td></tr></table>

<?php if ($aol_payment_plan->Export == "" && $aol_payment_plan->CurrentAction == "") { ?>

<script type="text/javascript">

<!--
 

//ew_ToggleSearchPanel(aol_payment_plan_list); // uncomment to init search panel as collapsed

//-->
 

</script>

<?php } ?>

<?php if ($aol_payment_plan->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
 

//

// Page Class

//

class caol_payment_plan_list {
 

	// Page ID

	var $PageID = 'list';
 

	// Table Name

	var $TableName = 'aol_payment_plan';
 

	// Page Object Name

	var $PageObjName = 'aol_payment_plan_list';
 

	// Page Name

	function PageName() {

		return ew_CurrentPage();

	}
 

	// Page Url

	function PageUrl() {

		$PageUrl = ew_CurrentPage() . "?";

		global $aol_payment_plan;

		if ($aol_payment_plan->UseTokenInUrl) $PageUrl .= "t=" . $aol_payment_plan->TableVar . "&"; // add page token

		return $PageUrl;

	}
 

	// 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() {

		if ($this->getMessage() <> "") { // Message in Session, display

			echo "<p><span class=\"ewMessage\">" . $this->getMessage() . "</span></p>";

			$_SESSION[EW_SESSION_MESSAGE] = ""; // Clear message in Session

		}

	}
 

	// Validate Page request

	function IsPageRequest() {

		global $objForm, $aol_payment_plan;

		if ($aol_payment_plan->UseTokenInUrl) {
 

			//IsPageRequest = False

			if ($objForm)

				return ($aol_payment_plan->TableVar == $objForm->GetValue("t"));

			if (@$_GET["t"] <> "")

				return ($aol_payment_plan->TableVar == $_GET["t"]);

		} else {

			return TRUE;

		}

	}
 

	//

	//  Class initialize

	//  - init objects

	//  - open connection

	//

	function caol_payment_plan_list() {

		global $conn;
 

		// Initialize table object

		$GLOBALS["aol_payment_plan"] = new caol_payment_plan();
 

		// Initialize other table object

		$GLOBALS['aol_grop_bill_payment'] = new caol_grop_bill_payment();
 

		// Intialize page id (for backward compatibility)

		if (!defined("EW_PAGE_ID"))

			define("EW_PAGE_ID", 'list', TRUE);
 

		// Initialize table name (for backward compatibility)

		if (!defined("EW_TABLE_NAME"))

			define("EW_TABLE_NAME", 'aol_payment_plan', TRUE);
 

		// Open connection to the database

		$conn = ew_Connect();
 

		// Initialize list options

		$this->ListOptions = new cListOptions();

	}
 

	// 

	//  Page_Init

	//

	function Page_Init() {

		global $gsExport, $gsExportFile, $aol_payment_plan;

	$aol_payment_plan->Export = @$_GET["export"]; // Get export parameter

	$gsExport = $aol_payment_plan->Export; // Get export parameter, used in header

	$gsExportFile = $aol_payment_plan->TableVar; // Get export file, used in header
 

		// Global page loading event (in userfn6.php)

		Page_Loading();
 

		// Page load event, used in current page

		$this->Page_Load();

	}
 

	//

	//  Page_Terminate

	//  - called when exit page

	//  - if URL specified, redirect to the URL

	//

	function Page_Terminate($url = "") {

		global $conn;
 

		// Page unload event, used in current page

		$this->Page_Unload();
 

		// Global page unloaded event (in userfn*.php)

		Page_Unloaded();
 

		 // Close Connection

		$conn->Close();
 

		// Go to URL if specified

		if ($url <> "") {

			ob_end_clean();

			header("Location: $url");

		}

		exit();

	}

	var $lDisplayRecs; // Number of display records

	var $lStartRec;

	var $lStopRec;

	var $lTotalRecs;

	var $lRecRange;

	var $sSrchWhere;

	var $lRecCnt;

	var $lEditRowCnt;

	var $lRowCnt;

	var $lRowIndex;

	var $lOptionCnt;

	var $lRecPerRow;

	var $lColCnt;

	var $sDeleteConfirmMsg; // Delete confirm message

	var $sDbMasterFilter;

	var $sDbDetailFilter;

	var $bMasterRecordExists;	

	var $ListOptions;

	var $sMultiSelectKey;
 

	//

	// Page main processing

	//

	function Page_Main() {

		global $objForm, $gsSearchError, $Security, $aol_payment_plan;

		$this->lDisplayRecs = 20;

		$this->lRecRange = 10;

		$this->lRecCnt = 0; // Record count
 

		// Search filters

		$sSrchAdvanced = ""; // Advanced search filter

		$sSrchBasic = ""; // Basic search filter

		$sFilter = "";

		$this->sSrchWhere = ""; // Search WHERE clause
 

		// Master/Detail

		$this->sDbMasterFilter = ""; // Master filter

		$this->sDbDetailFilter = ""; // Detail filter

		if ($this->IsPageRequest()) { // Validate request
 

			// Handle reset command

			$this->ResetCmd();
 

			// Set up master detail parameters

			$this->SetUpMasterDetail();
 

			// Get basic search criteria

			if ($gsSearchError == "")

				$sSrchBasic = $this->BasicSearchWhere();
 

			// Set Up Sorting Order

			$this->SetUpSortOrder();

		} // End Validate Request
 

		// Restore display records

		if ($aol_payment_plan->getRecordsPerPage() <> "") {

			$this->lDisplayRecs = $aol_payment_plan->getRecordsPerPage(); // Restore from Session

		} else {

			$this->lDisplayRecs = 20; // Load default

		}
 

		// Load Sorting Order

		$this->LoadSortOrder();
 

		// Build search criteria

		if ($sSrchAdvanced <> "")

			$this->sSrchWhere = ($this->sSrchWhere <> "") ? "($this->sSrchWhere) AND ($sSrchAdvanced)" : $sSrchAdvanced;

		if ($sSrchBasic <> "")

			$this->sSrchWhere = ($this->sSrchWhere <> "") ? "($this->sSrchWhere) AND ($sSrchBasic)" : $sSrchBasic;
 

		// Call Recordset_Searching event

		$aol_payment_plan->Recordset_Searching($this->sSrchWhere);
 

		// Save search criteria

		if ($this->sSrchWhere <> "") {

			if ($sSrchBasic == "")

				$this->ResetBasicSearchParms();

			$aol_payment_plan->setSearchWhere($this->sSrchWhere); // Save to Session

			$this->lStartRec = 1; // Reset start record counter

			$aol_payment_plan->setStartRecordNumber($this->lStartRec);

		} else {

			$this->RestoreSearchParms();

		}
 

		// Build filter

		$sFilter = "";
 

		// Restore master/detail filter

		$this->sDbMasterFilter = $aol_payment_plan->getMasterFilter(); // Restore master filter

		$this->sDbDetailFilter = $aol_payment_plan->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 ($aol_payment_plan->getMasterFilter() <> "" && $aol_payment_plan->getCurrentMasterTable() == "aol_grop_bill_payment") {

			global $aol_grop_bill_payment;

			$rsmaster = $aol_grop_bill_payment->LoadRs($this->sDbMasterFilter);

			$this->bMasterRecordExists = ($rsmaster && !$rsmaster->EOF);

			if (!$this->bMasterRecordExists) {

				$aol_payment_plan->setMasterFilter(""); // Clear master filter

				$aol_payment_plan->setDetailFilter(""); // Clear detail filter

				$this->setMessage("No records found"); // Set no record found

				$this->Page_Terminate($aol_payment_plan->getReturnUrl()); // Return to caller

			} else {

				$aol_grop_bill_payment->LoadListRowValues($rsmaster);

				$aol_grop_bill_payment->RowType = EW_ROWTYPE_MASTER; // Master row

				$aol_grop_bill_payment->RenderListRow();

				$rsmaster->Close();

			}

		}
 

		// Set up filter in Session

		$aol_payment_plan->setSessionWhere($sFilter);

		$aol_payment_plan->CurrentFilter = "";

	}
 

	// Return Basic Search sql

	function BasicSearchSQL($Keyword) {

		global $aol_payment_plan;

		$sKeyword = ew_AdjustSql($Keyword);

		$sql = "";

		$sql .= $aol_payment_plan->name->FldExpression . " LIKE '%" . $sKeyword . "%' OR ";

		$sql .= $aol_payment_plan->Billno->FldExpression . " LIKE '%" . $sKeyword . "%' OR ";

		$sql .= $aol_payment_plan->Remark->FldExpression . " LIKE '%" . $sKeyword . "%' OR ";

		if (substr($sql, -4) == " OR ") $sql = substr($sql, 0, strlen($sql)-4);

		return $sql;

	}
 

	// Return Basic Search Where based on search keyword and type

	function BasicSearchWhere() {

		global $Security, $aol_payment_plan;

		$sSearchStr = "";

		$sSearchKeyword = ew_StripSlashes(@$_GET[EW_TABLE_BASIC_SEARCH]);

		$sSearchType = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE];

		if ($sSearchKeyword <> "") {

			$sSearch = trim($sSearchKeyword);

			if ($sSearchType <> "") {

				while (strpos($sSearch, "  ") !== FALSE)

					$sSearch = str_replace("  ", " ", $sSearch);

				$arKeyword = explode(" ", trim($sSearch));

				foreach ($arKeyword as $sKeyword) {

					if ($sSearchStr <> "") $sSearchStr .= " " . $sSearchType . " ";

					$sSearchStr .= "(" . $this->BasicSearchSQL($sKeyword) . ")";

				}

			} else {

				$sSearchStr = $this->BasicSearchSQL($sSearch);

			}

		}

		if ($sSearchKeyword <> "") {

			$aol_payment_plan->setBasicSearchKeyword($sSearchKeyword);

			$aol_payment_plan->setBasicSearchType($sSearchType);

		}

		return $sSearchStr;

	}
 

	// Clear all search parameters

	function ResetSearchParms() {
 

		// Clear search where

		global $aol_payment_plan;

		$this->sSrchWhere = "";

		$aol_payment_plan->setSearchWhere($this->sSrchWhere);
 

		// Clear basic search parameters

		$this->ResetBasicSearchParms();

	}
 

	// Clear all basic search parameters

	function ResetBasicSearchParms() {
 

		// Clear basic search parameters

		global $aol_payment_plan;

		$aol_payment_plan->setBasicSearchKeyword("");

		$aol_payment_plan->setBasicSearchType("");

	}
 

	// Restore all search parameters

	function RestoreSearchParms() {

		global $gsSearchError, $aol_payment_plan;

		$this->sSrchWhere = $aol_payment_plan->getSearchWhere();

	}
 

	// Set up Sort parameters based on Sort Links clicked

	function SetUpSortOrder() {

		global $aol_payment_plan;
 

		// Check for an Order parameter

		if (@$_GET["order"] <> "") {

			$aol_payment_plan->CurrentOrder = ew_StripSlashes(@$_GET["order"]);

			$aol_payment_plan->CurrentOrderType = @$_GET["ordertype"];

			$aol_payment_plan->UpdateSort($aol_payment_plan->id); // Field 

			$aol_payment_plan->UpdateSort($aol_payment_plan->name); // Field 

			$aol_payment_plan->UpdateSort($aol_payment_plan->DateOnBill); // Field 

			$aol_payment_plan->UpdateSort($aol_payment_plan->DateDUE); // Field 

			$aol_payment_plan->UpdateSort($aol_payment_plan->DateExpectToplay); // Field 

			$aol_payment_plan->UpdateSort($aol_payment_plan->DATE_payment); // Field 

			$aol_payment_plan->UpdateSort($aol_payment_plan->PayMentId); // Field 

			$aol_payment_plan->UpdateSort($aol_payment_plan->DateArrive); // Field 

			$aol_payment_plan->UpdateSort($aol_payment_plan->datetimestampt); // Field 

			$aol_payment_plan->UpdateSort($aol_payment_plan->Billno); // Field 

			$aol_payment_plan->UpdateSort($aol_payment_plan->Amount); // Field 

			$aol_payment_plan->UpdateSort($aol_payment_plan->Remark); // Field 

			$aol_payment_plan->setStartRecordNumber(1); // Reset start position

		}

	}
 

	// Load Sort Order parameters

	function LoadSortOrder() {

		global $aol_payment_plan;

		$sOrderBy = $aol_payment_plan->getSessionOrderBy(); // Get order by from Session

		if ($sOrderBy == "") {

			if ($aol_payment_plan->SqlOrderBy() <> "") {

				$sOrderBy = $aol_payment_plan->SqlOrderBy();

				$aol_payment_plan->setSessionOrderBy($sOrderBy);

			}

		}

	}
 

	// Reset command based on querystring parameter cmd=

	// - RESET: reset search parameters

	// - RESETALL: reset search & master/detail parameters

	// - RESETSORT: reset sort parameters

	function ResetCmd() {

		global $aol_payment_plan;
 

		// Get reset cmd

		if (@$_GET["cmd"] <> "") {

			$sCmd = $_GET["cmd"];
 

			// Reset search criteria

			if (strtolower($sCmd) == "reset" || strtolower($sCmd) == "resetall")

				$this->ResetSearchParms();
 

			// Reset master/detail keys

			if (strtolower($sCmd) == "resetall") {

				$aol_payment_plan->getCurrentMasterTable = ""; // Clear master table

				$aol_payment_plan->setMasterFilter(""); // Clear master filter

				$this->sDbMasterFilter = "";

				$aol_payment_plan->setDetailFilter(""); // Clear detail filter

				$this->sDbDetailFilter = "";

				$aol_payment_plan->id->setSessionValue("");

			}
 

			// Reset sort criteria

			if (strtolower($sCmd) == "resetsort") {

				$sOrderBy = "";

				$aol_payment_plan->setSessionOrderBy($sOrderBy);

				$aol_payment_plan->id->setSort("");

				$aol_payment_plan->name->setSort("");

				$aol_payment_plan->DateOnBill->setSort("");

				$aol_payment_plan->DateDUE->setSort("");

				$aol_payment_plan->DateExpectToplay->setSort("");

				$aol_payment_plan->DATE_payment->setSort("");

				$aol_payment_plan->PayMentId->setSort("");

				$aol_payment_plan->DateArrive->setSort("");

				$aol_payment_plan->datetimestampt->setSort("");

				$aol_payment_plan->Billno->setSort("");

				$aol_payment_plan->Amount->setSort("");

				$aol_payment_plan->Remark->setSort("");

			}
 

			// Reset start position

			$this->lStartRec = 1;

			$aol_payment_plan->setStartRecordNumber($this->lStartRec);

		}

	}
 

	// Set up Starting Record parameters based on Pager Navigation

	function SetUpStartRec() {

		global $aol_payment_plan;

		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];

				$aol_payment_plan->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;

					}

					$aol_payment_plan->setStartRecordNumber($this->lStartRec);

				}

			}

		}

		$this->lStartRec = $aol_payment_plan->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

			$aol_payment_plan->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

			$aol_payment_plan->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

			$aol_payment_plan->setStartRecordNumber($this->lStartRec);

		}

	}
 

	// Load recordset

	function LoadRecordset($offset = -1, $rowcnt = -1) {

		global $conn, $aol_payment_plan;
 

		// Call Recordset Selecting event

		$aol_payment_plan->Recordset_Selecting($aol_payment_plan->CurrentFilter);
 

		// Load list page SQL

		$sSql = $aol_payment_plan->SelectSQL();

		if ($offset > -1 && $rowcnt > -1) $sSql .= " LIMIT $offset, $rowcnt";
 

		// Load recordset

		$conn->raiseErrorFn = 'ew_ErrorFn';	

		$rs = $conn->Execute($sSql);

		$conn->raiseErrorFn = '';
 

		// Call Recordset Selected event

		$aol_payment_plan->Recordset_Selected($rs);

		return $rs;

	}
 

	// Load row based on key values

	function LoadRow() {

		global $conn, $Security, $aol_payment_plan;

		$sFilter = $aol_payment_plan->KeyFilter();
 

		// Call Row Selecting event

		$aol_payment_plan->Row_Selecting($sFilter);
 

		// Load sql based on filter

		$aol_payment_plan->CurrentFilter = $sFilter;

		$sSql = $aol_payment_plan->SQL();

		if ($rs = $conn->Execute($sSql)) {

			if ($rs->EOF) {

				$LoadRow = FALSE;

			} else {

				$LoadRow = TRUE;

				$rs->MoveFirst();

				$this->LoadRowValues($rs); // Load row values
 

				// Call Row Selected event

				$aol_payment_plan->Row_Selected($rs);

			}

			$rs->Close();

		} else {

			$LoadRow = FALSE;

		}

		return $LoadRow;

	}
 

	// Load row values from recordset

	function LoadRowValues(&$rs) {

		global $aol_payment_plan;

		$aol_payment_plan->id->setDbValue($rs->fields('id'));

		$aol_payment_plan->name->setDbValue($rs->fields('name'));

		$aol_payment_plan->DateOnBill->setDbValue($rs->fields('DateOnBill'));

		$aol_payment_plan->DateDUE->setDbValue($rs->fields('DateDUE'));

		$aol_payment_plan->DateExpectToplay->setDbValue($rs->fields('DateExpectToplay'));

		$aol_payment_plan->DATE_payment->setDbValue($rs->fields('DATE_payment'));

		$aol_payment_plan->PayMentId->setDbValue($rs->fields('PayMentId'));

		$aol_payment_plan->DateArrive->setDbValue($rs->fields('DateArrive'));

		$aol_payment_plan->datetimestampt->setDbValue($rs->fields('datetimestampt'));

		$aol_payment_plan->Billno->setDbValue($rs->fields('Billno'));

		$aol_payment_plan->Amount->setDbValue($rs->fields('Amount'));

		$aol_payment_plan->Remark->setDbValue($rs->fields('Remark'));

	}
 

	// Render row values based on field settings

	function RenderRow() {

		global $conn, $Security, $aol_payment_plan;
 

		// Call Row_Rendering event

		$aol_payment_plan->Row_Rendering();
 

		// Common render codes for all row types

		// id
 

		$aol_payment_plan->id->CellCssStyle = "";

		$aol_payment_plan->id->CellCssClass = "";
 

		// name

		$aol_payment_plan->name->CellCssStyle = "";

		$aol_payment_plan->name->CellCssClass = "";
 

		// DateOnBill

		$aol_payment_plan->DateOnBill->CellCssStyle = "";

		$aol_payment_plan->DateOnBill->CellCssClass = "";
 

		// DateDUE

		$aol_payment_plan->DateDUE->CellCssStyle = "";

		$aol_payment_plan->DateDUE->CellCssClass = "";
 

		// DateExpectToplay

		$aol_payment_plan->DateExpectToplay->CellCssStyle = "";

		$aol_payment_plan->DateExpectToplay->CellCssClass = "";
 

		// DATE_payment

		$aol_payment_plan->DATE_payment->CellCssStyle = "";

		$aol_payment_plan->DATE_payment->CellCssClass = "";
 

		// PayMentId

		$aol_payment_plan->PayMentId->CellCssStyle = "";

		$aol_payment_plan->PayMentId->CellCssClass = "";
 

		// DateArrive

		$aol_payment_plan->DateArrive->CellCssStyle = "";

		$aol_payment_plan->DateArrive->CellCssClass = "";
 

		// datetimestampt

		$aol_payment_plan->datetimestampt->CellCssStyle = "";

		$aol_payment_plan->datetimestampt->CellCssClass = "";
 

		// Billno

		$aol_payment_plan->Billno->CellCssStyle = "";

		$aol_payment_plan->Billno->CellCssClass = "";
 

		// Amount

		$aol_payment_plan->Amount->CellCssStyle = "";

		$aol_payment_plan->Amount->CellCssClass = "";
 

		// Remark

		$aol_payment_plan->Remark->CellCssStyle = "";

		$aol_payment_plan->Remark->CellCssClass = "";

		if ($aol_payment_plan->RowType == EW_ROWTYPE_VIEW) { // View row
 

			// id

			$aol_payment_plan->id->ViewValue = $aol_payment_plan->id->CurrentValue;

			$aol_payment_plan->id->CssStyle = "";

			$aol_payment_plan->id->CssClass = "";

			$aol_payment_plan->id->ViewCustomAttributes = "";
 

			// name

			$aol_payment_plan->name->ViewValue = $aol_payment_plan->name->CurrentValue;

			$aol_payment_plan->name->CssStyle = "";

			$aol_payment_plan->name->CssClass = "";

			$aol_payment_plan->name->ViewCustomAttributes = "";
 

			// DateOnBill

			$aol_payment_plan->DateOnBill->ViewValue = $aol_payment_plan->DateOnBill->CurrentValue;

			$aol_payment_plan->DateOnBill->ViewValue = ew_FormatDateTime($aol_payment_plan->DateOnBill->ViewValue, 7);

			$aol_payment_plan->DateOnBill->CssStyle = "";

			$aol_payment_plan->DateOnBill->CssClass = "";

			$aol_payment_plan->DateOnBill->ViewCustomAttributes = "";
 

			// DateDUE

			$aol_payment_plan->DateDUE->ViewValue = $aol_payment_plan->DateDUE->CurrentValue;

			$aol_payment_plan->DateDUE->ViewValue = ew_FormatDateTime($aol_payment_plan->DateDUE->ViewValue, 7);

			$aol_payment_plan->DateDUE->CssStyle = "";

			$aol_payment_plan->DateDUE->CssClass = "";

			$aol_payment_plan->DateDUE->ViewCustomAttributes = "";
 

			// DateExpectToplay

			$aol_payment_plan->DateExpectToplay->ViewValue = $aol_payment_plan->DateExpectToplay->CurrentValue;

			$aol_payment_plan->DateExpectToplay->ViewValue = ew_FormatDateTime($aol_payment_plan->DateExpectToplay->ViewValue, 7);

			$aol_payment_plan->DateExpectToplay->CssStyle = "";

			$aol_payment_plan->DateExpectToplay->CssClass = "";

			$aol_payment_plan->DateExpectToplay->ViewCustomAttributes = "";
 

			// DATE_payment

			$aol_payment_plan->DATE_payment->ViewValue = $aol_payment_plan->DATE_payment->CurrentValue;

			$aol_payment_plan->DATE_payment->ViewValue = ew_FormatDateTime($aol_payment_plan->DATE_payment->ViewValue, 7);

			$aol_payment_plan->DATE_payment->CssStyle = "";

			$aol_payment_plan->DATE_payment->CssClass = "";

			$aol_payment_plan->DATE_payment->ViewCustomAttributes = "";
 

			// PayMentId

			$aol_payment_plan->PayMentId->ViewValue = $aol_payment_plan->PayMentId->CurrentValue;

			$aol_payment_plan->PayMentId->CssStyle = "";

			$aol_payment_plan->PayMentId->CssClass = "";

			$aol_payment_plan->PayMentId->ViewCustomAttributes = "";
 

			// DateArrive

			$aol_payment_plan->DateArrive->ViewValue = $aol_payment_plan->DateArrive->CurrentValue;

			$aol_payment_plan->DateArrive->ViewValue = ew_FormatDateTime($aol_payment_plan->DateArrive->ViewValue, 7);

			$aol_payment_plan->DateArrive->CssStyle = "";

			$aol_payment_plan->DateArrive->CssClass = "";

			$aol_payment_plan->DateArrive->ViewCustomAttributes = "";
 

			// datetimestampt

			$aol_payment_plan->datetimestampt->ViewValue = $aol_payment_plan->datetimestampt->CurrentValue;

			$aol_payment_plan->datetimestampt->ViewValue = ew_FormatDateTime($aol_payment_plan->datetimestampt->ViewValue, 7);

			$aol_payment_plan->datetimestampt->CssStyle = "";

			$aol_payment_plan->datetimestampt->CssClass = "";

			$aol_payment_plan->datetimestampt->ViewCustomAttributes = "";
 

			// Billno

			$aol_payment_plan->Billno->ViewValue = $aol_payment_plan->Billno->CurrentValue;

			$aol_payment_plan->Billno->CssStyle = "";

			$aol_payment_plan->Billno->CssClass = "";

			$aol_payment_plan->Billno->ViewCustomAttributes = "";
 

			// Amount

			$aol_payment_plan->Amount->ViewValue = $aol_payment_plan->Amount->CurrentValue;

			$aol_payment_plan->Amount->CssStyle = "";

			$aol_payment_plan->Amount->CssClass = "";

			$aol_payment_plan->Amount->ViewCustomAttributes = "";
 

			// Remark

			$aol_payment_plan->Remark->ViewValue = $aol_payment_plan->Remark->CurrentValue;

			$aol_payment_plan->Remark->CssStyle = "";

			$aol_payment_plan->Remark->CssClass = "";

			$aol_payment_plan->Remark->ViewCustomAttributes = "";
 

			// id

			$aol_payment_plan->id->HrefValue = "";
 

			// name

			$aol_payment_plan->name->HrefValue = "";
 

			// DateOnBill

			$aol_payment_plan->DateOnBill->HrefValue = "";
 

			// DateDUE

			$aol_payment_plan->DateDUE->HrefValue = "";
 

			// DateExpectToplay

			$aol_payment_plan->DateExpectToplay->HrefValue = "";
 

			// DATE_payment

			$aol_payment_plan->DATE_payment->HrefValue = "";
 

			// PayMentId

			$aol_payment_plan->PayMentId->HrefValue = "";
 

			// DateArrive

			$aol_payment_plan->DateArrive->HrefValue = "";
 

			// datetimestampt

			$aol_payment_plan->datetimestampt->HrefValue = "";
 

			// Billno

			$aol_payment_plan->Billno->HrefValue = "";
 

			// Amount

			$aol_payment_plan->Amount->HrefValue = "";
 

			// Remark

			$aol_payment_plan->Remark->HrefValue = "";

		}
 

		// Call Row Rendered event

		$aol_payment_plan->Row_Rendered();

	}
 

	// Set up Master Detail based on querystring parameter

	function SetUpMasterDetail() {

		global $aol_payment_plan;

		$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 == "aol_grop_bill_payment") {

				$bValidMaster = TRUE;

				$this->sDbMasterFilter = $aol_payment_plan->SqlMasterFilter_aol_grop_bill_payment();

				$this->sDbDetailFilter = $aol_payment_plan->SqlDetailFilter_aol_grop_bill_payment();

				if (@$_GET["idlink"] <> "") {

					$GLOBALS["aol_grop_bill_payment"]->idlink->setQueryStringValue($_GET["idlink"]);

					$aol_payment_plan->id->setQueryStringValue($GLOBALS["aol_grop_bill_payment"]->idlink->QueryStringValue);

					$aol_payment_plan->id->setSessionValue($aol_payment_plan->id->QueryStringValue);

					if (!is_numeric($GLOBALS["aol_grop_bill_payment"]->idlink->QueryStringValue)) $bValidMaster = FALSE;

					$this->sDbMasterFilter = str_replace("@idlink@", ew_AdjustSql($GLOBALS["aol_grop_bill_payment"]->idlink->QueryStringValue), $this->sDbMasterFilter);

					$this->sDbDetailFilter = str_replace("@id@", ew_AdjustSql($GLOBALS["aol_grop_bill_payment"]->idlink->QueryStringValue), $this->sDbDetailFilter);

				} else {

					$bValidMaster = FALSE;

				}

			}

		}

		if ($bValidMaster) {
 

			// Save current master table

			$aol_payment_plan->setCurrentMasterTable($sMasterTblVar);
 

			// Reset start record counter (new master key)

			$this->lStartRec = 1;

			$aol_payment_plan->setStartRecordNumber($this->lStartRec);

			$aol_payment_plan->setMasterFilter($this->sDbMasterFilter); // Set up master filter

			$aol_payment_plan->setDetailFilter($this->sDbDetailFilter); // Set up detail filter
 

			// Clear previous master session values

			if ($sMasterTblVar <> "aol_grop_bill_payment") {

				if ($aol_payment_plan->id->QueryStringValue == "") $aol_payment_plan->id->setSessionValue("");

			}

		} else {

			$this->sDbMasterFilter = $aol_payment_plan->getMasterFilter(); //  Restore master filter

			$this->sDbDetailFilter = $aol_payment_plan->getDetailFilter(); // Restore detail filter

		}

	}
 

	// Page Load event

	function Page_Load() {
 

		//echo "Page Load";

	}
 

	// Page Unload event

	function Page_Unload() {
 

		//echo "Page Unload";

	}
 

	// Form Custom Validate event

	function Form_CustomValidate(&$CustomError) {
 

		// Return error message in CustomError

		return TRUE;

	}

}

?>

Open in new window

deleterecord.JPG
0
Comment
Question by:teera
2 Comments
 
LVL 11

Accepted Solution

by:
bansidhar earned 300 total points
ID: 24026315
use print_r($_REQUEST) instead of print_r($_SESSION);
0
 
LVL 108

Assisted Solution

by:Ray Paseur
Ray Paseur earned 200 total points
ID: 24028660
There appear to be a few forms in the code posted above.  The forms submit information from a "form" page to an "action" script (denoted by "action=" in the <form> tag.

Forms usually submit via method="get" or method="post".  In the PHP action script, you can find the submitted information by looking at the superglobal arrays $_GET and $_POST.

HTH, ~Ray
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now