Revision 66 | Revision 70 | Zur aktuellen Revision | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed
<?php//$Id: details.php 67 2007-10-03 15:41:42Z lars $require("include/common.php");$smarty->assign("title","openVZ Administration");$smarty->assign("h1","vServer Konfiguration");$v_id=(isset($_POST["v_id"]))?$_POST["v_id"]:0;$hn_id=(isset($_POST["hn_id"]))?$_POST["hn_id"]:1;$sql="SELECT * FROM vserver_config WHERE v_id=$v_id";$res=$db->query($sql);if(!PEAR::isError($res)){while($row=$res->fetchRow()){switch($row["vc_name"]){case "DISKSPACE":$pos=strpos($row["vc_value"],":");$barrier=number_format((substr($row["vc_value"],0,$pos)) / 1048576,2,',','.');$limit =number_format((substr($row["vc_value"],$pos+1))/ 1048576,2,',','.');$row["vc_value2"]="BARRIER: $barrier GB ==> LIMIT: $limit GB";break;case "PHYSPAGES":case "PRIVVMPAGES":case "OOMGUARPAGES":case "VMGUARPAGES":$pos=strpos($row["vc_value"],":");$barrier=number_format((substr($row["vc_value"],0,$pos)*4096) / 1048576,2,',','.');$limit =number_format((substr($row["vc_value"],$pos+1))*4096 / 1048576,2,',','.');$row["vc_value2"]="BARRIER: $barrier MB ==> LIMIT: $limit MB";break;case "TCPRCVBUF":case "TCPSNDBUF":case "OTHERSOCKBUF":case "DGRAMRCVBUF":case "KMEMSIZE":case "DCACHESIZE":$pos=strpos($row["vc_value"],":");$barrier=number_format(substr($row["vc_value"],0,$pos) / 1048576,2,',','.');$limit =number_format(substr($row["vc_value"],$pos+1) / 1048576,2,',','.');$row["vc_value2"]="BARRIER: $barrier MB ==> LIMIT: $limit MB";break;case "FEATURES":$row["vc_value2"]=$row["vc_value"];break;default:$pos=strpos($row["vc_value"],":");if($pos !== false){$barrier=substr($row["vc_value"],0,$pos);$limit =substr($row["vc_value"],$pos+1);$row["vc_value2"]="BARRIER: $barrier ==> LIMIT: $limit";}else{$row["vc_value2"]=$row["vc_value"];}break;}$configs[]=$row;}$smarty->assign("v_config",$configs);}else{echo $res->getUserInfo();}$smarty->assign("v_id",$v_id);$smarty->assign("hn_id",$hn_id);$smarty->display("details.tpl");?>