<?php
//global $debug_query; $debug_query = true;
$template = $_REQUEST['template'];
if (isset($template) && ($template != '')) {
// TODO: try to load template
if ($template == 'WPCSS') {
echo '
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<link rel="stylesheet" href="css/phpMyEdit.css" />
<link rel="stylesheet" href="css/phpMyEdit-multireport.css" type="text/css" />
</head>
<body class="pme-main pme-report">
';
}
} else {
// this is the default
echo '
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Report</title>
<link rel="shortcut icon" type="image/x-icon" href="images/pme-icon.png" />
<link rel="stylesheet" href="css/phpMyEdit.css" />
<link rel="stylesheet" href="css/phpMyEdit-multireport.css" type="text/css" />
<script type="text/javascript" src="js/phpMyEdit.js"></script>
<style type="text/css">
</style>
</head>
<body class="pme-main pme-report">
';
}
function phpMyEditPageHeader($inst) {
global $debug_query;
echo "<div class='pme-report'>\n";
if (in_array($inst->{'page_type'}, array('L', 'A', 'C', 'V', 'D'))) {
$report = $inst->{'fdd'}['rd_reportcode']['default'];
if (isset($report)) {
if ($debug_query) {
$sql = "SELECT `re_name` AS 'Report Name', `re_title` AS 'Report Title'
FROM `pme_reports`
WHERE `re_code` = '" . $report . "'";
$inst->PrintAssociateTable($sql);
$sql = "SELECT `rd_sequence` AS 'Sequence',
`rd_title` AS 'Section Title',
`rd_sql` AS 'SQL'
FROM `pme_repdetails`
WHERE `rd_reportcode` = '" . $report . "'
ORDER BY `rd_sequence` ASC";
$inst->PrintAssociateTable($sql);
}
$sql = "SELECT `re_title` FROM `pme_reports`
WHERE `re_code` = '" . $report . "'";
$row = $inst->QueryDB($sql);
if (isset($row['re_title'])) {
echo "<h3>{$row['re_title']}</h3>\n";
}
$sql = "SELECT `rd_title`,`rd_sql` FROM `pme_repdetails`
WHERE `rd_reportcode` = '" . $report . "'
ORDER BY `rd_sequence` ASC";
$rows = $inst->FetchDB($sql, 'a');
if ($rows) {
foreach ($rows as $row) {
if (isset($row['rd_title'])) {
echo "<h4>{$row['rd_title']}</h4>\n";
}
if (isset($row['rd_sql'])) {
$inst->PrintAssociateTable($row['rd_sql']);
}
}
}
}
}
}
function phpMyEditPageFooter($inst) {
echo "</div>\n";
}
/*
* IMPORTANT NOTE: This generated file contains only a subset of huge amount
* of options that can be used with phpMyEdit. To get information about all
* features offered by phpMyEdit, please check the documentation. It is available
* on the phpMyEdit pages or in the manuals folder. Some information can also be
* found in the examples/configoptions.md file.
*
* https://sourceforge.net/projects/phpmariaedit/
*
* This file was generated by:
*
* phpMyEdit version: 5.7.6
* lib/phpMyEdit.class.php class: 5.7.6
* phpMyEditSetup.php script: 5.7.6
* generated script: 5.7.6
*
* This file was manually updated.
*/
require_once(dirname(__FILE__).'/lib/extensions/phpMyEdit-multireport.class.php');
require_once(dirname(__FILE__).'/lib/phpMyEditDB.php');
require_once(dirname(__FILE__).'/phpMyEditDefaults.php');
if (isset($_REQUEST['report'])) {
$opts['cgi']['persist'] = array('report' => $_REQUEST['report']);
}
if (isset($opts['cgi']['persist']['report'])) {
$report = $opts['cgi']['persist']['report'];
$opts['filters'] = "`re_code` = '" . $report . "'";
} else {
$report = '';
$opts['filters'] = "`re_code` != ''";
}
$opts['tb'] = 'pme_reports';
// custom settings overwriting general edit defaults
$opts['options'] = '';
$opts['navigation'] = 'GD';
$opts['execute'] = 0;
// Name of field which is the unique key
$opts['key'] = 're_code';
// Type of key field (int/real/string/date etc.)
$opts['key_type'] = 'string';
// Sorting field(s)
$opts['sort_field'] = array('re_code');
$opts['fdd']['rowid'] = array(
'name' => 'ID',
'select' => 'T',
'options' => 'ACH',
'maxlen' => '10',
'js' => array('required' => true),
'default' => '0'
);
$opts['fdd']['rd_reportcode'] = array(
'name' => 'Report',
'select' => 'T',
'options' => 'ACH',
'maxlen' => '10',
'js' => array('required' => true),
'values' => array('table' => 'pme_reports',
'column' => 're_code'
)
);
if ($report != '') {
$opts['fdd']['rd_reportcode']['options'] = 'ADR';
$opts['fdd']['rd_reportcode']['default'] = $report;
}
if (isset($template) && ($template != '') && ($template != 'WPCSS')) {
echo '
<script>
PME_js_setPageTitle("Run report - ' . $report. '");
</script>
';
}
// Now important call to phpMyEdit_MultiReport
new phpMyEdit_MultiReport($opts);
//eof