<?php
require "config.php";
session_start();
if(!isset($_SESSION['user']))
{
header('Location: index.php');
}
if($_SESSION['user'] == "")
{
header('Location: index.php');
}
if(strlen($_POST['textarea2']) > 5)
{
$fecha = date("d/m/y H:i a");
$comentariosuma = mysql_query("insert into comentariostickets (id,idticket,fecha,autor,contenido,staff) values ('','$_POST[idticket]','$fecha','$_POST[name]','$_POST[textarea2]','1')") or die ("Error el insertar");
$modifica=mysql_query("update tickets set ultimo='$_POST[name]' where id='$_POST[idticket]'");
//iniciar:mail
$ticekt1 = mysql_query("SELECT * from tickets WHERE id='$_POST[idticket]'");
$ticket = mysql_fetch_array($ticket1);
$user1 = mysql_query("SELECT * from usuarios WHERE nombre='$ticket[user]'");
$user = mysql_fetch_array($user1);
$sendTo = $user[user];
$subject = "Support Center - " . $titulo ." - New Answer";
$headers = "From: ";
$headers .= "<" . $mailprincipal . ">\r\n";
$headers .= "Reply-To: " . $mailprincipal;
$message = "Hello,\nYou have recived a have received a response from our Support Center.\nPlase login here to see the answer:" . $url;
mail($sendTo, $subject, $message, $headers);
//temina
$resultate = yes;
}
else
{
$resultate = no;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<script language="JavaScript" type="text/javascript">
function enviar()
{
document.departamentoselect.submit();
}
</script>
<title>Support Center - <?php echo $titulo; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><!-- default stylesheet -->
<link rel="stylesheet" type="text/css" media="all" href="index_files/index.css">
<style type="text/css">
<!--
body {
background-image: url();
margin-top: 0px;
margin-bottom: 0px;
}
-->
</style>
<link rel="stylesheet" href="index_files/style.css" type="text/css">
<!-- default javascript -->
<script language="Javascript">
</script>
<script language="Javascript" src="index_files/basejs.js" type="text/javascript"></script>
<style type="text/css">
<!--
.Estilo2 {color: #003366}
.Estilo3 {color: #000000}
.Estilo5 {color: #666666}
.Estilo1 {
FONT-FAMILY: Verdana, Arial, Helvetica;
font-size: 14px;
font-weight: bold;
}
.Estilo6 {color: #009933}
.Estilo6 {color: #FF0000}
.Estilo7 {font-size: 14px;
font-weight: bold;
color: #006600;
}
.Estilo8 {color: #006600; }
.Estilo20 {color: #000099}
-->
</style>
</head>
<body><center>
<p> </p>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="780">
<tbody>
<tr>
<td style="background-image: url();" valign="top"><table align="center" border="0" cellpadding="0" cellspacing="0" width="750">
<tbody>
<tr>
<td><table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td><table width="100%" border="0" cellpadding="3" cellspacing="0" background="index_files/button-right.jpg">
<tbody>
<tr>
<td align="left" valign="top" class="smalltext"><b><font color="#707070"><a href="index.php" id="navlink"></a>Support Center <img src="login_files/blueblockarrow.gif" width="8" height="8"> Administration <img src="login_files/blueblockarrow.gif" width="8" height="8"> </font></b><font color="#707070"><font color="#707070"><strong>Staff</strong></font><b> <img src="login_files/blueblockarrow.gif" width="8" height="8"> Answer Ticket </b></font></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td><table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td height="1" width="10"><img src="index_files/space.gif" height="1" width="5"></td>
<td height="1" width="10"><img src="index_files/space.gif" height="1" width="1"></td>
<td height="1" width="515"><img src="index_files/space.gif" height="1" width="5"></td>
<td height="1" width="210"><img src="index_files/space.gif" height="1" width="210"></td>
<td height="1" width="5"><img src="index_files/space.gif" height="1" width="5"></td>
</tr>
<tr>
<td height="1" width="10"> </td>
<td align="left" valign="top" width="10"><img src="index_files/space.gif" height="1" width="5"></td>
<td width="515" align="left" valign="top"><table class="sectiontitlebg" border="0" cellpadding="2" cellspacing="0" width="100%">
<tbody>
<tr>
<td width="1"><img src="login_files/blueblockarrow.gif"></td>
<td><strong><font color="#666666">Answer Ticket </font></strong></td>
</tr>
</tbody>
</table>
<?php
if($resultate == yes)
{
?>
<div align="center">
<p class="Estilo7">Success! </p>
<p class="Estilo8">The answer has been sent </p>
</div>
<p>
<?php
}
?>
</p>
<p>
<?php
if($resultate == no)
{
?>
</p>
<div align="center">
<p class="Estilo1 Estilo6">Error! </p>
<p class="Estilo6">Error trying to answer, perhaps the message is very short. </p>
</div>
<?php
}
?>
<p> </p></td>
<td align="left" valign="top"><table width="100%" height="323" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td align="left" valign="top"><table class="tborder" border="0" cellpadding="0" cellspacing="0" width="100%">
<!-- BEGIN LOGIN BOX -->
<tbody>
<tr class="tcat">
<td align="left" width="1"><img src="index_files/space.gif" height="21" width="1"></td>
<td align="left" width="8"><img src="index_files/blockarrow.gif" height="8" width="8"></td>
<td width="169" align="left" valign="middle"> <span class="smalltext">Welcome:<?php echo $_SESSION[name]; ?>(<a href="../close.php">close</a>)</span></td>
<td align="right" width="25"> </td>
</tr>
<tr>
<td colspan="4" bgcolor="#f5f5f5">
<table border="0" cellpadding="2" cellspacing="1" width="98%">
<tbody>
<tr>
<td class="smalltext" width="97%"><a href="login-staff.php" class="Estilo2"><img src="clipboard.gif" width="16" height="16"><span class="Estilo3"> Show Tickets </span></a></td>
<td width="3%"> </td>
</tr>
<tr>
<td class="smalltext"><img src="new.gif" width="16" height="16">
<?php
if($_SESSION['articulo'] == 1)
{
?><span class="Estilo3"> <a href="staff.php?code=475648DS7E4R5Y44F1ASD2W1">Publish Article</a> </span>
<?php
}
else
{
?><span class="Estilo5">Publish Article </span>
<?php } ?></td>
<td> </td>
</tr>
<tr>
<td class="smalltext"><p>
<img src="lock.gif" width="16" height="16">
<?php
if($_SESSION['ban'] == 1)
{
?><a href="staff.php?code=R5A7RHE4EW7D75EW5A" class="Estilo2"><span class="Estilo3"> Ban Users </span></a>
<?php
}
else
{
?><span class="Estilo5">Ban Users </span>
<?php } ?></p></td>
<td> </td>
</tr>
<tr>
<td class="smalltext"><form name="departamentoselect" method="post" action="staff.php">
<table class="tborder" border="0" cellpadding="0" cellspacing="0" width="100%">
<!-- BEGIN LOGIN BOX -->
<tbody>
<tr class="tcat">
<td align="left" width="1"><img src="index_files/space.gif" height="21" width="1"></td>
<td align="left" width="8"><img src="index_files/blockarrow.gif" height="8" width="8"></td>
<td width="169" align="left" valign="middle"> <img src="clipboard.gif" width="16" height="16"> Show Tickets </td>
<td align="right" width="25"> </td>
</tr>
<tr>
<td colspan="4" bgcolor="#f5f5f5"><table border="0" cellpadding="2" cellspacing="1" width="100%">
<tbody>
<tr>
<td class="smalltext" width="46%"><label>
<select name="departamento" onchange="enviar()">
<option value="" selected>Department..</option>
<?php
$usuariodep = "-" . $_SESSION['user'] . "-";
$busquedadepartamentos=mysql_query("SELECT * FROM departamentos WHERE staff LIKE '%$usuariodep%'") or die("Problemas en el select departamentos:".mysql_error());
while ($departamento=mysql_fetch_array($busquedadepartamentos))
{
?>
<option value="<?php echo $departamento['departamento']; ?>"><?php echo $departamento['departamento']; ?></option>
<?php } ?>
</select>
</label></td>
</tr>
</tbody>
</table>
<script language="Javascript">
document.loginform.loginemail.focus();
</script></td>
</tr>
<!-- END LOGIN BOX -->
<tr class="borderrow1">
<td colspan="4" align="left" height="1"><img src="index_files/space.gif" height="1" width="1"></td>
</tr>
<tr>
<td height="22" colspan="4" bgcolor="#f5f5f5"> </td>
</tr>
</tbody>
</table>
</form>
<a href="seach.php" class="Estilo2">
<div align="center"></div>
</label>
</a> </td><td> </td>
</tr>
</tbody>
</table>
</form>
<script language="Javascript">
document.loginform.loginemail.focus();
</script></td>
</tr>
<!-- END LOGIN BOX -->
<tr class="borderrow1">
<td colspan="4" align="left" height="1"><img src="index_files/space.gif" height="1" width="1"></td>
</tr>
<tr>
<td height="22" colspan="4" bgcolor="#f5f5f5"> </td>
</tr>
</tbody>
</table></td>
<td width="5"><img src="index_files/space.gif" height="1" width="5"></td>
</tr>
</tbody>
</table></td>
<td height="1" width="5"><img src="index_files/space.gif" height="1" width="5"></td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td colspan="2" height="15"><div align="center"><?php echo $titulo; echo "©"; echo $fecha = date("Y"); ?>. All rights Reserved - Power by <a href="http://www.opensupports.com" class="Estilo20">OpenSupports</a></div></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="830">
</table>
</center></body></html>