<?php
include('session.php');
include('connection.php');

$i=1;
			mysqli_query($GLOBALS["___mysqli_ston"], "SET NAMES utf8");			
			//$Comp_id="SELECT *  FROM `pdf_upload11`";
			$Comp_id = "select sw.dept_sub_category as deptname,dc.dept_name as subdept,dsc.dept_sub_category,pu.Date,pu.Status,
			pu.document1,pu.file_text,pu.srno
			 from sub_welfare sw join pdf_upload11 pu
			 on sw.srno	 = pu.department_name	 left outer join dept_category dc on dc.srno = pu.sub_dep_name left outer join
			 dept_sub_category dsc on pu.sub_of_sub_dept = dsc.srno";
			
$res=mysqli_query($GLOBALS["___mysqli_ston"], $Comp_id) or die('Query Failed: 4' . mysqli_error($GLOBALS["___mysqli_ston"]));
		
echo 
"<font size='2'><table border='1' bgcolor='white' style='border-style: solid; border-width: 1px;width:100%;height:50%;'>";

echo '<tr>
					<th scope="col" align="center">srno</th>                     
	    	<th scope="col" align="center">Department Name	</th>                     
	    	<th scope="col" align="center">Sub Department Name</th>                     
	    	<th scope="col" align="center">Sub Of Department Name</th>
	    	<th scope="col" align="center">Date</th>
	    	<th scope="col" align="center">Status</th>
	    	<th scope="col" align="center">Document</th>
					<th scope="col" align="center">Text File</th>
					
			   <th scope="col" align="center">Update</th> 
			  <th scope="col" align="center">Disable</th> 
     ';

echo '</tr>';

	while($rw2 = mysqli_fetch_assoc($res))
			{
$srno=$rw2['srno'];
$department_name=$rw2['deptname'];
$sub_dep_name=$rw2['subdept'];
$sub_of_sub_dept=$rw2['dept_sub_category'];
$Date=$rw2['Date'];
$info1=$rw2['document1'];
$file1=$rw2['file_text'];
$status=$rw2['Status'];
//;
		
				
echo ' <tr>
    <td onclick="update_company('.$i.')" style="cursor:pointer" title="Click here for edit">'.$srno.' </td>
    <td onclick="update_company('.$i.')" style="cursor:pointer" title="Click here for edit">'.$department_name.' </td>
    <td onclick="update_company('.$i.')" style="cursor:pointer" title="Click here for edit">'.$sub_dep_name.' </td>
    <td onclick="update_company('.$i.')" style="cursor:pointer" title="Click here for edit">'.$sub_of_sub_dept.' </td>
    <td onclick="update_company('.$i.')" style="cursor:pointer" title="Click here for edit">'.$Date.' </td>
    <td onclick="update_company('.$i.')" style="cursor:pointer" title="Click here for edit">'.$status.' </td>
    <td onclick="update_company('.$i.')" style="cursor:pointer" title="Click here for edit">'.$info1.' </td>
    <td onclick="update_company('.$i.')" style="cursor:pointer" title="Click here for edit">'.$file1.'</td>
    
    
     ';
  $i++;
echo "<td><button type='button' style='margin-left:0px;width:6em;' value='update' class='submit' onclick='update_company(".$srno .")'/>Update</button></td>";
echo "<td><button type='button' style='margin-left:0px;width:6em;' onclick='view5(".$srno.")'/>Disable</button></td>";
echo '</tr>';
  //		break;
								}

Echo "

</table></font>



";		
		
	

?>