array(T_ZBX_INT, O_MAND, P_SYS, DB_ID,NULL), "gitemid"=> array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), "itemid"=> array(T_ZBX_INT, O_OPT, NULL, NULL, 'isset({save})'), "color"=> array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({save})'), "drawtype"=> array(T_ZBX_INT, O_OPT, NULL, IN("0,1,2,3"), 'isset({save})'), "sortorder"=> array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0,65535), 'isset({save})'), "yaxisside"=> array(T_ZBX_INT, O_OPT, NULL, IN("0,1"), 'isset({save})'), "register"=> array(T_ZBX_STR, O_OPT, P_SYS|P_ACT, NULL, NULL), "save"=> array(T_ZBX_STR, O_OPT, P_SYS|P_ACT, NULL, NULL), "delete"=> array(T_ZBX_STR, O_OPT, P_SYS|P_ACT, NULL, NULL), "cancel"=> array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), "form"=> array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), "form_refresh"=> array(T_ZBX_INT, O_OPT, NULL, NULL, NULL) ); check_fields($fields); ?> ".S_NO_PERMISSIONS.""); show_page_footer(); exit; } ?> AddRow(new CImg("chart2.php?graphid=".$_REQUEST["graphid"]."&period=3600&from=0")); $table->Show(); if(isset($_REQUEST["form"])) { /****** FORM ******/ echo BR; insert_graphitem_form(); } else { /****** TABLE ******/ $form = new CForm(); $form->AddVar("graphid",$_REQUEST["graphid"]); $form->AddItem(new CButton("form",S_ADD_ITEM)); show_table_header(S_DISPLAYED_PARAMETERS_BIG,$form); $table = new CTableInfo("..."); $table->SetHeader(array(S_SORT_ORDER,S_HOST,S_PARAMETER,S_TYPE,S_COLOR,S_ACTIONS)); $result=DBselect("select i.itemid,h.host,i.description,gi.*,i.key_". " from hosts h,graphs_items gi,items i where i.itemid=gi.itemid". " and gi.graphid=".$_REQUEST["graphid"]." and h.hostid=i.hostid order by gi.sortorder"); while($row=DBfetch($result)) { $table->AddRow(array( $row["sortorder"], $row["host"], NEW CLink(item_description($row["description"],$row["key_"], "chart.php?itemid=".$row["itemid"]."&period=3600&from=0")), get_drawtype_description($row["drawtype"]), $row["color"], array( new CLink(S_CHANGE,"graph.php?graphid=".$_REQUEST["graphid"]. "&gitemid=".$row["gitemid"]."&form=update#form"), SPACE."-".SPACE, new CLink(S_UP,"graph.php?graphid=".$_REQUEST["graphid"]. "&gitemid=".$row["gitemid"]."®ister=up"), SPACE."-".SPACE, new CLink(S_DOWN,"graph.php?graphid=".$_REQUEST["graphid"]. "&gitemid=".$row["gitemid"]."®ister=down") ) )); } $table->Show(); } ?>