if ($_SERVER["REQUEST_METHOD"] == "POST") { DenyGuest(); if (!empty($_POST["Archive"])) { $widarchivestr = $_POST["WIDArchive"]; $wo = fixupwid($widarchivestr); if ($wo === false) { goto GenerateHtml; } $success_msg = changeactive($wo["WID"], 0); log_msg($loc, $success_msg); $doform = false; goto GenerateHtml; } if (!empty($_POST["UnArchive"])) { $widunarchivestr = $_POST["WIDUnArchive"]; $wo = fixupwid($widunarchivestr); if ($wo === false) { goto GenerateHtml; } $success_msg = changeactive($wo["WID"], 1); log_msg($loc, $success_msg); $doform = false; goto GenerateHtml; } DieWithMsg($loc, "Unknown post back."); } GenerateHtml: $stylesheet = array("../css/global.css", "../css/nav.css", "../css/utils_archive.css"); include "forms/header.php"; include "forms/nav_form.php"; include "forms/utils_menubar.php";
$instructions = ""; $visitbutton = ""; $ins_file = "../docs/MergeWorkOrder.md"; if (file_exists($ins_file)) { $instructions = MarkdownToHtml(file_get_contents($ins_file)); } $doform = true; $param_list = array(array("FieldName" => "WID1", "FieldType" => "Text", "Caption" => "Primary Work Order ID"), array("FieldName" => "WID2", "FieldType" => "Text", "Caption" => "Secondary Work Order ID"), array("FieldName" => "Sure", "FieldType" => "Boolean", "Value" => false, "Caption" => "Are you Sure?")); if ($_SERVER["REQUEST_METHOD"] == "GET") { goto GenerateHtml; } if ($_SERVER["REQUEST_METHOD"] == "POST") { DenyGuest(); PopulateParamList($param_list, $_POST); $wo1 = fixupwid($_POST["WID1"]); $wo2 = fixupwid($_POST["WID2"]); if ($wo1 === false || $wo2 === false) { goto GenerateHtml; } $sure = false; if (!empty($_POST["Sure"])) { $sure = $_POST["Sure"]; } if (!$sure) { $error_msg = "Workorders not merged. You didn't say that your sure."; goto GenerateHtml; } if ($wo1["WID"] == $wo2["WID"]) { $error_msg = "Workorders must be unique!"; goto GenerateHtml; }
$error_msg = ""; $success_msg = ""; $instructions = ""; $ins_file = "../docs/DeleteWorkOrder.md"; if (file_exists($ins_file)) { $instructions = MarkdownToHtml(file_get_contents($ins_file)); } $doform = true; $param_list = array(array("FieldName" => "WID", "FieldType" => "Text", "Caption" => "Work Order ID"), array("FieldName" => "Sure", "FieldType" => "Boolean", "Value" => false, "Caption" => "Are you Sure?")); if ($_SERVER["REQUEST_METHOD"] == "GET") { goto GenerateHtml; } if ($_SERVER["REQUEST_METHOD"] == "POST") { DenyGuest(); PopulateParamList($param_list, $_POST); $wo = fixupwid($_POST["WID"]); if ($wo === false) { goto GenerateHtml; } $sure = false; if (!empty($_POST["Sure"])) { $sure = $_POST["Sure"]; } if (!$sure) { $error_msg = "Workorder not deleted. You didn't say that your sure."; goto GenerateHtml; } $success_msg = delete_workorder($wo); $doform = false; goto GenerateHtml; }