<?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 "solicitudes_onlineinfo.php" ?>
<?php include "usuarioinfo.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
$solicitudes_online_list = new csolicitudes_online_list();
$Page =& $solicitudes_online_list;

// Page init processing
$solicitudes_online_list->Page_Init();

// Page main processing
$solicitudes_online_list->Page_Main();
?>
<?php include "header.php" ?>
<?php if ($solicitudes_online->Export == "") { ?>
<script type="text/javascript">
<!--

// Create page object
var solicitudes_online_list = new ew_Page("solicitudes_online_list");

// page properties
solicitudes_online_list.PageID = "list"; // page ID
var EW_PAGE_ID = solicitudes_online_list.PageID; // for backward compatibility

// extend page with Form_CustomValidate function
solicitudes_online_list.Form_CustomValidate = 
 function(fobj) { // DO NOT CHANGE THIS LINE!

 	// Your custom validation code here, return false if invalid. 
 	return true;
 }
<?php if (EW_CLIENT_VALIDATE) { ?>
solicitudes_online_list.ValidateRequired = true; // uses JavaScript validation
<?php } else { ?>
solicitudes_online_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 ($solicitudes_online->Export == "") { ?>
<?php } ?>
<?php
	$bSelectLimit = ($solicitudes_online->Export == "" && $solicitudes_online->SelectLimit);
	if (!$bSelectLimit)
		$rs = $solicitudes_online_list->LoadRecordset();
	$solicitudes_online_list->lTotalRecs = ($bSelectLimit) ? $solicitudes_online->SelectRecordCount() : $rs->RecordCount();
	$solicitudes_online_list->lStartRec = 1;
	if ($solicitudes_online_list->lDisplayRecs <= 0) // Display all records
		$solicitudes_online_list->lDisplayRecs = $solicitudes_online_list->lTotalRecs;
	if (!($solicitudes_online->ExportAll && $solicitudes_online->Export <> ""))
		$solicitudes_online_list->SetUpStartRec(); // Set up start record position
	if ($bSelectLimit)
		$rs = $solicitudes_online_list->LoadRecordset($solicitudes_online_list->lStartRec-1, $solicitudes_online_list->lDisplayRecs);
?>
<p><span class="phpmaker" style="white-space: nowrap;">TABLA: solicitudes online
<?php if ($solicitudes_online->Export == "" && $solicitudes_online->CurrentAction == "") { ?>
&nbsp;&nbsp;<a href="<?php echo $solicitudes_online_list->PageUrl() ?>export=excel"><img src='images/exportxls.gif' width='16' height='16' border='0' alt='Exportar a Excel'></a>
&nbsp;&nbsp;<a href="<?php echo $solicitudes_online_list->PageUrl() ?>export=word"><img src='images/exportdoc.gif' width='16' height='16' border='0' alt='Exportar a Word'></a>
&nbsp;&nbsp;<a href="<?php echo $solicitudes_online_list->PageUrl() ?>export=csv"><img src='images/exportcsv.gif' width='16' height='16' border='0' alt='Exportar a CSV'></a>
<?php } ?>
</span></p>
<?php if ($Security->IsLoggedIn()) { ?>
<?php if ($solicitudes_online->Export == "" && $solicitudes_online->CurrentAction == "") { ?>
<a href="javascript:ew_ToggleSearchPanel(solicitudes_online_list);" style="text-decoration: none;"><img id="solicitudes_online_list_SearchImage" src="images/collapse.gif" alt="" width="9" height="9" border="0"></a><span class="phpmaker">&nbsp;Buscar</span><br>
<div id="solicitudes_online_list_SearchPanel">
<form name="fsolicitudes_onlinelistsrch" id="fsolicitudes_onlinelistsrch" class="ewForm" action="<?php echo ew_CurrentPage() ?>">
<input type="hidden" id="t" name="t" value="solicitudes_online">
<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($solicitudes_online->getBasicSearchKeyword()) ?>">
			<input type="Submit" name="Submit" id="Submit" value="Buscar (*)">&nbsp;
			<a href="<?php echo $solicitudes_online_list->PageUrl() ?>cmd=reset">Ver Todo</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 ($solicitudes_online->getBasicSearchType() == "") { ?> checked="checked"<?php } ?>>Frase exacta</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 ($solicitudes_online->getBasicSearchType() == "AND") { ?> checked="checked"<?php } ?>>Todas las palabras</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 ($solicitudes_online->getBasicSearchType() == "OR") { ?> checked="checked"<?php } ?>>Cualquier palabra</label></span></td>
	</tr>
</table>
</form>
</div>
<?php } ?>
<?php } ?>
<?php $solicitudes_online_list->ShowMessage() ?>
<br>
<table cellspacing="0" class="ewGrid"><tr><td class="ewGridContent">
<div class="ewGridMiddlePanel">
<form name="fsolicitudes_onlinelist" id="fsolicitudes_onlinelist" class="ewForm" action="" method="post">
<?php if ($solicitudes_online_list->lTotalRecs > 0) { ?>
<table cellspacing="0" rowhighlightclass="ewTableHighlightRow" rowselectclass="ewTableSelectRow" roweditclass="ewTableEditRow" class="ewTable ewTableSeparate">
<?php
	$solicitudes_online_list->lOptionCnt = 0;
if ($Security->IsLoggedIn()) {
	$solicitudes_online_list->lOptionCnt++; // view
}
if ($Security->IsLoggedIn()) {
	$solicitudes_online_list->lOptionCnt++; // edit
}
if ($Security->IsLoggedIn()) {
	$solicitudes_online_list->lOptionCnt++; // copy
}
if ($Security->IsLoggedIn()) {
	$solicitudes_online_list->lOptionCnt++; // Delete
}
	$solicitudes_online_list->lOptionCnt += count($solicitudes_online_list->ListOptions->Items); // Custom list options
?>
<?php echo $solicitudes_online->TableCustomInnerHtml ?>
<thead><!-- Table header -->
	<tr class="ewTableHeader">
<?php if ($solicitudes_online->id->Visible) { // id ?>
	<?php if ($solicitudes_online->SortUrl($solicitudes_online->id) == "") { ?>
		<td>id</td>
	<?php } else { ?>
		<td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $solicitudes_online->SortUrl($solicitudes_online->id) ?>',1);">
			<table cellspacing="0" class="ewTableHeaderBtn"><tr><td>id</td><td style="width: 10px;"><?php if ($solicitudes_online->id->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($solicitudes_online->id->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>
		</td>
	<?php } ?>
<?php } ?>		
<?php if ($solicitudes_online->empresa->Visible) { // empresa ?>
	<?php if ($solicitudes_online->SortUrl($solicitudes_online->empresa) == "") { ?>
		<td>empresa</td>
	<?php } else { ?>
		<td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $solicitudes_online->SortUrl($solicitudes_online->empresa) ?>',1);">
			<table cellspacing="0" class="ewTableHeaderBtn"><tr><td>empresa&nbsp;(*)</td><td style="width: 10px;"><?php if ($solicitudes_online->empresa->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($solicitudes_online->empresa->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>
		</td>
	<?php } ?>
<?php } ?>		
<?php if ($solicitudes_online->contacto->Visible) { // contacto ?>
	<?php if ($solicitudes_online->SortUrl($solicitudes_online->contacto) == "") { ?>
		<td>contacto</td>
	<?php } else { ?>
		<td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $solicitudes_online->SortUrl($solicitudes_online->contacto) ?>',1);">
			<table cellspacing="0" class="ewTableHeaderBtn"><tr><td>contacto&nbsp;(*)</td><td style="width: 10px;"><?php if ($solicitudes_online->contacto->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($solicitudes_online->contacto->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>
		</td>
	<?php } ?>
<?php } ?>		
<?php if ($solicitudes_online->email->Visible) { // email ?>
	<?php if ($solicitudes_online->SortUrl($solicitudes_online->email) == "") { ?>
		<td>email</td>
	<?php } else { ?>
		<td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $solicitudes_online->SortUrl($solicitudes_online->email) ?>',1);">
			<table cellspacing="0" class="ewTableHeaderBtn"><tr><td>email&nbsp;(*)</td><td style="width: 10px;"><?php if ($solicitudes_online->email->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($solicitudes_online->email->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>
		</td>
	<?php } ?>
<?php } ?>		
<?php if ($solicitudes_online->tipo->Visible) { // tipo ?>
	<?php if ($solicitudes_online->SortUrl($solicitudes_online->tipo) == "") { ?>
		<td>tipo</td>
	<?php } else { ?>
		<td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $solicitudes_online->SortUrl($solicitudes_online->tipo) ?>',1);">
			<table cellspacing="0" class="ewTableHeaderBtn"><tr><td>tipo&nbsp;(*)</td><td style="width: 10px;"><?php if ($solicitudes_online->tipo->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($solicitudes_online->tipo->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>
		</td>
	<?php } ?>
<?php } ?>		
<?php if ($solicitudes_online->fecha_registro->Visible) { // fecha_registro ?>
	<?php if ($solicitudes_online->SortUrl($solicitudes_online->fecha_registro) == "") { ?>
		<td>fecha registro</td>
	<?php } else { ?>
		<td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $solicitudes_online->SortUrl($solicitudes_online->fecha_registro) ?>',1);">
			<table cellspacing="0" class="ewTableHeaderBtn"><tr><td>fecha registro</td><td style="width: 10px;"><?php if ($solicitudes_online->fecha_registro->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($solicitudes_online->fecha_registro->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>
		</td>
	<?php } ?>
<?php } ?>		
<?php if ($solicitudes_online->Export == "") { ?>
<?php if ($Security->IsLoggedIn()) { ?>
<td style="white-space: nowrap;">&nbsp;</td>
<?php } ?>
<?php if ($Security->IsLoggedIn()) { ?>
<td style="white-space: nowrap;">&nbsp;</td>
<?php } ?>
<?php if ($Security->IsLoggedIn()) { ?>
<td style="white-space: nowrap;">&nbsp;</td>
<?php } ?>
<?php if ($Security->IsLoggedIn()) { ?>
<td style="white-space: nowrap;">&nbsp;</td>
<?php } ?>
<?php

// Custom list options
foreach ($solicitudes_online_list->ListOptions->Items as $ListOption) {
	if ($ListOption->Visible)
		echo $ListOption->HeaderCellHtml;
}
?>
<?php } ?>
	</tr>
</thead>
<?php
if ($solicitudes_online->ExportAll && $solicitudes_online->Export <> "") {
	$solicitudes_online_list->lStopRec = $solicitudes_online_list->lTotalRecs;
} else {
	$solicitudes_online_list->lStopRec = $solicitudes_online_list->lStartRec + $solicitudes_online_list->lDisplayRecs - 1; // Set the last record to display
}
$solicitudes_online_list->lRecCount = $solicitudes_online_list->lStartRec - 1;
if ($rs && !$rs->EOF) {
	$rs->MoveFirst();
	if (!$solicitudes_online->SelectLimit && $solicitudes_online_list->lStartRec > 1)
		$rs->Move($solicitudes_online_list->lStartRec - 1);
}
$solicitudes_online_list->lRowCnt = 0;
while (($solicitudes_online->CurrentAction == "gridadd" || !$rs->EOF) &&
	$solicitudes_online_list->lRecCount < $solicitudes_online_list->lStopRec) {
	$solicitudes_online_list->lRecCount++;
	if (intval($solicitudes_online_list->lRecCount) >= intval($solicitudes_online_list->lStartRec)) {
		$solicitudes_online_list->lRowCnt++;

	// Init row class and style
	$solicitudes_online->CssClass = "";
	$solicitudes_online->CssStyle = "";
	$solicitudes_online->RowClientEvents = "onmouseover='ew_MouseOver(event, this);' onmouseout='ew_MouseOut(event, this);' onclick='ew_Click(event, this);'";
	if ($solicitudes_online->CurrentAction == "gridadd") {
		$solicitudes_online_list->LoadDefaultValues(); // Load default values
	} else {
		$solicitudes_online_list->LoadRowValues($rs); // Load row values
	}
	$solicitudes_online->RowType = EW_ROWTYPE_VIEW; // Render view

	// Render row
	$solicitudes_online_list->RenderRow();
?>
	<tr<?php echo $solicitudes_online->RowAttributes() ?>>
	<?php if ($solicitudes_online->id->Visible) { // id ?>
		<td<?php echo $solicitudes_online->id->CellAttributes() ?>>
<div<?php echo $solicitudes_online->id->ViewAttributes() ?>><?php echo $solicitudes_online->id->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($solicitudes_online->empresa->Visible) { // empresa ?>
		<td<?php echo $solicitudes_online->empresa->CellAttributes() ?>>
<div<?php echo $solicitudes_online->empresa->ViewAttributes() ?>><?php echo $solicitudes_online->empresa->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($solicitudes_online->contacto->Visible) { // contacto ?>
		<td<?php echo $solicitudes_online->contacto->CellAttributes() ?>>
<div<?php echo $solicitudes_online->contacto->ViewAttributes() ?>><?php echo $solicitudes_online->contacto->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($solicitudes_online->email->Visible) { // email ?>
		<td<?php echo $solicitudes_online->email->CellAttributes() ?>>
<div<?php echo $solicitudes_online->email->ViewAttributes() ?>><?php echo $solicitudes_online->email->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($solicitudes_online->tipo->Visible) { // tipo ?>
		<td<?php echo $solicitudes_online->tipo->CellAttributes() ?>>
<div<?php echo $solicitudes_online->tipo->ViewAttributes() ?>><?php echo $solicitudes_online->tipo->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($solicitudes_online->fecha_registro->Visible) { // fecha_registro ?>
		<td<?php echo $solicitudes_online->fecha_registro->CellAttributes() ?>>
<div<?php echo $solicitudes_online->fecha_registro->ViewAttributes() ?>><?php echo $solicitudes_online->fecha_registro->ListViewValue() ?></div>
</td>
	<?php } ?>
<?php if ($solicitudes_online->Export == "") { ?>
<?php if ($Security->IsLoggedIn()) { ?>
<td style="white-space: nowrap;"><span class="phpmaker">
<a href="<?php echo $solicitudes_online->ViewUrl() ?>"><img src='images/browse.gif' width='16' height='16' border='0' alt='Ver'></a>
</span></td>
<?php } ?>
<?php if ($Security->IsLoggedIn()) { ?>
<td style="white-space: nowrap;"><span class="phpmaker">
<a href="<?php echo $solicitudes_online->EditUrl() ?>"><img src='images/edit.gif' width='16' height='16' border='0' alt='Editar'></a>
</span></td>
<?php } ?>
<?php if ($Security->IsLoggedIn()) { ?>
<td style="white-space: nowrap;"><span class="phpmaker">
<a href="<?php echo $solicitudes_online->CopyUrl() ?>"><img src='images/copy.gif' width='16' height='16' border='0' alt='Copiar'></a>
</span></td>
<?php } ?>
<?php if ($Security->IsLoggedIn()) { ?>
<td style="white-space: nowrap;"><span class="phpmaker">
<a href="<?php echo $solicitudes_online->DeleteUrl() ?>"><img src='images/delete.gif' width='16' height='16' border='0' alt='Borrar'></a>
</span></td>
<?php } ?>
<?php

// Custom list options
foreach ($solicitudes_online_list->ListOptions->Items as $ListOption) {
	if ($ListOption->Visible)
		echo $ListOption->BodyCellHtml;
}
?>
<?php } ?>
	</tr>
<?php
	}
	if ($solicitudes_online->CurrentAction <> "gridadd")
		$rs->MoveNext();
}
?>
</tbody>
</table>
<?php } ?>
</form>
<?php

// Close recordset
if ($rs)
	$rs->Close();
?>
</div>
<?php if ($solicitudes_online->Export == "") { ?>
<div class="ewGridLowerPanel">
<?php if ($solicitudes_online->CurrentAction <> "gridadd" && $solicitudes_online->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($solicitudes_online_list->Pager)) $solicitudes_online_list->Pager = new cPrevNextPager($solicitudes_online_list->lStartRec, $solicitudes_online_list->lDisplayRecs, $solicitudes_online_list->lTotalRecs) ?>
<?php if ($solicitudes_online_list->Pager->RecordCount > 0) { ?>
	<table border="0" cellspacing="0" cellpadding="0"><tr><td><span class="phpmaker">Página&nbsp;</span></td>
<!--first page button-->
	<?php if ($solicitudes_online_list->Pager->FirstButton->Enabled) { ?>
	<td><a href="<?php echo $solicitudes_online_list->PageUrl() ?>start=<?php echo $solicitudes_online_list->Pager->FirstButton->Start ?>"><img src="images/first.gif" alt="Primera" width="16" height="16" border="0"></a></td>
	<?php } else { ?>
	<td><img src="images/firstdisab.gif" alt="Primera" width="16" height="16" border="0"></td>
	<?php } ?>
<!--previous page button-->
	<?php if ($solicitudes_online_list->Pager->PrevButton->Enabled) { ?>
	<td><a href="<?php echo $solicitudes_online_list->PageUrl() ?>start=<?php echo $solicitudes_online_list->Pager->PrevButton->Start ?>"><img src="images/prev.gif" alt="Previo" width="16" height="16" border="0"></a></td>
	<?php } else { ?>
	<td><img src="images/prevdisab.gif" alt="Previo" 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 $solicitudes_online_list->Pager->CurrentPage ?>" size="4"></td>
<!--next page button-->
	<?php if ($solicitudes_online_list->Pager->NextButton->Enabled) { ?>
	<td><a href="<?php echo $solicitudes_online_list->PageUrl() ?>start=<?php echo $solicitudes_online_list->Pager->NextButton->Start ?>"><img src="images/next.gif" alt="Siguiente" width="16" height="16" border="0"></a></td>	
	<?php } else { ?>
	<td><img src="images/nextdisab.gif" alt="Siguiente" width="16" height="16" border="0"></td>
	<?php } ?>
<!--last page button-->
	<?php if ($solicitudes_online_list->Pager->LastButton->Enabled) { ?>
	<td><a href="<?php echo $solicitudes_online_list->PageUrl() ?>start=<?php echo $solicitudes_online_list->Pager->LastButton->Start ?>"><img src="images/last.gif" alt="Ultima" width="16" height="16" border="0"></a></td>	
	<?php } else { ?>
	<td><img src="images/lastdisab.gif" alt="Ultima" width="16" height="16" border="0"></td>
	<?php } ?>
	<td><span class="phpmaker">&nbsp;de <?php echo $solicitudes_online_list->Pager->PageCount ?></span></td>
	</tr></table>
	</td>	
	<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
	<td>
	<span class="phpmaker">Registros <?php echo $solicitudes_online_list->Pager->FromIndex ?> a <?php echo $solicitudes_online_list->Pager->ToIndex ?> de <?php echo $solicitudes_online_list->Pager->RecordCount ?></span>
<?php } else { ?>
	<?php if ($solicitudes_online_list->sSrchWhere == "0=101") { ?>
	<span class="phpmaker">Ingresar criterio de búsqueda</span>
	<?php } else { ?>
	<span class="phpmaker">No se encontraron registros</span>
	<?php } ?>
<?php } ?>
		</td>
<?php if ($solicitudes_online_list->lTotalRecs > 0) { ?>
		<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
		<td><table border="0" cellspacing="0" cellpadding="0"><tr><td>Tamaño&nbsp;</td><td>
<input type="hidden" id="t" name="t" value="solicitudes_online">
<select name="<?php echo EW_TABLE_REC_PER_PAGE ?>" id="<?php echo EW_TABLE_REC_PER_PAGE ?>" onchange="this.form.submit();" class="phpmaker">
<option value="20"<?php if ($solicitudes_online_list->lDisplayRecs == 20) { ?> selected="selected"<?php } ?>>20</option>
<option value="50"<?php if ($solicitudes_online_list->lDisplayRecs == 50) { ?> selected="selected"<?php } ?>>50</option>
<option value="ALL"<?php if ($solicitudes_online->getRecordsPerPage() == -1) { ?> selected="selected"<?php } ?>>Todos</option>
</select></td></tr></table>
		</td>
<?php } ?>
	</tr>
</table>
</form>
<?php } ?>
<?php //if ($solicitudes_online_list->lTotalRecs > 0) { ?>
<span class="phpmaker">
<?php if ($Security->IsLoggedIn()) { ?>
<a href="<?php echo $solicitudes_online->AddUrl() ?>">Agregar</a>&nbsp;&nbsp;
<?php } ?>
</span>
<?php //} ?>
</div>
<?php } ?>
</td></tr></table>
<?php if ($solicitudes_online->Export == "" && $solicitudes_online->CurrentAction == "") { ?>
<script type="text/javascript">
<!--

//ew_ToggleSearchPanel(solicitudes_online_list); // uncomment to init search panel as collapsed
//-->

</script>
<?php } ?>
<?php if ($solicitudes_online->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 csolicitudes_online_list {

	// Page ID
	var $PageID = 'list';

	// Table Name
	var $TableName = 'solicitudes_online';

	// Page Object Name
	var $PageObjName = 'solicitudes_online_list';

	// Page Name
	function PageName() {
		return ew_CurrentPage();
	}

	// Page Url
	function PageUrl() {
		$PageUrl = ew_CurrentPage() . "?";
		global $solicitudes_online;
		if ($solicitudes_online->UseTokenInUrl) $PageUrl .= "t=" . $solicitudes_online->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, $solicitudes_online;
		if ($solicitudes_online->UseTokenInUrl) {

			//IsPageRequest = False
			if ($objForm)
				return ($solicitudes_online->TableVar == $objForm->GetValue("t"));
			if (@$_GET["t"] <> "")
				return ($solicitudes_online->TableVar == $_GET["t"]);
		} else {
			return TRUE;
		}
	}

	//
	//  Class initialize
	//  - init objects
	//  - open connection
	//
	function csolicitudes_online_list() {
		global $conn;

		// Initialize table object
		$GLOBALS["solicitudes_online"] = new csolicitudes_online();

		// Initialize other table object
		$GLOBALS['usuario'] = new cusuario();

		// 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", 'solicitudes_online', TRUE);

		// Open connection to the database
		$conn = ew_Connect();

		// Initialize list options
		$this->ListOptions = new cListOptions();
	}

	// 
	//  Page_Init
	//
	function Page_Init() {
		global $gsExport, $gsExportFile, $solicitudes_online;
		global $Security;
		$Security = new cAdvancedSecurity();
		if (!$Security->IsLoggedIn()) $Security->AutoLogin();
		if (!$Security->IsLoggedIn()) {
			$Security->SaveLastUrl();
			$this->Page_Terminate("login.php");
		}
	$solicitudes_online->Export = @$_GET["export"]; // Get export parameter
	$gsExport = $solicitudes_online->Export; // Get export parameter, used in header
	$gsExportFile = $solicitudes_online->TableVar; // Get export file, used in header
	if ($solicitudes_online->Export == "excel") {
		header('Content-Type: application/vnd.ms-excel');
		header('Content-Disposition: attachment; filename=' . $gsExportFile .'.xls');
	}
	if ($solicitudes_online->Export == "word") {
		header('Content-Type: application/vnd.ms-word');
		header('Content-Disposition: attachment; filename=' . $gsExportFile .'.doc');
	}
	if ($solicitudes_online->Export == "csv") {
		header('Content-Type: application/csv');
		header('Content-Disposition: attachment; filename=' . $gsExportFile .'.csv');
	}

		// 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, $solicitudes_online;
		$this->lDisplayRecs = 50;
		$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

			// Set up records per page dynamically
			$this->SetUpDisplayRecs();

			// Handle reset command
			$this->ResetCmd();

			// Get basic search criteria
			if ($gsSearchError == "")
				$sSrchBasic = $this->BasicSearchWhere();

			// Set Up Sorting Order
			$this->SetUpSortOrder();
		} // End Validate Request

		// Restore display records
		if ($solicitudes_online->getRecordsPerPage() <> "") {
			$this->lDisplayRecs = $solicitudes_online->getRecordsPerPage(); // Restore from Session
		} else {
			$this->lDisplayRecs = 50; // 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
		$solicitudes_online->Recordset_Searching($this->sSrchWhere);

		// Save search criteria
		if ($this->sSrchWhere <> "") {
			if ($sSrchBasic == "")
				$this->ResetBasicSearchParms();
			$solicitudes_online->setSearchWhere($this->sSrchWhere); // Save to Session
			$this->lStartRec = 1; // Reset start record counter
			$solicitudes_online->setStartRecordNumber($this->lStartRec);
		} else {
			$this->RestoreSearchParms();
		}

		// Build filter
		$sFilter = "";
		if ($this->sDbDetailFilter <> "")
			$sFilter = ($sFilter <> "") ? "($sFilter) AND (" . $this->sDbDetailFilter . ")" : $this->sDbDetailFilter;
		if ($this->sSrchWhere <> "")
			$sFilter = ($sFilter <> "") ? "($sFilter) AND (". $this->sSrchWhere . ")" : $this->sSrchWhere;

		// Set up filter in Session
		$solicitudes_online->setSessionWhere($sFilter);
		$solicitudes_online->CurrentFilter = "";

		// Export data only
		if (in_array($solicitudes_online->Export, array("html","word","excel","xml","csv"))) {
			$this->ExportData();
			$this->Page_Terminate(); // Terminate response
			exit();
		}
	}

	// Set up number of records displayed per page
	function SetUpDisplayRecs() {
		global $solicitudes_online;
		$sWrk = @$_GET[EW_TABLE_REC_PER_PAGE];
		if ($sWrk <> "") {
			if (is_numeric($sWrk)) {
				$this->lDisplayRecs = intval($sWrk);
			} else {
				if (strtolower($sWrk) == "all") { // Display all records
					$this->lDisplayRecs = -1;
				} else {
					$this->lDisplayRecs = 50; // Non-numeric, load default
				}
			}
			$solicitudes_online->setRecordsPerPage($this->lDisplayRecs); // Save to Session

			// Reset start position
			$this->lStartRec = 1;
			$solicitudes_online->setStartRecordNumber($this->lStartRec);
		}
	}

	// Return Basic Search sql
	function BasicSearchSQL($Keyword) {
		global $solicitudes_online;
		$sKeyword = ew_AdjustSql($Keyword);
		$sql = "";
		$sql .= $solicitudes_online->empresa->FldExpression . " LIKE '%" . $sKeyword . "%' OR ";
		$sql .= $solicitudes_online->contacto->FldExpression . " LIKE '%" . $sKeyword . "%' OR ";
		$sql .= $solicitudes_online->email->FldExpression . " LIKE '%" . $sKeyword . "%' OR ";
		$sql .= $solicitudes_online->telefono->FldExpression . " LIKE '%" . $sKeyword . "%' OR ";
		$sql .= $solicitudes_online->mensaje->FldExpression . " LIKE '%" . $sKeyword . "%' OR ";
		$sql .= $solicitudes_online->tipo->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, $solicitudes_online;
		$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 <> "") {
			$solicitudes_online->setBasicSearchKeyword($sSearchKeyword);
			$solicitudes_online->setBasicSearchType($sSearchType);
		}
		return $sSearchStr;
	}

	// Clear all search parameters
	function ResetSearchParms() {

		// Clear search where
		global $solicitudes_online;
		$this->sSrchWhere = "";
		$solicitudes_online->setSearchWhere($this->sSrchWhere);

		// Clear basic search parameters
		$this->ResetBasicSearchParms();
	}

	// Clear all basic search parameters
	function ResetBasicSearchParms() {

		// Clear basic search parameters
		global $solicitudes_online;
		$solicitudes_online->setBasicSearchKeyword("");
		$solicitudes_online->setBasicSearchType("");
	}

	// Restore all search parameters
	function RestoreSearchParms() {
		global $gsSearchError, $solicitudes_online;
		$this->sSrchWhere = $solicitudes_online->getSearchWhere();
	}

	// Set up Sort parameters based on Sort Links clicked
	function SetUpSortOrder() {
		global $solicitudes_online;

		// Check for an Order parameter
		if (@$_GET["order"] <> "") {
			$solicitudes_online->CurrentOrder = ew_StripSlashes(@$_GET["order"]);
			$solicitudes_online->CurrentOrderType = @$_GET["ordertype"];
			$solicitudes_online->UpdateSort($solicitudes_online->id); // Field 
			$solicitudes_online->UpdateSort($solicitudes_online->empresa); // Field 
			$solicitudes_online->UpdateSort($solicitudes_online->contacto); // Field 
			$solicitudes_online->UpdateSort($solicitudes_online->email); // Field 
			$solicitudes_online->UpdateSort($solicitudes_online->tipo); // Field 
			$solicitudes_online->UpdateSort($solicitudes_online->fecha_registro); // Field 
			$solicitudes_online->setStartRecordNumber(1); // Reset start position
		}
	}

	// Load Sort Order parameters
	function LoadSortOrder() {
		global $solicitudes_online;
		$sOrderBy = $solicitudes_online->getSessionOrderBy(); // Get order by from Session
		if ($sOrderBy == "") {
			if ($solicitudes_online->SqlOrderBy() <> "") {
				$sOrderBy = $solicitudes_online->SqlOrderBy();
				$solicitudes_online->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 $solicitudes_online;

		// Get reset cmd
		if (@$_GET["cmd"] <> "") {
			$sCmd = $_GET["cmd"];

			// Reset search criteria
			if (strtolower($sCmd) == "reset" || strtolower($sCmd) == "resetall")
				$this->ResetSearchParms();

			// Reset sort criteria
			if (strtolower($sCmd) == "resetsort") {
				$sOrderBy = "";
				$solicitudes_online->setSessionOrderBy($sOrderBy);
				$solicitudes_online->id->setSort("");
				$solicitudes_online->empresa->setSort("");
				$solicitudes_online->contacto->setSort("");
				$solicitudes_online->email->setSort("");
				$solicitudes_online->tipo->setSort("");
				$solicitudes_online->fecha_registro->setSort("");
			}

			// Reset start position
			$this->lStartRec = 1;
			$solicitudes_online->setStartRecordNumber($this->lStartRec);
		}
	}

	// Set up Starting Record parameters based on Pager Navigation
	function SetUpStartRec() {
		global $solicitudes_online;
		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];
				$solicitudes_online->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;
					}
					$solicitudes_online->setStartRecordNumber($this->lStartRec);
				}
			}
		}
		$this->lStartRec = $solicitudes_online->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
			$solicitudes_online->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
			$solicitudes_online->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
			$solicitudes_online->setStartRecordNumber($this->lStartRec);
		}
	}

	// Load recordset
	function LoadRecordset($offset = -1, $rowcnt = -1) {
		global $conn, $solicitudes_online;

		// Call Recordset Selecting event
		$solicitudes_online->Recordset_Selecting($solicitudes_online->CurrentFilter);

		// Load list page SQL
		$sSql = $solicitudes_online->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
		$solicitudes_online->Recordset_Selected($rs);
		return $rs;
	}

	// Load row based on key values
	function LoadRow() {
		global $conn, $Security, $solicitudes_online;
		$sFilter = $solicitudes_online->KeyFilter();

		// Call Row Selecting event
		$solicitudes_online->Row_Selecting($sFilter);

		// Load sql based on filter
		$solicitudes_online->CurrentFilter = $sFilter;
		$sSql = $solicitudes_online->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
				$solicitudes_online->Row_Selected($rs);
			}
			$rs->Close();
		} else {
			$LoadRow = FALSE;
		}
		return $LoadRow;
	}

	// Load row values from recordset
	function LoadRowValues(&$rs) {
		global $solicitudes_online;
		$solicitudes_online->id->setDbValue($rs->fields('id'));
		$solicitudes_online->empresa->setDbValue($rs->fields('empresa'));
		$solicitudes_online->contacto->setDbValue($rs->fields('contacto'));
		$solicitudes_online->email->setDbValue($rs->fields('email'));
		$solicitudes_online->telefono->setDbValue($rs->fields('telefono'));
		$solicitudes_online->mensaje->setDbValue($rs->fields('mensaje'));
		$solicitudes_online->tipo->setDbValue($rs->fields('tipo'));
		$solicitudes_online->cod_usuario->setDbValue($rs->fields('cod_usuario'));
		$solicitudes_online->atendido->setDbValue($rs->fields('atendido'));
		$solicitudes_online->fecha_registro->setDbValue($rs->fields('fecha_registro'));
	}

	// Render row values based on field settings
	function RenderRow() {
		global $conn, $Security, $solicitudes_online;

		// Call Row_Rendering event
		$solicitudes_online->Row_Rendering();

		// Common render codes for all row types
		// id

		$solicitudes_online->id->CellCssStyle = "";
		$solicitudes_online->id->CellCssClass = "";

		// empresa
		$solicitudes_online->empresa->CellCssStyle = "";
		$solicitudes_online->empresa->CellCssClass = "";

		// contacto
		$solicitudes_online->contacto->CellCssStyle = "";
		$solicitudes_online->contacto->CellCssClass = "";

		// email
		$solicitudes_online->email->CellCssStyle = "";
		$solicitudes_online->email->CellCssClass = "";

		// tipo
		$solicitudes_online->tipo->CellCssStyle = "";
		$solicitudes_online->tipo->CellCssClass = "";

		// fecha_registro
		$solicitudes_online->fecha_registro->CellCssStyle = "";
		$solicitudes_online->fecha_registro->CellCssClass = "";
		if ($solicitudes_online->RowType == EW_ROWTYPE_VIEW) { // View row

			// id
			$solicitudes_online->id->ViewValue = $solicitudes_online->id->CurrentValue;
			$solicitudes_online->id->CssStyle = "";
			$solicitudes_online->id->CssClass = "";
			$solicitudes_online->id->ViewCustomAttributes = "";

			// empresa
			$solicitudes_online->empresa->ViewValue = $solicitudes_online->empresa->CurrentValue;
			$solicitudes_online->empresa->CssStyle = "";
			$solicitudes_online->empresa->CssClass = "";
			$solicitudes_online->empresa->ViewCustomAttributes = "";

			// contacto
			$solicitudes_online->contacto->ViewValue = $solicitudes_online->contacto->CurrentValue;
			$solicitudes_online->contacto->CssStyle = "";
			$solicitudes_online->contacto->CssClass = "";
			$solicitudes_online->contacto->ViewCustomAttributes = "";

			// email
			$solicitudes_online->email->ViewValue = $solicitudes_online->email->CurrentValue;
			$solicitudes_online->email->CssStyle = "";
			$solicitudes_online->email->CssClass = "";
			$solicitudes_online->email->ViewCustomAttributes = "";

			// tipo
			$solicitudes_online->tipo->ViewValue = $solicitudes_online->tipo->CurrentValue;
			$solicitudes_online->tipo->CssStyle = "";
			$solicitudes_online->tipo->CssClass = "";
			$solicitudes_online->tipo->ViewCustomAttributes = "";

			// fecha_registro
			$solicitudes_online->fecha_registro->ViewValue = $solicitudes_online->fecha_registro->CurrentValue;
			$solicitudes_online->fecha_registro->ViewValue = ew_FormatDateTime($solicitudes_online->fecha_registro->ViewValue, 5);
			$solicitudes_online->fecha_registro->CssStyle = "";
			$solicitudes_online->fecha_registro->CssClass = "";
			$solicitudes_online->fecha_registro->ViewCustomAttributes = "";

			// id
			$solicitudes_online->id->HrefValue = "";

			// empresa
			$solicitudes_online->empresa->HrefValue = "";

			// contacto
			$solicitudes_online->contacto->HrefValue = "";

			// email
			$solicitudes_online->email->HrefValue = "";

			// tipo
			$solicitudes_online->tipo->HrefValue = "";

			// fecha_registro
			$solicitudes_online->fecha_registro->HrefValue = "";
		}

		// Call Row Rendered event
		$solicitudes_online->Row_Rendered();
	}

	// Export data in XML or CSV format
	function ExportData() {
		global $solicitudes_online;
		$sCsvStr = "";

		// Default export style
		$sExportStyle = "h";

		// Load recordset
		$rs = $this->LoadRecordset();
		$this->lTotalRecs = $rs->RecordCount();
		$this->lStartRec = 1;

		// Export all
		if ($solicitudes_online->ExportAll) {
			$this->lStopRec = $this->lTotalRecs;
		} else { // Export 1 page only
			$this->SetUpStartRec(); // Set up start record position

			// Set the last record to display
			if ($this->lDisplayRecs < 0) {
				$this->lStopRec = $this->lTotalRecs;
			} else {
				$this->lStopRec = $this->lStartRec + $this->lDisplayRecs - 1;
			}
		}
		if ($solicitudes_online->Export == "xml") {
			$XmlDoc = new cXMLDocument();
		} else {
			echo ew_ExportHeader($solicitudes_online->Export);

			// Horizontal format, write header
			if ($sExportStyle <> "v" || $solicitudes_online->Export == "csv") {
				$sExportStr = "";
				ew_ExportAddValue($sExportStr, 'id', $solicitudes_online->Export);
				ew_ExportAddValue($sExportStr, 'empresa', $solicitudes_online->Export);
				ew_ExportAddValue($sExportStr, 'contacto', $solicitudes_online->Export);
				ew_ExportAddValue($sExportStr, 'email', $solicitudes_online->Export);
				ew_ExportAddValue($sExportStr, 'tipo', $solicitudes_online->Export);
				ew_ExportAddValue($sExportStr, 'fecha_registro', $solicitudes_online->Export);
				echo ew_ExportLine($sExportStr, $solicitudes_online->Export);
			}
		}

		// Move to first record
		$this->lRecCnt = $this->lStartRec - 1;
		if (!$rs->EOF) {
			$rs->MoveFirst();
			$rs->Move($this->lStartRec - 1);
		}
		while (!$rs->EOF && $this->lRecCnt < $this->lStopRec) {
			$this->lRecCnt++;
			if (intval($this->lRecCnt) >= intval($this->lStartRec)) {
				$this->LoadRowValues($rs);

				// Render row for display
				$solicitudes_online->RowType = EW_ROWTYPE_VIEW; // Render view
				$this->RenderRow();
				if ($solicitudes_online->Export == "xml") {
					$XmlDoc->BeginRow();
					$XmlDoc->AddField('id', $solicitudes_online->id->CurrentValue);
					$XmlDoc->AddField('empresa', $solicitudes_online->empresa->CurrentValue);
					$XmlDoc->AddField('contacto', $solicitudes_online->contacto->CurrentValue);
					$XmlDoc->AddField('email', $solicitudes_online->email->CurrentValue);
					$XmlDoc->AddField('tipo', $solicitudes_online->tipo->CurrentValue);
					$XmlDoc->AddField('fecha_registro', $solicitudes_online->fecha_registro->CurrentValue);
					$XmlDoc->EndRow();
				} else {
					if ($sExportStyle == "v" && $solicitudes_online->Export <> "csv") { // Vertical format
						echo ew_ExportField('id', $solicitudes_online->id->ExportValue($solicitudes_online->Export, $solicitudes_online->ExportOriginalValue), $solicitudes_online->Export);
						echo ew_ExportField('empresa', $solicitudes_online->empresa->ExportValue($solicitudes_online->Export, $solicitudes_online->ExportOriginalValue), $solicitudes_online->Export);
						echo ew_ExportField('contacto', $solicitudes_online->contacto->ExportValue($solicitudes_online->Export, $solicitudes_online->ExportOriginalValue), $solicitudes_online->Export);
						echo ew_ExportField('email', $solicitudes_online->email->ExportValue($solicitudes_online->Export, $solicitudes_online->ExportOriginalValue), $solicitudes_online->Export);
						echo ew_ExportField('tipo', $solicitudes_online->tipo->ExportValue($solicitudes_online->Export, $solicitudes_online->ExportOriginalValue), $solicitudes_online->Export);
						echo ew_ExportField('fecha_registro', $solicitudes_online->fecha_registro->ExportValue($solicitudes_online->Export, $solicitudes_online->ExportOriginalValue), $solicitudes_online->Export);
					}	else { // Horizontal format
						$sExportStr = "";
						ew_ExportAddValue($sExportStr, $solicitudes_online->id->ExportValue($solicitudes_online->Export, $solicitudes_online->ExportOriginalValue), $solicitudes_online->Export);
						ew_ExportAddValue($sExportStr, $solicitudes_online->empresa->ExportValue($solicitudes_online->Export, $solicitudes_online->ExportOriginalValue), $solicitudes_online->Export);
						ew_ExportAddValue($sExportStr, $solicitudes_online->contacto->ExportValue($solicitudes_online->Export, $solicitudes_online->ExportOriginalValue), $solicitudes_online->Export);
						ew_ExportAddValue($sExportStr, $solicitudes_online->email->ExportValue($solicitudes_online->Export, $solicitudes_online->ExportOriginalValue), $solicitudes_online->Export);
						ew_ExportAddValue($sExportStr, $solicitudes_online->tipo->ExportValue($solicitudes_online->Export, $solicitudes_online->ExportOriginalValue), $solicitudes_online->Export);
						ew_ExportAddValue($sExportStr, $solicitudes_online->fecha_registro->ExportValue($solicitudes_online->Export, $solicitudes_online->ExportOriginalValue), $solicitudes_online->Export);
						echo ew_ExportLine($sExportStr, $solicitudes_online->Export);
					}
				}
			}
			$rs->MoveNext();
		}

		// Close recordset
		$rs->Close();
		if ($solicitudes_online->Export == "xml") {
			header("Content-Type: text/xml");
			echo $XmlDoc->XML();
		} else {
			echo ew_ExportFooter($solicitudes_online->Export);
		}
	}

	// 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;
	}
}
?>
