Example #1
0
		}	
	});
</script>';

if ($_SESSION["back_to_menu"])
    $xt->assign("back_to_menu", true);
else
    $xt->assign("back_to_menu", false);
$xt->assign("wr_pagestylepath", $wr_pagestylepath);
$xt->assign("chart_block", true);
$xt->assign("chart_constructor", $show_dchart);
$xt->assign("load_flash_player", $load_flash_player);
if (!IsStoredProcedure($chrt_array['sql']))
    $xt->assign("testAdvSearch", testAdvSearch($chrt_array['tables'][0]));
else
    $xt->assign("testAdvSearch", false);

$chart_name_js = jsreplace(postvalue('cname'));
$xt->assign("chart_name_js", $chart_name_js);

$xt->assign("chart_title", runner_htmlspecialchars($chrt_array['title']));
$xt->assign("short_table_name", runner_htmlspecialchars($chrt_array['settings']['short_table_name']));
$xt->assign("short_table_name_js", jsreplace($chrt_array['settings']['short_table_name']));
$xt->assign("ext", "php");

$searchType = (!is_wr_project()) ? GetTableLink("dsearch") : GetTableLink(runner_htmlspecialchars($chrt_array['settings']['short_table_name']), "search");
$xt->assign("searchHref", "href='" . $searchType . "?cname=" . $chart_name_js . "'");

$templatefile = GetTemplateName("", "dchart");
$xt->display($templatefile);
?>
if ( !empty( $arr ) ){
	$b_includes .= "<script type='text/javascript'>
		$(document).ready(function(){"."\r\n";
	
	for ($i=0; $i < count($arr); $i++) {
		$b_includes .= "
		tr_elem = $('.condition-row').eq('".$i."');
		$(tr_elem).show();
		$(tr_elem).find('input, select').each(function(){
			this.disabled = false;
		});
		$(tr_elem).find('select#field_opt').val('".jsreplace($arr[$i]["field_opt"])."');
		$(tr_elem).find('input#filter_value').val('".jsreplace($arr[$i]["filter_value"])."');
		$(tr_elem).find('input#first_or_value').val('".jsreplace($arr[$i]["first_or_value"])."');
		$(tr_elem).find('input#second_or_value').val('".jsreplace($arr[$i]["second_or_value"])."');
		$(tr_elem).find('input#third_or_value').val('".jsreplace($arr[$i]["third_or_value"])."');
		"."\r\n";	
	}
	
	$b_includes .= '
		tr_elem = $(".condition-row").eq('.count($arr).');
		$(tr_elem).show();
		$(tr_elem).find("input, select").each(function(){
			this.disabled = false;
		});
	});
	</script>'."\r\n";
}
$xt->assign("report_name_preview",$_SESSION['webreports']['settings']['name']);
$xt->assign("b_includes", $b_includes);
$xt->assign("wr_pagestylepath", $wr_pagestylepath);
Example #3
0
        Reload_Chart(postvalue("cname"));
    }
}
include 'include/xtempl.php';
$xt = new Xtempl();
$chrt_array = getChartArray(postvalue("cname"));
if (is_wr_project()) {
    include "include/" . $chrt_array['settings']['short_table_name'] . "_variables.php";
}
$show_dchart = '<script type="text/javascript" language="javascript">
	//<![CDATA[
	var chart = new AnyChart("' . GetRootPathForResources("libs/swf/AnyChart.swf") . '", "' . GetRootPathForResources("libs/swf/Preloader.swf") . '");
	chart.width = "780";
	chart.height = "570";

	var xmlFile = "' . GetTableLink("dchartdata", "", 'cname=' . jsreplace(runner_htmlspecialchars(postvalue('cname')))) . '";
	xmlFile += "&ctype=' . $chrt_array['chart_type']['type'] . '";
	chart.setXMLFile(xmlFile);
	chart.write();
	//]]>
</script>';
$load_flash_player = '
<script type="text/javascript">
	var svgSupported = window.SVGAngle != undefined;
		var str="";
		if (!svgSupported)
		{
			str = "<center>";
			str += "' . "" . '<br /><br />";
			str += "<a href=\\"http://www.adobe.com/go/getflashplayer\\"><img border=\\"0\\" src=\\"http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif\\" /></a><br />";
			str += "</center>";		
$jscode.="TEXT_MONTH_DEC='".jsreplace("December")."';\r\n";

$jscode.="TEXT_DAY_SU='".jsreplace("Su")."';\r\n";
$jscode.="TEXT_DAY_MO='".jsreplace("Mo")."';\r\n";
$jscode.="TEXT_DAY_TU='".jsreplace("Tu")."';\r\n";
$jscode.="TEXT_DAY_WE='".jsreplace("We")."';\r\n";
$jscode.="TEXT_DAY_TH='".jsreplace("Th")."';\r\n";
$jscode.="TEXT_DAY_FR='".jsreplace("Fr")."';\r\n";
$jscode.="TEXT_DAY_SA='".jsreplace("Sa")."';\r\n";

$jscode.="TEXT_TODAY='".jsreplace("today")."';\r\n";
$jscode .= '
locale_dateformat = "'.$locale_info["LOCALE_IDATE"].'";
locale_datedelimiter = "'.$locale_info["LOCALE_SDATE"].'";
bLoading = false;
TEXT_PLEASE_SELECT = "'.jsreplace("Please select").'"; 
detect = navigator.userAgent.toLowerCase();
checkIt = function(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}
ShowHideControls = function ()
{';
foreach ( $inspect_fields as $fld ) {
	if(is_wr_db())
		$fld_type=WRGetFieldType($fld['table'].".".$fld['name']);
	elseif(is_wr_custom())
		$fld_type=WRCustomGetFieldType($fld['table'],$fld['name']);
	else
function WRProcessLargeText($text,$field,$recid,$chars,$mode,$strLabel, $isProgectTable = false)
{
	if(!$chars)
		return $text;
	if($mode!=MODE_LIST && $mode!=MODE_PRINT || strlen($text)<$chars+10)
		return $text;
	
	if($isProgectTable)
		$shortening = GetShorteningForLargeText($text, $cNumberOfChars);
	else 
		$shortening = substr($text,0,$chars);
		
	if($mode==MODE_PRINT)
	{
		return $shortening."...";
	}
//	List page
	$id="textbox_".GoodFieldName($field).$recid;
	$textbox="<span style=\"display:none\" id=\"".$id."\">".runner_htmlspecialchars($text)."</span>";
	$link="<a href=# onclick=\"
	
	var offset = $(this).offset();
	offset.left -= $(window).scrollLeft();
	offset.top -= $(window).scrollTop();
	$('#".$id."').clone().dialog(
	{
title: '".jsreplace($strLabel)."',
		draggable: true,
		resizable: true,
		bgiframe: true,
		modal: false,
		minheight:400,
		position:[offset.left-50,offset.top-50]
	}
	);
	return false;
	\">&nbsp;"."More"."...</a>";
	return $shortening.$link.$textbox;
}
		if(!is_numeric($i))
			continue;
		$b_includes .= '
		tr_elem = $(".condition-row").eq('.$i.');
		$(tr_elem).show();
		$(tr_elem).find("input, select").each(function(){
			if ((this.id == "group_by_value" || this.id == "having_value") && !$("#group_by_toggle")[0].checked) {
				return;
			}
			this.disabled = false;
		});
		$(tr_elem).find("select#field_opt").val(\''.jsreplace($arr[$i]['field_opt']).'\');
		$(tr_elem).find("input#filter_value").val(\''.jsreplace($arr[$i]['filter_value']).'\');
		$(tr_elem).find("input#first_or_value").val(\''.jsreplace($arr[$i]['first_or_value']).'\');
		$(tr_elem).find("input#second_or_value").val(\''.jsreplace($arr[$i]['second_or_value']).'\');
		$(tr_elem).find("input#third_or_value").val(\''.jsreplace($arr[$i]['third_or_value']).'\');
		sortDir = $(tr_elem).find("select#sort_dir").get(0);
		$(sortDir).val("'.($arr[$i]['sort_dir']).'");
		sortOrder=$(tr_elem).find("select#sort_order").get(0);
		sortOrder.options[sortOrder.options.length]=new Option("","'.($arr[$i]['sort_order']).'");
		$(sortOrder).val("'.($arr[$i]['sort_order']).'");
		$(tr_elem).find("select#group_by_value").val("'.($arr[$i]['group_by_value']).'");
		$(tr_elem).find("input#having_value").val("'.($arr[$i]['having_value']).'");
		if(!$(sortDir).val() || $(sortDir).val()=="-1")
			$(sortOrder).hide();
		else
			$(sortOrder).show();
		'."\r\n";	
	}
	
	$b_includes .= '
Example #7
0
function WRProcessLargeText($text, $field, $recid, $chars, $mode, $strLabel, $isProgectTable = false)
{
    if (!$chars) {
        return $text;
    }
    if ($mode != MODE_LIST && $mode != MODE_PRINT || strlen($text) < $chars + 10) {
        return $text;
    }
    if ($isProgectTable) {
        $shortening = GetShorteningForLargeText($text, $cNumberOfChars);
    } else {
        $shortening = substr($text, 0, $chars);
    }
    if ($mode == MODE_PRINT) {
        return $shortening . "...";
    }
    //	List page
    $id = "textbox_" . GoodFieldName($field) . $recid;
    $textbox = "<span style=\"display:none\" id=\"" . $id . "\">" . $text . "</span>";
    $link = "<a href=# onclick=\"\n\t\n\tvar offset = \$(this).offset();\n\toffset.left -= \$(window).scrollLeft();\n\toffset.top -= \$(window).scrollTop();\n\t\$('#" . $id . "').clone().dialog(\n\t{\ntitle: '" . jsreplace($strLabel) . "',\n\t\tdraggable: true,\n\t\tresizable: true,\n\t\tbgiframe: true,\n\t\tmodal: false,\n\t\tminheight:400,\n\t\tposition:[offset.left-50,offset.top-50]\n\t}\n\t);\n\treturn false;\n\t\">&nbsp;" . "Más" . "...</a>";
    return $shortening . $link . $textbox;
}
function BuildSelectControl($field, $value, $fieldNum = 0, $mode, $id = "", $additionalCtrlParams, &$pageObj)
{
    global $conn, $strTableName;
    //	read control settings
    $table = $strTableName;
    $strLabel = Label($field);
    $is508 = isEnableSection508();
    $alt = "";
    if (($mode == MODE_INLINE_EDIT || $mode == MODE_INLINE_ADD) && $is508) {
        $alt = ' alt="' . htmlspecialchars($strLabel) . '" ';
    }
    $cfield = "value_" . GoodFieldName($field) . "_" . $id;
    $clookupfield = "display_value_" . GoodFieldName($field) . "_" . $id;
    $openlookup = "open_lookup_" . GoodFieldName($field) . "_" . $id;
    $ctype = "type_" . GoodFieldName($field) . "_" . $id;
    if ($fieldNum) {
        $cfield = "value" . $fieldNum . "_" . GoodFieldName($field) . "_" . $id;
        $ctype = "type" . $fieldNum . "_" . GoodFieldName($field) . "_" . $id;
    }
    $addnewitem = false;
    $advancedadd = false;
    $strCategoryControl = CategoryControl($field, $table);
    $categoryFieldId = GoodFieldName(CategoryControl($field, $table));
    $bUseCategory = UseCategory($field, $table);
    $dependentLookups = GetFieldData($table, $field, "DependentLookups", array());
    $lookupType = GetLookupType($field, $table);
    $LCType = LookupControlType($field, $table);
    $horizontalLookup = GetFieldData($table, $field, "HorizontalLookup", false);
    $inputStyle = $additionalCtrlParams['style'] ? 'style="' . $additionalCtrlParams['style'] . '"' : '';
    $lookupTable = GetLookupTable($field, $table);
    $strLookupWhere = LookupWhere($field, $table);
    $lookupSize = SelectSize($field, $table);
    if ($LCType == LCT_CBLIST) {
        $lookupSize = 2;
    }
    // simply > 1 for CBLIST
    $add_page = GetTableURL($lookupTable) . "_add.php";
    $list_page = GetTableURL($lookupTable) . "_list.php";
    $strPerm = GetUserPermissions($lookupTable);
    //	alter "add on the fly" settings
    if (strpos($strPerm, "A") !== false) {
        $addnewitem = GetFieldData($table, $field, "AllowToAdd", false);
        $advancedadd = !GetFieldData($table, $field, "SimpleAdd", false);
        if (!$advancedadd) {
            $addnewitem = false;
        }
    }
    //	alter lookuptype settings
    if ($LCType == LCT_LIST && strpos($strPerm, "S") === false) {
        $LCType = LCT_DROPDOWN;
    }
    if ($LCType == LCT_LIST) {
        $addnewitem = false;
    }
    if ($mode == MODE_SEARCH) {
        $addnewitem = false;
    }
    //	prepare multi-select attributes
    $multiple = "";
    $postfix = "";
    if ($lookupSize > 1) {
        $avalue = splitvalues($value);
        $multiple = " multiple";
        $postfix = "[]";
    } else {
        $avalue = array((string) $value);
    }
    //	prepare JS code
    $className = "DropDownLookup";
    if ($LCType == LCT_AJAX) {
        $className = "EditBoxLookup";
    } elseif ($LCType == LCT_LIST) {
        $className = "ListPageLookup";
    } elseif ($LCType == LCT_CBLIST) {
        $className = "CheckBoxLookup";
    }
    //	build the control
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //	list of values
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    if ($lookupType == LT_LISTOFVALUES) {
        //	read lookup values
        $arr = GetFieldData($table, $field, "LookupValues", array());
        //	print Type control to allow selecting nothing
        if ($lookupSize > 1) {
            echo "<input id=\"" . $ctype . "\" type=hidden name=\"" . $ctype . "\" value=\"multiselect\">";
        }
        //	dropdown control
        if ($LCType == LCT_DROPDOWN) {
            $alt = "";
            echo '<select id="' . $cfield . '" size = "' . $lookupSize . '" ' . $alt . 'name="' . $cfield . $postfix . '" ' . $multiple . '>';
            if ($lookupSize < 2) {
                echo '<option value="">' . mlang_message("PLEASE_SELECT") . '</option>';
            } else {
                if ($mode == MODE_SEARCH) {
                    echo '<option value=""> </option>';
                }
            }
            foreach ($arr as $opt) {
                $res = array_search((string) $opt, $avalue);
                if (!($res === NULL || $res === FALSE)) {
                    echo '<option value="' . htmlspecialchars($opt) . '" selected>' . htmlspecialchars($opt) . '</option>';
                } else {
                    echo '<option value="' . htmlspecialchars($opt) . '">' . htmlspecialchars($opt) . '</option>';
                }
            }
            echo "</select>";
        } elseif ($LCType == LCT_CBLIST) {
            echo '<div align=\'left\'>';
            $spacer = '<br/>';
            if ($horizontalLookup) {
                $spacer = '&nbsp;';
            }
            $i = 0;
            foreach ($arr as $opt) {
                echo '<input id="' . $cfield . '_' . $i . '" type="checkbox" ' . $alt . ' name="' . $cfield . $postfix . '" value="' . htmlspecialchars($opt) . '"';
                $res = array_search((string) $opt, $avalue);
                if (!($res === NULL || $res === FALSE)) {
                    echo ' checked="checked" ';
                }
                echo '/>';
                echo '&nbsp;<b id="data_' . $cfield . '_' . $i . '">' . htmlspecialchars($opt) . '</b>' . $spacer;
                $i++;
            }
            echo '</div>';
        }
        return;
    }
    // build table-based lookup
    ////////////////////////////////////////////////////////////////////////////////////////////
    //	table-based ajax-lookup control
    ////////////////////////////////////////////////////////////////////////////////////////////
    if ($LCType == LCT_AJAX || $LCType == LCT_LIST) {
        ////////////////////////////////////////////////////////////////////////////////////////////
        //	dependent ajax-lookup control
        ////////////////////////////////////////////////////////////////////////////////////////////
        if (UseCategory($field)) {
            // ajax	dependent dropdown
            // get parent value
            $celementvalue = "var parVal = ''; var parCtrl = Runner.controls.ControlManager.getAt('" . jsreplace($strTableName) . "', " . $id . ", '" . jsreplace($field) . "', 0).parentCtrl; if (parCtrl){ parVal = parCtrl.getStringValue();};";
            if ($LCType == LCT_AJAX) {
                echo '<input type="text" categoryId="' . $categoryFieldId . '" autocomplete="off" id="' . $clookupfield . '" name="' . $clookupfield . '" ' . $inputStyle . '>';
            } elseif ($LCType == LCT_LIST) {
                echo '<input type="text" categoryId="' . $categoryFieldId . '" autocomplete="off" id="' . $clookupfield . '" name="' . $clookupfield . '"  readonly ' . $inputStyle . '>';
                echo "&nbsp;<a href=# id=" . $openlookup . ">" . mlang_message("SELECT_LIST") . "</a>";
            }
            echo '<input type="hidden" id="' . $cfield . '" name="' . $cfield . '">';
            //	add new item link
            if ($addnewitem) {
                echo "&nbsp;<a href=# id='addnew_" . $cfield . "'>" . mlang_message("ADD_NEW") . "</a>";
            }
            return;
        }
        ////////////////////////////////////////////////////////////////////////////////////////////
        //	regular ajax-lookup control
        ////////////////////////////////////////////////////////////////////////////////////////////
        //	get the initial value
        $lookup_value = "";
        $lookupSQL = buildLookupSQL($field, $table, "", $value, false, true, false, true);
        $rs_lookup = db_query($lookupSQL, $conn);
        if ($data = db_fetch_numarray($rs_lookup)) {
            $lookup_value = $data[1];
        } elseif (strlen($strLookupWhere)) {
            // try w/o WHERE expression
            $lookupSQL = buildLookupSQL($field, $table, "", $value, false, true, false, true);
            $rs_lookup = db_query($lookupSQL, $conn);
            if ($data = db_fetch_numarray($rs_lookup)) {
                $lookup_value = $data[1];
            }
        }
        //	build the control
        if ($LCType == LCT_AJAX) {
            if (!strlen($lookup_value) && GetFieldData($strTableName, $field, "freeInput", false)) {
                $lookup_value = $value;
            }
            echo '<input type="text" ' . $inputStyle . ' autocomplete="off" ' . (($mode == MODE_INLINE_EDIT || $mode == MODE_INLINE_ADD) && $is508 == true ? 'alt="' . $strLabel . '" ' : '') . 'id="' . $clookupfield . '" name="' . $clookupfield . '" value="' . htmlspecialchars($lookup_value) . '">';
        } elseif ($LCType == LCT_LIST) {
            echo '<input type="text" autocomplete="off" ' . $inputStyle . ' id="' . $clookupfield . '" ' . (($mode == MODE_INLINE_EDIT || $mode == MODE_INLINE_ADD) && $is508 == true ? 'alt="' . $strLabel . '" ' : '') . 'name="' . $clookupfield . '" value="' . htmlspecialchars($lookup_value) . '" 	readonly >';
            echo "&nbsp;<a href=# id=" . $openlookup . ">" . mlang_message("SELECT_LIST") . "</a>";
        }
        echo '<input type="hidden" id="' . $cfield . '" name="' . $cfield . '" value="' . htmlspecialchars($value) . '">';
        //	add new item
        if ($addnewitem) {
            echo "&nbsp;<a href=# id='addnew_" . $cfield . "'>" . mlang_message("ADD_NEW") . "</a>";
        }
        return;
    }
    ////////////////////////////////////////////////////////////////////////////////////////////
    //	classic lookup - start
    ////////////////////////////////////////////////////////////////////////////////////////////
    $lookupSQL = buildLookupSQL($field, $table, "", "", false, false, false);
    $rs = db_query($lookupSQL, $conn);
    ////////////////////////////////////////////////////////////////////////////////////////////
    //	dependent classic lookup
    ////////////////////////////////////////////////////////////////////////////////////////////
    if ($bUseCategory) {
        //	print Type control to allow selecting nothing
        if ($lookupSize > 1) {
            echo "<input id=\"" . $ctype . "\" type=hidden name=\"" . $ctype . "\" value=\"multiselect\">";
        }
        echo '<select size = "' . $lookupSize . '" id="' . $cfield . '" name="' . $cfield . $postfix . '"' . $multiple . '>';
        echo '<option value="">' . mlang_message("PLEASE_SELECT") . '</option>';
        echo "</select>";
        if ($addnewitem) {
            echo "&nbsp;<a href=# id='addnew_" . $cfield . "'>" . mlang_message("ADD_NEW") . "</a>";
        }
        return;
    }
    ////////////////////////////////////////////////////////////////////////////////////////////
    //	simple classic lookup
    ////////////////////////////////////////////////////////////////////////////////////////////
    //	print control header
    if ($lookupSize > 1) {
        echo "<input id=\"" . $ctype . "\" type=hidden name=\"" . $ctype . "\" value=\"multiselect\">";
    }
    if ($LCType != LCT_CBLIST) {
        echo '<select size = "' . $lookupSize . '" id="' . $cfield . '" ' . (($mode == MODE_INLINE_EDIT || $mode == MODE_INLINE_ADD) && $is508 == true ? 'alt="' . $strLabel . '" ' : '') . 'name="' . $cfield . $postfix . '"' . $multiple . '>';
        if ($lookupSize < 2) {
            echo '<option value="">' . mlang_message("PLEASE_SELECT") . '</option>';
        } else {
            if ($mode == MODE_SEARCH) {
                echo '<option value=""> </option>';
            }
        }
    } else {
        echo '<div align=\'left\'>';
        $spacer = '<br/>';
        if ($horizontalLookup) {
            $spacer = '&nbsp;';
        }
    }
    //	print lookup data
    $found = false;
    $i = 0;
    while ($data = db_fetch_numarray($rs)) {
        $res = array_search((string) $data[0], $avalue);
        $checked = "";
        if (!($res === NULL || $res === FALSE)) {
            $found = true;
            if ($LCType == LCT_CBLIST) {
                $checked = " checked=\"checked\"";
            } else {
                $checked = " selected";
            }
        }
        if ($LCType == LCT_CBLIST) {
            echo '<input id="' . $cfield . '_' . $i . '" type="checkbox" ' . $alt . ' name="' . $cfield . $postfix . '" value="' . htmlspecialchars($data[0]) . '"' . $checked . '/>';
            echo '&nbsp;<b id="data_' . $cfield . '_' . $i . '">' . htmlspecialchars($data[1]) . '</b>' . $spacer;
        } else {
            echo '<option value="' . htmlspecialchars($data[0]) . '"' . $checked . '>' . htmlspecialchars($data[1]) . '</option>';
        }
        $i++;
    }
    //	try the same query w/o WHERE clause if current value not found
    if (!$found && strlen($value) && $mode == MODE_EDIT && strlen($strLookupWhere)) {
        $lookupSQL = buildLookupSQL($field, $table, "", $value, false, true, false, false, true);
        $rs = db_query($lookupSQL, $conn);
        if ($data = db_fetch_numarray($rs)) {
            if ($LCType == LCT_CBLIST) {
                echo '<input id="' . $cfield . '_' . $i . '" type="checkbox" ' . $alt . ' name="' . $cfield . $postfix . '" value="' . htmlspecialchars($data[0]) . '" checked="checked"/>';
                echo '&nbsp;<b id="data_' . $cfield . '_' . $i . '">' . htmlspecialchars($data[1]) . '</b>' . $spacer;
            } else {
                echo '<option value="' . htmlspecialchars($data[0]) . '" selected>' . htmlspecialchars($data[1]) . '</option>';
            }
        }
    }
    //	print footer
    if ($LCType != LCT_CBLIST) {
        echo "</select>";
    } else {
        echo '</div>';
    }
    //	add new item
    if ($addnewitem) {
        echo "&nbsp;<a href=# id='addnew_" . $cfield . "'>" . mlang_message("ADD_NEW") . "</a>";
    }
}
Example #9
0
function xt_showchart($params)
{
	$width=700;
	$height=530;
	$chartPreview = "";
	if($params["chartPreview"])
		$chartPreview = "&chartPreview=true";
	if(isset($params["custom1"]))
		$width=$params["custom1"];
	if(isset($params["custom2"]))
		$height=$params["custom2"];
	if ($params["resize"])
	{
		$maxWidth = 400;
		$maxHeight = 280;
		$r = $maxWidth / $maxHeight;
		$r2 = $width / $height;
		if (($width > $maxWidth) || ($height > $maxHeight))
		{
			if ($r2 >= $r)
			{ // width
				$height = round( $height * $maxWidth / $width );
				$width = $maxWidth;
			}
			else
			{
				$width = round ( $width * $maxHeight / $height );
				$height = $maxHeight;
			}
		}
	}

	$showDetails = isset( $params["showDetails"] ) ? $params["showDetails"] :  true;

	$settings = new ProjectSettings(GetTableByShort($params["chartname"]));
	$refresh = $settings->getChartRefreshTime()*60000;
	if ($_SERVER["SERVER_PORT"]==443)
		$http = "https";
	else
		$http="http";	
?>
<div id='<?php echo $params["chartname"].$params["id"] ?>' style="width:<?php echo $width; ?>px;height:<?php echo $height; ?>px">
<?php if (!$params["singlePage"]) { ?>
<script type="text/javascript" language="javascript" src="libs/js/AnyChart.js"></script>
<script type="text/javascript" language="javascript" src="libs/js/AnyChartHTML5.js"></script>
<script type="text/javascript">
<?php global $useFlashChartLibrary; if (!$useFlashChartLibrary) { ?>
var	svgSupported = !!document.createElementNS && !!document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect;
	AnyChart.renderingType = svgSupported ? anychart.RenderingType.SVG_PREFERRED : anychart.RenderingType.FLASH_PREFERRED;
<?php } else { ?>
	AnyChart.renderingType = anychart.RenderingType.FLASH_PREFERRED;
<?php } ?>
</script>

<script type="text/javascript" language="javascript">
	//<![CDATA[
	var chart = new AnyChart('libs/swf/AnyChart.swf','libs/swf/Preloader.swf');
	
	chart.width = '<?php echo $width; ?>';
	chart.height = '<?php echo $height; ?>';
	chart.wMode='opaque';
	chart.id = 'chart_' + '<?php echo $params["chartname"];?>';
	
	var xmlFile = '<?php echo GetTableLink("dchartdata")?>?chartname=<?php echo jsreplace($params["chartname"]).$chartPreview;?>';
	xmlFile += '&ctype=<?php echo $params["ctype"];?>';
	xmlFile += '&showDetails=<?php echo $showDetails;?>';
	xmlFile += '&hasFlash=' + AnyChart.platform.hasRequiredVersion;
	
	chart.setXMLFile(xmlFile);
	chart.write('<?php echo $params["chartname"].$params["id"];?>');
	<?php
	
	$chartname = jsreplace($params["chartname"]);
	if($params["ctype"]=="Gauge")
		$refrFunction="Runner.updateGaugeChart(\'".$chartname."\')";
	else
		$refrFunction="Runner.updateChart(\'".$chartname."\', ".($showDetails ? "true" : "false").")";
	
	if(!$useFlashChartLibrary && ( $params["ctype"]=="2DPie" || $params["ctype"]=="2DDoughnut" || $params["ctype"]=="Funnel" || $params["ctype"]=="OHLC" || $params["ctype"]=="Candle" ))
		$refresh="0";
	if($refresh!="0" && !isMobile())
		echo "setInterval('".$refrFunction."',".$refresh.");";
	?>
	//]]>
</script>
<?php } ?>
</div>
<?php
}
	{
		if(is_wr_custom())
			$table_name="";
		else
			$table_name=$arr[$i]["table"].".";
		$computed_value = ($arr[$i]["agr_func"]) ?
			$arr[$i]["agr_func"]."(".$table_name.$arr[$i]["name"].")" :
			$table_name.$arr[$i]["name"];
			
		if ($_SESSION['webcharts']['chart_type']['type']!="ohlc" && $_SESSION['webcharts']['chart_type']['type']!="candlestick")
		{
			$b_includes .= 'if($("select[id=field' . ($i+1) . ']").val()==\''.jsreplace($computed_value).'\')
			$("input[id=series_label_' . ($i+1) . ']").val(\''.jsreplace($arr[$i]["label"]).'\');'."\r\n";
		}
		else
			$b_includes .= '$("input[id=series_label_' . ($i+1) . ']").val(\''.jsreplace($arr[$i]["label"]).'\');'."\r\n";
	}		
}

$b_includes .= '});
</script>'."\r\n";


if(is_wr_project())
	$xt->assign("disable", "disabled");
	
if ($_SESSION['webcharts']['chart_type']['type']!="gauge" && $_SESSION['webcharts']['chart_type']['type']!="bubble")
	$xt->assign("separator","style='display:none'");

if ($_SESSION['webcharts']['chart_type']['type']!="bubble")
	$xt->assign("span_style","style='display:none'");
function xt_showchart($params)
{
    $width = 700;
    $height = 530;
    if (array_key_exists("custom1", $params)) {
        $width = $params["custom1"];
    }
    if (array_key_exists("custom2", $params)) {
        $height = $params["custom2"];
    }
    $refresh = GetTableData($params["table"], ".ChartRefreshTime", 10) * 60000;
    if ($_SERVER["SERVER_PORT"] == 443) {
        $http = "https";
    } else {
        $http = "http";
    }
    ?>
<div id='<?php 
    echo $params["chartname"];
    ?>
'>
<noscript>
	<object id="<?php 
    echo $params['chartname'];
    ?>
" 
			name="<?php 
    echo $params['chartname'];
    ?>
" 
			classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
			width="100%" 
			height="100%" 
			codebase="<?php 
    echo $http;
    ?>
://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
		<param name="movie" value="libs/swf/Preloader.swf" />
		<param name="bgcolor" value="#FFFFFF" />
		<param name="wmode" value="opaque" />
		<param name="allowScriptAccess" value="always" />
		<param name="flashvars" value="swfFile=<?php 
    echo 'dchartdata.php%3Fchartname%3D' . $params['chartname'];
    ?>
" />
		
		<embed type="application/x-shockwave-flash" 
			   pluginspage="<?php 
    echo $http;
    ?>
://www.adobe.com/go/getflashplayer" 
			   src="libs/swf/Preloader.swf" 
			   width="100%" 
			   height="100%" 
			   id="<?php 
    echo $params['chartname'];
    ?>
" 
			   name="<?php 
    echo $params['chartname'];
    ?>
" 
			   bgColor="#FFFFFF" 
			   allowScriptAccess="always" 
			   flashvars="swfFile=<?php 
    echo 'dchartdata.php%3Fchartname%3D' . $params['chartname'];
    ?>
" />
	</object>				
</noscript>
<script type="text/javascript">
	//<![CDATA[
	document.write('<center>');
	document.write("You need to have Adobe Flash Player 9 (or above) to view the chart.<br /><br />");
	document.write("<a href=\"<?php 
    echo $http;
    ?>
://www.adobe.com/go/getflashplayer\"><img border=\"0\" src=\"<?php 
    echo $http;
    ?>
://www.adobe.com/images/shared/download_buttons/get_flash_player.gif\" /></a><br />");
	document.write('</center>');
	//]]>
</script>
<script type="text/javascript" language="javascript" src="libs/js/AnyChart.js"></script>
<script type="text/javascript" language="javascript">
	//<![CDATA[
	var chart = new AnyChart('libs/swf/AnyChart.swf','libs/swf/Preloader.swf');
	chart.width = '<?php 
    echo $width;
    ?>
';
	chart.height = '<?php 
    echo $height;
    ?>
';
	chart.wMode='opaque';

	var xmlFile = 'dchartdata.php?chartname=<?php 
    echo jsreplace($params["chartname"]);
    ?>
';
	xmlFile += '&ctype=<?php 
    echo $params["ctype"];
    ?>
';
	chart.setXMLFile(xmlFile);
	chart.write('<?php 
    echo $params["chartname"];
    ?>
');
	if("<?php 
    echo $refresh;
    ?>
"!="0")
		setInterval('refreshChart()',<?php 
    echo $refresh;
    ?>
);
	function refreshChart()
	{
		page='dchartdata.php?chartname=<?php 
    echo jsreplace($params["chartname"]);
    ?>
';
		params={
				action:'refresh',
				rndval:Math.random()
				};
		$.get(page,params,function(xml)
			{
				var arr = new Array();
				arr=xml.split("\n");
				for(i=0; i<arr.length;i+=2)
				{
					chart.removeSeries(arr[i]);
					chart.addSeries(arr[i+1]);
					chart.updatePointData(arr[i]+"_gauge",arr[i]+"_point",{value: arr[i+1]});
				}
				chart.refresh();
			});

	}
	//]]>
</script>
</div>
<?php 
}
				foreach($value["right_fields"] as $k=>$val)
					$b_includes .= "rel.right_fields[".$k."]='".$val."';";
			}	
		}
		$b_includes .= "option = new Option('".jsreplace($arr_parts[0])."','".jsreplace($arr_parts[1])."');
		option.rel=rel;
		var objSel=document.getElementById('rel_list');
		objSel.options[objSel.length]=option;
		if (table_stack['".jsreplace($arr_parts[1])."'] == undefined) 
		{
			table_stack['".jsreplace($arr_parts[1])."'] = 1;
			$('#left_tables').append(\"<option value='".jsreplace($arr_parts[1])."'>".$arr_parts[1]."</option>\");
		} 
		else 
		{
			table_stack['".jsreplace($arr_parts[1])."'] = table_stack['".jsreplace($arr_parts[1])."'] + 1;
		}		
		"."\r\n";	
		$c++;
	}
}
else
{
	$b_includes .='$("#left_tables").val($("#left_tables")[0].options[1].value);
		$("#left_tables").change();';
}
$b_includes .= '});
function live_change(th)
{
		var id = th.id.substr(th.id.length-1),
			tr  = $(th).parent().parent(),
Example #13
0
 public function buildAJAXLookup($value, $mode)
 {
     ////////////////////////////////////////////////////////////////////////////////////////////
     //	dependent ajax-lookup control
     ////////////////////////////////////////////////////////////////////////////////////////////
     if ($this->bUseCategory) {
         // ajax	dependent dropdown
         // get parent value
         $celementvalue = "var parVal = ''; var parCtrl = Runner.controls.ControlManager.getAt('" . jsreplace($this->pageObject->tName) . "', " . $this->id . ", '" . jsreplace($this->field) . "', 0).parentCtrl; if (parCtrl){ parVal = parCtrl.getStringValue();};";
         if ($this->LCType == LCT_AJAX) {
             echo '<input type="text" categoryId="' . $this->categoryFieldId . '" autocomplete="off" id="' . $this->clookupfield . '" name="' . $this->clookupfield . '" ' . $this->inputStyle . '>';
         } else {
             if ($this->LCType == LCT_LIST) {
                 echo '<input type="text" categoryId="' . $this->categoryFieldId . '" autocomplete="off" id="' . $this->clookupfield . '" name="' . $this->clookupfield . '"  readonly ' . $this->inputStyle . '>';
                 echo "&nbsp;<a href=# id=" . $this->openlookup . ">" . "Select" . "</a>";
             }
         }
         echo '<input type="hidden" id="' . $this->cfield . '" name="' . $this->cfield . '">';
         //	add new item link
         if ($this->addnewitem) {
             echo "&nbsp;<a href=# id='addnew_" . $this->cfield . "'>" . "Add new" . "</a>";
         }
         return;
     }
     ////////////////////////////////////////////////////////////////////////////////////////////
     //	regular ajax-lookup control
     ////////////////////////////////////////////////////////////////////////////////////////////
     //	get the initial value
     $lookup_value = "";
     $lookupSQL = buildLookupSQL($this->lookupPageType, $this->field, $this->pageObject->tName, "", $value, false, true, false, true);
     $this->fillLookupFieldsIndexes();
     $rs_lookup = db_query($lookupSQL, $this->conn);
     if ($data = db_fetch_numarray($rs_lookup)) {
         if ($this->isDisplayFieldEncrypted) {
             $lookup_value = $this->ciphererDisplay->DecryptField($this->lookupType == LT_QUERY ? $this->displayFieldName : $this->field, $data[$this->displayFieldIndex]);
         } else {
             $lookup_value = $data[$this->displayFieldIndex];
         }
     } elseif (strlen($this->strLookupWhere)) {
         // try w/o WHERE expression
         $lookupSQL = buildLookupSQL($this->lookupPageType, $this->field, $this->pageObject->tName, "", $value, false, true, false, false);
         $rs_lookup = db_query($lookupSQL, $this->conn);
         if ($data = db_fetch_numarray($rs_lookup)) {
             if ($this->isDisplayFieldEncrypted) {
                 $lookup_value = $this->ciphererDisplay->DecryptField($this->lookupType == LT_QUERY ? $this->displayFieldName : $this->field, $data[$this->displayFieldIndex]);
             } else {
                 $lookup_value = $data[$this->displayFieldIndex];
             }
         }
     }
     //	build the control
     if ($this->LCType == LCT_AJAX) {
         if (!strlen($lookup_value) && ($this->pageObject->pSetEdit->isfreeInput($this->field) || $this->lookupPageType == PAGE_SEARCH)) {
             $lookup_value = $value;
         }
         echo '<input type="text" ' . $this->inputStyle . ' autocomplete="off" ' . (($mode == MODE_INLINE_EDIT || $mode == MODE_INLINE_ADD) && $this->is508 == true ? 'alt="' . $this->strLabel . '" ' : '') . 'id="' . $this->clookupfield . '" name="' . $this->clookupfield . '" value="' . htmlspecialchars($lookup_value) . '">';
     } elseif ($this->LCType == LCT_LIST) {
         echo '<input type="text" autocomplete="off" ' . $this->inputStyle . ' id="' . $this->clookupfield . '" ' . (($mode == MODE_INLINE_EDIT || $mode == MODE_INLINE_ADD) && $this->is508 == true ? 'alt="' . $this->strLabel . '" ' : '') . 'name="' . $this->clookupfield . '" value="' . htmlspecialchars($lookup_value) . '" 	readonly >';
         echo "&nbsp;<a href=# id=" . $this->openlookup . ">" . "Select" . "</a>";
     }
     echo '<input type="hidden" id="' . $this->cfield . '" name="' . $this->cfield . '" value="' . htmlspecialchars($value) . '">';
     //	add new item
     if ($this->addnewitem) {
         echo "&nbsp;<a href=# id='addnew_" . $this->cfield . "'>" . "Add new" . "</a>";
     }
 }
Example #14
0
 function GetLockInfo($strtable, $keys, $links, $pageid)
 {
     $page = GetTableLink(GetTableURL($strtable), "edit");
     $skeys = "";
     foreach ($keys as $ind => $val) {
         if (strlen($skeys)) {
             $skeys .= "&";
         }
         $skeys .= rawurlencode($val);
     }
     $where = $this->connection->addFieldWrappers("table") . "=" . $this->connection->prepareString($strtable) . " AND " . $this->connection->addFieldWrappers("keys") . "=" . $this->connection->prepareString($skeys) . " AND " . $this->connection->addFieldWrappers("sessionid") . "<>'" . session_id() . "' AND " . $this->connection->addFieldWrappers("action") . "=1";
     $qResult = $this->query($where, $this->connection->addFieldWrappers("id") . " asc");
     if ($data = $qResult->fetchAssoc()) {
         $sdate = now();
         $arrDateTime = db2time($data["startdatetime"]);
         $str = mysprintf($this->LockAdmin, array($data["userid"], round(secondsPassedFrom($data["startdatetime"]) / 60, 2)));
         if ($links) {
             $str .= '<a class="unlock" href="#" onclick="Runner.pages.PageManager.getAt(\'' . runner_htmlspecialchars(jsreplace($strtable)) . '\', ' . $pageid . ').locking.UnlockAdmin(\'' . runner_htmlspecialchars(jsreplace($skeys)) . '\',\'' . $data["sessionid"] . '\',\'no\');return false;">' . "Desbloquear registro" . '</a>';
             $str .= '<a class="edit" href="#" onclick="Runner.pages.PageManager.getAt(\'' . runner_htmlspecialchars(jsreplace($strtable)) . '\', ' . $pageid . ').locking.UnlockAdmin(\'' . runner_htmlspecialchars(jsreplace($skeys)) . '\',\'' . $data["sessionid"] . '\',\'yes\');return false;">' . "Editar registro" . '</a>';
         }
         return $str;
     }
     return "";
 }
Example #15
0
function BuildSecondDropdownArray($arrName, $strSQL)
{
    global $conn;
    echo $arrName . "=new Array();\r\n";
    $i = 0;
    $rs = db_query($strSQL, $conn);
    while ($row = db_fetch_numarray($rs)) {
        echo $arrName . "[" . $i * 3 . "]='" . jsreplace($row[0]) . "';\r\n";
        echo $arrName . "[" . ($i * 3 + 1) . "]='" . jsreplace($row[1]) . "';\r\n";
        echo $arrName . "[" . ($i * 3 + 2) . "]='" . jsreplace($row[2]) . "';\r\n";
        $i++;
    }
}
	$fields_type=array();
	$fields_type=WRGetAllCustomFieldType();
}

foreach ($group_fields as $fld) {
	if(!is_wr_custom())
		$type = WRGetFieldType($fld);
	else
		$type = $fields_type[$fld];

	if ( IsNumberType( $type ) ) {
		$b_includes .= "fld_types['" . jsreplace($fld) . "'] = \"number\";"."\r\n";
	} elseif ( IsCharType( $type ) ) {
		$b_includes .= "fld_types['" . jsreplace($fld) . "'] = \"string\";"."\r\n";
	} elseif ( IsDateFieldType( $type ) ) {
		$b_includes .= "fld_types['" . jsreplace($fld) . "'] = \"date\";"."\r\n";
	}
}

if (is_wr_db()) {
	$b_includes .= '
	var NEXT_PAGE_URL = "'.GetTableLink("webreport4").'",
		PREV_PAGE_URL = "'.GetTableLink("webreport2").'";
	'."\r\n";
} else {
	$b_includes .= '
	var NEXT_PAGE_URL = "'.GetTableLink("webreport4").'",
		PREV_PAGE_URL = "'.GetTableLink("webreport0").'";
	'."\r\n";	
}
Example #17
0
 function GetLockInfo($strtable, $keys, $links, $pageid)
 {
     $page = GetTableURL($strtable) . "_edit.php";
     $skeys = "";
     foreach ($keys as $ind => $val) {
         if (strlen($skeys)) {
             $skeys .= "&";
         }
         $skeys .= rawurlencode($val);
     }
     $rstmp = $this->TableObj->Query(AddFieldWrappers("table") . "=" . db_prepare_string($strtable) . " and " . AddFieldWrappers("keys") . "=" . db_prepare_string($skeys) . " and " . AddFieldWrappers("sessionid") . "<>'" . session_id() . "' and " . AddFieldWrappers("action") . "=1", AddFieldWrappers("id") . " asc");
     if ($data = db_fetch_array($rstmp)) {
         $sdate = now();
         $arrDateTime = db2time($data["startdatetime"]);
         $str = mysprintf($this->LockAdmin, array($data["userid"], round(secondsPassedFrom($data["startdatetime"]) / 60, 2)));
         if ($links) {
             $str .= '<a class="unlock" href="#" onclick="Runner.pages.PageManager.getAt(\'' . htmlspecialchars(jsreplace($strtable)) . '\', ' . $pageid . ').locking.UnlockAdmin(\'' . htmlspecialchars(jsreplace($skeys)) . '\',\'' . $data["sessionid"] . '\',\'no\');return false;">' . "Unlock record" . '</a>';
             $str .= '<a class="edit" href="#" onclick="Runner.pages.PageManager.getAt(\'' . htmlspecialchars(jsreplace($strtable)) . '\', ' . $pageid . ').locking.UnlockAdmin(\'' . htmlspecialchars(jsreplace($skeys)) . '\',\'' . $data["sessionid"] . '\',\'yes\');return false;">' . "Edit record" . '</a>';
         }
         return $str;
     } else {
         return "";
     }
 }
Example #18
0
function xt_showchart($params)
{
    $width = 700;
    $height = 530;
    $chartPreview = "";
    if ($params["chartPreview"]) {
        $chartPreview = "&chartPreview=true";
    }
    if (isset($params["custom1"])) {
        $width = $params["custom1"];
    }
    if (isset($params["custom2"])) {
        $height = $params["custom2"];
    }
    if ($params["dashResize"]) {
        if ($params["dashWidth"] && $params["dashHeight"]) {
            $width = $params["dashWidth"];
            $height = $params["dashHeight"];
        } elseif ($params["dashWidth"]) {
            $height = round($height * $params["dashWidth"] / $width);
            $width = $params["dashWidth"];
        } elseif ($params["dashHeight"]) {
            $width = round($width * $params["dashHeight"] / $height);
            $height = $params["dashHeight"];
        }
        // adjust the chart size to fit it in the dash cell
        $width *= 0.95;
        $height *= 0.95;
    } elseif ($params["resize"]) {
        $maxWidth = 400;
        $maxHeight = 280;
        $r = $maxWidth / $maxHeight;
        $r2 = $width / $height;
        if ($width > $maxWidth || $height > $maxHeight) {
            if ($r2 >= $r) {
                // width
                $height = round($height * $maxWidth / $width);
                $width = $maxWidth;
            } else {
                $width = round($width * $maxHeight / $height);
                $height = $maxHeight;
            }
        }
    }
    $showDetails = isset($params["showDetails"]) ? $params["showDetails"] : true;
    $settings = new ProjectSettings(GetTableByShort($params["chartname"]));
    $refresh = $settings->getChartRefreshTime() * 1000;
    if ($_SERVER["SERVER_PORT"] == 443) {
        $http = "https";
    } else {
        $http = "http";
    }
    ?>
<div id='<?php 
    echo $params["chartname"] . $params["id"];
    ?>
' style="width:<?php 
    echo $width;
    ?>
px;height:<?php 
    echo $height;
    ?>
px">
<?php 
    if (!$params["singlePage"]) {
        ?>
<script type="text/javascript" language="javascript" src="libs/js/AnyChart.js"></script>
<script type="text/javascript" language="javascript" src="libs/js/AnyChartHTML5.js"></script>
<script type="text/javascript">
<?php 
        global $useFlashChartLibrary;
        if (!$useFlashChartLibrary) {
            ?>
var	svgSupported = !!document.createElementNS && !!document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect;
	AnyChart.renderingType = svgSupported ? anychart.RenderingType.SVG_PREFERRED : anychart.RenderingType.FLASH_PREFERRED;
<?php 
        } else {
            ?>
	AnyChart.renderingType = anychart.RenderingType.FLASH_PREFERRED;
<?php 
        }
        ?>
</script>

<script type="text/javascript" language="javascript">
	//<![CDATA[
	var chart = new AnyChart('libs/swf/AnyChart.swf','libs/swf/Preloader.swf');
	
	chart.width = '<?php 
        echo $width;
        ?>
';
	chart.height = '<?php 
        echo $height;
        ?>
';
	chart.wMode='opaque';
	chart.id = 'chart_' + '<?php 
        echo $params["chartname"];
        ?>
';
	
	var xmlFile = '<?php 
        echo GetTableLink("dchartdata");
        ?>
?chartname=<?php 
        echo jsreplace($params["chartname"]) . $chartPreview;
        ?>
';
	xmlFile += '&ctype=<?php 
        echo $params["ctype"];
        ?>
';
	xmlFile += '&showDetails=<?php 
        echo $showDetails;
        ?>
';
	xmlFile += '&hasFlash=' + AnyChart.platform.hasRequiredVersion;

<?php 
        if (isset($params["dash"]) && $params["dash"]) {
            ?>
	xmlFile += '&dashChart=<?php 
            echo $params["dash"];
            ?>
';
<?php 
        }
        ?>
	
<?php 
        if (isset($params["dashTName"]) && $params["dashTName"]) {
            ?>
	xmlFile += '&dashTName=<?php 
            echo $params["dashTName"];
            ?>
';
	xmlFile += '&dashElName=<?php 
            echo $params["dashElementName"];
            ?>
';
	xmlFile += '&pageId=<?php 
            echo $params["id"];
            ?>
';
	$.ajax( {
		type: "GET",
		url: xmlFile,
		dataType: "xml",
		success: function( xml ) {
			var $xml = $( xml );
			Runner.updateDetailsForDashboardChart( $xml.find( "detail_master_keys" ).text(), $xml.find( "detail_page_id" ).text() );
		}
	});
<?php 
        }
        ?>
	chart.setXMLFile(xmlFile);
	chart.write('<?php 
        echo $params["chartname"] . $params["id"];
        ?>
');
	<?php 
        $chartname = jsreplace($params["chartname"]);
        if ($params["ctype"] == "Gauge") {
            $refrFunction = "Runner.updateGaugeChart(\\'" . $chartname . "\\')";
        } else {
            $refrFunction = "Runner.updateChart(\\'" . $chartname . "\\', " . ($showDetails ? "true" : "false") . ", " . ($params["dash"] ? "true" : "false") . ")";
        }
        if (!$useFlashChartLibrary && ($params["ctype"] == "2DPie" || $params["ctype"] == "2DDoughnut" || $params["ctype"] == "Funnel" || $params["ctype"] == "OHLC" || $params["ctype"] == "Candle")) {
            $refresh = "0";
        }
        if ($refresh != "0" && !isMobile()) {
            echo "setInterval('" . $refrFunction . "'," . $refresh . ");";
        }
        ?>
	//]]>
</script>
<?php 
    }
    ?>
</div>
<?php 
}
Example #19
0
$jscode .= "TEXT_MONTH_OCT='" . jsreplace("Octubre") . "';\r\n";
$jscode .= "TEXT_MONTH_NOV='" . jsreplace("Noviembre") . "';\r\n";
$jscode .= "TEXT_MONTH_DEC='" . jsreplace("Diciembre") . "';\r\n";
$jscode .= "TEXT_DAY_SU='" . jsreplace("DO") . "';\r\n";
$jscode .= "TEXT_DAY_MO='" . jsreplace("L") . "';\r\n";
$jscode .= "TEXT_DAY_TU='" . jsreplace("MAR") . "';\r\n";
$jscode .= "TEXT_DAY_WE='" . jsreplace("MI") . "';\r\n";
$jscode .= "TEXT_DAY_TH='" . jsreplace("J") . "';\r\n";
$jscode .= "TEXT_DAY_FR='" . jsreplace("V") . "';\r\n";
$jscode .= "TEXT_DAY_SA='" . jsreplace("S") . "';\r\n";
$jscode .= "TEXT_TODAY='" . jsreplace("Hoy") . "';\r\n";
$jscode .= '
locale_dateformat = "' . $locale_info["LOCALE_IDATE"] . '";
locale_datedelimiter = "' . $locale_info["LOCALE_SDATE"] . '";
bLoading = false;
TEXT_PLEASE_SELECT = "' . jsreplace("Por favor seleccione") . '"; 
detect = navigator.userAgent.toLowerCase();
checkIt = function(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}
ShowHideControls = function ()
{';
foreach ($inspect_fields as $fld) {
    if (is_wr_db()) {
        $fld_type = WRGetFieldType($fld['table'] . "." . $fld['name']);
    } elseif (is_wr_custom()) {
        $fld_type = WRCustomGetFieldType($fld['table'], $fld['name']);
    } else {
Example #20
0
function xt_showchart($params)
{
    $width = 700;
    $height = 530;
    if (isset($params["custom1"])) {
        $width = $params["custom1"];
    }
    if (isset($params["custom2"])) {
        $height = $params["custom2"];
    }
    $settings = new ProjectSettings(GetTableByShort($params["chartname"]));
    $refresh = $settings->getChartRefreshTime() * 60000;
    if ($_SERVER["SERVER_PORT"] == 443) {
        $http = "https";
    } else {
        $http = "http";
    }
    ?>
<div id='<?php 
    echo $params["chartname"];
    ?>
' style="width:<?php 
    echo $width;
    ?>
px;height:<?php 
    echo $height;
    ?>
px">
<noscript>
	<object id="'.htmlspecialchars(postvalue('cname')).'" 
		name="'.htmlspecialchars(postvalue('cname')).'" 
		classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
		width="100%" 
		height="100%" 
		codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
		<param name="movie" value="libs/swf/Preloader.swf" />
		<param name="bgcolor" value="#FFFFFF" />

		<param name="allowScriptAccess" value="always" />
		<param name="flashvars" value="swfFile=dchartdata.php%3Fcname%3D'.htmlspecialchars(postvalue('cname')).'%26ctype%3D'.$chrt_array['chart_type']['type'].'" />
		
		<embed type="application/x-shockwave-flash" 
			   pluginspage="http://www.adobe.com/go/getflashplayer" 
			   src="libs/swf/Preloader.swf" 
			   width="100%" 
			   height="100%" 
			   id="'.htmlspecialchars(postvalue('cname')).'" 
			   name="'.htmlspecialchars(postvalue('cname')).'" 
			   bgColor="#FFFFFF" 
			   allowScriptAccess="always" 
			   flashvars="swfFile=dchartdata.php%3Fcname%3D'.htmlspecialchars(postvalue('cname')).'%26ctype%3D'.$chrt_array['chart_type']['type'].'" />
	</object>				
</noscript>
<script type="text/javascript" language="javascript" src="libs/js/AnyChart.js"></script>
<script type="text/javascript" language="javascript" src="libs/js/AnyChartHTML5.js"></script>
<script type="text/javascript">
AnyChart.renderingType = anychart.RenderingType.FLASH_PREFERRED;
var svgSupported = window.SVGAngle != undefined;
if (!svgSupported)
{
 	//<![CDATA[
	document.write('<center>');
	document.write("You need to have Adobe Flash Player 9 (or above) to view the chart.<br /><br />");
	document.write("<a href=\"<?php 
    echo $http;
    ?>
://www.adobe.com/go/getflashplayer\"><img border=\"0\" src=\"<?php 
    echo $http;
    ?>
://www.adobe.com/images/shared/download_buttons/get_flash_player.gif\" /></a><br />");
	document.write('</center>');
	//]]>
}	
</script>

<script type="text/javascript" language="javascript">
	//<![CDATA[
	var chart = new AnyChart('libs/swf/AnyChart.swf','libs/swf/Preloader.swf');
	chart.width = '<?php 
    echo $width;
    ?>
';
	chart.height = '<?php 
    echo $height;
    ?>
';
	chart.wMode='opaque';
	chart.id = 'chart_' + '<?php 
    echo $params["chartname"];
    ?>
';
	var xmlFile = 'dchartdata.php?chartname=<?php 
    echo jsreplace($params["chartname"]);
    ?>
';
	xmlFile += '&ctype=<?php 
    echo $params["ctype"];
    ?>
';
	chart.setXMLFile(xmlFile);
	chart.write('<?php 
    echo $params["chartname"];
    ?>
');
	if("<?php 
    echo $refresh;
    ?>
"!="0" && "<?php 
    echo isMobile();
    ?>
"=="false")
		setInterval('refreshChart()',<?php 
    echo $refresh;
    ?>
);
	function refreshChart()
	{
		page='dchartdata.php?chartname=<?php 
    echo jsreplace($params["chartname"]);
    ?>
';
		params={
				action:'refresh',
				rndval:Math.random()
				};
		$.get(page,params,function(xml)
			{
				var arr = new Array();
				arr=xml.split("\n");
				for(i=0; i<arr.length;i+=2)
				{
					chart.removeSeries(arr[i]);
					chart.addSeries(arr[i+1]);
					chart.updatePointData(arr[i]+"_gauge",arr[i]+"_point",{value: arr[i+1]});
				}
				chart.refresh();
			});

	}
	//]]>
</script>
</div>
<?php 
}
Example #21
0
if (testAdvSearch($rpt_array['tables'][0]))
    $xt->assign("adv_search_block", true);

$reportName = "";
if (postvalue('rname'))
    $reportName = runner_htmlspecialchars(postvalue('rname'));
else
    $reportName = runner_htmlspecialchars(@$_SESSION['webreports']['settings']['name']);
$xt->assign("reportName", $reportName);

if (postvalue("q"))
    $xt->assign("searchClause", "&q=" . postvalue("q"));
$xt->assign("reportNamejs", jsreplace(postvalue('rname')));
$xt->assign("reportTitle", runner_htmlspecialchars($rpt_array['settings']['title']));
$xt->assign("shortTableName", runner_htmlspecialchars($rpt_array['short_table_name']));
$xt->assign("shortTableNamejs", jsreplace($rpt_array['short_table_name']));

$searchType = (!is_wr_project()) ? GetTableLink("dsearch") : GetTableLink(runner_htmlspecialchars($rpt_array['short_table_name']), "search");
$xt->assign("searchHref", "href='" . $searchType . "?rname=" . $reportName . "'");

$xt->assign("ext", "php");

if (postvalue("param") == "preview")
    $preview = "_preview";

switch ($rpt_array['miscellaneous']['type']){
    case "stepped" :
	$templatefile = GetTemplateName("", "dreport" . $preview);
	break;
    case "block" :
	$templatefile = GetTemplateName("", "dreport1" . $preview);
Example #22
0
    echo "</tr>\n";
}
//ID3
for ($af = 0, $j = 0; $j < $naf; $j++) {
    /*print files*/
    $cmd = "{$avssdir}/bin/id3v2-avss -l \"{$path}/" . $allfiles["fname"][$j] . "\" ";
    $fp = popen("{$cmd}", "r");
    while ($buffer = fgets($fp, 1024)) {
        //$buffer=str_replace("'" , "", $buffer);
        //$buffer=str_replace("\n" , "", $buffer);
        $buffer = chop($buffer);
        $x = explode(":", $buffer, 2);
        $f = explode(" ", $x[0], 2);
        //first word
        if (isset($x[1])) {
            $x[1] = jsreplace($x[1]);
        } else {
            $x[1] = "";
        }
        $TAGS[$j][$f[0]] = $x[1];
        if (isset($ID3s[$j])) {
            $ID3s[$j] .= "<b>" . $f[0] . ":</b>" . $x[1] . " ";
        } else {
            $ID3s[$j] = "<b>" . $f[0] . ":</b>" . $x[1] . " ";
        }
    }
    pclose($fp);
}
echo "<form method=post name=filefrm action='{$PHP_SELF}?path=" . urlencode($path) . "&amp;sess={$sess}'>\n";
for ($af = 0, $j = 0; $j < $naf; $j++) {
    /*print files*/
	$b_includes .= '
	
			NEXT_PAGE_URL = "'.GetTableLink("webreport3").'";
			PREV_PAGE_URL = "'.GetTableLink("webreport").'";';
			$b_includes .= '$("td[id=row1], td[id=row2]").hide();'."\r\n";
	foreach ($arr_tables_custom as $tbl) 
	{
		if(!$tbl["isStorProc"])
		{
			$selected="";
			if ( !empty( $_SESSION['webreports']['tables'] ) )
				if ( in_array( $tbl["sqlname"], $_SESSION['webreports']['tables'] ) )
					$selected = "selected";
				if(postvalue("sqlname")==$tbl["sqlname"])
					$selected = "selected";
				$b_includes .= "$('<option ".$selected."></option>').attr('value', '".jsreplace($tbl["sqlname"])."').html('".jsreplace(getCaptionTable($tbl["sqlname"]))."').appendTo($('#tables'));"."\r\n";
		}
	}		
	$b_includes .= '
	}
	$("li").css("list-style-type","none");	
	$(".selected").css("padding-bottom","0px");
	
	if($("#tables").get(0).selectedIndex==-1)
		$("#tables").get(0).selectedIndex=0;
	
	//if(li_selected_start!=li_selected)
	//	$("#row5,#row6").show();
	//else if(table_name==$("#tables").val())
	//	$("#row5,#row6").hide();		
	empty_table_list();
			<input type="text" id="editformatobj_lookupobj_where_' . $cnt . '" name="editformatobj_lookupobj_where_' . $cnt . '" value="' . GetLWWhere($arr['field'],PAGE_REPORT) . '" >
		</td>
	</tr>';
}

$arr = $_SESSION['webreports']['totals'];

if ( !empty( $arr ) ) {

	$b_includes .= '<script type="text/javascript">
		$(document).ready(function(){'."\n";

	foreach ($arr as $id => $totals) {
		if(!is_wr_custom()) 
			$b_includes .= "$('tr[id=".$id."]', '#trt').find('td').eq(1).text('" . jsreplace($totals["table"].".".$totals["name"]) . "');"."\n";
		$b_includes .= "$('tr[id=".$id."]', '#trt').find('td').eq(2).find('input').val('" . jsreplace($totals["label"]) . "');"."\n";
		$total_name=$totals["name"];
		if(is_wr_db()) 
			$total_name=$totals["table"].".".$totals["name"];
		if ( !in_array($total_name, $aSelGroupFields) || $is_crosstable_report=="true") {
			$b_includes .= '$("tr[id='.$id.']", "#trt").find("td").eq(3).find("input").attr("checked",' . ($totals["show"] == "true" ? "true" : "false") . ');'."\n";
			$b_includes .= '$("tr[id='.$id.']", "#trt").find("td").eq(4).find("input").attr("checked",' . ($totals["min"] == "true" ? "true" : "false") . ');'."\n";
			$b_includes .= '$("tr[id='.$id.']", "#trt").find("td").eq(5).find("input").attr("checked",' . ($totals["max"] == "true" ? "true" : "false") . ');'."\n";
			$b_includes .= '$("tr[id='.$id.']", "#trt").find("td").eq(6).find("input").attr("checked",' . ($totals["sum"] == "true" ? "true" : "false") . ');'."\n";
			$b_includes .= '$("tr[id='.$id.']", "#trt").find("td").eq(7).find("input").attr("checked",' . ($totals["avg"] == "true" ? "true" : "false") . ');'."\n";
			$b_includes .= '$("tr[id='.$id.']", "#trt").find("td").eq(8).find("input").attr("checked",' . ($totals["curr"] == "true" ? "true" : "false") . ');'."\n";
		}
	}
	$b_includes .= '
	arr=new Array;
	arr[0]="show"