$obj_traffic_type = new traffic_types(); $obj_traffic_type->id = @security_form_input_predefined("int", "id", 0, ""); $obj_traffic_type->data["type_name"] = @security_form_input_predefined("any", "type_name", 1, ""); $obj_traffic_type->data["type_label"] = @security_form_input_predefined("any", "type_label", 1, ""); $obj_traffic_type->data["type_description"] = @security_form_input_predefined("any", "type_description", 0, ""); /* Verify Data */ // verify that the traffic type exists, if one is selected if ($obj_traffic_type->id) { if (!$obj_traffic_type->verify_id()) { log_write("error", "process", "The traffic type you have attempted to edit - " . $obj_traffic_type->id . " - does not exist in this system."); } } // check naming if (!$obj_traffic_type->verify_fields()) { log_write("error", "process", "Unacceptable values provided, please see above errors."); } /* Check for any errors */ if (error_check()) { if (!$obj_traffic_type->id) { $_SESSION["error"]["form"]["traffic_types_add"] = "failed"; header("Location: ../index.php?page=services/traffic-types-add.php"); exit(0); } else { $_SESSION["error"]["form"]["traffic_types_edit"] = "failed"; header("Location: ../index.php?page=services/traffic-types-view.php&id=" . $obj_traffic_type->id . ""); exit(0); }