  <?php 	include('config/database_connection.php');   

$connecttion = getSQLConection();

$query = " Select Emp_Id,Emp_Name, ";
$query .= " (select DepName from dbo.tblDepartment m Where m.DepID = Emp_Master.DepID ) as [Emp_Dep], ";
$query .= " (select DesName from dbo.tblDesignation m Where m.DesID = Emp_Master.DesID) as [Emp_Des] ";
$query .= " FROM dbo.Emp_Master WHERE Emp_Master.Emp_Id = $_REQUEST[emp_id] ";



$result = sqlsrv_query($connecttion, $query);
$row = sqlsrv_fetch_array($result);


 closeSQLConnection($connecttion);
 ?>
 
<div style="background-color:#FFF; height:auto; " align="center">
  <img id="loder" style="visibility:hidden;"  src="images/ajax-loader.gif" align="middle" alt="Loder" />
 
  <table style='width:95%; height:auto; color:Maroon;' cellpadding='0' cellspacing='0' border='0' align="center" >

    <tr>
      <td  colspan="5">&nbsp;
        
      </td>
    </tr>
    <tr>

      <tr>
        <td rowspan="4" style="width:7%" >

          <img align="left" style="height:52px; width:50px; cursor: url(&quot;magnify.cur&quot;), 
    -moz-zoom-in; opacity: 1; "  src="images/Emp_Pic/<?php echo $_REQUEST['emp_id']; ?>.jpg" class="magnify"  />

        </td>
        <td  colspan="4"  >&nbsp;
          
        </td>
      </tr>
      <tr>
    
    <tr>
 
  <td style="width:5%" align="right">
    <strong> Pin : </strong>
  </td>
    <td style="width:58%" align="left">
      <strong>
        &nbsp; <?php echo "$row[Emp_Id]"; ?>
      </strong>
    </td>
    <td style="width:10%" align="right">
      <strong>Designation :</strong>
  </td>
    <td style="width:20%" align="left">
      <strong>
        &nbsp;<?php echo "$row[Emp_Des]"; ?>
      </strong>
  </td>
  
  </tr>


  
    <tr>
  <td  align="right">
    <strong>Name :</strong>
  </td>
    <td   align="left">
      <strong>
        &nbsp; <?php echo "$row[Emp_Name]"; ?>
      </strong>
  </td>
    <td   align="right">
      <strong>Department :</strong>
  </td>
    <td  align="left">
      <strong>
        &nbsp;<?php echo "$row[Emp_Dep]"; ?>
      </strong>
  </td>
  
  </tr>

    <tr>
      <td  colspan="4">&nbsp;
        
      </td>
    </tr>


    <tr>
      <td  colspan="4">&nbsp;
        
      </td>
    </tr>


    <tr>
      <td  colspan="5">&nbsp;
        
      </td>
    </tr>
    <tr>

      <tr>
        <td  colspan="5">&nbsp;
          
        </td>
      </tr>
      <tr>
 </table> 
 
 

     <table style='width:95%; height:auto;' cellpadding='0' cellspacing='0' border='0' align="center" >
     
     <thead style="color:#060;" >
						<th align="left" style='border-bottom:1px solid #000;width:5%;'>&nbsp;SL</th> 
						<th  align="left" style='border-bottom:1px solid #000;width:15%;'>Date</th>
						<th  align="left" style='border-bottom:1px solid #000;width:15%;'>Time</th>
						<th  align="left" style='border-bottom:1px solid #000;width:10%;'></th>
                        <th style='border-bottom:1px solid #000;width:5%;'>&nbsp;</th>
                        <th style='border-bottom:1px solid #000;width:5%;'>Mathch</th>
                        <th style='border-bottom:1px solid #000;width:10%;'>&nbsp;</th>
                        <th style='border-bottom:1px solid #000;width:5%;'>&nbsp;</th>
						<th align='center' style='border-bottom:1px solid #000;width:10%;'>Assumption</th>
						<th align='center' style='border-bottom:1px solid #000;width:10%;'>Result</th>
            <th align='center' style='border-bottom:1px solid #000;width:10%;'>Point</th>
 
			 
					</thead> 
 
 
 <?php 	 
 
 
 				
 	$display = "";
	$connecttion = getSQLConection();
	
	$query = " EXEC [usp_employee_result] $_REQUEST[emp_id] ";
 
 
		$result = sqlsrv_query($connecttion, $query);

 

 	$i = 1;
    $point = 0;
    
    $total_point = 0;
		
		while($row = sqlsrv_fetch_array($result))
		{
			
 
 
       
			$display .= "<tr style='height:35px; color:#060;' >
				<td style='border-bottom:1px solid #000; ' align='left' >
			 	&nbsp;$i
				</td>
				<td style='border-bottom:1px solid #000;' align='left' >
			 	$row[date]
				</td>
				<td style='border-bottom:1px solid #000;' align='left' >
			    $row[time]
				</td>
				<td style='border-bottom:1px solid #000;' align='left' >
			    $row[left_com]
				</td>
				<td style='border-bottom:1px solid #000;' align='left' >
			    <img class='magnify'  width='30' height='18'  align='middle' src='images/country/$row[left_prefix].png' />
				</td>
				<td style='border-bottom:1px solid #000;' align='left' >
			 	VS
				</td>
				<td style='border-bottom:1px solid #000;' align='left' >
			    $row[right_com]
				</td>
				<td style='border-bottom:1px solid #000;' align='left' >
			 	  <img class='magnify'  width='30' height='18'  align='middle' src='images/country/$row[right_prefix].png' />
				</td>
				<td style='border-bottom:1px solid #000;' align='center' >
		 $row[bit_left] - $row[bit_right]
				</td>
				<td style='border-bottom:1px solid #000;' align='center' >
        $row[goal_left] - $row[goal_right]
		 
				</td>";
				
 
				 
				 
 
 
          $display .= "<td style='border-bottom:1px solid #000;' align='center' >$row[point]</td></tr> ";
      
 
			$total_point = $total_point + $row['point'];
			$i++;
			
		} 
		
 
	
				$display .= "<tr style='height:35px; color:#060;' >
				<td  align='left' >
 
				</td>
				<td   align='left' >
	 
				</td>
				<td   align='left' >
		 
				</td>
				<td   align='left' >
		 
				</td>
				<td   align='left' >
 
				</td>
				<td   align='left' >
		 
				</td>
				<td   align='left' >
			 
				</td>
				<td   align='left' >
 
				</td>
				<td   align='center' >
 
				</td>
				<td   align='center' >
     
		 <strong>Total : <strong>
				</td>
        
       <td   align='center' >
		      <strong>$total_point</strong>
				</td>
			 
			</tr> ";
 
 
 
 
 
 echo $display;
 
 
 ?>

 
<tr><td colspan='10'>&nbsp;</td></tr>
 
</table>
 
 
 

	</div> 