<?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_lab_ot_list = new kp_lab_ot_list();

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

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

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

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

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

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

	// Dynamic selection lists
	// Filters

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

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

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

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

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

// Render list options (header, left)
$kp_lab_ot_list->ListOptions->render("header", "left");
?>
<?php if ($kp_lab_ot_list->id_reg->Visible) { // id_reg ?>
	<?php if ($kp_lab_ot_list->SortUrl($kp_lab_ot_list->id_reg) == "") { ?>
		<th data-name="id_reg" class="<?php echo $kp_lab_ot_list->id_reg->headerCellClass() ?>"><div id="elh_kp_lab_ot_id_reg" class="kp_lab_ot_id_reg"><div class="ew-table-header-caption"><?php echo $kp_lab_ot_list->id_reg->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="id_reg" class="<?php echo $kp_lab_ot_list->id_reg->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $kp_lab_ot_list->SortUrl($kp_lab_ot_list->id_reg) ?>', 1);"><div id="elh_kp_lab_ot_id_reg" class="kp_lab_ot_id_reg">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $kp_lab_ot_list->id_reg->caption() ?></span><span class="ew-table-header-sort"><?php if ($kp_lab_ot_list->id_reg->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($kp_lab_ot_list->id_reg->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($kp_lab_ot_list->idempresa->Visible) { // idempresa ?>
	<?php if ($kp_lab_ot_list->SortUrl($kp_lab_ot_list->idempresa) == "") { ?>
		<th data-name="idempresa" class="<?php echo $kp_lab_ot_list->idempresa->headerCellClass() ?>"><div id="elh_kp_lab_ot_idempresa" class="kp_lab_ot_idempresa"><div class="ew-table-header-caption"><?php echo $kp_lab_ot_list->idempresa->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="idempresa" class="<?php echo $kp_lab_ot_list->idempresa->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $kp_lab_ot_list->SortUrl($kp_lab_ot_list->idempresa) ?>', 1);"><div id="elh_kp_lab_ot_idempresa" class="kp_lab_ot_idempresa">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $kp_lab_ot_list->idempresa->caption() ?><?php echo $Language->phrase("SrchLegend") ?></span><span class="ew-table-header-sort"><?php if ($kp_lab_ot_list->idempresa->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($kp_lab_ot_list->idempresa->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($kp_lab_ot_list->numero->Visible) { // numero ?>
	<?php if ($kp_lab_ot_list->SortUrl($kp_lab_ot_list->numero) == "") { ?>
		<th data-name="numero" class="<?php echo $kp_lab_ot_list->numero->headerCellClass() ?>"><div id="elh_kp_lab_ot_numero" class="kp_lab_ot_numero"><div class="ew-table-header-caption"><?php echo $kp_lab_ot_list->numero->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="numero" class="<?php echo $kp_lab_ot_list->numero->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $kp_lab_ot_list->SortUrl($kp_lab_ot_list->numero) ?>', 1);"><div id="elh_kp_lab_ot_numero" class="kp_lab_ot_numero">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $kp_lab_ot_list->numero->caption() ?><?php echo $Language->phrase("SrchLegend") ?></span><span class="ew-table-header-sort"><?php if ($kp_lab_ot_list->numero->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($kp_lab_ot_list->numero->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($kp_lab_ot_list->fecha->Visible) { // fecha ?>
	<?php if ($kp_lab_ot_list->SortUrl($kp_lab_ot_list->fecha) == "") { ?>
		<th data-name="fecha" class="<?php echo $kp_lab_ot_list->fecha->headerCellClass() ?>"><div id="elh_kp_lab_ot_fecha" class="kp_lab_ot_fecha"><div class="ew-table-header-caption"><?php echo $kp_lab_ot_list->fecha->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="fecha" class="<?php echo $kp_lab_ot_list->fecha->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $kp_lab_ot_list->SortUrl($kp_lab_ot_list->fecha) ?>', 1);"><div id="elh_kp_lab_ot_fecha" class="kp_lab_ot_fecha">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $kp_lab_ot_list->fecha->caption() ?></span><span class="ew-table-header-sort"><?php if ($kp_lab_ot_list->fecha->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($kp_lab_ot_list->fecha->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($kp_lab_ot_list->tipocompra->Visible) { // tipocompra ?>
	<?php if ($kp_lab_ot_list->SortUrl($kp_lab_ot_list->tipocompra) == "") { ?>
		<th data-name="tipocompra" class="<?php echo $kp_lab_ot_list->tipocompra->headerCellClass() ?>"><div id="elh_kp_lab_ot_tipocompra" class="kp_lab_ot_tipocompra"><div class="ew-table-header-caption"><?php echo $kp_lab_ot_list->tipocompra->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="tipocompra" class="<?php echo $kp_lab_ot_list->tipocompra->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $kp_lab_ot_list->SortUrl($kp_lab_ot_list->tipocompra) ?>', 1);"><div id="elh_kp_lab_ot_tipocompra" class="kp_lab_ot_tipocompra">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $kp_lab_ot_list->tipocompra->caption() ?><?php echo $Language->phrase("SrchLegend") ?></span><span class="ew-table-header-sort"><?php if ($kp_lab_ot_list->tipocompra->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($kp_lab_ot_list->tipocompra->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($kp_lab_ot_list->cita->Visible) { // cita ?>
	<?php if ($kp_lab_ot_list->SortUrl($kp_lab_ot_list->cita) == "") { ?>
		<th data-name="cita" class="<?php echo $kp_lab_ot_list->cita->headerCellClass() ?>"><div id="elh_kp_lab_ot_cita" class="kp_lab_ot_cita"><div class="ew-table-header-caption"><?php echo $kp_lab_ot_list->cita->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="cita" class="<?php echo $kp_lab_ot_list->cita->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $kp_lab_ot_list->SortUrl($kp_lab_ot_list->cita) ?>', 1);"><div id="elh_kp_lab_ot_cita" class="kp_lab_ot_cita">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $kp_lab_ot_list->cita->caption() ?></span><span class="ew-table-header-sort"><?php if ($kp_lab_ot_list->cita->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($kp_lab_ot_list->cita->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($kp_lab_ot_list->estado->Visible) { // estado ?>
	<?php if ($kp_lab_ot_list->SortUrl($kp_lab_ot_list->estado) == "") { ?>
		<th data-name="estado" class="<?php echo $kp_lab_ot_list->estado->headerCellClass() ?>"><div id="elh_kp_lab_ot_estado" class="kp_lab_ot_estado"><div class="ew-table-header-caption"><?php echo $kp_lab_ot_list->estado->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="estado" class="<?php echo $kp_lab_ot_list->estado->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $kp_lab_ot_list->SortUrl($kp_lab_ot_list->estado) ?>', 1);"><div id="elh_kp_lab_ot_estado" class="kp_lab_ot_estado">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $kp_lab_ot_list->estado->caption() ?></span><span class="ew-table-header-sort"><?php if ($kp_lab_ot_list->estado->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($kp_lab_ot_list->estado->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($kp_lab_ot_list->fecha_enviado->Visible) { // fecha_enviado ?>
	<?php if ($kp_lab_ot_list->SortUrl($kp_lab_ot_list->fecha_enviado) == "") { ?>
		<th data-name="fecha_enviado" class="<?php echo $kp_lab_ot_list->fecha_enviado->headerCellClass() ?>"><div id="elh_kp_lab_ot_fecha_enviado" class="kp_lab_ot_fecha_enviado"><div class="ew-table-header-caption"><?php echo $kp_lab_ot_list->fecha_enviado->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="fecha_enviado" class="<?php echo $kp_lab_ot_list->fecha_enviado->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $kp_lab_ot_list->SortUrl($kp_lab_ot_list->fecha_enviado) ?>', 1);"><div id="elh_kp_lab_ot_fecha_enviado" class="kp_lab_ot_fecha_enviado">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $kp_lab_ot_list->fecha_enviado->caption() ?></span><span class="ew-table-header-sort"><?php if ($kp_lab_ot_list->fecha_enviado->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($kp_lab_ot_list->fecha_enviado->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($kp_lab_ot_list->fecha_asignada->Visible) { // fecha_asignada ?>
	<?php if ($kp_lab_ot_list->SortUrl($kp_lab_ot_list->fecha_asignada) == "") { ?>
		<th data-name="fecha_asignada" class="<?php echo $kp_lab_ot_list->fecha_asignada->headerCellClass() ?>"><div id="elh_kp_lab_ot_fecha_asignada" class="kp_lab_ot_fecha_asignada"><div class="ew-table-header-caption"><?php echo $kp_lab_ot_list->fecha_asignada->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="fecha_asignada" class="<?php echo $kp_lab_ot_list->fecha_asignada->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $kp_lab_ot_list->SortUrl($kp_lab_ot_list->fecha_asignada) ?>', 1);"><div id="elh_kp_lab_ot_fecha_asignada" class="kp_lab_ot_fecha_asignada">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $kp_lab_ot_list->fecha_asignada->caption() ?></span><span class="ew-table-header-sort"><?php if ($kp_lab_ot_list->fecha_asignada->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($kp_lab_ot_list->fecha_asignada->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($kp_lab_ot_list->fecha_inicio->Visible) { // fecha_inicio ?>
	<?php if ($kp_lab_ot_list->SortUrl($kp_lab_ot_list->fecha_inicio) == "") { ?>
		<th data-name="fecha_inicio" class="<?php echo $kp_lab_ot_list->fecha_inicio->headerCellClass() ?>"><div id="elh_kp_lab_ot_fecha_inicio" class="kp_lab_ot_fecha_inicio"><div class="ew-table-header-caption"><?php echo $kp_lab_ot_list->fecha_inicio->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="fecha_inicio" class="<?php echo $kp_lab_ot_list->fecha_inicio->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $kp_lab_ot_list->SortUrl($kp_lab_ot_list->fecha_inicio) ?>', 1);"><div id="elh_kp_lab_ot_fecha_inicio" class="kp_lab_ot_fecha_inicio">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $kp_lab_ot_list->fecha_inicio->caption() ?></span><span class="ew-table-header-sort"><?php if ($kp_lab_ot_list->fecha_inicio->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($kp_lab_ot_list->fecha_inicio->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($kp_lab_ot_list->fecha_fin->Visible) { // fecha_fin ?>
	<?php if ($kp_lab_ot_list->SortUrl($kp_lab_ot_list->fecha_fin) == "") { ?>
		<th data-name="fecha_fin" class="<?php echo $kp_lab_ot_list->fecha_fin->headerCellClass() ?>"><div id="elh_kp_lab_ot_fecha_fin" class="kp_lab_ot_fecha_fin"><div class="ew-table-header-caption"><?php echo $kp_lab_ot_list->fecha_fin->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="fecha_fin" class="<?php echo $kp_lab_ot_list->fecha_fin->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $kp_lab_ot_list->SortUrl($kp_lab_ot_list->fecha_fin) ?>', 1);"><div id="elh_kp_lab_ot_fecha_fin" class="kp_lab_ot_fecha_fin">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $kp_lab_ot_list->fecha_fin->caption() ?></span><span class="ew-table-header-sort"><?php if ($kp_lab_ot_list->fecha_fin->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($kp_lab_ot_list->fecha_fin->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php

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

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

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

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

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

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

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

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

// Render list options (body, left)
$kp_lab_ot_list->ListOptions->render("body", "left", $kp_lab_ot_list->RowCount);
?>
	<?php if ($kp_lab_ot_list->id_reg->Visible) { // id_reg ?>
		<td data-name="id_reg" <?php echo $kp_lab_ot_list->id_reg->cellAttributes() ?>>
<span id="el<?php echo $kp_lab_ot_list->RowCount ?>_kp_lab_ot_id_reg" class="kp_lab_ot_id_reg">
<span<?php echo $kp_lab_ot_list->id_reg->viewAttributes() ?>><?php echo $kp_lab_ot_list->id_reg->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($kp_lab_ot_list->idempresa->Visible) { // idempresa ?>
		<td data-name="idempresa" <?php echo $kp_lab_ot_list->idempresa->cellAttributes() ?>>
<span id="el<?php echo $kp_lab_ot_list->RowCount ?>_kp_lab_ot_idempresa" class="kp_lab_ot_idempresa">
<span<?php echo $kp_lab_ot_list->idempresa->viewAttributes() ?>><?php echo $kp_lab_ot_list->idempresa->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($kp_lab_ot_list->numero->Visible) { // numero ?>
		<td data-name="numero" <?php echo $kp_lab_ot_list->numero->cellAttributes() ?>>
<span id="el<?php echo $kp_lab_ot_list->RowCount ?>_kp_lab_ot_numero" class="kp_lab_ot_numero">
<span<?php echo $kp_lab_ot_list->numero->viewAttributes() ?>><?php echo $kp_lab_ot_list->numero->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($kp_lab_ot_list->fecha->Visible) { // fecha ?>
		<td data-name="fecha" <?php echo $kp_lab_ot_list->fecha->cellAttributes() ?>>
<span id="el<?php echo $kp_lab_ot_list->RowCount ?>_kp_lab_ot_fecha" class="kp_lab_ot_fecha">
<span<?php echo $kp_lab_ot_list->fecha->viewAttributes() ?>><?php echo $kp_lab_ot_list->fecha->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($kp_lab_ot_list->tipocompra->Visible) { // tipocompra ?>
		<td data-name="tipocompra" <?php echo $kp_lab_ot_list->tipocompra->cellAttributes() ?>>
<span id="el<?php echo $kp_lab_ot_list->RowCount ?>_kp_lab_ot_tipocompra" class="kp_lab_ot_tipocompra">
<span<?php echo $kp_lab_ot_list->tipocompra->viewAttributes() ?>><?php echo $kp_lab_ot_list->tipocompra->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($kp_lab_ot_list->cita->Visible) { // cita ?>
		<td data-name="cita" <?php echo $kp_lab_ot_list->cita->cellAttributes() ?>>
<span id="el<?php echo $kp_lab_ot_list->RowCount ?>_kp_lab_ot_cita" class="kp_lab_ot_cita">
<span<?php echo $kp_lab_ot_list->cita->viewAttributes() ?>><?php echo $kp_lab_ot_list->cita->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($kp_lab_ot_list->estado->Visible) { // estado ?>
		<td data-name="estado" <?php echo $kp_lab_ot_list->estado->cellAttributes() ?>>
<span id="el<?php echo $kp_lab_ot_list->RowCount ?>_kp_lab_ot_estado" class="kp_lab_ot_estado">
<span<?php echo $kp_lab_ot_list->estado->viewAttributes() ?>><?php echo $kp_lab_ot_list->estado->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($kp_lab_ot_list->fecha_enviado->Visible) { // fecha_enviado ?>
		<td data-name="fecha_enviado" <?php echo $kp_lab_ot_list->fecha_enviado->cellAttributes() ?>>
<span id="el<?php echo $kp_lab_ot_list->RowCount ?>_kp_lab_ot_fecha_enviado" class="kp_lab_ot_fecha_enviado">
<span<?php echo $kp_lab_ot_list->fecha_enviado->viewAttributes() ?>><?php echo $kp_lab_ot_list->fecha_enviado->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($kp_lab_ot_list->fecha_asignada->Visible) { // fecha_asignada ?>
		<td data-name="fecha_asignada" <?php echo $kp_lab_ot_list->fecha_asignada->cellAttributes() ?>>
<span id="el<?php echo $kp_lab_ot_list->RowCount ?>_kp_lab_ot_fecha_asignada" class="kp_lab_ot_fecha_asignada">
<span<?php echo $kp_lab_ot_list->fecha_asignada->viewAttributes() ?>><?php echo $kp_lab_ot_list->fecha_asignada->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($kp_lab_ot_list->fecha_inicio->Visible) { // fecha_inicio ?>
		<td data-name="fecha_inicio" <?php echo $kp_lab_ot_list->fecha_inicio->cellAttributes() ?>>
<span id="el<?php echo $kp_lab_ot_list->RowCount ?>_kp_lab_ot_fecha_inicio" class="kp_lab_ot_fecha_inicio">
<span<?php echo $kp_lab_ot_list->fecha_inicio->viewAttributes() ?>><?php echo $kp_lab_ot_list->fecha_inicio->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($kp_lab_ot_list->fecha_fin->Visible) { // fecha_fin ?>
		<td data-name="fecha_fin" <?php echo $kp_lab_ot_list->fecha_fin->cellAttributes() ?>>
<span id="el<?php echo $kp_lab_ot_list->RowCount ?>_kp_lab_ot_fecha_fin" class="kp_lab_ot_fecha_fin">
<span<?php echo $kp_lab_ot_list->fecha_fin->viewAttributes() ?>><?php echo $kp_lab_ot_list->fecha_fin->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
<?php

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

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