<?php
namespace PHPMaker2020\project2;

// Session
if (session_status() !== PHP_SESSION_ACTIVE)
	session_start(); // Init session data

// Output buffering
ob_start();

// Autoload
include_once "autoload.php";
?>
<?php

// Write header
WriteHeader(FALSE);

// Create page object
$kp_ubigeos_list = new kp_ubigeos_list();

// Run the page
$kp_ubigeos_list->run();

// Setup login status
SetupLoginStatus();
SetClientVar("login", LoginStatus());

// Global Page Rendering event (in userfn*.php)
Page_Rendering();

// Page Rendering event
$kp_ubigeos_list->Page_Render();
?>
<?php include_once "header.php"; ?>
<?php if (!$kp_ubigeos_list->isExport()) { ?>
<script>
var fkp_ubigeoslist, currentPageID;
loadjs.ready("head", function() {

	// Form object
	currentPageID = ew.PAGE_ID = "list";
	fkp_ubigeoslist = currentForm = new ew.Form("fkp_ubigeoslist", "list");
	fkp_ubigeoslist.formKeyCountName = '<?php echo $kp_ubigeos_list->FormKeyCountName ?>';
	loadjs.done("fkp_ubigeoslist");
});
var fkp_ubigeoslistsrch;
loadjs.ready("head", function() {

	// Form object for search
	fkp_ubigeoslistsrch = currentSearchForm = new ew.Form("fkp_ubigeoslistsrch");

	// Dynamic selection lists
	// Filters

	fkp_ubigeoslistsrch.filterList = <?php echo $kp_ubigeos_list->getFilterList() ?>;
	loadjs.done("fkp_ubigeoslistsrch");
});
</script>
<script>
loadjs.ready("head", function() {

	// Client script
	// Write your client script here, no need to add script tags.

});
</script>
<?php } ?>
<?php if (!$kp_ubigeos_list->isExport()) { ?>
<div class="btn-toolbar ew-toolbar">
<?php if ($kp_ubigeos_list->TotalRecords > 0 && $kp_ubigeos_list->ExportOptions->visible()) { ?>
<?php $kp_ubigeos_list->ExportOptions->render("body") ?>
<?php } ?>
<?php if ($kp_ubigeos_list->ImportOptions->visible()) { ?>
<?php $kp_ubigeos_list->ImportOptions->render("body") ?>
<?php } ?>
<?php if ($kp_ubigeos_list->SearchOptions->visible()) { ?>
<?php $kp_ubigeos_list->SearchOptions->render("body") ?>
<?php } ?>
<?php if ($kp_ubigeos_list->FilterOptions->visible()) { ?>
<?php $kp_ubigeos_list->FilterOptions->render("body") ?>
<?php } ?>
<div class="clearfix"></div>
</div>
<?php } ?>
<?php
$kp_ubigeos_list->renderOtherOptions();
?>
<?php if ($Security->CanSearch()) { ?>
<?php if (!$kp_ubigeos_list->isExport() && !$kp_ubigeos->CurrentAction) { ?>
<form name="fkp_ubigeoslistsrch" id="fkp_ubigeoslistsrch" class="form-inline ew-form ew-ext-search-form" action="<?php echo CurrentPageName() ?>">
<div id="fkp_ubigeoslistsrch-search-panel" class="<?php echo $kp_ubigeos_list->SearchPanelClass ?>">
<input type="hidden" name="cmd" value="search">
<input type="hidden" name="t" value="kp_ubigeos">
	<div class="ew-extended-search">
<div id="xsr_<?php echo $kp_ubigeos_list->SearchRowCount + 1 ?>" class="ew-row d-sm-flex">
	<div class="ew-quick-search input-group">
		<input type="text" name="<?php echo Config("TABLE_BASIC_SEARCH") ?>" id="<?php echo Config("TABLE_BASIC_SEARCH") ?>" class="form-control" value="<?php echo HtmlEncode($kp_ubigeos_list->BasicSearch->getKeyword()) ?>" placeholder="<?php echo HtmlEncode($Language->phrase("Search")) ?>">
		<input type="hidden" name="<?php echo Config("TABLE_BASIC_SEARCH_TYPE") ?>" id="<?php echo Config("TABLE_BASIC_SEARCH_TYPE") ?>" value="<?php echo HtmlEncode($kp_ubigeos_list->BasicSearch->getType()) ?>">
		<div class="input-group-append">
			<button class="btn btn-primary" name="btn-submit" id="btn-submit" type="submit"><?php echo $Language->phrase("SearchBtn") ?></button>
			<button type="button" data-toggle="dropdown" class="btn btn-primary dropdown-toggle dropdown-toggle-split" aria-haspopup="true" aria-expanded="false"><span id="searchtype"><?php echo $kp_ubigeos_list->BasicSearch->getTypeNameShort() ?></span></button>
			<div class="dropdown-menu dropdown-menu-right">
				<a class="dropdown-item<?php if ($kp_ubigeos_list->BasicSearch->getType() == "") { ?> active<?php } ?>" href="#" onclick="return ew.setSearchType(this);"><?php echo $Language->phrase("QuickSearchAuto") ?></a>
				<a class="dropdown-item<?php if ($kp_ubigeos_list->BasicSearch->getType() == "=") { ?> active<?php } ?>" href="#" onclick="return ew.setSearchType(this, '=');"><?php echo $Language->phrase("QuickSearchExact") ?></a>
				<a class="dropdown-item<?php if ($kp_ubigeos_list->BasicSearch->getType() == "AND") { ?> active<?php } ?>" href="#" onclick="return ew.setSearchType(this, 'AND');"><?php echo $Language->phrase("QuickSearchAll") ?></a>
				<a class="dropdown-item<?php if ($kp_ubigeos_list->BasicSearch->getType() == "OR") { ?> active<?php } ?>" href="#" onclick="return ew.setSearchType(this, 'OR');"><?php echo $Language->phrase("QuickSearchAny") ?></a>
			</div>
		</div>
	</div>
</div>
	</div><!-- /.ew-extended-search -->
</div><!-- /.ew-search-panel -->
</form>
<?php } ?>
<?php } ?>
<?php $kp_ubigeos_list->showPageHeader(); ?>
<?php
$kp_ubigeos_list->showMessage();
?>
<?php if ($kp_ubigeos_list->TotalRecords > 0 || $kp_ubigeos->CurrentAction) { ?>
<div class="card ew-card ew-grid<?php if ($kp_ubigeos_list->isAddOrEdit()) { ?> ew-grid-add-edit<?php } ?> kp_ubigeos">
<form name="fkp_ubigeoslist" id="fkp_ubigeoslist" class="form-inline ew-form ew-list-form" action="<?php echo CurrentPageName() ?>" method="post">
<?php if ($Page->CheckToken) { ?>
<input type="hidden" name="<?php echo Config("TOKEN_NAME") ?>" value="<?php echo $Page->Token ?>">
<?php } ?>
<input type="hidden" name="t" value="kp_ubigeos">
<div id="gmp_kp_ubigeos" class="<?php echo ResponsiveTableClass() ?>card-body ew-grid-middle-panel">
<?php if ($kp_ubigeos_list->TotalRecords > 0 || $kp_ubigeos_list->isGridEdit()) { ?>
<table id="tbl_kp_ubigeoslist" class="table ew-table"><!-- .ew-table -->
<thead>
	<tr class="ew-table-header">
<?php

// Header row
$kp_ubigeos->RowType = ROWTYPE_HEADER;

// Render list options
$kp_ubigeos_list->renderListOptions();

// Render list options (header, left)
$kp_ubigeos_list->ListOptions->render("header", "left");
?>
<?php if ($kp_ubigeos_list->codubigeo->Visible) { // codubigeo ?>
	<?php if ($kp_ubigeos_list->SortUrl($kp_ubigeos_list->codubigeo) == "") { ?>
		<th data-name="codubigeo" class="<?php echo $kp_ubigeos_list->codubigeo->headerCellClass() ?>"><div id="elh_kp_ubigeos_codubigeo" class="kp_ubigeos_codubigeo"><div class="ew-table-header-caption"><?php echo $kp_ubigeos_list->codubigeo->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="codubigeo" class="<?php echo $kp_ubigeos_list->codubigeo->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $kp_ubigeos_list->SortUrl($kp_ubigeos_list->codubigeo) ?>', 1);"><div id="elh_kp_ubigeos_codubigeo" class="kp_ubigeos_codubigeo">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $kp_ubigeos_list->codubigeo->caption() ?><?php echo $Language->phrase("SrchLegend") ?></span><span class="ew-table-header-sort"><?php if ($kp_ubigeos_list->codubigeo->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($kp_ubigeos_list->codubigeo->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($kp_ubigeos_list->codruta->Visible) { // codruta ?>
	<?php if ($kp_ubigeos_list->SortUrl($kp_ubigeos_list->codruta) == "") { ?>
		<th data-name="codruta" class="<?php echo $kp_ubigeos_list->codruta->headerCellClass() ?>"><div id="elh_kp_ubigeos_codruta" class="kp_ubigeos_codruta"><div class="ew-table-header-caption"><?php echo $kp_ubigeos_list->codruta->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="codruta" class="<?php echo $kp_ubigeos_list->codruta->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $kp_ubigeos_list->SortUrl($kp_ubigeos_list->codruta) ?>', 1);"><div id="elh_kp_ubigeos_codruta" class="kp_ubigeos_codruta">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $kp_ubigeos_list->codruta->caption() ?><?php echo $Language->phrase("SrchLegend") ?></span><span class="ew-table-header-sort"><?php if ($kp_ubigeos_list->codruta->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($kp_ubigeos_list->codruta->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php

// Render list options (header, right)
$kp_ubigeos_list->ListOptions->render("header", "right");
?>
	</tr>
</thead>
<tbody>
<?php
if ($kp_ubigeos_list->ExportAll && $kp_ubigeos_list->isExport()) {
	$kp_ubigeos_list->StopRecord = $kp_ubigeos_list->TotalRecords;
} else {

	// Set the last record to display
	if ($kp_ubigeos_list->TotalRecords > $kp_ubigeos_list->StartRecord + $kp_ubigeos_list->DisplayRecords - 1)
		$kp_ubigeos_list->StopRecord = $kp_ubigeos_list->StartRecord + $kp_ubigeos_list->DisplayRecords - 1;
	else
		$kp_ubigeos_list->StopRecord = $kp_ubigeos_list->TotalRecords;
}
$kp_ubigeos_list->RecordCount = $kp_ubigeos_list->StartRecord - 1;
if ($kp_ubigeos_list->Recordset && !$kp_ubigeos_list->Recordset->EOF) {
	$kp_ubigeos_list->Recordset->moveFirst();
	$selectLimit = $kp_ubigeos_list->UseSelectLimit;
	if (!$selectLimit && $kp_ubigeos_list->StartRecord > 1)
		$kp_ubigeos_list->Recordset->move($kp_ubigeos_list->StartRecord - 1);
} elseif (!$kp_ubigeos->AllowAddDeleteRow && $kp_ubigeos_list->StopRecord == 0) {
	$kp_ubigeos_list->StopRecord = $kp_ubigeos->GridAddRowCount;
}

// Initialize aggregate
$kp_ubigeos->RowType = ROWTYPE_AGGREGATEINIT;
$kp_ubigeos->resetAttributes();
$kp_ubigeos_list->renderRow();
while ($kp_ubigeos_list->RecordCount < $kp_ubigeos_list->StopRecord) {
	$kp_ubigeos_list->RecordCount++;
	if ($kp_ubigeos_list->RecordCount >= $kp_ubigeos_list->StartRecord) {
		$kp_ubigeos_list->RowCount++;

		// Set up key count
		$kp_ubigeos_list->KeyCount = $kp_ubigeos_list->RowIndex;

		// Init row class and style
		$kp_ubigeos->resetAttributes();
		$kp_ubigeos->CssClass = "";
		if ($kp_ubigeos_list->isGridAdd()) {
		} else {
			$kp_ubigeos_list->loadRowValues($kp_ubigeos_list->Recordset); // Load row values
		}
		$kp_ubigeos->RowType = ROWTYPE_VIEW; // Render view

		// Set up row id / data-rowindex
		$kp_ubigeos->RowAttrs->merge(["data-rowindex" => $kp_ubigeos_list->RowCount, "id" => "r" . $kp_ubigeos_list->RowCount . "_kp_ubigeos", "data-rowtype" => $kp_ubigeos->RowType]);

		// Render row
		$kp_ubigeos_list->renderRow();

		// Render list options
		$kp_ubigeos_list->renderListOptions();
?>
	<tr <?php echo $kp_ubigeos->rowAttributes() ?>>
<?php

// Render list options (body, left)
$kp_ubigeos_list->ListOptions->render("body", "left", $kp_ubigeos_list->RowCount);
?>
	<?php if ($kp_ubigeos_list->codubigeo->Visible) { // codubigeo ?>
		<td data-name="codubigeo" <?php echo $kp_ubigeos_list->codubigeo->cellAttributes() ?>>
<span id="el<?php echo $kp_ubigeos_list->RowCount ?>_kp_ubigeos_codubigeo" class="kp_ubigeos_codubigeo">
<span<?php echo $kp_ubigeos_list->codubigeo->viewAttributes() ?>><?php echo $kp_ubigeos_list->codubigeo->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($kp_ubigeos_list->codruta->Visible) { // codruta ?>
		<td data-name="codruta" <?php echo $kp_ubigeos_list->codruta->cellAttributes() ?>>
<span id="el<?php echo $kp_ubigeos_list->RowCount ?>_kp_ubigeos_codruta" class="kp_ubigeos_codruta">
<span<?php echo $kp_ubigeos_list->codruta->viewAttributes() ?>><?php echo $kp_ubigeos_list->codruta->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
<?php

// Render list options (body, right)
$kp_ubigeos_list->ListOptions->render("body", "right", $kp_ubigeos_list->RowCount);
?>
	</tr>
<?php
	}
	if (!$kp_ubigeos_list->isGridAdd())
		$kp_ubigeos_list->Recordset->moveNext();
}
?>
</tbody>
</table><!-- /.ew-table -->
<?php } ?>
</div><!-- /.ew-grid-middle-panel -->
<?php if (!$kp_ubigeos->CurrentAction) { ?>
<input type="hidden" name="action" id="action" value="">
<?php } ?>
</form><!-- /.ew-list-form -->
<?php

// Close recordset
if ($kp_ubigeos_list->Recordset)
	$kp_ubigeos_list->Recordset->Close();
?>
<?php if (!$kp_ubigeos_list->isExport()) { ?>
<div class="card-footer ew-grid-lower-panel">
<?php if (!$kp_ubigeos_list->isGridAdd()) { ?>
<form name="ew-pager-form" class="form-inline ew-form ew-pager-form" action="<?php echo CurrentPageName() ?>">
<?php echo $kp_ubigeos_list->Pager->render() ?>
</form>
<?php } ?>
<div class="ew-list-other-options">
<?php $kp_ubigeos_list->OtherOptions->render("body", "bottom") ?>
</div>
<div class="clearfix"></div>
</div>
<?php } ?>
</div><!-- /.ew-grid -->
<?php } ?>
<?php if ($kp_ubigeos_list->TotalRecords == 0 && !$kp_ubigeos->CurrentAction) { // Show other options ?>
<div class="ew-list-other-options">
<?php $kp_ubigeos_list->OtherOptions->render("body") ?>
</div>
<div class="clearfix"></div>
<?php } ?>
<?php
$kp_ubigeos_list->showPageFooter();
if (Config("DEBUG"))
	echo GetDebugMessage();
?>
<?php if (!$kp_ubigeos_list->isExport()) { ?>
<script>
loadjs.ready("load", function() {

	// Startup script
	// Write your table-specific startup script here
	// console.log("page loaded");

});
</script>
<?php } ?>
<?php include_once "footer.php"; ?>
<?php
$kp_ubigeos_list->terminate();
?>