<?php $PageSecurity = 4;
global  $db;
include('includes/session.inc');
include('includes/SQL_CommonFunctions.inc');
include('includes/function_lib.php');
?>
<link href="css/professional/default.css" rel="stylesheet" type="text/css" />
<?php 
if($_REQUEST['submit_tech']!='')
{


	$key = key($_REQUEST['submit_tech']);
	$sql1="Insert into trouble_ticket_creation_assignment set
			ttid='".$_REQUEST['ttid']."', 
			technician_id='".$_REQUEST['tech_id'][$key]."'";
		
	$result1=DB_query($sql1,$db);
?>
<script>
self.close();

</script>
<?php 
}
?>



<h2 align="center">Assignment Details </h2>
<form name="form1" action="" method="post">
  <table width="100%" border="0" cellspacing="3" cellpadding="2" align="center">
    <tr>
		<th width="5%"><strong>S.No.</strong></th>
      <th width="15%"><strong>Order No.</strong></th>
	  <th width="15%"><strong>Approve No.</strong></th>
      <th width="25%">Client Name</th>
      <th width="15%">Expected Closing Date</th>
	  <th width="20%">Consignee </th>
    </tr>
  <?php
 	$sql=DB_query("SELECT * FROM workassignment_creation_assignment where technician_id='".$_REQUEST['techaid']."'",$db); 	
	?>  
      <?php		
	$i=0;
	$j = 1;
	if(DB_num_rows($sql)>0)
	{
		while($myrow=DB_fetch_array($sql))
	  	{ 
		$j = $j +$i;  ?>
      <tr bgcolor="#CCCCCC">
	  <td width="5%"><?php echo  $j;?></td>
          <td width="35%">
		<?php 
		echo $ParnoSQL= $s->GetFieldValue('salesorder', 'id="'.$myrow['ttid'].'"','orderNo');
		$ParnoSQL= $s->GetFieldValue('salesorder', 'id="'.$myrow['ttid'].'"','client');
		?>
		</td>
		<td width="19%"><?php 	echo $myrow['ApprId'];?></td>
<td width="19%"><?php 	echo $ParnameSQL= $s->GetFieldValue('clientmaster', 'id="'.$ParnoSQL.'"','c_name');;?></td>
<td width="19%"><?php echo $closerSQL= $s->GetFieldValue('trouble_ticket_creation','id="'.$myrow['ttid'].'"','closer_date');?></td>
<td width="19%"><?php echo $closerSQL= $s->GetFieldValue('trouble_ticket_creation','id="'.$myrow['ttid'].'"','closer_date');?></td>
      </tr>
      <?php $i++;} }?>
</form>
<div style="text-align:center"><input type="button" name="back" value="Back" onclick="window.history.back()" class="search" /></div>
