$res .= "</form>"; $res .= "<div class='menu_button_on_right'><span id='account_save_result'></span>"; $res .= "<a href='#' onClick='cancelAccount();return false;'><img src='images/button_cancel_32.png'></a> "; $res .= "<a href='#' onClick='createAccount();return false;'><img src='images/button_ok_32.png'></a> "; $res .= "</div>"; print $res; exit; } if ($action == "createaccount") { $mg = mg_connect($config, "", "", ""); if ($mg) { $stmt = new mg_stmt_insert($mg, "accounts", $mg_account_defaults); $stmt->addColumnValueDate("createtime"); $stmt->addColumnValue("name", $_POST["account_name"]); $stmt->addColumnValue("id_engine", intval($_POST["id_engine"])); if (!$stmt->checkNotNull($mg_account_not_null)) { $res = "Error "; } else { $stmt->execute(); $res = "Success "; } $res = "Success "; //$res .= $s; } print $res; exit; } if ($action == "saveaccount") { $id = $_POST["account_id"]; if ($id == "") { $res = "Error ";
$stmt = new mg_stmt_insert($mg, "users", $mg_user_defaults); $stmt->addColumnValueDate("createtime"); $stmt->addColumnValue("user_name", $_POST["user_name"]); if ($_POST["user_level"] == "2") { $stmt->addColumnValue("id_account", 0); } else { $stmt->addColumnValue("id_account", intval($_POST["id_account"])); } $stmt->addColumnValue("user_password", $_POST["user_password"]); $stmt->addColumnValue("user_level", $_POST["user_level"]); if (isset($_POST["change_password"]) && trim($_POST["change_password"] == "1")) { $stmt->addColumnValue("change_password_next_logon", "1"); } else { $stmt->addColumnValue("change_password_next_logon", "0"); } if (!$stmt->checkNotNull($mg_user_not_null)) { $res = "Error "; } else { $stmt->execute(); $res = "Success "; } $res = "Success "; } print $res; exit; } if ($action == "saveuser") { $id = $_POST["user_id"]; if ($id == "") { $res = "Error "; print $res;
$res .= "</div>"; print $res; exit; } if ($action == "createtarget") { $mg = mg_connect($config, "", "", ""); if ($mg) { $stmt = new mg_stmt_insert($mg, "targets", $mg_target_defaults); $stmt->addColumnValueDate("createtime"); $stmt->addColumnValue("id_account", intval($_POST["id_account"])); $stmt->addColumnValue("name", $_POST["name"]); $stmt->addColumnValue("output_type", $_POST["output_type"]); $stmt->addColumnValue("target_type", $_POST["target_type"]); $stmt->addColumnValue("target_parameters", $_POST["target_parameters"]); $stmt->addColumnValue("queue_dir", $_POST["queue_dir"]); if (!$stmt->checkNotNull($mg_target_not_null)) { $res = "Error "; } else { $stmt->execute(); $res = "Success "; } $res = "Success "; } print $res; exit; } if ($action == "savetarget") { $id = $_POST["id"]; if ($id == "") { $res = "Error "; print $res;
$res .= "<input type='hidden' id='action' name ='action' value='createengine'>"; $res .= "</form>"; $res .= "<div class='menu_button_on_right'><span id='engine_save_result'></span>"; $res .= "<a href='#' onClick='cancelEngine();return false;'><img src='images/button_cancel_32.png'></a> "; $res .= "<a href='#' onClick='createEngine();return false;'><img src='images/button_ok_32.png'></a> "; $res .= "</div>"; print $res; exit; } if ($action == "createengine") { $mg = mg_connect($config, "", "", ""); if ($mg) { $stmt = new mg_stmt_insert($mg, "engines", $mg_engine_defaults); $stmt->addColumnValueDate("createtime"); $stmt->addColumnValue("name", $_POST["engine_name"]); if (!$stmt->checkNotNull($mg_engine_not_null)) { $res = "Error "; } else { $stmt->execute(); $res = "Success "; } $res = "Success "; } print $res; exit; } if ($action == "saveengine") { $id = $_POST["engine_id"]; if ($id == "") { $res = "Error "; print $res;