- <?php
- // +-------------------------------------------------------------+
- // | DeskPRO v [2.0.1 Production]
- // | Copyright (C) 2001 - 2004 Headstart Solutions Limited
- // | Supplied by WTN-WDYL
- // | Nullified by WTN-WDYL
- // | Distribution via WebForum, ForumRU and associated file dumps
- // +-------------------------------------------------------------+
- // | DESKPRO IS NOT FREE SOFTWARE
- // +-------------------------------------------------------------+
- // | License ID : Full Enterprise License =) ...
- // | License Owner : WTN-WDYL Team
- // +-------------------------------------------------------------+
- // | $RCSfile: deskpro_help.php,v $
- // | $Date: 2004/02/10 01:34:28 $
- // | $Revision: 1.9 $
- // +-------------------------------------------------------------+
- // | File Details:
- // | - DeskPRO-provided technician interface help system.
- // +-------------------------------------------------------------+
- error_reporting(E_ALL ^ E_NOTICE);
- include "./../global.php";
- tech_mini_header(NULL);
- echo "<table cellpadding="0" width="100%"><tr height="30"><td> <b>DeskPRO Technician Interface Guide</b> [<a href="javascript:self.close()">close</a>]</td><td align="right">" . html_image('pic010.gif') . " </td></tr><tr height="1"><td height="1" colspan="2" bgcolor="#000000">" . html_image('spacer.gif') . "</td></tr></table>";
- echo "<table width="100%" cellspacing="0"><tr><td valign="top">";
- $cat = array();
- $entry = array();
- $db->query("SELECT * FROM tech_internal_help_cat ORDER BY displayorder");
- while ($res = $db->row_array()) {
- $cat[] = $res;
- }
- if ($_REQUEST['category']) {
- if ((int)($_REQUEST['category'])) {
- $db->query("SELECT * FROM tech_internal_help_entry WHERE category = '" . mysql_escape_string($_REQUEST[category]) . "' ORDER BY displayorder");
- } else {
- $db->query("SELECT tech_internal_help_entry.*, tech_internal_help_cat.name AS name FROM tech_internal_help_entry LEFT JOIN tech_internal_help_cat ON tech_internal_help_cat.id = tech_internal_help_entry.category WHERE name like '%" . mysql_escape_string($_REQUEST[category]) . "%' ORDER BY tech_internal_help_entry.displayorder");
- }
- while ($res = $db->row_array()) {
- $entry[] = $res;
- }
- }
- echo "<tr valign="top"><td nowrap><table cellpadding="1" cellspacing="0">n";
- // Draw the category list bar (left column)
- foreach ($cat as $key => $val) {
- $txt = $val['name'];
- if ($val['id'] == $_REQUEST['category'] or $val['name'] == $_REQUEST['category']) {
- $show_entries = 1;
- $img = "tech/folder.gif";
- } else {
- $show_entries = 0;
- $img = "tech/folder.gif";
- }
- $txt = str_replace(" ", " ", $txt);
- echo "<tr><td valign="top"><img src="./../../images/$img"></td><td><a href="deskpro_help.php?category=$val[id]$mini">$txt</a></td></tr>n";
- // If we're drawing the popup, we need to show the entry index along with the categories
- if ($show_entries) {
- echo "<tr><td colspan="2"><table cellpadding="0" cellspacing="0">";
- foreach ($entry as $key2 => $val2) {
- $txt = str_replace(" ", " ", $val2['title']);
- if ($val2['id'] == $_REQUEST['entry'] OR $val2['title'] == $_REQUEST['entry']) {
- $img = "tech/document.gif";
- } else {
- $img = "tech/document.gif";
- }
- echo "<tr><td> <img src="./../../images/$img"></td><td><a href="deskpro_help.php?category=$val[id]&entry=$val2[id]$mini">$txt</font></a></td></tr>n";
- }
- echo "</td></tr></table>";
- }
- }
- print "</table><td width="100%"><br />n";
- if ($_REQUEST['entry']) {
- if ((int)($_REQUEST['entry'])) {
- $result = $db->query_return("SELECT * FROM tech_internal_help_entry WHERE id = '$_REQUEST[entry]'");
- } else {
- $_REQUEST['entry'] = mysql_escape_string($_REQUEST['entry']);
- $result = $db->query_return("SELECT * FROM tech_internal_help_entry WHERE title LIKE '%" . mysql_escape_string($_REQUEST[entry]) . "%'");
- }
- echo "<U><B>$result[title]</B></U><BR>";
- echo $result['entry'];
- } else {
- if ($_REQUEST['category']) {
- $result = $db->query_return("SELECT * FROM tech_internal_help_entry WHERE title LIKE '%Introduction%' AND category = '$_REQUEST[category]'");
- echo "<U><B>$result[title]</B></U><BR>";
- echo $result['entry'];
- } else {
- echo "Select a category at left to begin.";
- }
- }
- echo "</td></tr></table>";
- ?>