<?php
	include "db_connection/db_connection.php";
	include "config/config.php";
	
	$emp_id		=	$_GET['emp_id']; //THIS IS PARTY ID                    
	$cate_id	=	$_GET['cate_id']; //THIS IS CATEGORY ID  
	
	$SLCTct = "SELECT * FROM emp_det WHERE emp_det_id = '$emp_id'";
	$QURYct = mysqli_query($connect,$SLCTct);
	$FTCHct = mysqli_fetch_object($QURYct);                  
?>
	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="dTable" id="dynamic">
    	<thead>
        	<tr style="height:50px; padding:10px; line-height:50px; color:#FFFFFF; background:#C0C0C0">
                <th width="12%">S.No</th>
                <th width="22%">Point</th>
                <th width="22%">From Date</th>
                <th width="22%">To Date</th>
                <th width="22%">Cad Hrs</th>
            </tr>
        </thead>
        <tbody>
            <?php
				$SLCT = "SELECT  * FROM emp_cad_det WHERE emp_det_id = '$emp_id' AND master_cad_cat_id = '$cate_id' GROUP BY STR_TO_DATE(to_date,'%d/%m/%Y') ORDER BY emp_cad_det_id ASC";
				//echo $SLCT;
				$QURY = mysqli_query($connect,$SLCT);
				$loop=1;
				if(mysqli_num_rows($QURY)>0)
				{			
					while($FTCH = mysqli_fetch_object($QURY))
					{
				
						$SLCT_c = "SELECT  * FROM master_cad_cat WHERE master_cad_cat_id = '$FTCH->master_cad_cat_id'";			
						$QURY_c = mysqli_query($connect,$SLCT_c);
						$FTCH_c = mysqli_fetch_object($QURY_c);
			?>
                        <tr style="height:30px; padding:10px; line-height:30px; color:#FFFFFF">
                            <td align="center"><?php echo $loop ?></td>
                            <td align="center"><?php echo $FTCH_c->cad_cat_name; ?></td>
                            <td align="center"><?php echo date("d/m/Y", strtotime($FTCH->fm_date));  ?></td>
                            <td align="center"><?php if($FTCH->to_date!=''){ echo date("d/m/Y", strtotime($FTCH->to_date)); } ?></td>
                            <td align="center"><?php echo $FTCH->cat_hrs; ?></td>
                        </tr>
            
            <?php
						$loop ++;
			 		}
			 	}
			 ?>
        </tbody>
  	</table>
