Hi! Im planning to make the entries of the Ticket # links to view the ticket information. But how do i pass the value of the clicked ticket# to the next page? thanks in advance!
<?php
session_start();
if(!session_is_registered(myusername)){
header("Location:main_login.php");
}
?>
<html>
<head>
<title>Employee</title>
<style type="text/css">
<!--
.tableContent {
font-family:Euphemia;
font-size: 13px;
font-style: normal;
color: #000;
}
.tableHead2 {
font-family: "Myriad Pro Light", "Myriad Pro";
font-size: 14px;
font-style: normal;
font-weight: bold;
color: #FFF;
}
-->
</style>
</head>
<body>
<tr>
</br>
<table width="926" height="25" border="0" style="text-align: center; font-weight: normal; border-collapse:collapse; border:1px solid #346198" cellpadding="2" cellspacing="2" id="myTable">
<tr class="tableHead2">
<td width="95" height="20" bgcolor="#346198"><div align="center">Ticket #</div></td>
<td width="73" bgcolor="#346198"><div align="center">Asset ID</div></td>
<td width="152" bgcolor="#346198"><div align="center">User</div></td>
<td width="149" bgcolor="#346198"><div align="center">Location</div></td>
<td width="95" bgcolor="#346198"><div align="center">Date Reported</div></td>
<td width="77" bgcolor="#346198"><div align="center">Priority</div></td>
<td width="78" bgcolor="#346198"><div align="center">Days Open</div></td>
<td width="155" bgcolor="#346198"><div align="center">Requires Action Of</div></td>
</tr>
<?php
include "..\configdb.php";
include "..\opendb.php";
$userId = $_SESSION['userId'];
//GET ticket number
$result = mysql_query("SELECT _ticketNum, _assets_id
FROM trouble_ticket
WHERE _user_accounts_id='$userId'
AND _ticketStatus='New' OR _ticketStatus='Open'");
if(!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
while($row=mysql_fetch_array($result))
{
$i;
echo "<tr align='center' class='tableContent'>";
echo "<td>";
if(strcmp($row['_ticketStatus'],'New'))
{echo "<font color='#FF0000'> NEW </font>";}
echo $row['_ticketNum'];
echo "</td>";
//GET asset control number
$idAsset = $row['_assets_id'];
$result1 = mysql_query("SELECT _controlNum
FROM assets
WHERE _id='$idAsset'");
while($row=mysql_fetch_array($result1))
{
$i;
echo "<td>";
echo $row['_controlNum'];
echo "</td>";
$controlNumber = $row['_controlNum'];
$i++;
}
//GET user's name
$result2 = mysql_query("SELECT _firstName, _lastName
FROM user_accounts
WHERE _id = '$userId'");
while($row=mysql_fetch_array($result2))
{
$i;
echo "<td>";
echo $row['_firstName']." ".$row['_lastName'];
echo "</td>";
$i++;
} // end while loop
//GET branch
$result3 = mysql_query("SELECT _branchName
FROM branch
WHERE _id = (SELECT _branch_id FROM user_accounts WHERE _id='$userId')");
while($row=mysql_fetch_array($result3))
{
$i;
echo "<td>";
echo $row['_branchName'];
echo "</td>";
$i++;
} // end while loop
//GET date, priority, days open, ticket stat
$result4= mysql_query("SELECT _dateReported, _priority, _daysOpen, _ticketStatus
FROM trouble_ticket
WHERE _user_accounts_id='$userId'
AND _ticketStatus='New' OR _ticketStatus='Open'");
if($row=mysql_fetch_array($result4))
{
echo "<td>";
echo $row['_dateReported'];
echo "</td>";
echo "<td>";
echo $row['_priority'];
echo "</td>";
echo "<td>";
echo $row['_daysOpen'];
echo "</td>";
$stat = $row['_ticketStatus'];
if(!strcmp($stat,"New"))
{
echo "<td>";
echo "Technician";
echo "</td>";
}
}
echo "</tr>";
$i++;
} // end while loop
include "..\closedb.php";
?>
</table>
</td>
</tr>
<tr>
<td align="right"> </td>
</body>
</html>