<?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
$ubigeo_peru_departments_list = new ubigeo_peru_departments_list();

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

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

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

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

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

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

	// Dynamic selection lists
	// Filters

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

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

});
</script>
<?php } ?>
<?php if (!$ubigeo_peru_departments_list->isExport()) { ?>
<div class="btn-toolbar ew-toolbar">
<?php if ($ubigeo_peru_departments_list->TotalRecords > 0 && $ubigeo_peru_departments_list->ExportOptions->visible()) { ?>
<?php $ubigeo_peru_departments_list->ExportOptions->render("body") ?>
<?php } ?>
<?php if ($ubigeo_peru_departments_list->ImportOptions->visible()) { ?>
<?php $ubigeo_peru_departments_list->ImportOptions->render("body") ?>
<?php } ?>
<?php if ($ubigeo_peru_departments_list->SearchOptions->visible()) { ?>
<?php $ubigeo_peru_departments_list->SearchOptions->render("body") ?>
<?php } ?>
<?php if ($ubigeo_peru_departments_list->FilterOptions->visible()) { ?>
<?php $ubigeo_peru_departments_list->FilterOptions->render("body") ?>
<?php } ?>
<div class="clearfix"></div>
</div>
<?php } ?>
<?php
$ubigeo_peru_departments_list->renderOtherOptions();
?>
<?php if ($Security->CanSearch()) { ?>
<?php if (!$ubigeo_peru_departments_list->isExport() && !$ubigeo_peru_departments->CurrentAction) { ?>
<form name="fubigeo_peru_departmentslistsrch" id="fubigeo_peru_departmentslistsrch" class="form-inline ew-form ew-ext-search-form" action="<?php echo CurrentPageName() ?>">
<div id="fubigeo_peru_departmentslistsrch-search-panel" class="<?php echo $ubigeo_peru_departments_list->SearchPanelClass ?>">
<input type="hidden" name="cmd" value="search">
<input type="hidden" name="t" value="ubigeo_peru_departments">
	<div class="ew-extended-search">
<div id="xsr_<?php echo $ubigeo_peru_departments_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($ubigeo_peru_departments_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($ubigeo_peru_departments_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 $ubigeo_peru_departments_list->BasicSearch->getTypeNameShort() ?></span></button>
			<div class="dropdown-menu dropdown-menu-right">
				<a class="dropdown-item<?php if ($ubigeo_peru_departments_list->BasicSearch->getType() == "") { ?> active<?php } ?>" href="#" onclick="return ew.setSearchType(this);"><?php echo $Language->phrase("QuickSearchAuto") ?></a>
				<a class="dropdown-item<?php if ($ubigeo_peru_departments_list->BasicSearch->getType() == "=") { ?> active<?php } ?>" href="#" onclick="return ew.setSearchType(this, '=');"><?php echo $Language->phrase("QuickSearchExact") ?></a>
				<a class="dropdown-item<?php if ($ubigeo_peru_departments_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 ($ubigeo_peru_departments_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 $ubigeo_peru_departments_list->showPageHeader(); ?>
<?php
$ubigeo_peru_departments_list->showMessage();
?>
<?php if ($ubigeo_peru_departments_list->TotalRecords > 0 || $ubigeo_peru_departments->CurrentAction) { ?>
<div class="card ew-card ew-grid<?php if ($ubigeo_peru_departments_list->isAddOrEdit()) { ?> ew-grid-add-edit<?php } ?> ubigeo_peru_departments">
<form name="fubigeo_peru_departmentslist" id="fubigeo_peru_departmentslist" 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="ubigeo_peru_departments">
<div id="gmp_ubigeo_peru_departments" class="<?php echo ResponsiveTableClass() ?>card-body ew-grid-middle-panel">
<?php if ($ubigeo_peru_departments_list->TotalRecords > 0 || $ubigeo_peru_departments_list->isGridEdit()) { ?>
<table id="tbl_ubigeo_peru_departmentslist" class="table ew-table"><!-- .ew-table -->
<thead>
	<tr class="ew-table-header">
<?php

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

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

// Render list options (header, left)
$ubigeo_peru_departments_list->ListOptions->render("header", "left");
?>
<?php if ($ubigeo_peru_departments_list->id->Visible) { // id ?>
	<?php if ($ubigeo_peru_departments_list->SortUrl($ubigeo_peru_departments_list->id) == "") { ?>
		<th data-name="id" class="<?php echo $ubigeo_peru_departments_list->id->headerCellClass() ?>"><div id="elh_ubigeo_peru_departments_id" class="ubigeo_peru_departments_id"><div class="ew-table-header-caption"><?php echo $ubigeo_peru_departments_list->id->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="id" class="<?php echo $ubigeo_peru_departments_list->id->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $ubigeo_peru_departments_list->SortUrl($ubigeo_peru_departments_list->id) ?>', 1);"><div id="elh_ubigeo_peru_departments_id" class="ubigeo_peru_departments_id">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $ubigeo_peru_departments_list->id->caption() ?><?php echo $Language->phrase("SrchLegend") ?></span><span class="ew-table-header-sort"><?php if ($ubigeo_peru_departments_list->id->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($ubigeo_peru_departments_list->id->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($ubigeo_peru_departments_list->name->Visible) { // name ?>
	<?php if ($ubigeo_peru_departments_list->SortUrl($ubigeo_peru_departments_list->name) == "") { ?>
		<th data-name="name" class="<?php echo $ubigeo_peru_departments_list->name->headerCellClass() ?>"><div id="elh_ubigeo_peru_departments_name" class="ubigeo_peru_departments_name"><div class="ew-table-header-caption"><?php echo $ubigeo_peru_departments_list->name->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="name" class="<?php echo $ubigeo_peru_departments_list->name->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $ubigeo_peru_departments_list->SortUrl($ubigeo_peru_departments_list->name) ?>', 1);"><div id="elh_ubigeo_peru_departments_name" class="ubigeo_peru_departments_name">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $ubigeo_peru_departments_list->name->caption() ?><?php echo $Language->phrase("SrchLegend") ?></span><span class="ew-table-header-sort"><?php if ($ubigeo_peru_departments_list->name->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($ubigeo_peru_departments_list->name->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($ubigeo_peru_departments_list->id_pais->Visible) { // id_pais ?>
	<?php if ($ubigeo_peru_departments_list->SortUrl($ubigeo_peru_departments_list->id_pais) == "") { ?>
		<th data-name="id_pais" class="<?php echo $ubigeo_peru_departments_list->id_pais->headerCellClass() ?>"><div id="elh_ubigeo_peru_departments_id_pais" class="ubigeo_peru_departments_id_pais"><div class="ew-table-header-caption"><?php echo $ubigeo_peru_departments_list->id_pais->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="id_pais" class="<?php echo $ubigeo_peru_departments_list->id_pais->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $ubigeo_peru_departments_list->SortUrl($ubigeo_peru_departments_list->id_pais) ?>', 1);"><div id="elh_ubigeo_peru_departments_id_pais" class="ubigeo_peru_departments_id_pais">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $ubigeo_peru_departments_list->id_pais->caption() ?></span><span class="ew-table-header-sort"><?php if ($ubigeo_peru_departments_list->id_pais->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($ubigeo_peru_departments_list->id_pais->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php

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

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

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

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

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

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

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

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

// Render list options (body, left)
$ubigeo_peru_departments_list->ListOptions->render("body", "left", $ubigeo_peru_departments_list->RowCount);
?>
	<?php if ($ubigeo_peru_departments_list->id->Visible) { // id ?>
		<td data-name="id" <?php echo $ubigeo_peru_departments_list->id->cellAttributes() ?>>
<span id="el<?php echo $ubigeo_peru_departments_list->RowCount ?>_ubigeo_peru_departments_id" class="ubigeo_peru_departments_id">
<span<?php echo $ubigeo_peru_departments_list->id->viewAttributes() ?>><?php echo $ubigeo_peru_departments_list->id->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($ubigeo_peru_departments_list->name->Visible) { // name ?>
		<td data-name="name" <?php echo $ubigeo_peru_departments_list->name->cellAttributes() ?>>
<span id="el<?php echo $ubigeo_peru_departments_list->RowCount ?>_ubigeo_peru_departments_name" class="ubigeo_peru_departments_name">
<span<?php echo $ubigeo_peru_departments_list->name->viewAttributes() ?>><?php echo $ubigeo_peru_departments_list->name->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($ubigeo_peru_departments_list->id_pais->Visible) { // id_pais ?>
		<td data-name="id_pais" <?php echo $ubigeo_peru_departments_list->id_pais->cellAttributes() ?>>
<span id="el<?php echo $ubigeo_peru_departments_list->RowCount ?>_ubigeo_peru_departments_id_pais" class="ubigeo_peru_departments_id_pais">
<span<?php echo $ubigeo_peru_departments_list->id_pais->viewAttributes() ?>><?php echo $ubigeo_peru_departments_list->id_pais->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
<?php

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

// Close recordset
if ($ubigeo_peru_departments_list->Recordset)
	$ubigeo_peru_departments_list->Recordset->Close();
?>
<?php if (!$ubigeo_peru_departments_list->isExport()) { ?>
<div class="card-footer ew-grid-lower-panel">
<?php if (!$ubigeo_peru_departments_list->isGridAdd()) { ?>
<form name="ew-pager-form" class="form-inline ew-form ew-pager-form" action="<?php echo CurrentPageName() ?>">
<?php echo $ubigeo_peru_departments_list->Pager->render() ?>
</form>
<?php } ?>
<div class="ew-list-other-options">
<?php $ubigeo_peru_departments_list->OtherOptions->render("body", "bottom") ?>
</div>
<div class="clearfix"></div>
</div>
<?php } ?>
</div><!-- /.ew-grid -->
<?php } ?>
<?php if ($ubigeo_peru_departments_list->TotalRecords == 0 && !$ubigeo_peru_departments->CurrentAction) { // Show other options ?>
<div class="ew-list-other-options">
<?php $ubigeo_peru_departments_list->OtherOptions->render("body") ?>
</div>
<div class="clearfix"></div>
<?php } ?>
<?php
$ubigeo_peru_departments_list->showPageFooter();
if (Config("DEBUG"))
	echo GetDebugMessage();
?>
<?php if (!$ubigeo_peru_departments_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
$ubigeo_peru_departments_list->terminate();
?>