$primary = $_POST["MainPic"]; $picid = 0; if (isset($_FILES["PicFile"])) { $fileinfo = $_FILES["PicFile"]; if (CheckFileInput($fileinfo)) { $picid = PicFileUpload($_FILES["PicFile"]); if (!$picid) { $error_msg = "Uploaded File does not seem to be a picture."; goto GenerateHtml; } } } if ($_POST["IncRevision"]) { $userinfo = GetUserInfo($userid); $username = MakeFullName($userinfo); //MakeAbbrivatedName($userinfo); IncrementRevision($wid, $username); } AppendWorkOrderData($wid, $userid, $textinfo, $picid, $primary); $success_msg = "Data Added!"; $wo = GetWO($wid); $doform = false; goto GenerateHtml; } GenerateHtml: $stylesheet = array("../css/global.css", "../css/nav.css", "../css/wo_head.css", "../css/wo_add_data.css"); include "forms/header.php"; include "forms/nav_form.php"; include "forms/wo_display_menubar.php"; include "forms/wo_add_data_form.php"; include "forms/footer.php";
$error_msg = "Nothing Input. Try again."; goto GenerateHtml; } if (!checkdigits($wid)) { $error_msg = "The input seems to be in the wrong format. Use only numeric digits."; $d["WID"] = $wid; PopulateParamList($param_list, $d); goto GenerateHtml; } if ($wid < 0 || $wid > 9999) { $error_msg = "Input out of range. Allowable range is from 0 to 9999."; $d["WID"] = $wid; PopulateParamList($param_list, $d); goto GenerateHtml; } $wo = GetWO(intval($wid), true); if (!$wo) { $widstr = sprintf("W%04d", intval($wid)); $error_msg = "Work Order " . $widstr . ' not found.'; goto GenerateHtml; } if ($wo["Active"] == 0) { $widstr = sprintf("W%04d", intval($wid)); $error_msg = "Work Order " . $widstr . ' has been archived. It must be resurrected by a captain before it can be viewed.'; goto GenerateHtml; } $d = array(); $d["wid"] = intval($wid); JumpToPage("pages/wo_display.php", $d); } GenerateHtml:
function FixUpWid($input) { global $error_msg; if (empty($input)) { $error_msg = "Missing Input. Try again."; return false; } $wid = trim(strtoupper($input)); if (strlen($wid) <= 0) { $error_msg = "Missing Input. Try again."; return false; } if (substr($wid, 0, 1) == "W") { $wid = substr($wid, 1); } if (strlen($wid) <= 0) { $error_msg = "Missing Input. Try again."; return false; } if (!checkdigits($wid)) { $error_msg = "The input seems to be in the wrong format. Use only numeric digits."; return false; } if ($wid < 0 || $wid > 9999) { $error_msg = "Input out of range. Allowable range is from 0 to 9999."; return false; } $wo = GetWO(intval($wid)); if (!$wo) { $error_msg = "Work Order W" . intval($wid) . ' not found.'; return false; } return $wo; }
$doform = true; $wid = ""; $ap = array(); $assigned_workers = array(); $primarypic_url = ""; $primarypic_ref = ""; $override = false; if ($_SERVER["REQUEST_METHOD"] == "GET") { if (empty($_GET["wid"])) { DieWithMsg($loc, "No WID given."); } $wid = $_GET["wid"]; if (isset($_GET["override"])) { $override = $_GET["override"]; } $wo = GetWO($wid, $override); if (!$wo) { $doform = false; $error_msg = "This Work Order doesn't seem to exist."; goto GenerateHtml; } $pagetabtitle = "Epic " . $wo["WIDStr"]; $pagetitle = "Work Order"; $ap = GetAppendedData($wid); $assigned_workers = GetAssignedWorkers($wid); $wo["Description"] = wordwrap($wo["Description"], 65, "\n", true); $picinfo = GetPrimaryPicInfo($wid); if ($picinfo) { $picid = $picinfo["PicID"]; $primarypic = PicPathName($picid, "tiny"); if (file_exists($primarypic)) {