<?php
namespace PHPMaker2020\recetarios_2021;

// Autoload
include_once "autoload.php";

// Session
if (session_status() !== PHP_SESSION_ACTIVE)
	\Delight\Cookie\Session::start(Config("COOKIE_SAMESITE")); // Init session data

// Output buffering
ob_start();
?>
<?php

// Write header
WriteHeader(FALSE);

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

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

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

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

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

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

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

	// Dynamic selection lists
	// Filters

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// Render list options (body, left)
$remitente_list->ListOptions->render("body", "left", $remitente_list->RowCount);
?>
	<?php if ($remitente_list->id->Visible) { // id ?>
		<td data-name="id" <?php echo $remitente_list->id->cellAttributes() ?>>
<span id="el<?php echo $remitente_list->RowCount ?>_remitente_id">
<span<?php echo $remitente_list->id->viewAttributes() ?>><?php echo $remitente_list->id->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($remitente_list->Remitente->Visible) { // Remitente ?>
		<td data-name="Remitente" <?php echo $remitente_list->Remitente->cellAttributes() ?>>
<span id="el<?php echo $remitente_list->RowCount ?>_remitente_Remitente">
<span<?php echo $remitente_list->Remitente->viewAttributes() ?>><?php echo $remitente_list->Remitente->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
<?php

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

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