sliperypete
Limp Gawd
- Joined
- Jun 12, 2006
- Messages
- 143
This is what I have so far and I cant get any data in the solution attribute in the ticket table. I am trying to insert the solution in open ticket that is selected by the tech. The ticketid is passed in the URL of the browser.
<?php
session_start();
include "level2_check.php";
include("config.php");
$status = $_POST['status'];
$solution = $_POST['solution'];
if(isset($_POST['Submit']))
{
$res = mysql_query("SELECT * FROM ticket WHERE ticket_id='$ticketid'");
if (mysql_num_rows($res) > 0)
{
// found a match
$sql="UPDATE ticket
SET solution='$solution'
WHERE ticket_id='$ticketid'";
$result = mysql_query($sql) or die(mysql_error());
echo "The ticket is now closed good work!";
} else
{
echo "There was an error trying to close this ticket please try again";
}
}
?>
<html>
<head>
<title>Close Ticket</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">
<?php include ("admin_header.html") ?>
</head>
<body>
<?php echo $ticketid; ?>
<h3 align="center">Close Ticket</h3>
<table width="60%" border="1" align="center" cellpadding="1" cellspacing="1" bordercolor="#000000">
<form name="form1" method="post" action="admin_closeticket.php">
<input name="status" type="hidden" id="status" value="0">
<tr>
<td nowrap align="right">Solution:</td>
<td height="100"><textarea name="solution" id="solution"></textarea></td>
</tr>
<tr>
<td><input type="submit" value="submit"></td>
</tr>
</form>
</table>
</body>
</html>
<?php
session_start();
include "level2_check.php";
include("config.php");
$status = $_POST['status'];
$solution = $_POST['solution'];
if(isset($_POST['Submit']))
{
$res = mysql_query("SELECT * FROM ticket WHERE ticket_id='$ticketid'");
if (mysql_num_rows($res) > 0)
{
// found a match
$sql="UPDATE ticket
SET solution='$solution'
WHERE ticket_id='$ticketid'";
$result = mysql_query($sql) or die(mysql_error());
echo "The ticket is now closed good work!";
} else
{
echo "There was an error trying to close this ticket please try again";
}
}
?>
<html>
<head>
<title>Close Ticket</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">
<?php include ("admin_header.html") ?>
</head>
<body>
<?php echo $ticketid; ?>
<h3 align="center">Close Ticket</h3>
<table width="60%" border="1" align="center" cellpadding="1" cellspacing="1" bordercolor="#000000">
<form name="form1" method="post" action="admin_closeticket.php">
<input name="status" type="hidden" id="status" value="0">
<tr>
<td nowrap align="right">Solution:</td>
<td height="100"><textarea name="solution" id="solution"></textarea></td>
</tr>
<tr>
<td><input type="submit" value="submit"></td>
</tr>
</form>
</table>
</body>
</html>