2010-12-30 09:38:25 +00:00
|
|
|
<?php
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
G::LoadClass('processMap');
|
|
|
|
|
$oProcessMap = new processMap(new DBConnection);
|
|
|
|
|
|
2010-12-30 11:29:05 +00:00
|
|
|
if(isset($_GET['pid']) && !isset($_GET['type'])){
|
|
|
|
|
$rows = $oProcessMap->getExtReportTables($_GET['pid']);
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-03 14:44:06 +00:00
|
|
|
else if(isset($_GET['pid']) && $_GET['type'] == 'NORMAL')
|
2010-12-30 09:38:25 +00:00
|
|
|
{
|
2010-12-30 11:29:05 +00:00
|
|
|
$aTheFields = array();
|
|
|
|
|
$aTheFields = getDynaformsVars($_GET['pid'], false);
|
|
|
|
|
foreach ($aTheFields as $aField) {
|
|
|
|
|
$rows[] = array('FIELD_UID' => $aField['sName'] . '-' . $aField['sType'],
|
|
|
|
|
'FIELD_NAME' => $aField['sName']);
|
|
|
|
|
}
|
2010-12-30 09:38:25 +00:00
|
|
|
}
|
|
|
|
|
|
2011-01-03 14:44:06 +00:00
|
|
|
else if(isset($_GET['pid']) && $_GET['type'] == 'GRID'){
|
2010-12-30 11:29:05 +00:00
|
|
|
$aTheFields = array();
|
|
|
|
|
$aTheFields = getGridsVars($_GET['pid']);
|
|
|
|
|
foreach ($aTheFields as $aField) {
|
|
|
|
|
$rows[] = array('FIELD_UID' => $aField['sName'] . '-' . $aField['sXmlForm'],
|
|
|
|
|
'FIELD_NAME' => $aField['sName']);
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-01-04 14:33:49 +00:00
|
|
|
if(isset($_GET['tid']))
|
|
|
|
|
{
|
|
|
|
|
require_once 'classes/model/ReportTable.php';
|
|
|
|
|
$o = new ReportTable();
|
|
|
|
|
$rows = $o->load($_GET['tid']);
|
|
|
|
|
}
|
|
|
|
|
|
2010-12-30 09:38:25 +00:00
|
|
|
|
|
|
|
|
$result['totalCount'] = count($rows);
|
|
|
|
|
$result['data'] = $rows;
|
2011-04-19 16:26:20 -04:00
|
|
|
print G::json_encode( $result ) ;
|
2010-12-30 09:38:25 +00:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch ( Exception $e ) {
|
2011-04-19 16:26:20 -04:00
|
|
|
print G::json_encode ( $e->getMessage() );
|
2010-12-30 09:38:25 +00:00
|
|
|
}
|
2011-04-19 16:26:20 -04:00
|
|
|
?>
|