示例#1
0
include_once "sp_charts.php";
include_once "common_functions.php";
$path = $DOCROOT;
$_date = 'lastyear';
$display_date = "Last Year";
$provider_id = $_SESSION['provider']['serviceprovider_id'];
$csvfile = "/var/www/charts/genpie_" . $_date . ".csv";
$_SESSION['csvfile'] = $csvfile;
$imagename = "";
$count = "";
$imagename = "pie_popularsearches.png";
$row = 0;
$num = 0;
$services = array();
$searches = array();
$res_by_popularity = get_search_by_popularity($_date, $provider_id);
if (($handle = fopen($csvfile, "r")) !== FALSE) {
    while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
        $num = count($data);
        $row++;
        for ($c = 0; $c < $num; $c++) {
            if ($c % 2) {
                array_push($searches, $data[$c]);
            } else {
                array_push($services, $data[$c]);
            }
        }
    }
}
require_once "/var/www/ChartDirector/lib/phpchartdir.php";
# Create a PieChart object of size 360 x 300 pixels
                    $display_date = 'Last Year';
                }
            }
        }
    }
}
$_SESSION['selected_value'] = $_date;
$csvfile = "/var/www/charts/genpie_" . $_date . ".csv";
$_SESSION['csvfile'] = $csvfile;
$data = 0;
$imagename = "";
$count = "";
$imagename = "pie_popularsearches.png";
$services = array();
$searches = array();
$res_by_popularity = get_search_by_popularity($_date, $csvfile);
$row = 0;
$num = 0;
if (($handle = fopen($csvfile, "r")) !== FALSE) {
    while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
        $num = count($data);
        $row++;
        for ($c = 0; $c < $num; $c++) {
            if ($c % 2) {
                array_push($searches, $data[$c]);
            } else {
                array_push($services, $data[$c]);
            }
        }
    }
}