<?
	$windowid = $_GET['dt1'];
	$groupid = $_GET['dt2'];
	
	include "../../Connections/connect_mysql.php";
	
	//groupreport_tb
	
	
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script>
$(document).ready(function() {
	$('#reportpstb').DataTable({
		"dom": 'f', //กำหนดส่วนหัวเอง
		"scrollY":        "200px",
        "scrollCollapse": true,
        "paging":         false
	});
	
});
</script>
</head>

<body>
	<table id="reportpstb" class="display cell-border compact row-border table table-striped table-bordered" cellspacing="0" width="100%">
          <thead>
              <tr>	
                  <th>ชื่อรายงาน</th>
              </tr>
          </thead>
          <tbody>
         <?
		  	
			//groupreport_tb
			$sql_gpt = " select * from groupreport_tb where groprpGTeamID={$groupid}";
			$result_gpt = mysql_query($sql_gpt) or die(mysql_error());
			while($record_gpt=mysql_fetch_array($result_gpt)){
				$groprpRepID_gpt = $record_gpt['groprpRepID'];
					
					$sql=" select * from report_tb where repID={$groprpRepID_gpt}; ";
				 	$result = mysql_query($sql) or die(mysql_error());
					$record=mysql_fetch_array($result);
					$repID = $record['repID'];
					$repName = $record['repName'];
		 ?>
         
          	<tr id="r<?=$repID?>" onClick="javascript:selectreport(<?=$repID?>,<?=$windowid?>);">	
                <td><?=$repName?></td>
            </tr>
         <?			
			}//while
		 ?>
          </tbody>
     </table>
</body>
</html>
<?
	mysql_close($c);
?>