Skip to content

Commit

Permalink
added report objects
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Jones <adrianj1998@hotmail.com>
  • Loading branch information
adrianj98 committed Oct 24, 2012
1 parent 2e99ff5 commit 298d3dd
Show file tree
Hide file tree
Showing 14 changed files with 1,332 additions and 936 deletions.
21 changes: 18 additions & 3 deletions class/JasperGroovy.php
Expand Up @@ -7,7 +7,7 @@
* @author adrian
*/

class jasperJavascript extends JasperExp
class JasperGroovy extends JasperExp
{

function _setVar($name,$codename,$value) {
Expand All @@ -17,10 +17,25 @@ function _setVar($name,$codename,$value) {
}


function right($value, $count) {

return substr($value, ($count * -1));
}

function left($string, $count) {
return substr($string, 0, $count);
}

public $arraysqltable;
public $previousarraydata ;
public $arrayVariable;
public $global_pointer;
public $arrayParameter;

function run($code)
{

$code = $this->replaceVars($code);
//$code = $this->replaceVars($code);

$arrdata=explode("+",$code);

Expand Down Expand Up @@ -108,7 +123,7 @@ function run($code)

return implode($arrdata);
}
return $result ;
return false ;

}

Expand Down
54 changes: 26 additions & 28 deletions class/JasperJS.php
@@ -1,41 +1,39 @@
<?php

require_once(dirname(__FILE__) . '/j4p5/js.php');

require_once(dirname(__FILE__).'/j4p5/js.php');
class jasperJavascript extends JasperExp {


class jasperJavascript extends JasperExp
{
static $compiled = array();

function _setVar($name,$codename,$value) {

js::define($codename ,array(),array('value'=>$value));

}


function run($code)
{
// echo $code .' - ';
$code = trim($code);
if (empty($code))
return $code;
$code = $this->replaceVars($code);
function _setVar($name, $codename, $value) {

$code = 'var result = ( '.$code .');';
js::define($codename, array(), array('value' => $value));
}

#-- Run the js code.
function run($code) {
$code = trim($code);
if (empty($code))
return $code;
$code = $this->replaceVars($code);
$id = md5($code);
$code = 'function func_' . $id . ' () { return (' . $code . '); }';

// -- compile script
if (!self::$compiled[$id]) {
js::run($code, JS_DIRECT, $id);
self::$compiled[$id] = jsrt::$jsfunctions['func_' . $id];
}

js::run($code);
$func = self::$compiled[$id];

//-- Run the js code.

$result = php_str(call_user_func($func));
// $result = php_str(jsrt::idv('result'));

$result = php_str(jsrt::idv('result'));
return $result;
}

return $result ;

}

}
}


28 changes: 0 additions & 28 deletions class/JasperParser.php

This file was deleted.

0 comments on commit 298d3dd

Please sign in to comment.