<h1><?php 
echo $page_title;?></h1>
<?php 
include("ClassRole.php");
  
 if($_REQUEST['action']=='View')
   {
	 $sql="select * from support_troubletickets where ticketid='".$_REQUEST['ticketid']."' ";
 		$result=DB_query($sql,$db);
		$myrow=DB_fetch_array($result);
		$ticket_no=$myrow['ticket_no'];
		$groupname=$myrow['groupname']; 
		$parent_id=$myrow['parent_id'];
		$product_id=$myrow['product_id'];
		$priority=$myrow['priority'];
		$severity=$myrow['severity'];
		$status=$myrow['status'];
		$category=$myrow['category'];
		$ticket_title=$myrow['ticket_title'];
		$hours=$myrow['hours'];
		$days=$myrow['days'];
		$accountid=$myrow['accountid'];
		$terms_conditions=$myrow['terms_conditions'];
		$purchaseorder=$myrow['purchaseorder'];
		$mode_of_complaint=$myrow['mode_of_complaint'];
		$groupid=$myrow['groupid'];
		$leaduserid=$myrow['leaduserid'];
		 
   }
   ?>

<form name="form1" method="post" action="">
<fieldset align="left">
  <legend><strong>TICKET INFORMATION:</strong></legend>
<table width="100%" border="0">
  <tr>
    <td>Title</td><td> <input name="ticket_title" type="text" value="<?php  echo $ticket_title?>"  readonly   size="50"></td> 
    <td>Product Name&nbsp;</td>
    <?php $ItemName=$s->getField('item_master','id',$product_id,'StockID');?>
	<td> <input name="product_id" type="text" value="<?php  echo $ItemName?>" readonly  size="50"></td>
  </tr>
   <tr>
    <td> Priority </td><td> 
	<input type="text" readonly="true" value="<?php  echo $priority;?>">
</td>
    <td>Hours </td><td> <input name="hours" type="text" value="<?php  echo $hours?>" readonly="true"    size="50"></td>
  </tr>
  <tr>
    <td> Severity </td><td> 
	
	<input name="severity"  style="width:150px;" value="<?php echo $severity;?>" readonly>
 	</td>
    <td>Days </td><td> <input name="days" type="text" value="<?php  echo $days?>"  readonly size="50"></td>
  </tr>
  <tr>
  <td>Status</td><td> 
  
	<input name="status"  style="width:150px;" readonly value=" <?php  echo $status?>">
 	</td>
    <td> Category </td><td> 
	
	<input name="category"  style="width:150px;" value="<?php  echo $category ?>" readonly>
 	</td>
  </tr>
  <tr>
    <td>Ticket No	&nbsp;</td><td> <input name="ticket_no" type="text" value="<?php  echo $ticket_no?>" size="50" readonly ></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  </table>
  
  </fieldset>
<fieldset align="left">
  <legend><strong>COMPLAINT DESCRIPTION:-</strong></legend>
<table width="100%" border="0">
  
  <tr>
    <td colspan="4"><strong>Description&nbsp;</strong> </td>
  </tr>
  <tr>
    <td  colspan="4">
    	<textarea name="terms_conditions" cols="50" rows="2" readonly="true"><?php echo $terms_conditions?></textarea></td>
  </tr>
  
</table></fieldset>


<fieldset align="left">
  <legend ><strong>TICKET INFORMATION:</strong></legend>
  <table width="100%" border="0">
  	
		<tr>
	<td>Assigned To</td>
	<?php $GroupName=$s->getField('securityroles','secroleid',$groupid,'secrolename');?>
	<td width="24%"><input type="text" name="groupid" value="<?php echo $GroupName ?>" readonly></td>	
		<?php $UserName=$s->getField('www_users','id',$leaduserid,'userid');?>
		<td width="26%">Users Name </td>	
		<td width="24%"><input type="text" name="leaduserid" value="<?php echo $UserName ?>" readonly></td>
			<td>Account &nbsp;</td><td> 
				<?php $AccountName=$s->getField('accountledger','AccountsID',$accountid,'AccountName');?>
				<input name="accountid" type="text" value="<?php  echo $AccountName?>"  readonly size="50"></td>
		</tr>
		
		
  
  <?php 
	
	
	if($_REQUEST['action']=='View') 
	{
		
	}
	else 
		{
			
	?>
  <tr>
    <td  colspan="4">
      <input type="submit" name="Save" value="Save">
  
    </td>
  </tr>
  <?php } ?>
</table>
  
  
</fieldset>
  </form>