session_start();
if (!session_is_registered("LLC"))
{
// if session check fails, invoke error handler
header("Location: /error.php?e=1");
exit();
}
else
{
$user = $_SESSION['UNAME'];
include("../includes/dbconfig.php");
$connection = mysql_connect($db_host, $db_user, $db_pass) or die ("Unable to connect!");
$today = date("Ymd");
$query = "SELECT max(SerialNo) from request WHERE left(SerialNo, 8) = '$today'";
mysql_select_db($db_name);
$result = mysql_query($query, $connection) or die ("Error in query: $query. " . mysql_error());
$row = mysql_fetch_row($result);
if ($row[0] == '')
{
$sn = $today.'01';
}
else
{
$sn = $row[0] + 1;
$sn = $sn.'';
}
$ProblemDate = $_POST['Syear'].'/'.$_POST['Smonth'].'/'.$_POST['Sdate'];
$ProblemDate1 = $_POST['Smonth'].'/'.$_POST['Sdate'].'/'.$_POST['Syear'];
$ReqCompDate = $_POST['Ryear'].'/'.$_POST['Rmonth'].'/'.$_POST['Rdate'];
$ReqCompDate1 = $_POST['Rmonth'].'/'.$_POST['Rdate'].'/'.$_POST['Ryear'];
$name = $_POST["Name"];
$ext = $_POST["Ext"];
$location = $_POST['Location'];
$station = $_POST['Station'];
$type = $_POST['Type'];
$problem = $_POST['Problem'];
$steps = $_POST['Steps'];
$comments = $_POST['Comments'];
$priority1 = $_POST['Priority'];
if ($priority1 == "Medium")
{
$priority = '1';
$image = "prior_medium.gif";
}
else if ($priority1 == "High")
{
$priority = '2';
$image = "prior_high.gif";
}
else if ($priority1 == "Low")
{
$priority = '0';
$image = "prior_low.gif";
}
//$problem = str_replace("'","''",$problem);
$problem1 = addslashes($problem);
$steps1 = addslashes($steps);
$comments1 = addslashes($comments);
$query = "insert into request set SerialNo='$sn', ReportTime=NOW(), UpdateTime=NOW(), Status='0', ReportPerson='$name', ";
$query = $query."UserName='$user', Extension='$ext', Location='$location', StationNo='$station', ProblemDate='$ProblemDate', ";
$query = $query."ReqCompDate='$ReqCompDate', Description='$problem', StepsTaken='$steps', Comments='$comments',";
$query = $query."Priority='$priority', Type='$type', AssignTo='agallardo'";
mysql_select_db($db_name);
$result = mysql_query($query, $connection) or die ("Error in query: $query. " . mysql_error());
$problem = str_replace("\n","
",$problem);
$problem = str_replace("\'","'",$problem);
$problem = str_replace("\\\"","\"",$problem);
$steps = str_replace("\n","
",$steps);
$steps = str_replace("\'","'",$steps);
$steps = str_replace("\\\"","\"",$steps);
$comments = str_replace("\n","
",$comments);
$comments = str_replace("\'","'",$comments);
$comments = str_replace("\\\"","\"",$comments);
include("SendMail.php");
$TEXT="Request #: $sn.\n";
$TEXT=$TEXT."Priority: $priority1.\n";
$TEXT=$TEXT."Please go to the following web address for the latest update:\n";
$TEXT=$TEXT."detail.php?sn=$sn\n";
$HTML="\n";
$HTML=$HTML."
\n";
$HTML=$HTML."\n";
$HTML=$HTML."Request #: $sn\n";
$HTML=$HTML." | \n";
$HTML=$HTML."\n";
$HTML=$HTML." Priority: $priority1\n";
$HTML=$HTML." \n";
$HTML=$HTML." | \n";
$HTML=$HTML."
\n";
$HTML=$HTML."
\n";
$HTML=$HTML."\n";
$HTML=$HTML."\n";
$HTML=$HTML."\n";
$HTML=$HTML."Person Reporting Problem: | \n";
$HTML=$HTML." $name | \n";
$HTML=$HTML."Ext.: | \n";
$HTML=$HTML." $ext | \n";
$HTML=$HTML." |
\n";
$HTML=$HTML."\n";
$HTML=$HTML."\n";
$HTML=$HTML."Location: | \n";
$HTML=$HTML."$location | \n";
$HTML=$HTML."Station: | \n";
$HTML=$HTML."$station | \n";
$HTML=$HTML."Problem Started: | \n";
$HTML=$HTML."$ProblemDate1 | \n";
$HTML=$HTML." |
\n";
$HTML=$HTML."\n";
$HTML=$HTML."Type: | \n";
$HTML=$HTML."$type | \n";
$HTML=$HTML."Request Completion By: | \n";
$HTML=$HTML."$ReqCompDate1 | |
\n";
$HTML=$HTML."\n";
$HTML=$HTML." Problem: $problem | |
\n";
$HTML=$HTML."\n";
$HTML=$HTML."Steps Taken: $steps | |
\n";
$HTML=$HTML."\n";
$HTML=$HTML."Comments: $comments | \n";
$HTML=$HTML." |
\n";
$HTML=$HTML."
For the latest update, please click here.\n";
$HTML=$HTML."
Language Learning Center\n";
// $ATTM=array("/home/myself/test/go.jpg", "/home/myself/test/SomeDoc.pdf");
$ATTM=array();
// $CC="";
SendMail(
"pmarcy@mtsac.edu","Language Learning Center", //sender
"llc@mtsac.edu","LLC staff", //recipient
"", //copy to
"New computer service request. #".$sn, //subject
$TEXT,$HTML,$ATTM); //body and attachment(s)
}
?>
Confirmation of Computer Request, LLC
*** Broken a:29527 www: LLC Staff Links ***
|
Computer Service Confirmation
|
|
Problem Report
Your request has been submitted. Appropriate action
will soon be taken to fix the problem.
Request #: echo "$sn"; ?>
|
Priority:
echo " $priority1"; ?>
|
Person
Reporting Problem: |
echo "$name"; ?> |
Ext.: |
echo "$ext"; ?>
|
|
Location: |
echo "$location"; ?>
|
Station: |
echo "$station"; ?> |
Problem
Started: |
echo "$ProblemDate1"; ?>
|
|
Type: |
echo "$type"; ?>
|
Request
Completion By: |
echo "$ReqCompDate1"; ?>
|
|
Problem:
echo "$problem";
?>
|
|
Steps Taken:
echo "$steps";
?>
|
|
Comments:
echo "$comments";
?>
|
|
|