function getResults($acctId) { $tc = new TopCompanyResults(); $entry = $tc->getEntry($acctId); //dump($entry); $responses = $tc->getResponses($entry); $otype = $entry->Is_Hardware__c ? 'Hardware' : 'Software'; $position = $responses['02']->Position; //print "$otype organization is $position breakpoint<br>"; //dump($responses); $response = array('Hardware' => $otype, 'Position' => $position, 'Responses' => $responses); return json_encode($response); }
$org = $_SESSION['org']; } else { $org = ''; } if (isset($_SESSION['chart'])) { $chart = $_SESSION['chart']; } else { $chart = ''; } if (isset($_REQUEST['org'])) { $org = $_REQUEST['org']; $chart = $_REQUEST['chart']; $action = $_REQUEST['action']; $_SESSION['org'] = $org; $_SESSION['chart'] = $chart; $entry = $tc->getEntry($org); $results = $tc->getResponses($entry); $otype = $entry->Is_Hardware__c ? 'Hardware' : 'Software'; $position = $results['02']->Position; $result = $results[$chart]; $benchmark = ($result->Benchmark_High - $result->Benchmark_Low) / 2 + $result->Benchmark_Low; $ytemp = max($result->Response__c, $result->Benchmark_High, $result->Peer_Median, $result->Group_Median__c); $yaxis = $ytemp - $ytemp % 5 + 5; if ($yaxis < 15) { $yaxis = 15; } $overUnder = $position == 'ABOVE' ? '70% or more' : 'less than 70%'; $ctitle = $result->Question__c; $data = new pData(); $bdat = array(array(0 => $result->Benchmark_High, 1 => $result->Benchmark_High, 2 => $result->Benchmark_High, 3 => $result->Benchmark_High, 4 => $result->Benchmark_High, 5 => $result->Benchmark_High), array(0 => $result->Benchmark_Low, 1 => $result->Benchmark_Low, 2 => $result->Benchmark_Low, 3 => $result->Benchmark_Low, 4 => $result->Benchmark_Low, 5 => $result->Benchmark_Low)); $data->addPoints(array($result->Prior_Year, $result->Response__c, $result->Peer_Median, $result->Group_Median__c), "series1");