46 lines
1.1 KiB
PHP
46 lines
1.1 KiB
PHP
|
|
<?php
|
||
|
|
/*
|
||
|
|
* @component SQL 2 Excel Component
|
||
|
|
* @copyright Copyright (C) Joomla-R-Us, joomla-r-us.com
|
||
|
|
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPLv3
|
||
|
|
*/
|
||
|
|
|
||
|
|
// No direct access
|
||
|
|
defined( '_JEXEC' ) or die( 'Restricted access' );
|
||
|
|
|
||
|
|
jimport( 'joomla.application.component.view' );
|
||
|
|
|
||
|
|
class Sql2excelViewRtparms extends JView
|
||
|
|
{
|
||
|
|
|
||
|
|
function display($tpl = null)
|
||
|
|
{
|
||
|
|
// Workbook ID
|
||
|
|
$wb_id = JRequest::getVar( 'id', 0, 'get', 'int' );
|
||
|
|
|
||
|
|
JHTML::stylesheet( 'preview.css', 'components/com_sql2excel/assets/css/' );
|
||
|
|
|
||
|
|
if ( (int) $wb_id > 0 ) {
|
||
|
|
$model =& $this->getModel();
|
||
|
|
$wsParms = $model->getWorksheetParms((int) $wb_id);
|
||
|
|
|
||
|
|
if ( count($wsParms) >= 1 ) {
|
||
|
|
$parmcnt = 0;
|
||
|
|
foreach ( $wsParms as $ws ) {
|
||
|
|
$parmcnt = $parmcnt + $ws->nr_parms;
|
||
|
|
}
|
||
|
|
$this->assignRef('worksheetParms',$wsParms);
|
||
|
|
$wbTitle = $wsParms[0]->wbtitle;
|
||
|
|
$this->assignRef('wbtitle',$wbTitle);
|
||
|
|
$this->assignRef('wb_id',$wb_id);
|
||
|
|
$this->assignRef('nr_parms',$parmcnt);
|
||
|
|
} else {
|
||
|
|
JError::raiseError( 500, JText::_( 'No data' ) );
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
JError::raiseError( 500, JText::_( 'Invalid Workbook ID' ) );
|
||
|
|
}
|
||
|
|
parent::display($tpl);
|
||
|
|
}
|
||
|
|
}
|