Version of script: 2.4.1
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:
Write your message below:
I am somewhat integrating a bit of asset mgmt into my hesk installation.... This just a simple left join query to html table. I display the ticket ID field associated with the asset (joining on a custom field for serial number)..... I was looking at the code for the show tickets function and how it links that ticket id to the url of the ticket with the tracking id...... it seems there are a lot of shortened codes and i cannot pinpoint how to pull this off with my table.. can any php gurus help me?
Simple Question: How can I make my ticket ID column in my query to HTML table make the ID results link to the ticket.
Code: Select all
<?php
/*******************************************************************************
* Title: Help Desk Software HESK
* Version: 2.4.1 from 18th August 2012
* Author: Klemen Stirn
* Website: http://www.hesk.com
********************************************************************************
* COPYRIGHT AND TRADEMARK NOTICE
* Copyright 2005-2012 Klemen Stirn. All Rights Reserved.
* HESK is a registered trademark of Klemen Stirn.
* The HESK may be used and modified free of charge by anyone
* AS LONG AS COPYRIGHT NOTICES AND ALL THE COMMENTS REMAIN INTACT.
* By using this code you agree to indemnify Klemen Stirn from any
* liability that might arise from it's use.
* Selling the code for this program, in part or full, without prior
* written consent is expressly forbidden.
* Using this code, in part or full, to create derivate work,
* new scripts or products is expressly forbidden. Obtain permission
* before redistributing this software over the Internet or in
* any other medium. In all cases copyright and header must remain intact.
* This Copyright is in full effect in any country that has International
* Trade Agreements with the United States of America or
* with the European Union.
* Removing any of the copyright notices without purchasing a license
* is expressly forbidden. To remove HESK copyright notice you must purchase
* a license for this script. For more information on how to obtain
* a license please visit the page below:
* https://www.hesk.com/buy.php
*******************************************************************************/
define('IN_SCRIPT',1);
define('HESK_PATH','../');
/* Make sure the install folder is deleted */
if (is_dir(HESK_PATH . 'install')) {die('Please delete the <b>install</b> folder from your server for security reasons then refresh this page!');}
/* Get all the required files and functions */
require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/admin_functions.inc.php');
require(HESK_PATH . 'inc/database.inc.php');
hesk_session_start();
hesk_dbConnect();
hesk_isLoggedIn();
define('CALENDAR',1);
define('MAIN_PAGE',1);
/* Print header */
require_once(HESK_PATH . 'inc/header.inc.php');
/* Print admin navigation */
require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?>
</td>
</tr>
<tr>
<td>
<?php
$con=mysqli_connect("localhost","heskusr","password","hesk");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT hesk_assets.CUST, hesk_assets.ASSET_SERIAL_NR, hesk_assets.ASSET_STATUS, hesk_assets.ASSET_SW_VERSION, hesk_assets.LAST, hesk_users.name, hesk_tickets.id FROM hesk_assets LEFT JOIN hesk_tickets ON hesk_assets.ASSET_SERIAL_NR = hesk_tickets.custom1 LEFT JOIN hesk_users ON hesk_users.id = hesk_tickets.owner WHERE NOT hesk_tickets.status = 4 AND hesk_assets.ASSET_SERIAL_NR = hesk_tickets.custom1 AND hesk_tickets.category =1");
?>
<table style="width:100%;border:none;border-collapse:collapse;"><tr>
<td style="width:25%"> </td>
<td style="width:50%;text-align:center"><h3>Current Assets</h3></td>
<td style="width:25%;text-align:right">I don't know</td>
</tr></table>
<br>
<center>
<?php
echo "<table border='1'>
<tr>
<th>Customer</th>
<th>Serial Number</th>
<th> Status</th>
<th>Code</th>
<th>Last Message</th>
<th>Owner</th>
<th>Ticket #</th>
</tr>";
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['CUST'] . "</td>";
echo "<td>" . $row['ASSET_SERIAL_NR'] . "</td>";
echo "<td>" . $row['ASSET_STATUS'] . "</td>";
echo "<td>" . $row['ASSET_SW_VERSION'] . "</td>";
echo "<td>" . $row['LAST'] . "</td>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['id'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysqli_close($con);
?>
</center>