<?php
include("postget.php");
include_once("common.php");
$pagetitle = _CANNED_RESPONSES;

checklevel(2,$_REQUEST['clientid']);

include("head_template.php");
echo '
<div class="container">
	<div class="row">
';

print(messagetopinthispage(_ONLY_ARE_DISPLAYED_THE_ITEMS_RELATED_TO_THE_CURRENT_LANGUAGE." (".langname($currentlang).")","",2));

echo '<table id="table-1" class="table table-striped">';
print("
	<tr id='0' class='nodrop nodrag'>
	<th>&nbsp;</th> 
	<th>".ucfirst(_NAME)."</th> 
	<th>".ucfirst(_DESCRIPTION)."</th> 
	<th>".ucfirst(_DEPARTMENT)."</th> 
	<th>".ucfirst(_OPTIONS)."</th> 
	</tr>");

$data = query("SELECT * FROM hd_tickets_canned WHERE langs LIKE '%".$currentlang."%' ORDER by orderby",0);

$_SESSION['ordenar'] = "[hd_tickets_canned]{orderby}(id)<and langs LIKE '%".$currentlang."%'>";

while($row=mysql_fetch_array($data)) {

	print("<tr><td class='dragHandle'>&nbsp;</td>");
	print("<td>".ucfirst($row[name])."</td>");
	print("<td>".ucfirst($row[description])."</td>");
	print("<td align='center'>");
	if ($row[dept]==0) {
		print (ucfirst(_ALL));
	}else{
		$depto = query("SELECT name FROM hd_tickets_dep WHERE depid='$row[dept]'",1);
		print ($depto[name]);
	}
	print("</td>");

	print("<td align='center'>
	<a href='".$serverurl."/canned2.php?id=$row[id]'><img class='sprites edit' src='images/transparent.gif' border='0' title='"._EDIT."'></a>
	<a href='".$serverurl."/canned3.php?id=$row[id]&text=$row[name]'><img class='sprites del' src='images/transparent.gif' border='0' title='"._DELETE."'></a>
	</td>
	</tr>");
}
print("</table>");

graybutton('canned2.php',_ADD_CANNED_RESPONSE);


echo '
</div>
</div>
';

include("foot_template.php");
?>
	
