array( "Back to policies" => "policy-main.php" ), )); # Display change screen if ($_POST['frmaction'] == "change") { # Check a policy was selected if (isset($_POST['policy_id'])) { # Prepare statement $stmt = $db->prepare("SELECT ID, Name, Priority, Description, Disabled FROM ${DB_TABLE_PREFIX}policies WHERE ID = ?"); ?>
execute(array($_POST['policy_id'])); $row = $stmt->fetchObject(); $stmt->closeCursor(); ?>
Old Value New Value
Name name ?>
Priority priority ?>
Description description ?>
Disabled disabled ? 'yes' : 'no' ?>

No policy selected
quote($_POST['policy_name'])); } if (isset($_POST['policy_priority']) && $_POST['policy_priority'] != "") { array_push($updates,"Priority = ".$db->quote($_POST['policy_priority'])); } if (!empty($_POST['policy_description'])) { array_push($updates,"Description = ".$db->quote($_POST['policy_description'])); } if (isset($_POST['policy_disabled']) && $_POST['policy_disabled'] != "") { array_push($updates ,"Disabled = ".$db->quote($_POST['policy_disabled'])); } # Check if we have updates if (sizeof($updates) > 0) { $updateStr = implode(', ',$updates); $res = $db->exec("UPDATE ${DB_TABLE_PREFIX}policies SET $updateStr WHERE ID = ".$db->quote($_POST['policy_id'])); if ($res) { ?>
Policy updated
Error updating policy!
errorInfo()) ?>
No changes made to policy
Invalid invocation