Example #1
0
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);
}
Example #2
0
<?php

session_start();
/* pChart library inclusions */
include "../pChart/class/pData.class.php";
include "../pChart/class/pDraw.class.php";
include "../pChart/class/pImage.class.php";
require 'TopCompanyResults.php';
$barwidths = array('1' => 35, '1+' => 85, '2' => 145, '2+' => 195, '3' => 255, '3+' => 305, '4' => 365, '4+' => 415, '5' => 475, '5+' => 525);
$tc = new TopCompanyResults();
if (isset($_SESSION['org'])) {
    $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];