Traffic Umrechner
[include file=sol-includes/trafficcalc.php iframe=true width=300 height=170 scrolling=no]

Source-Code

$xajax = new xajax();

$xajax->configure("javascript URI","/xajax/");
$xajax->registerFunction("mbit2traffic");
$xajax->registerFunction("traffic2mbit");

function mbit2traffic($arg)
{
    $objResponse = new xajaxResponse();
	if( ! ereg("^[0-9]{1,12}$",$arg['d']) )	{
		$objResponse->alert("Specified Value for day is invalid!");
		return $objResponse;
	}
	if( ! ereg("^[0-9\.]{1,12}$",$arg['m']) )	{
		$objResponse->alert("Specified Value for Mbit is invalid!");
		return $objResponse;
	}
	$traffic = round(10.5466667*$arg['d']*$arg['m']);
	#$objResponse->alert(var_export($arg,1));
    $objResponse->assign("traffic","value", $traffic);
    return $objResponse;
}

function traffic2mbit($arg)
{
    $objResponse = new xajaxResponse();
	if( ! ereg("^[0-9]{1,12}$",$arg['d']) )	{
		$objResponse->alert("Specified Value for day is invalid!");
		return $objResponse;
	}
	if( ! ereg("^[0-9]{1,12}$",$arg['t']) )	{
		$objResponse->alert("Specified Value for Traffic is invalid!");
		return $objResponse;
	}
	$traffic = round( $arg['t']/$arg['d']/10.5466667, 2 );
	#$objResponse->alert(var_export($arg,1));
    $objResponse->assign("mbit","value", $traffic);
    return $objResponse;
}

$xajax->processRequest();
 

bitcoin Icon This page does not contain ads! If you find it usefull, feel free to send me some Support via Bitcoin.
1944UDg5P3zWpsejg1wGyHXAicxYK27HF2
✉ Marco Götze//