<?php
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
    
class bfRecordManagementHtml
{
	public static function backjump()
	{
?>
		<form action="index2.php" method="post" name="adminForm" id="adminForm" class="adminForm">
			<input type="hidden" name="option" value="com_facileforms" />
			<input type="hidden" name="act" value="<?php echo JRequest::getVar('act', '') ?>" />
			<input type="hidden" id="limitstart" name="limitstart" value="<?php echo JRequest::getInt('limitstart',0); ?>" />
			<input type="hidden" id="mylimit" name="mylimit" value="<?php echo JRequest::getInt('mylimit',20); ?>" />
			<input type="hidden" id="form" name="form" value="<?php echo JRequest::getInt('form',0); ?>" />
			<input type="hidden" id="search" name="search" value="<?php echo JRequest::getVar('search',''); ?>" />
			<input type="hidden" name="txtsearch" value="<?php echo JRequest::getWord('txtsearch','false'); ?>" />
			<input type="hidden" name="order" value="<?php echo JRequest::getWord('order','DESC') ?>" />
			<input type="hidden" name="orderBy" value="<?php echo JRequest::getWord('orderBy','submitted') ?>" />
			<input type="hidden" name="task" value="cancel" />
		</form>
		<script type="text/javascript">
		document.adminForm.submit();
		</script>
<?
	}
	
	public static function record(stdClass $rec, array $subs)
	{
?>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
		<script type="text/javascript" src="<?php echo JURI::root(); ?>/includes/js/overlib_mini.js"></script>
		<form action="index2.php" method="post" name="adminForm" id="adminForm" class="adminForm">
		<table cellpadding="0" cellspacing="0" border="0" class="adminform" style="width:100%;">
			<tr><th colspan="4" class="title">BreezingForms - <?php echo BFText::_('RECORDS_VIEWRECORD'); ?></th></tr>
			<tr>
				<td></td>
				<td colspan="2">
					<fieldset><legend><?php echo BFText::_('RECORDS_SUBMINFO'); ?></legend>
						<table cellpadding="0" cellspacing="0" border="1">
							<tr>
								<td nowrap><strong><?php echo BFText::_('RECORDS_SUBMITTED'); ?></strong></td>
								<td nowrap><strong>IP</strong></td>
								<td nowrap><strong><?php echo BFText::_('RECORDS_PROVIDER'); ?></strong></td>
								<td nowrap><strong><?php echo BFText::_('RECORDS_OPSYS'); ?></strong></td>
								<td nowrap><strong><?php echo BFText::_('RECORDS_BROWSER'); ?></strong></td>
							</tr>
							<tr>
								<td nowrap valign="top"><?php echo $rec->submitted; ?></td>
								<td nowrap valign="top"><?php echo $rec->ip; ?></td>
								<td nowrap valign="top"><?php echo htmlspecialchars($rec->provider, ENT_QUOTES); ?></td>
								<td nowrap valign="top"><?php echo htmlspecialchars($rec->opsys, ENT_QUOTES); ?></td>
								<td valign="top"><?php echo htmlspecialchars($rec->browser, ENT_QUOTES); ?></td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td></td>
			</tr>
			
			
			<tr>
				<td></td>
				<td colspan="2">
					<fieldset><legend><?php echo BFText::_('Payment Information'); ?></legend>
						<table cellpadding="0" cellspacing="0" border="1">
							<tr>
								<td nowrap><strong><?php echo BFText::_('Transaction ID'); ?></strong></td>
								<td nowrap><strong><?php echo BFText::_('Transaction Date'); ?></strong></td>
								<td nowrap><strong><?php echo BFText::_('Test-Account'); ?></strong></td>
								<td nowrap><strong><?php echo BFText::_('Download tries'); ?></strong></td>
							</tr>
							<tr>
								<td nowrap valign="top"><?php echo $rec->paypal_tx_id; ?></td>
								<td nowrap valign="top"><?php echo $rec->paypal_payment_date ?></td>
								<td nowrap valign="top"><?php echo $rec->paypal_testaccount ? BFText::_('YES') : BFText::_('NO'); ?></td>
								<td valign="top"><?php echo $rec->paypal_download_tries ?></td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td></td>
			</tr>
			
			<tr>
				<td></td>
				<td>
					<fieldset><legend><?php echo BFText::_('RECORDS_RECORDINFO'); ?></legend>
						<table cellpadding="0" cellspacing="0" border="1">
							<tr>
								<td nowrap><strong>ID</strong></td>
								<td nowrap><strong><?php echo BFText::_('RECORDS_VIEWED'); ?></strong></td>
								<td nowrap><strong><?php echo BFText::_('RECORDS_EXPORTED'); ?></strong></td>
								<td nowrap><strong><?php echo BFText::_('RECORDS_ARCHIVED'); ?></strong></td>
							</tr>
							<tr>
								<td nowrap><?php echo $rec->id; ?></td>
								<td nowrap><?php if ($rec->viewed) echo BFText::_('RECORDS_YES'); else echo BFText::_('RECORDS_NO'); ?></td>
								<td nowrap><?php if ($rec->exported) echo BFText::_('RECORDS_YES'); else echo BFText::_('RECORDS_NO'); ?></td>
								<td nowrap><?php if ($rec->archived) echo BFText::_('RECORDS_YES'); else echo BFText::_('RECORDS_NO'); ?></td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td>
					<fieldset><legend><?php echo BFText::_('RECORDS_FORMINFO'); ?></legend>
						<table cellpadding="0" cellspacing="0" border="1">
							<tr>
								<td nowrap><strong>ID</strong></td>
								<td nowrap><strong><?php echo BFText::_('RECORDS_TITLE'); ?></strong></td>
								<td nowrap><strong><?php echo BFText::_('RECORDS_NAME'); ?></strong></td>
							</tr>
							<tr>
								<td nowrap><?php echo $rec->form; ?></td>
								<td nowrap><?php echo $rec->title; ?></td>
								<td nowrap><?php echo $rec->name; ?></td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td colspan="2">
					<fieldset><legend><?php echo BFText::_('RECORDS_SUBMVALUES'); ?></legend>
						<table cellpadding="0" cellspacing="0" border="1">
							<tr>
								<td nowrap><strong><?php echo BFText::_('RECORDS_RECORDID'); ?></strong></td>
								<td nowrap><strong><?php echo BFText::_('RECORDS_ELEMENTID'); ?></strong></td>
								<td nowrap><strong><?php echo BFText::_('RECORDS_TITLE'); ?></strong></td>
								<td nowrap><strong><?php echo BFText::_('RECORDS_NAME'); ?></strong></td>
								<td nowrap><strong><?php echo BFText::_('RECORDS_TYPE'); ?></strong></td>
								<td nowrap><strong><?php echo BFText::_('RECORDS_VALUE'); ?></strong></td>
								<td nowrap><strong><?php echo BFText::_('EDIT'); ?></strong></td>
							</tr>
<?php
			for($i=0; $i < count( $subs ); $i++) {
				$sub = $subs[$i];
?>
							<tr>
								<td nowrap valign="top"><?php echo $sub->id; ?></td>
								<td nowrap valign="top"><?php echo $sub->element; ?></td>
								<td nowrap valign="top"><?php echo htmlentities($sub->title, ENT_QUOTES, 'UTF-8'); ?></td>
								<td nowrap valign="top"><?php echo $sub->name; ?></td>
								<td nowrap valign="top"><?php echo $sub->type; ?></td>
								<td width="50%" valign="top"><?php echo htmlentities($sub->value, ENT_QUOTES, 'UTF-8'); ?></td>
								<td width="50%" valign="top">
								<?php
								if($sub->type != 'Textarea')
								{
								?>
									<input type="text" name="ff_nm_<?php echo $sub->name; ?>" value="<?php echo htmlentities($sub->value, ENT_QUOTES, 'UTF-8'); ?>" style="width:100%"/>
								<?php
								}
								else
								{
								?>
									<textarea name="ff_nm_<?php echo $sub->name; ?>" style="width:100%;height:100px;"><?php echo htmlentities($sub->value, ENT_QUOTES, 'UTF-8'); ?></textarea>
								<?php
								}
								?>
								<input type="checkbox" value="<?php echo $sub->name; ?>" name="update[]"/>
								</td>
							</tr>
<?php
			} // for
?>
						</table>
					</fieldset>
				</td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td colspan="2" style="text-align:right">
					<a class="toolbar" href="javascript:submitbutton('save');">
						<img src="images/save_f2.png"  alt="" name="save" border="0" align="middle" />&nbsp;<?php echo BFText::_('TOOLBAR_SAVE'); ?>
					</a>&nbsp;&nbsp;
					<a class="toolbar" href="javascript:submitbutton('cancel');">
						<img src="images/cancel_f2.png"  alt="" name="cancel" border="0" align="middle" />&nbsp;<?php echo BFText::_('TOOLBAR_CANCEL'); ?>
					</a>
				</td>
				<td></td>
			</tr>
		</table>
		<input type="hidden" name="option" value="com_facileforms" />
		<input type="hidden" name="act" value="<?php echo JRequest::getVar('act', '') ?>" />
		<input type="hidden" id="limitstart" name="limitstart" value="<?php echo JRequest::getInt('limitstart',0); ?>" />
		<input type="hidden" id="mylimit" name="mylimit" value="<?php echo JRequest::getInt('mylimit',20); ?>" />
		<input type="hidden" id="form" name="form" value="<?php echo JRequest::getInt('form',0); ?>" />
		<input type="hidden" id="search" name="search" value="<?php echo JRequest::getVar('search',''); ?>" />
		<input type="hidden" name="txtsearch" value="<?php echo JRequest::getWord('txtsearch','false'); ?>" />
		<input type="hidden" name="order" value="<?php echo JRequest::getWord('order','DESC') ?>" />
		<input type="hidden" name="orderBy" value="<?php echo JRequest::getWord('orderBy','submitted') ?>" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="record_id" value="<?php echo $rec->id; ?>" />
		</form>
<?php
	}
	
	public static function records(array $rows, JPagination $pagination, array $forms)
	{
?>
<script type="text/javascript">
function submitbutton(pressbutton)
			{
				var form = document.adminForm;
				switch (pressbutton) {
					case 'remove':
					case 'exportCsv':
					case 'exportXls':
					case 'exportPdf':
					case 'exportXml':
						if (form.boxchecked.value==0) {
							alert("<?php echo BFText::_('RECORDS_PLSSELECTRECS'); ?>");
							return;
						} // if
						form.exportt.value = 1;
						break;
					case 'viewed':
					case 'exported':
					case 'archived':
						var writeStatus = false;
						for(var i = 0; i < form.write_status.length; i++)
						{
							if(form.write_status[i].checked && (form.write_status[i].value == 'set' || form.write_status[i].value == 'unset'))
							{
								writeStatus = true;
								break;
							}
						}
						if (writeStatus && form.boxchecked.value==0) {
							alert("<?php echo BFText::_('RECORDS_PLSSELECTRECS'); ?>");
							return;
						} // if
						form.status_update.value = 1;
						break;
					default:
						break;
				} // switch
				switch (pressbutton) {
					case 'remove':
						if (!confirm("<?php echo BFText::_('RECORDS_ASKDELETE'); ?>")) return;
						break;
					default:
						break;
				} // switch
				submitform(pressbutton);
				form.exportt.value = 0;
} // submitbutton

function listItemTask( id, task )
{
	var f = document.adminForm;
	cb = eval( 'f.' + id );
	if (cb) {
		for (i = 0; true; i++) {
			cbx = eval('f.cb'+i);
			if (!cbx) break;
				cbx.checked = false;
			} // for
			cb.checked = true;
			f.boxchecked.value = 1;
			submitbutton(task);
		}
	return false;
} // listItemTask
</script>

<table class="adminlist">
	<tfoot>
    	<tr>
    		<td colspan="14">
    			<form action="#">
    				<?php echo $pagination->getListFooter() ?>
    			</form>
    		</td>
    	</tr>
	</tfoot>
</table>

<form action="index.php" method="post" name="adminForm">
<div id="editcell">

    <table class="adminlist">
    <thead>
    	<tr>
    		<td valign="top" colspan="1000">
    			<table class="adminlist" width="100%">
    				<thead>
	    			<tr>
	    				<td>
			    			<?php echo BFText::_('FILTER'); ?>:
			    			<input type="text" name="search" value="<?php echo htmlentities(JRequest::getVar('search',''),ENT_QUOTES, 'UTF-8'); ?>" onchange="form.status_update.value = 1;document.adminForm.submit()"/>
			    			<?php echo BFText::_('TEXT'); ?>: <input type="checkbox" name="txtsearch" onclick="form.status_update.value = 1;document.adminForm.submit()" value="true"<?php echo JRequest::getWord('txtsearch','false') == 'true' ? ' checked="checked"' : ''; ?>/>
			    			<select name="form" onchange="form.status_update.value = 1;document.adminForm.submit()">
			    				<option value=""><?php echo BFText::_('ALL'); ?></option>
			    				<?php
								foreach($forms As $form)
								{
									if(trim($form->name) != '')
									{
										echo '<option value="'.$form->id.'"'.(JRequest::getInt('form',0) == $form->id ? ' selected="selected"' : '').'>'.htmlentities($form->title, ENT_QUOTES, 'UTF-8').' ('.htmlentities($form->name, ENT_QUOTES, 'UTF-8').')</option>'."\n";
									}
								}
			    				?>
			    			</select>
						</td>
						<td align="right" valign="top">
			    			<?php echo BFText::_('Write Status'); ?>: <input type="radio" name="write_status" value=""<?php echo JRequest::getVar('write_status','') == '' ? ' checked="checked"' : ''; ?>/>  <?php echo BFText::_('none'); ?> <input type="radio" name="write_status" value="unset"<?php echo JRequest::getVar('write_status','') == 'unset' ? ' checked="checked"' : ''; ?>/> <?php echo BFText::_('unset'); ?> <input type="radio" name="write_status" value="set"<?php echo JRequest::getVar('write_status','') == 'set' ? ' checked="checked"' : ''; ?>/> <?php echo BFText::_('set'); ?>
			    		</td>
					</tr>
					</thead>
				</table>
    		</td>
    	</tr>
        <tr>
        	<th nowrap align="center"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($rows); ?>);" /></th>
            <th>
                <a href="index.php?option=com_facileforms&amp;act=recordmanagement&amp;txtsearch=<?php echo JRequest::getWord('txtsearch','false'); ?>&amp;search=<?php echo htmlentities(JRequest::getVar('search',''), ENT_QUOTES, 'UTF-8'); ?>&amp;form=<?php echo htmlentities(JRequest::getVar('form',''), ENT_QUOTES, 'UTF-8'); ?>&amp;task=<?php echo JRequest::getVar('task',''); ?>&amp;limitstart=<?php echo JRequest::getInt('limitstart',0); ?>&amp;mylimit=<?php echo JRequest::getInt('mylimit',20); ?>&amp;order=<?php echo JRequest::getVar('order', 'DESC') == 'DESC' ? 'ASC' : 'DESC'; ?>&amp;orderBy=id"><?php echo BFText::_( 'ID' ); ?></a>
            </th>
            <th>
                <a href="index.php?option=com_facileforms&amp;act=recordmanagement&amp;txtsearch=<?php echo JRequest::getWord('txtsearch','false'); ?>&amp;search=<?php echo htmlentities(JRequest::getVar('search',''), ENT_QUOTES, 'UTF-8'); ?>&amp;form=<?php echo htmlentities(JRequest::getVar('form',''), ENT_QUOTES, 'UTF-8'); ?>&amp;task=<?php echo JRequest::getVar('task',''); ?>&amp;limitstart=<?php echo JRequest::getInt('limitstart',0); ?>&amp;mylimit=<?php echo JRequest::getInt('mylimit',20); ?>&amp;order=<?php echo JRequest::getVar('order', 'DESC') == 'DESC' ? 'ASC' : 'DESC'; ?>&amp;orderBy=submitted"><?php echo BFText::_( 'RECORDS_SUBMITTED' ); ?></a>
            </th>
            <th>
                <a href="index.php?option=com_facileforms&amp;act=recordmanagement&amp;txtsearch=<?php echo JRequest::getWord('txtsearch','false'); ?>&amp;search=<?php echo htmlentities(JRequest::getVar('search',''), ENT_QUOTES, 'UTF-8'); ?>&amp;form=<?php echo htmlentities(JRequest::getVar('form',''), ENT_QUOTES, 'UTF-8'); ?>&amp;task=<?php echo JRequest::getVar('task',''); ?>&amp;limitstart=<?php echo JRequest::getInt('limitstart',0); ?>&amp;mylimit=<?php echo JRequest::getInt('mylimit',20); ?>&amp;order=<?php echo JRequest::getVar('order', 'DESC') == 'DESC' ? 'ASC' : 'DESC'; ?>&amp;orderBy=ip"><?php echo BFText::_( 'IP' ); ?></a>
            </th>
            <th>
                <a href="index.php?option=com_facileforms&amp;act=recordmanagement&amp;txtsearch=<?php echo JRequest::getWord('txtsearch','false'); ?>&amp;search=<?php echo htmlentities(JRequest::getVar('search',''), ENT_QUOTES, 'UTF-8'); ?>&amp;form=<?php echo htmlentities(JRequest::getVar('form',''), ENT_QUOTES, 'UTF-8'); ?>&amp;task=<?php echo JRequest::getVar('task',''); ?>&amp;limitstart=<?php echo JRequest::getInt('limitstart',0); ?>&amp;mylimit=<?php echo JRequest::getInt('mylimit',20); ?>&amp;order=<?php echo JRequest::getVar('order', 'DESC') == 'DESC' ? 'ASC' : 'DESC'; ?>&amp;orderBy=provider"><?php echo BFText::_( 'RECORDS_PROVIDER' ); ?></a>
            </th>
            <th>
                <a href="index.php?option=com_facileforms&amp;act=recordmanagement&amp;txtsearch=<?php echo JRequest::getWord('txtsearch','false'); ?>&amp;search=<?php echo htmlentities(JRequest::getVar('search',''), ENT_QUOTES, 'UTF-8'); ?>&amp;form=<?php echo htmlentities(JRequest::getVar('form',''), ENT_QUOTES, 'UTF-8'); ?>&amp;task=<?php echo JRequest::getVar('task',''); ?>&amp;limitstart=<?php echo JRequest::getInt('limitstart',0); ?>&amp;mylimit=<?php echo JRequest::getInt('mylimit',20); ?>&amp;order=<?php echo JRequest::getVar('order', 'DESC') == 'DESC' ? 'ASC' : 'DESC'; ?>&amp;orderBy=title"><?php echo BFText::_( 'RECORDS_TITLE' ); ?></a>
            </th>
            <th>
                <a href="index.php?option=com_facileforms&amp;act=recordmanagement&amp;txtsearch=<?php echo JRequest::getWord('txtsearch','false'); ?>&amp;search=<?php echo htmlentities(JRequest::getVar('search',''), ENT_QUOTES, 'UTF-8'); ?>&amp;form=<?php echo htmlentities(JRequest::getVar('form',''), ENT_QUOTES, 'UTF-8'); ?>&amp;task=<?php echo JRequest::getVar('task',''); ?>&amp;limitstart=<?php echo JRequest::getInt('limitstart',0); ?>&amp;mylimit=<?php echo JRequest::getInt('mylimit',20); ?>&amp;order=<?php echo JRequest::getVar('order', 'DESC') == 'DESC' ? 'ASC' : 'DESC'; ?>&amp;orderBy=name"><?php echo BFText::_( 'RECORDS_NAME' ); ?></a>
            </th>
            <th>
                <a href="index.php?option=com_facileforms&amp;act=recordmanagement&amp;txtsearch=<?php echo JRequest::getWord('txtsearch','false'); ?>&amp;search=<?php echo htmlentities(JRequest::getVar('search',''), ENT_QUOTES, 'UTF-8'); ?>&amp;form=<?php echo htmlentities(JRequest::getVar('form',''), ENT_QUOTES, 'UTF-8'); ?>&amp;task=<?php echo JRequest::getVar('task',''); ?>&amp;limitstart=<?php echo JRequest::getInt('limitstart',0); ?>&amp;mylimit=<?php echo JRequest::getInt('mylimit',20); ?>&amp;order=<?php echo JRequest::getVar('order', 'DESC') == 'DESC' ? 'ASC' : 'DESC'; ?>&amp;orderBy=paypal_tx_id"><?php echo BFText::_( 'Payment Tx ID' ); ?></a>
            </th>
            <th>
                <a href="index.php?option=com_facileforms&amp;act=recordmanagement&amp;txtsearch=<?php echo JRequest::getWord('txtsearch','false'); ?>&amp;search=<?php echo htmlentities(JRequest::getVar('search',''), ENT_QUOTES, 'UTF-8'); ?>&amp;form=<?php echo htmlentities(JRequest::getVar('form',''), ENT_QUOTES, 'UTF-8'); ?>&amp;task=<?php echo JRequest::getVar('task',''); ?>&amp;limitstart=<?php echo JRequest::getInt('limitstart',0); ?>&amp;mylimit=<?php echo JRequest::getInt('mylimit',20); ?>&amp;order=<?php echo JRequest::getVar('order', 'DESC') == 'DESC' ? 'ASC' : 'DESC'; ?>&amp;orderBy=paypal_payment_date"><?php echo BFText::_( 'Payment Tx Date' ); ?></a>
            </th>
            <th>
                <a href="index.php?option=com_facileforms&amp;act=recordmanagement&amp;txtsearch=<?php echo JRequest::getWord('txtsearch','false'); ?>&amp;search=<?php echo htmlentities(JRequest::getVar('search',''), ENT_QUOTES, 'UTF-8'); ?>&amp;form=<?php echo htmlentities(JRequest::getVar('form',''), ENT_QUOTES, 'UTF-8'); ?>&amp;task=<?php echo JRequest::getVar('task',''); ?>&amp;limitstart=<?php echo JRequest::getInt('limitstart',0); ?>&amp;mylimit=<?php echo JRequest::getInt('mylimit',20); ?>&amp;order=<?php echo JRequest::getVar('order', 'DESC') == 'DESC' ? 'ASC' : 'DESC'; ?>&amp;orderBy=paypal_testaccount"><?php echo BFText::_( 'Payment Test-Account?' ); ?></a>
            </th>
            <th>
                <a href="index.php?option=com_facileforms&amp;act=recordmanagement&amp;txtsearch=<?php echo JRequest::getWord('txtsearch','false'); ?>&amp;search=<?php echo htmlentities(JRequest::getVar('search',''), ENT_QUOTES, 'UTF-8'); ?>&amp;form=<?php echo htmlentities(JRequest::getVar('form',''), ENT_QUOTES, 'UTF-8'); ?>&amp;task=<?php echo JRequest::getVar('task',''); ?>&amp;limitstart=<?php echo JRequest::getInt('limitstart',0); ?>&amp;mylimit=<?php echo JRequest::getInt('mylimit',20); ?>&amp;order=<?php echo JRequest::getVar('order', 'DESC') == 'DESC' ? 'ASC' : 'DESC'; ?>&amp;orderBy=paypal_download_tries"><?php echo BFText::_( 'Payment download tries' ); ?></a>
            </th>
            <th nowrap align="center"><?php echo BFText::_('RECORDS_VIEWED'); ?></th>
			<th nowrap align="center"><?php echo BFText::_('RECORDS_EXPORTED'); ?></th>
			<th nowrap align="center"><?php echo BFText::_('RECORDS_ARCHIVED'); ?></th>
        </tr>            
    </thead>
    <?php
    $k = 0;
    $cnt = count( $rows );
    for ($i=0; $i < $cnt; $i++)
    {
        $row = $rows[$i];
        if ($row->viewed) $view_src = "images/tick.png"; else $view_src = "images/publish_x.png";
		if ($row->exported) $exp_src = "images/tick.png"; else $exp_src = "images/publish_x.png";
		if ($row->archived) $arch_src = "images/tick.png"; else $arch_src = "images/publish_x.png";
        ?>
        <tr class="<?php echo "row$k"; ?>">
            <td nowrap align="center"><input type="checkbox" id="cb<?php echo $i; ?>" name="ids[]" value="<?php echo $row->id; ?>" onclick="isChecked(this.checked);" /></td>
			<td nowrap align="left"><a href="#" onclick="return listItemTask('cb<?php echo $i; ?>','edit')"><?php echo $row->id; ?></a></td>
			<td nowrap align="left"><a href="#" onclick="return listItemTask('cb<?php echo $i; ?>','edit')"><?php echo $row->submitted; ?></a></td>
			<td nowrap align="left"><?php echo $row->ip; ?></td>
			<td nowrap align="left"><?php echo $row->provider; ?></td>
			<td nowrap align="left"><?php echo $row->title; ?></td>
			<td nowrap align="left"><?php echo $row->name; ?></td>
			<td nowrap align="left"><?php echo $row->paypal_tx_id; ?></td>
			<td nowrap align="left"><?php echo $row->paypal_payment_date; ?></td>
			<td nowrap align="left"><?php echo $row->paypal_testaccount ? BFText::_('YES') : BFText::_('NO'); ?></td>
			<td nowrap align="left"><?php echo $row->paypal_download_tries; ?></td>
			<td nowrap align="center"><a href="index.php?option=com_facileforms&amp;act=recordmanagement&amp;txtsearch=<?php echo JRequest::getWord('txtsearch','false'); ?>&amp;search=<?php echo htmlentities(JRequest::getVar('search',''), ENT_QUOTES, 'UTF-8'); ?>&amp;form=<?php echo htmlentities(JRequest::getVar('form',''), ENT_QUOTES, 'UTF-8'); ?>&amp;task=<?php echo JRequest::getVar('task',''); ?>&amp;limitstart=<?php echo JRequest::getInt('limitstart',0); ?>&amp;mylimit=<?php echo JRequest::getInt('mylimit',20); ?>&amp;id=<?php echo $row->id ?>&amp;viewed=<?php echo $row->viewed ?>&amp;order=<?php echo JRequest::getWord('order','DESC') ?>&amp;orderBy=<?php echo JRequest::getWord('orderBy','submitted') ?>"><img src="<?php echo $view_src; ?>" alt="+" border="0" /></a></td>
			<td nowrap align="center"><a href="index.php?option=com_facileforms&amp;act=recordmanagement&amp;txtsearch=<?php echo JRequest::getWord('txtsearch','false'); ?>&amp;search=<?php echo htmlentities(JRequest::getVar('search',''), ENT_QUOTES, 'UTF-8'); ?>&amp;form=<?php echo htmlentities(JRequest::getVar('form',''), ENT_QUOTES, 'UTF-8'); ?>&amp;task=<?php echo JRequest::getVar('task',''); ?>&amp;limitstart=<?php echo JRequest::getInt('limitstart',0); ?>&amp;mylimit=<?php echo JRequest::getInt('mylimit',20); ?>&amp;id=<?php echo $row->id ?>&amp;exported=<?php echo $row->exported ?>&amp;order=<?php echo JRequest::getWord('order','DESC') ?>&amp;orderBy=<?php echo JRequest::getWord('orderBy','submitted') ?>"><img src="<?php echo $exp_src; ?>" alt="+" border="0" /></a></td>
			<td nowrap align="center"><a href="index.php?option=com_facileforms&amp;act=recordmanagement&amp;txtsearch=<?php echo JRequest::getWord('txtsearch','false'); ?>&amp;search=<?php echo htmlentities(JRequest::getVar('search',''), ENT_QUOTES, 'UTF-8'); ?>&amp;form=<?php echo htmlentities(JRequest::getVar('form',''), ENT_QUOTES, 'UTF-8'); ?>&amp;task=<?php echo JRequest::getVar('task',''); ?>&amp;limitstart=<?php echo JRequest::getInt('limitstart',0); ?>&amp;mylimit=<?php echo JRequest::getInt('mylimit',20); ?>&amp;id=<?php echo $row->id ?>&amp;archived=<?php echo $row->archived ?>&amp;order=<?php echo JRequest::getWord('order','DESC') ?>&amp;orderBy=<?php echo JRequest::getWord('orderBy','submitted') ?>"><img src="<?php echo $arch_src; ?>" alt="+" border="0" /></a></td>
        </tr>
        <?php
        $k = 1 - $k;
    }
    ?>
    </table>
</div>

<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="option" value="com_facileforms" />
<input type="hidden" id="task" name="task" value="<?php echo JRequest::getVar('task',''); ?>" />
<input type="hidden" name="act" value="recordmanagement" />
<input type="hidden" name="status_update" value="0" />
<input type="hidden" name="order" value="<?php echo JRequest::getWord('order','DESC') ?>" />
<input type="hidden" name="orderBy" value="<?php echo JRequest::getWord('orderBy','submitted') ?>" />
<input type="hidden" id="limitstart" name="limitstart" value="<?php echo JRequest::getInt('limitstart',0); ?>" />
<input type="hidden" id="mylimit" name="mylimit" value="<?php echo JRequest::getInt('mylimit',20); ?>" />
<input type="hidden" id="exportt" name="exportt" value="0" />
 
</form>

<table class="adminlist">
	<tfoot>
    	<tr>
    		<td colspan="14">
    			<form action="#">
    				<?php echo $pagination->getListFooter() ?>
    			</form>
    		</td>
    	</tr>
	</tfoot>
</table>

<script>
// fixing limit, since it seems not to be available through JRequest or even $_POST/$_GET/$_REQUEST
document.getElementById('limit').onchange = 
function(){
	document.getElementById('mylimit').value = document.getElementById('limit').options[document.getElementById('limit').selectedIndex].value;
	document.adminForm.submit();
};
</script>

<?php
	}
	
}