session_start(); if (!session_is_registered("LLC")) { // if session check fails, invoke error handler $sn = isset($_GET['sn']) ? $_GET['sn'] : ""; if ($sn != "") {header("Location: loginform.php?sn=$sn");} else {header("Location: error.php?e=1");} exit(); } ?>
Computer Service Request$sn = isset($_GET['sn']) ? $_GET['sn'] : ""; include("include/dbconfig.php"); $connection = mysql_connect($db_host, $db_user, $db_pass) or die ("Unable to connect!"); $query = "SELECT *, DATE_FORMAT(ReportTime, '%m/%d/%Y %H:%i') d1, DATE_FORMAT(ProblemDate, '%m/%d/%Y') d2, DATE_FORMAT(ReqCompDate, '%m/%d/%Y') d3 from request WHERE SerialNo = '$sn'"; mysql_select_db($db_name); $result = mysql_query($query, $connection) or die ("Error in query: $query. " . mysql_error()); $row = mysql_fetch_array($result); if ($row["Status"]==0){$status = 'Open';} else if ($row["Status"]==8){$status = 'Closed';} else if ($row["Status"]==3){$status = 'Solved';} else {$status = 'Unknown';} $ReportTime = $row["d1"]; $ReportPerson = $row["ReportPerson"]; $Extension = $row["Extension"]; $Location = $row["Location"]; $ProblemDate = $row["d2"]; $StationNo = $row["StationNo"]; $Type = $row["Type"]; $ReqCompDate = $row["d3"]; $Description = str_replace("\n","",$row["Description"]); $StepsTaken = str_replace("\n"," ",$row["StepsTaken"]); $Comments = str_replace("\n"," ",$row["Comments"]); $Procedures = $row["Procedures"]; $Prio = $row["Priority"]; $AssignTo = $row["AssignTo"]; $Training = $row["Training"]; if ($Training == '1'){$need = " checked";}else {$need = "";} for ($i=0; $i<3; $i++) { $P[$i]=''; } if ($Prio == '1') { $Priority = "Medium"; $P[1] = "selected"; } else if ($Prio == '2') { $Priority = " ![]() ![]()
END; if ($Procedures != '') { $p = str_replace("\n"," ",$Procedures); print << $p END; } $query = "SELECT * from followup WHERE SerialNo = '$sn'"; $result = mysql_query($query, $connection) or die ("Error in query: $query. " . mysql_error()); while ($row = mysql_fetch_array($result)) { if ($row['Type'] == '1'){$head = ' ![]() ![]() ![]() ![]() ![]() ![]() ",$row['Description']); print << $comments END; } if ($status != 'Closed') {print <<
END; } if (session_is_registered("SUPER") || session_is_registered("CFS")) {print << END; } ?> |