Jump to content

PHPVMS Dashboard error


dbrambilla

Recommended Posts

Hi All,

It appears that my host provider (Bluehost) recently tried to upgrade me to PHP version 5.6 which caused a bunch of problems. They have since put me back to PHP version 5.4.43.

The site now seems to work but I am getting an error on the PHPVMS Dashboard page. The error as follows:

Open Flash Chart

JSON Parse Error [syntax Error]

Error at character 0, line 1:

0: <br />

Has anyone seen this before and can you give me any guidance on how to repair this issue? Is this caused by a setting in the php.ini file maybe that was changed? The host provider says this is a script issue and forwarded me on some error message:

America/Denver] PHP Warning: Creating default object from empty value in /home4/canadid7/public_html/phpvms/admin/modules/Plugins/Plugins.php on line 59

[09-Jan-2016 03:40:45 America/Denver] PHP Strict Standards: Non-static method OFCharts::show_chart() should not be called statically in /home4/canadid7/public_html/phpvms/core/common/OFCharts.class.php on line 204

Appreciate any help you can provide.

Best Regards,

Darryl

Link to comment
Share on other sites

  • Moderators

Hey Darryl,

This is a known phpVMS issue when you use the latest PHP versions. Simply open your core/common/OFCharts.class.php file, find this:

protected function show_chart($title) {

and replace it with this:

protected static function show_chart($title) {

Link to comment
Share on other sites

  • 4 weeks later...

Still not working. Is this correct?

<?php

/**

* phpVMS - Virtual Airline Administration Software

* Copyright © 2008 Nabeel Shahzad

* For more information, visit www.phpvms.net

* Forums: http://www.phpvms.net/forum'>http://www.phpvms.net/forum

* Documentation: http://www.phpvms.net/docs'>http://www.phpvms.net/docs

*

* phpVMS is licenced under the following license:

* Creative Commons Attribution Non-commercial Share Alike (by-nc-sa)

* View license.txt in the root, or visit http://creativecommons.org/licenses/by-nc-sa/3.0/

*

* @author Nabeel Shahzad

* @copyright Copyright © 2008, Nabeel Shahzad

* @link http://www.phpvms.net

* @license http://creativecommons.org/licenses/by-nc-sa/3.0/

*/

class OFCharts extends CodonData

{

protected static $chart;

protected static $x_axis;

protected static $y_axis;

protected static $data_set = array();

protected static $range;

protected static function init()

{

include_once CORE_LIB_PATH.'/php-ofc-library/open-flash-chart.php';

self::$chart = new open_flash_chart();

self::$y_axis = new y_axis();

self::$x_axis = new x_axis();

}

protected static function get_range($values)

{

# Determine a max

$range = array(

'max' => $values[0],

'min' => $values[1],

);

foreach($values as $v)

{

if($v > $range['max'])

$range['max'] = $v;

if($v < $range['min'])

$range['min'] = $v;

}

if($range['max'] == $range['min'])

{

$step = ceil($range['max']/2);

}

else

{

$diff = intval(abs($range['max'] - $range['min']));

$step = ceil(($diff / 90));

}

$range['max'] += $step;

$range['min'] -= $step;

return $range;

}

public static function add_data_set($titles, $values, $line_title = '', $color='#3D5C56')

{

self::$data_set[] = array(

'line_title' => $line_title,

'titles' => $titles,

'values' => $values,

'color' => $color,

);

}

public static function create_pie_graph($title)

{

self::init();

$d = array();

foreach(self::$data_set as $data)

{

$d[] = new pie_value($data['values'], $data['titles']);

}

$pie = new pie();

$pie->start_angle(35)

->add_animation( new pie_fade() )

->add_animation( new pie_bounce(4) )

// ->label_colour('#432BAF') // <-- uncomment to see all labels set to blue

->gradient_fill()

->tooltip( '#val# of #total#<br>#percent# of 100%' )

->colours(

array(

'#1F8FA1', // <-- blue

'#848484', // <-- grey

'#CACFBE', // <-- green

'#DEF799' // <-- light green

)

);

$pie->set_values( $d );

self::$chart->add_element($pie);

self::show_chart($title);

}

public static function create_area_graph($title)

{

self::init();

$d = new solid_dot();

$d->size(3)->halo_size(1)->colour('#3D5C56');

$range_values = array();

foreach(self::$data_set as $data)

{

if(!is_array($data['values']))

continue;

$area = new area();

// set the circle line width:

$area->set_width( 2 );

$area->set_default_dot_style($d);

$area->set_colour($data['color']);

$area->set_fill_colour($data['color']);

$area->set_fill_alpha( .3 );

$area->on_show(new line_on_show('pop-up', 2, 0.5));

$area->set_key($data['line_title'], 10);

$area->set_values($data['values']);

# Since there should be an even number on the xaxis for all sets

$x_axis_titles = $data['titles'];

# Add our values into a big bucket so we can get the highest and lowest

$range_values = array_merge($range_values, $data['values']);

self::$chart->add_element($area);

}

$x_labels = new x_axis_labels();

$x_labels->set_labels( $x_axis_titles );

$x_labels->set_vertical();

self::$x_axis->set_labels( $x_labels );

$range = self::get_range($range_values);

self::$y_axis->set_range($range['min'], $range['max']);

self::show_chart($title);

}

/**

* Create a single line graph

*

* @param string $title Title of the graph

* @param array $values Array of values

* @param array $titles Array of titles

* @return none

*

*/

public static function create_line_graph($title)

{

self::init();

$d = new solid_dot();

$d->size(3)->halo_size(1)->colour('#3D5C56');

$range_values = array();

foreach(self::$data_set as $data)

{

if(!is_array($data['values']))

continue;

$line = new line();

$line->set_default_dot_style($d);

$line->set_values($data['values']);

$line->set_width(2);

$line->set_key($data['line_title'], 10);

$line->set_colour($data['color']);

# Since there should be an even number on the xaxis for all sets

$x_axis_titles = $data['titles'];

# Add our values into a big bucket so we can get the highest and lowest

$range_values = array_merge($range_values, $data['values']);

self::$chart->add_element($line);

}

$x_labels = new x_axis_labels();

$x_labels->set_labels( $x_axis_titles );

$x_labels->set_vertical();

self::$x_axis->set_labels( $x_labels );

$range = self::get_range($range_values);

self::$y_axis->set_range($range['min'], $range['max']);

self::show_chart($title);

}

protected static function show_chart($title)

{

$title = new title($title);

self::$chart->set_title($title);

self::$chart->set_y_axis(self::$y_axis);

self::$chart->set_x_axis(self::$x_axis);

self::$chart->set_bg_colour( '#FFFFFF' );

#echo '<pre>';

echo self::$chart->toPrettyString();

}

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...