Revision 62 | Revision 64 | Zur aktuellen Revision | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed
<?php//$Id: details.php 63 2007-10-03 15:24:39Z 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":$barrier=number_format((substr($row["vc_value"],0,strpos($row["vc_value"],":"))) / 1048576,2,',','.');$limit =number_format((substr($row["vc_value"],strpos($row["vc_value"],":")+1))/ 1048576,2,',','.');$row["vc_value2"]="BARRIER: $barrier GB ==> LIMIT: $limit GB";break;case "PHYSPAGES":case "PRIVVMPAGES":case "OOMGUARPAGES":case "VMGUARPAGES":$barrier=number_format((substr($row["vc_value"],0,strpos($row["vc_value"],":"))*4096) / 1048576,2,',','.');$limit =number_format((substr($row["vc_value"],strpos($row["vc_value"],":")+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":$barrier=number_format(substr($row["vc_value"],0,strpos($row["vc_value"],":")) / 1048576,2,',','.');$limit =number_format(substr($row["vc_value"],strpos($row["vc_value"],":")+1) / 1048576,2,',','.');$row["vc_value2"]="BARRIER: $barrier MB ==> LIMIT: $limit MB";break;default:if(strpos($row["vc_value"],":") !== false){$barrier=substr($row["vc_value"],0,strpos($row["vc_value"],":"));$limt =substr($row["vc_value"],strpos($row["vc_value"],":")+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");?>